blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
348d97b1e22aabd1290ce342b37a06cbb3a6a7f7
69f7d41f5e4e902d9c2c5a340816061c8c0ecca4
/sha1.h
b737665a2c00155c6f1f6985c0f8b49d64d3c0bb
[]
no_license
FoFabien/mhse
2fc6012eb38ad25bbe7a444a95ca1416f183280e
c0128ff37f7a454a52ba07e6f8a62314e62eef4d
refs/heads/master
2021-01-19T14:27:45.321607
2017-04-13T12:52:05
2017-04-13T12:52:05
88,164,500
0
0
null
null
null
null
UTF-8
C++
false
false
239
h
#ifndef SHA1_DEFINED #define SHA1_DEFINED namespace sha1 { void calc(const void* src, const int bytelength, unsigned char* hash); void toString(const unsigned char* hash, char* str); } // namespace sha1 #endif // SHA1_DEFINED
[ "FoFabien@users.noreply.github.com" ]
FoFabien@users.noreply.github.com
7944128706b93b80938b753d8beb2dd5e53fbdab
1ae555d3088dc123836060371fc520bf0ff13e52
/atcoder/abc152/c.cpp
1df5eb000794d569810b2c65986f3244fb553ede
[]
no_license
knagakura/procon
a87b9a1717674aeb5ee3da0301d465e95c758fde
c6ac49dbaaa908ff13cb0d9af439efe5439ec691
refs/heads/master
2022-01-31T19:46:33.535685
2022-01-23T11:59:02
2022-01-23T11:59:02
161,764,993
0
0
null
null
null
null
UTF-8
C++
false
false
1,217
cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,N) for(int i=0;i<int(N);++i) #define rep1(i,N) for(int i=1;i<int(N);++i) #define all(a) (a).begin(),(a).end() #define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; } #define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; } #define bit(k) (1LL<<(k)) typedef long long ll; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = 1e9; const ll INFLL = 1e18; const ll MOD = 1e9+7; const double PI = acos(-1.0); const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; /*------------------------------------/ for library*/ /*------------------------------------*/ int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int N;cin>>N; vector<ll> A(N); rep(i,N)cin>>A[i]; ll minn = INFLL; int cnt = 0; rep(i,N){ if(minn > A[i])cnt++; chmin(minn,A[i]); } cout<<cnt<<endl; }
[ "knagakura@bs.s.u-tokyo.ac.jp" ]
knagakura@bs.s.u-tokyo.ac.jp
74db1324f3555a835e196d2e516263590e5be5d6
c69f5e34ad2281f6c60f1ed0684e4dab70efe307
/Lab/4 Salary, Commision.cpp
544f5cef99cc7b4287a3966b4ec31ab01d7b16d0
[]
no_license
laksh10-stan/C-C-programs
85db446a13bd70400f14a19374d4dc95545777ae
adacfdd837f4b05f5c46266283ac4306b8668f59
refs/heads/master
2021-02-08T12:58:53.399264
2020-03-01T13:33:43
2020-03-01T13:33:43
244,154,127
0
0
null
null
null
null
UTF-8
C++
false
false
384
cpp
#include <stdio.h> #include <conio.h> main() { int quantity,price; printf ("enter the values of quantity and price"); scanf ("%d%d",&quantity,&price); int salary=1500; float rate=0.03; float bonus=50; float commision; commision=quantity*rate*price; printf ("commision is %f",commision); float sale; sale=bonus+commision+salary; printf ("sale is %f",sale); return 0; }
[ "43860070+Kushjadaun@users.noreply.github.com" ]
43860070+Kushjadaun@users.noreply.github.com
1c78146e5e52bdfb650f9bc2a098a214cccdd33a
bc29026f3774f47c1740254803aa7cdb25d9fc4e
/AbilitySystem/Intermediate/Build/Win64/UE4Editor/Inc/AbilitySystem/AttributeSetBase.gen.cpp
142f407b44445e18761e5b0f4243bc95b165be03
[]
no_license
AmarZeno/AbilitySystem
46fa4ad234824d90895c09e62071d8be412e4199
c0f3a58ba574564333f655a127cc5d397a32c317
refs/heads/master
2023-01-10T22:53:48.182227
2020-11-15T20:13:22
2020-11-15T20:13:22
312,923,182
0
0
null
null
null
null
UTF-8
C++
false
false
9,566
cpp
// Copyright Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ===========================================================================*/ #include "UObject/GeneratedCppIncludes.h" #include "AbilitySystem/Public/AttributeSetBase.h" #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable : 4883) #endif PRAGMA_DISABLE_DEPRECATION_WARNINGS void EmptyLinkFunctionForGeneratedCodeAttributeSetBase() {} // Cross Module References ABILITYSYSTEM_API UFunction* Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature(); UPackage* Z_Construct_UPackage__Script_AbilitySystem(); ABILITYSYSTEM_API UClass* Z_Construct_UClass_UAttributeSetBase_NoRegister(); ABILITYSYSTEM_API UClass* Z_Construct_UClass_UAttributeSetBase(); GAMEPLAYABILITIES_API UClass* Z_Construct_UClass_UAttributeSet(); GAMEPLAYABILITIES_API UScriptStruct* Z_Construct_UScriptStruct_FGameplayAttributeData(); // End Cross Module References struct Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics { struct _Script_AbilitySystem_eventOnHealthChangeDelegate_Parms { float Health; float MaxHealth; }; static const UE4CodeGen_Private::FFloatPropertyParams NewProp_MaxHealth; static const UE4CodeGen_Private::FFloatPropertyParams NewProp_Health; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; const UE4CodeGen_Private::FFloatPropertyParams Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::NewProp_MaxHealth = { "MaxHealth", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Float, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(_Script_AbilitySystem_eventOnHealthChangeDelegate_Parms, MaxHealth), METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FFloatPropertyParams Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::NewProp_Health = { "Health", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Float, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(_Script_AbilitySystem_eventOnHealthChangeDelegate_Parms, Health), METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::NewProp_MaxHealth, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::NewProp_Health, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::Function_MetaDataParams[] = { { "Comment", "/**\n * \n */" }, { "ModuleRelativePath", "Public/AttributeSetBase.h" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::FuncParams = { (UObject*(*)())Z_Construct_UPackage__Script_AbilitySystem, nullptr, "OnHealthChangeDelegate__DelegateSignature", nullptr, nullptr, sizeof(_Script_AbilitySystem_eventOnHealthChangeDelegate_Parms), Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x00130000, 0, 0, METADATA_PARAMS(Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UDelegateFunction_AbilitySystem_OnHealthChangeDelegate__DelegateSignature_Statics::FuncParams); } return ReturnFunction; } void UAttributeSetBase::StaticRegisterNativesUAttributeSetBase() { } UClass* Z_Construct_UClass_UAttributeSetBase_NoRegister() { return UAttributeSetBase::StaticClass(); } struct Z_Construct_UClass_UAttributeSetBase_Statics { static UObject* (*const DependentSingletons[])(); #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Class_MetaDataParams[]; #endif #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_MaxHealth_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_MaxHealth; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_Health_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_Health; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; static const FCppClassTypeInfoStatic StaticCppClassTypeInfo; static const UE4CodeGen_Private::FClassParams ClassParams; }; UObject* (*const Z_Construct_UClass_UAttributeSetBase_Statics::DependentSingletons[])() = { (UObject* (*)())Z_Construct_UClass_UAttributeSet, (UObject* (*)())Z_Construct_UPackage__Script_AbilitySystem, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UAttributeSetBase_Statics::Class_MetaDataParams[] = { { "IncludePath", "AttributeSetBase.h" }, { "ModuleRelativePath", "Public/AttributeSetBase.h" }, }; #endif #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_MaxHealth_MetaData[] = { { "Category", "AttributeSetBase" }, { "ModuleRelativePath", "Public/AttributeSetBase.h" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_MaxHealth = { "MaxHealth", nullptr, (EPropertyFlags)0x0010000000000005, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UAttributeSetBase, MaxHealth), Z_Construct_UScriptStruct_FGameplayAttributeData, METADATA_PARAMS(Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_MaxHealth_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_MaxHealth_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_Health_MetaData[] = { { "Category", "AttributeSetBase" }, { "ModuleRelativePath", "Public/AttributeSetBase.h" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_Health = { "Health", nullptr, (EPropertyFlags)0x0010000000000005, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UAttributeSetBase, Health), Z_Construct_UScriptStruct_FGameplayAttributeData, METADATA_PARAMS(Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_Health_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_Health_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UClass_UAttributeSetBase_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_MaxHealth, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UAttributeSetBase_Statics::NewProp_Health, }; const FCppClassTypeInfoStatic Z_Construct_UClass_UAttributeSetBase_Statics::StaticCppClassTypeInfo = { TCppClassTypeTraits<UAttributeSetBase>::IsAbstract, }; const UE4CodeGen_Private::FClassParams Z_Construct_UClass_UAttributeSetBase_Statics::ClassParams = { &UAttributeSetBase::StaticClass, nullptr, &StaticCppClassTypeInfo, DependentSingletons, nullptr, Z_Construct_UClass_UAttributeSetBase_Statics::PropPointers, nullptr, UE_ARRAY_COUNT(DependentSingletons), 0, UE_ARRAY_COUNT(Z_Construct_UClass_UAttributeSetBase_Statics::PropPointers), 0, 0x003000A0u, METADATA_PARAMS(Z_Construct_UClass_UAttributeSetBase_Statics::Class_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UClass_UAttributeSetBase_Statics::Class_MetaDataParams)) }; UClass* Z_Construct_UClass_UAttributeSetBase() { static UClass* OuterClass = nullptr; if (!OuterClass) { UE4CodeGen_Private::ConstructUClass(OuterClass, Z_Construct_UClass_UAttributeSetBase_Statics::ClassParams); } return OuterClass; } IMPLEMENT_CLASS(UAttributeSetBase, 3795839624); template<> ABILITYSYSTEM_API UClass* StaticClass<UAttributeSetBase>() { return UAttributeSetBase::StaticClass(); } static FCompiledInDefer Z_CompiledInDefer_UClass_UAttributeSetBase(Z_Construct_UClass_UAttributeSetBase, &UAttributeSetBase::StaticClass, TEXT("/Script/AbilitySystem"), TEXT("UAttributeSetBase"), false, nullptr, nullptr, nullptr); DEFINE_VTABLE_PTR_HELPER_CTOR(UAttributeSetBase); PRAGMA_ENABLE_DEPRECATION_WARNINGS #ifdef _MSC_VER #pragma warning (pop) #endif
[ "amarzeno@outlook.com" ]
amarzeno@outlook.com
bd510019596fc61f95312c253c70dcc58bf1d6a5
93df24d181adb2d2ad273c00cb2631578b27a575
/C++/algorithms/bit_manipulation/flipping_bits.cpp
0c7b71f902fe9fee5366d0e3b806048a9ab465c0
[]
no_license
MiguelAleman/hackerrank
26b16a29447f3f3627b8940f4d3121f6d6617b91
3f9418847b62fea9fa6a3da50e0bf00ebcf3642e
refs/heads/master
2022-04-29T12:23:54.548392
2022-03-20T18:18:56
2022-03-20T18:18:56
42,289,068
1
0
null
null
null
null
UTF-8
C++
false
false
156
cpp
#include <iostream> using namespace std; int main(){ int T; cin >> T; for (int i = 0; i < T; ++i) { unsigned N; cin >> N; cout << ~N << endl; } }
[ "miguel.aleman@upr.edu" ]
miguel.aleman@upr.edu
bbdc63d27356c09a959c9d88cdc4d5e897ac06e6
a22a87d94c0ddc5daf3b2ce253f7539e96bff755
/src/Steamhammer/Source/OpponentModel.cpp
1930cffbc9f6ce793cff61b862ab8f89f0016c21
[ "Apache-2.0" ]
permissive
liuruoze/BetaStar
4138e9633ee35915dce506d8d6dc703f390fa6a9
b7f10211dd3ee595cd1e824e4ee425f0be6c9123
refs/heads/main
2023-07-27T12:15:26.084755
2021-09-03T07:25:58
2021-09-03T07:25:58
402,682,916
5
0
null
null
null
null
UTF-8
C++
false
false
33,005
cpp
#include "InformationManager.h" #include "OpponentModel.h" #include "Random.h" using namespace UAlbertaBot; OpeningPlan OpponentModel::predictEnemyPlan() const { struct PlanInfoType { int wins; int games; double weight; bool alwaysSwitchesAfterLoss; // Does the opponent always choose a different opening after this one loses? bool alwaysPlaysAfterWin; // Does the opponent always choose this opening again after it wins? }; PlanInfoType planInfo[int(OpeningPlan::Size)]; // 1. Initialize. for (int plan = int(OpeningPlan::Unknown); plan < int(OpeningPlan::Size); ++plan) { planInfo[plan].wins = 0; planInfo[plan].games = 0; planInfo[plan].weight = 0.0; planInfo[plan].alwaysSwitchesAfterLoss = plan != int(OpeningPlan::Unknown); planInfo[plan].alwaysPlaysAfterWin = plan != int(OpeningPlan::Unknown); } std::ostringstream log; log << "Predicting enemy plan:"; // 2. Perform initial forward pass to initialize "alwaysSwitchesAfterLoss" and "alwaysPlaysAfterWin" GameRecord* previous = nullptr; for (int i = std::max(0U, _pastGameRecords.size() - 50); i < _pastGameRecords.size(); i++) { GameRecord* current = _pastGameRecords[i]; if (previous && previous->getEnemyPlan() != OpeningPlan::Unknown && current->getEnemyPlan() != OpeningPlan::Unknown) { log << "\nCurrent " << OpeningPlanString(current->getEnemyPlan()) << ", previous " << OpeningPlanString(previous->getEnemyPlan()); if (current->getWin()) log << " (win): "; else log << " (loss): "; // Did the enemy use the same strategy as the previous game? if (previous->getEnemyPlan() == current->getEnemyPlan()) { // Switch the alwaysSwitchesAfterLoss flag to false if we won the previous game planInfo[int(previous->getEnemyPlan())].alwaysSwitchesAfterLoss = planInfo[int(previous->getEnemyPlan())].alwaysSwitchesAfterLoss && !previous->getWin(); } else { // Switch the alwaysPlaysAfterWin flag to false if we lost the previous game planInfo[int(previous->getEnemyPlan())].alwaysPlaysAfterWin = planInfo[int(previous->getEnemyPlan())].alwaysPlaysAfterWin && previous->getWin(); } log << "alwaysSwitchesAfterLoss=" << planInfo[int(previous->getEnemyPlan())].alwaysSwitchesAfterLoss; log << "; alwaysPlaysAfterWin=" << planInfo[int(previous->getEnemyPlan())].alwaysPlaysAfterWin; } previous = current; } // 3. Perform backwards pass to weight the opponent plans double weight = 100000.0; int count = 0; for (auto it = _pastGameRecords.rbegin(); it != _pastGameRecords.rend() && count < 25; it++) { auto record = *it; count++; if (_gameRecord.sameMatchup(*record)) { log << "\n" << count << ": " << OpeningPlanString(record->getEnemyPlan()); if (record->getWin()) log << " (win): "; else log << " (loss): "; PlanInfoType & info = planInfo[int(record->getEnemyPlan())]; info.games += 1; // If this is the most recent game, check if the enemy will definitely use the plan from the previous game again if (count == 1 && !record->getWin() && info.alwaysPlaysAfterWin) { log << "Enemy always continues with this plan after a win; short-circuiting"; Log().Debug() << log.str(); return record->getEnemyPlan(); } // If this is the most recent game, check if the enemy will definitely switch strategies from the previous game if (count == 1 && record->getWin() && info.alwaysSwitchesAfterLoss) { info.weight = -1000000.0; log << "Enemy never continues this plan after a loss"; } else { // Weight games we won lower double change = weight * (record->getWin() ? 0.5 : 1.0); info.weight += weight * (record->getWin() ? 0.5 : 1.0); log << "Increased by " << change << " to " << info.weight; } // more recent game records are more heavily weighted weight *= 0.8; } } // 3. Decide. // For now, set the most heavily weighted plan other than Unknown as the expected plan. Ignore the other info. OpeningPlan bestPlan = OpeningPlan::Unknown; double bestWeight = 0.0; for (int plan = int(OpeningPlan::Unknown) + 1; plan < int(OpeningPlan::Size); ++plan) { if (planInfo[plan].weight > bestWeight) { bestPlan = OpeningPlan(plan); bestWeight = planInfo[plan].weight; } } if (count > 0) { log << "\nDecided on " << OpeningPlanString(bestPlan); Log().Debug() << log.str(); } return bestPlan; } // Does the opponent seem to play the same strategy every game? // If we're pretty sure, set _singleStrategy to true. // So far, we only check the plan. We have plenty of other data that could be helpful. void OpponentModel::considerSingleStrategy() { // Gather info. int knownPlan = 0; int unknownPlan = 0; std::set<OpeningPlan> plansSeen; for (const GameRecord * record : _pastGameRecords) { if (_gameRecord.sameMatchup(*record)) { OpeningPlan plan = record->getEnemyPlan(); if (plan == OpeningPlan::Unknown) { unknownPlan += 1; } else { knownPlan += 1; plansSeen.insert(plan); } } } // Decide. // If we don't recognize the majority of plans, we're not sure. if (knownPlan >= 2 && plansSeen.size() == 1 && unknownPlan <= knownPlan) { _singleStrategy = true; } } // If the opponent model has collected useful information, // set _recommendedOpening, the opening to play (or instructions for choosing it). // This runs once before play starts, when all we know is the opponent // and whatever the game records tell us about the opponent. void OpponentModel::considerOpenings() { struct OpeningInfoType { int sameWins; // on the same map as this game, or following the same plan as this game int sameGames; int otherWins; // across all other maps/plans int otherGames; double weightedWins; double weightedGames; OpeningInfoType() : sameWins(0) , sameGames(0) , otherWins(0) , otherGames(0) // The weighted values doesn't need to be initialized up front. { } }; int totalWins = 0; int totalGames = 0; std::map<std::string, OpeningInfoType> openingInfo; // opening name -> opening info OpeningInfoType planInfo; // summary of the recorded enemy plans // Gather basic information from the game records. for (const GameRecord * record : _pastGameRecords) { if (_gameRecord.sameMatchup(*record)) { ++totalGames; if (record->getWin()) { ++totalWins; } OpeningInfoType & info = openingInfo[record->getOpeningName()]; if (record->getMapName() == BWAPI::Broodwar->mapFileName()) { info.sameGames += 1; if (record->getWin()) { info.sameWins += 1; } } else { info.otherGames += 1; if (record->getWin()) { info.otherWins += 1; } } if (record->getExpectedEnemyPlan() == record->getEnemyPlan()) { // The plan was recorded as correctly predicted in that game. planInfo.sameGames += 1; if (record->getWin()) { planInfo.sameWins += 1; } } else { // The plan was not correctly predicted. planInfo.otherGames += 1; if (record->getWin()) { planInfo.otherWins += 1; } } } } UAB_ASSERT(totalWins == planInfo.sameWins + planInfo.otherWins, "bad total"); UAB_ASSERT(totalGames == planInfo.sameGames + planInfo.otherGames, "bad total"); OpeningPlan enemyPlan = _expectedEnemyPlan; // Disable the rest for now _recommendedOpening = getOpeningForEnemyPlan(enemyPlan); return; // For the first games, stick to the counter openings based on the predicted plan. if (totalGames <= 5) { _recommendedOpening = getOpeningForEnemyPlan(enemyPlan); return; // with or without expected play } UAB_ASSERT(totalGames > 0 && totalWins >= 0, "bad total"); UAB_ASSERT(openingInfo.size() > 0 && int(openingInfo.size()) <= totalGames, "bad total"); // If we keep winning, stick to the winning track. if (totalWins == totalGames || _singleStrategy && planInfo.sameWins > 0 && planInfo.sameWins == planInfo.sameGames) // Unknown plan is OK { _recommendedOpening = getOpeningForEnemyPlan(enemyPlan); return; // with or without expected play } // Randomly choose any opening that always wins, or always wins on this map. // This bypasses the map weighting below. // The algorithm is reservoir sampling in the simplest case, with reservoir size = 1. // It gives equal probabilities without remembering all the elements. std::string alwaysWins; double nAlwaysWins = 0.0; std::string alwaysWinsOnThisMap; double nAlwaysWinsOnThisMap = 0.0; for (auto item : openingInfo) { const OpeningInfoType & info = item.second; if (info.sameWins + info.otherWins > 0 && info.sameWins + info.otherWins == info.sameGames + info.otherGames) { nAlwaysWins += 1.0; if (Random::Instance().flag(1.0 / nAlwaysWins)) { alwaysWins = item.first; } } if (info.sameWins > 0 && info.sameWins == info.sameGames) { nAlwaysWinsOnThisMap += 1.0; if (Random::Instance().flag(1.0 / nAlwaysWinsOnThisMap)) { alwaysWinsOnThisMap = item.first; } } } if (!alwaysWins.empty()) { _recommendedOpening = alwaysWins; return; } if (!alwaysWinsOnThisMap.empty()) { _recommendedOpening = alwaysWinsOnThisMap; return; } // Explore different actions this proportion of the time. // The number varies depending on the overall win rate: Explore less if we're usually winning. const double overallWinRate = double(totalWins) / totalGames; UAB_ASSERT(overallWinRate >= 0.0 && overallWinRate <= 1.0, "bad total"); const double explorationRate = 0.05 + (1.0 - overallWinRate) * 0.10; // Decide whether to explore, and choose which kind of exploration to do. // The kind of exploration is affected by totalGames. Exploration choices are: // The counter openings - "Counter ...". // The matchup openings - "matchup". // Any opening that this race can play - "random". // The opening chooser in ParseUtils knows how to interpret the strings. if (totalWins == 0 || Random::Instance().flag(explorationRate)) { const double wrongPlanRate = double(planInfo.otherGames) / totalGames; // Is the predicted enemy plan likely to be right? if (totalGames > 30 && Random::Instance().flag(0.75)) { _recommendedOpening = "random"; } else if (Random::Instance().flag(0.8 * wrongPlanRate * double(std::min(totalGames, 20)) / 20.0)) { _recommendedOpening = "matchup"; } else { _recommendedOpening = getOpeningForEnemyPlan(enemyPlan); } return; } // Compute "weighted" win rates which combine map win rates and overall win rates, as an // estimate of the true win rate on this map. The estimate is ad hoc, using an assumption // that is sure to be wrong. for (auto it = openingInfo.begin(); it != openingInfo.end(); ++it) { OpeningInfoType & info = it->second; // Evidence provided by game results is proportional to the square root of the number of games. // So let's pretend that a game played on the same map provides mapPower times as much evidence // as a game played on another map. double mapPower = info.sameGames ? (info.sameGames + info.otherGames) / sqrt(info.sameGames) : 0.0; info.weightedWins = mapPower * info.sameWins + info.otherWins; info.weightedGames = mapPower * info.sameGames + info.otherGames; } // We're not exploring. Choose an opening with the best weighted win rate. // This is a variation on the epsilon-greedy method. double bestScore = -1.0; // every opening will have a win rate >= 0 double nBest = 1.0; for (auto it = openingInfo.begin(); it != openingInfo.end(); ++it) { const OpeningInfoType & info = it->second; double score = info.weightedGames < 0.1 ? 0.0 : info.weightedWins / info.weightedGames; if (score > bestScore) { _recommendedOpening = it->first; bestScore = score; nBest = 1.0; } else if (abs (score - bestScore) < 0.0001) { // We choose randomly among openings with essentially equal score, using reservoir sampling. nBest += 1.0; if (Random::Instance().flag(1.0 / nBest)) { _recommendedOpening = it->first; } } } } // Possibly update the expected enemy plan. // This runs later in the game, when we may have more information. void OpponentModel::reconsiderEnemyPlan() { if (_planRecognizer.getPlan() != OpeningPlan::Unknown) { // We already know the actual plan. No need to form an expectation. return; } if (!_gameRecord.getEnemyIsRandom() || BWAPI::Broodwar->enemy()->getRace() == BWAPI::Races::Unknown) { // For now, we only update the expected plan if the enemy went random // and we have now learned its race. // The new information should narrow down the possibilities. return; } // Don't reconsider too often. if (BWAPI::Broodwar->getFrameCount() % 12 != 8) { return; } // We set the new expected plan even if it is Unknown. Better to know that we don't know. _expectedEnemyPlan = predictEnemyPlan(); } // If it seems appropriate to try to steal the enemy's gas, note that. // We randomly steal gas at a configured rate, then possibly auto-steal gas if // we have data about the opponent suggesting it might be a good idea. // This version runs once per game at the start. Future versions might run later, // so they can take into account what the opponent is doing. void OpponentModel::considerGasSteal() { // Don't steal gas if the expected enemy plan is something that doesn't require it if (_expectedEnemyPlan == OpeningPlan::FastRush || _expectedEnemyPlan == OpeningPlan::Proxy || _expectedEnemyPlan == OpeningPlan::WorkerRush || _expectedEnemyPlan == OpeningPlan::HeavyRush) { return; } // 1. Is auto gas stealing turned on? if (!Config::Strategy::AutoGasSteal) { return; } // 2. Gather data. // We add fictitious games saying that not stealing gas was tried once and won, and stealing gas // was tried twice and lost. That way we don't try stealing gas unless we lose games without; // it represents that stealing gas has a cost. int nGames = 4; // 4 fictitious games total int nWins = 1; // 1 fictitious win total int nStealTries = 3; // 3 fictitious gas steals int nStealWins = 0; // 3 fictitious losses on gas steal int nStealSuccesses = 0; // for deciding on timing (not used yet) for (const GameRecord * record : _pastGameRecords) { if (_gameRecord.sameMatchup(*record)) { ++nGames; if (record->getWin()) { ++nWins; } if (record->getFrameScoutSentForGasSteal()) { ++nStealTries; if (record->getWin()) { ++nStealWins; } if (record->getGasStealHappened()) { ++nStealSuccesses; } } } } // 3. Decide. // We're deciding whether to TRY to steal gas, so measure whether TRYING helps. // Because of the fictitious games, we never divide by zero. int plainGames = nGames - nStealTries; int plainWins = nWins - nStealWins; double plainWinRate = double(plainWins) / plainGames; double stealWinRate = double(nStealWins) / nStealTries; double plainUCB = plainWinRate + UCB1_bound(plainGames, nGames); double stealUCB = stealWinRate + UCB1_bound(nStealTries, nGames); //BWAPI::Broodwar->printf("plain wins %d/%d -> %g steal wins %d/%d -> %g", // plainWins, plainGames, plainUCB, // nStealWins, nStealTries, stealUCB); _recommendGasSteal = stealUCB > plainUCB; } // Find the past game record which best matches the current game and remember it. void OpponentModel::setBestMatch() { int bestScore = -1; GameRecord * bestRecord = nullptr; for (GameRecord * record : _pastGameRecords) { int score = _gameRecord.distance(*record); if (score != -1 && (!bestRecord || score < bestScore)) { bestScore = score; bestRecord = record; } } _bestMatch = bestRecord; } // We expect the enemy to follow the given opening plan. // Recommend an opening to counter that plan. // The counters are configured; all we have to do is name the strategy mix. // The empty opening "" means play the regular openings, no plan recognized. std::string OpponentModel::getOpeningForEnemyPlan(OpeningPlan enemyPlan) { if (enemyPlan == OpeningPlan::Unknown) { return ""; } return "Counter " + OpeningPlanString(enemyPlan); } // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- OpponentModel::OpponentModel() : _bestMatch(nullptr) , _singleStrategy(false) , _initialExpectedEnemyPlan(OpeningPlan::Unknown) , _expectedEnemyPlan(OpeningPlan::Unknown) , _enemyCanFastRush(false) , _recommendGasSteal(false) , _worstCaseExpectedAirTech(INT_MAX) , _worstCaseExpectedCloakTech(INT_MAX) , _expectedPylonHarassBehaviour(0) , _pylonHarassBehaviour(0) { _filename = "om_" + InformationManager::Instance().getEnemyName() + ".txt"; } void OpponentModel::readFile(std::string filename) { std::ifstream inFile(filename); // There may not be a file to read. That's OK. if (inFile.bad()) { return; } while (inFile.good()) { // NOTE We allocate records here and never free them if valid. // Their lifetime is the whole game. GameRecord * record = new GameRecord(inFile); if (record->isValid()) { _pastGameRecords.push_back(record); } else { delete record; } } inFile.close(); } // Read past game records from the opponent model file, and do initial analysis. void OpponentModel::read() { if (Config::IO::ReadOpponentModel) { // Usually the data is in the read directory readFile(Config::IO::ReadDir + _filename); // For tournaments, we might not have access to put pre-trained data into the read directory // So if we don't have any data, check if there is anything in the AI directory // We will write out the entire data set at the end of the game, so we only have to do this once if (_pastGameRecords.empty()) { readFile(Config::IO::AIDir + _filename); } } // Make immediate decisions that may take into account the game records. // The initial expected enemy plan is set only here. That's the idea. // The current expected enemy plan may be reset later. _expectedEnemyPlan = _initialExpectedEnemyPlan = predictEnemyPlan(); considerSingleStrategy(); considerOpenings(); considerGasSteal(); // If the opponent has done a fast rush against us in the last 50 games, flag it int count = 0; for (auto it = _pastGameRecords.rbegin(); it != _pastGameRecords.rend() && count < 50; it++) { if (!_gameRecord.sameMatchup(**it)) continue; count++; if ((*it)->getEnemyPlan() == OpeningPlan::FastRush) { Log().Get() << "Enemy has done a fast rush in the last 50 games"; _enemyCanFastRush = true; break; } } // If we have no record of the opponent, assume they can do a fast rush if (count == 0) { _enemyCanFastRush = true; // Don't need to do anything more when we have no same matchup records return; } // Look at the previous 3 games and store the earliest frame we saw air and cloak tech count = 0; for (auto it = _pastGameRecords.rbegin(); it != _pastGameRecords.rend() && count < 3; it++) { if (!_gameRecord.sameMatchup(**it)) continue; count++; int airTech = (*it)->getAirTechFrame(); if (airTech > 0 && airTech < _worstCaseExpectedAirTech) _worstCaseExpectedAirTech = airTech; int cloakTech = (*it)->getCloakTechFrame(); if (cloakTech > 0 && cloakTech < _worstCaseExpectedCloakTech) _worstCaseExpectedCloakTech = cloakTech; } if (_worstCaseExpectedAirTech != INT_MAX) Log().Get() << "Worst case expected air tech at frame " << _worstCaseExpectedAirTech; if (_worstCaseExpectedCloakTech != INT_MAX) Log().Get() << "Worst case expected cloaked combat units at frame " << _worstCaseExpectedCloakTech; // Set the expected pylon harass behaviour // Start by gathering attempts and observed results int mannerTries = 0; int mannerWins = 0; int mannerPylonAttackedByMultipleWorkersWhileBuilding = 0; int mannerPylonAttackedByMultipleWorkersWhenComplete = 0; int mannerPylonSurvived1500Frames = 0; int lureTries = 0; int lureWins = 0; int lurePylonAttackedByMultipleWorkersWhileBuilding = 0; int lurePylonAttackedByMultipleWorkersWhenComplete = 0; for (auto it = _pastGameRecords.rbegin(); it != _pastGameRecords.rend(); it++) { if (!_gameRecord.sameMatchup(**it)) continue; int gameBehaviour = (*it)->getPylonHarassBehaviour(); if ((gameBehaviour & (int)PylonHarassBehaviour::MannerPylonBuilt) != 0) { mannerTries++; if ((*it)->getWin()) mannerWins++; if ((gameBehaviour & (int)PylonHarassBehaviour::MannerPylonAttackedByMultipleWorkersWhileBuilding) != 0) mannerPylonAttackedByMultipleWorkersWhileBuilding++; if ((gameBehaviour & (int)PylonHarassBehaviour::MannerPylonAttackedByMultipleWorkersWhenComplete) != 0) mannerPylonAttackedByMultipleWorkersWhenComplete++; if ((gameBehaviour & (int)PylonHarassBehaviour::MannerPylonSurvived1500Frames) != 0) mannerPylonSurvived1500Frames++; } if ((gameBehaviour & (int)PylonHarassBehaviour::LurePylonBuilt) != 0) { lureTries++; if ((*it)->getWin()) lureWins++; if ((gameBehaviour & (int)PylonHarassBehaviour::LurePylonAttackedByMultipleWorkersWhileBuilding) != 0) lurePylonAttackedByMultipleWorkersWhileBuilding++; if ((gameBehaviour & (int)PylonHarassBehaviour::LurePylonAttackedByMultipleWorkersWhenComplete) != 0) lurePylonAttackedByMultipleWorkersWhenComplete++; } } // Compute our overall win rate count = 0; int wins = 0; for (auto it = _pastGameRecords.rbegin(); it != _pastGameRecords.rend() && count < 50; it++) { if (!_gameRecord.sameMatchup(**it)) continue; count++; if ((*it)->getWin()) wins++; } double winRate = (double)wins / (double)count; // Log stored information std::ostringstream status; status << "Expected pylon harass behaviour: "; // Set the expected behaviour based on this logic: // - If we have less than 2 games experience, don't assume anything // - Consider it working if we observe it at least half the time and our win rate is improved // We give the thresholds a bit of leeway when we have few data points if (mannerTries > 1) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::MannerPylonBuilt; status << "have mannered"; if (mannerTries < 5 || (double)mannerWins / (double)mannerTries > 0.9 * winRate) { bool effective = false; if ((double)mannerPylonAttackedByMultipleWorkersWhileBuilding / (double)mannerTries > (mannerTries > 3 ? 0.49 : 0.32)) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::MannerPylonAttackedByMultipleWorkersWhileBuilding; status << "; got reaction while building"; effective = true; } if ((double)mannerPylonAttackedByMultipleWorkersWhenComplete / (double)mannerTries > (mannerTries > 3 ? 0.49 : 0.32)) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::MannerPylonAttackedByMultipleWorkersWhenComplete; status << "; got reaction after built"; effective = true; } if ((double)mannerPylonSurvived1500Frames / (double)mannerTries > (mannerTries > 3 ? 0.49 : 0.32)) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::MannerPylonSurvived1500Frames; status << "; survived 1500 frames"; effective = true; } if (!effective) status << ": ineffective"; } else { status << ": low win rate: " << ((double)mannerWins / (double)mannerTries) << " vs. " << winRate; } } else { status << "have not mannered"; } if (lureTries > 1) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::LurePylonBuilt; status << "; have lured"; if (lureTries < 5 || (double)lureWins / (double)lureTries > 0.9 * winRate) { bool effective = false; if ((double)lurePylonAttackedByMultipleWorkersWhileBuilding / (double)lureWins > (lureTries > 3 ? 0.49 : 0.32)) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::LurePylonAttackedByMultipleWorkersWhileBuilding; status << "; got reaction while building"; effective = true; } if ((double)lurePylonAttackedByMultipleWorkersWhenComplete / (double)lureWins > (lureTries > 3 ? 0.49 : 0.32)) { _expectedPylonHarassBehaviour |= (int)PylonHarassBehaviour::LurePylonAttackedByMultipleWorkersWhenComplete; status << "; got reaction after built"; effective = true; } if (!effective) status << ": ineffective"; } else { status << ": low win rate: " << ((double)lureWins / (double)lureTries) << " vs. " << winRate; } } else { status << "; have not lured"; } Log().Get() << status.str(); } // Write the game records to the opponent model file. void OpponentModel::write() { if (Config::IO::WriteOpponentModel) { std::ofstream outFile(Config::IO::WriteDir + _filename, std::ios::trunc); // If it fails, there's not much we can do about it. if (outFile.bad()) { return; } // The number of initial game records to skip over without rewriting. // In normal operation, nToSkip is 0 or 1. int nToSkip = 0; if (int(_pastGameRecords.size()) >= Config::IO::MaxGameRecords) { nToSkip = _pastGameRecords.size() - Config::IO::MaxGameRecords + 1; } // Rewrite any old records that were read in. // Not needed for local testing or for SSCAIT, necessary for other competitions. for (auto record : _pastGameRecords) { if (nToSkip > 0) { --nToSkip; } else { record->write(outFile); } } // And write the record of this game. _gameRecord.write(outFile); outFile.close(); } } void OpponentModel::update() { _planRecognizer.update(); reconsiderEnemyPlan(); if (Config::IO::ReadOpponentModel || Config::IO::WriteOpponentModel) { _gameRecord.update(); // TODO the rest is turned off for now, not currently useful return; if (BWAPI::Broodwar->getFrameCount() % 32 == 31) { setBestMatch(); } if (_bestMatch) { //_bestMatch->debugLog(); //BWAPI::Broodwar->drawTextScreen(200, 10, "%cmatch %s %s", white, _bestMatch->mapName, _bestMatch->openingName); BWAPI::Broodwar->drawTextScreen(220, 6, "%cmatch", white); } else { BWAPI::Broodwar->drawTextScreen(220, 6, "%cno best match", white); } } } // Fill in the snapshot with a prediction of what the opponent may have at a given time. void OpponentModel::predictEnemy(int lookaheadFrames, PlayerSnapshot & snap) const { const int t = BWAPI::Broodwar->getFrameCount() + lookaheadFrames; // Use the best-match past game record if possible. // Otherwise, take a current snapshot and call it the prediction. if (_bestMatch && _bestMatch->findClosestSnapshot(t, snap)) { // All done. } else { snap.takeEnemy(); } } // The inferred enemy opening plan. OpeningPlan OpponentModel::getEnemyPlan() const { return _planRecognizer.getPlan(); } // String for displaying the recognized enemy opening plan in the UI. std::string OpponentModel::getEnemyPlanString() const { return OpeningPlanString(_planRecognizer.getPlan()); } // String for displaying the expected enemy opening plan in the UI. std::string OpponentModel::getExpectedEnemyPlanString() const { return OpeningPlanString(_expectedEnemyPlan); } // The recognized enemy plan, or the current expected enemy plan if none. OpeningPlan OpponentModel::getBestGuessEnemyPlan() const { if (_planRecognizer.getPlan() != OpeningPlan::Unknown) { return _planRecognizer.getPlan(); } return _expectedEnemyPlan; } // Look through past games and adjust our strategy weights appropriately std::map<std::string, double> OpponentModel::getStrategyWeightFactors() const { std::map<std::string, double> result; std::map<std::string, int> strategyCount; std::map<std::string, int> strategyLosses; std::ostringstream log; log << "Deciding strategy weight factors:"; // Compute a factor to adjust the weight for each strategy // More recent results are weighted more heavily // Results on the same map are weighted more heavily int count = 0; for (auto it = _pastGameRecords.rbegin(); it != _pastGameRecords.rend(); it++) { if (!_gameRecord.sameMatchup(**it)) continue; count++; bool sameMap = (*it)->getMapName() == BWAPI::Broodwar->mapFileName(); auto& strategy = (*it)->getOpeningName(); log << "\n" << count << ": " << strategy << " " << ((*it)->getWin() ? "won" : "lost") << " on " << (*it)->getMapName() << ". "; if (result.find(strategy) == result.end()) { // Our proxy 2-gate is given a boost on 2-player maps if (strategy == "Proxy9-9Gate" && BWAPI::Broodwar->getStartLocations().size() == 2) result[strategy] = 1.5; else result[strategy] = 1.0; strategyCount[strategy] = 0; strategyLosses[strategy] = 0; } double factor = result[strategy]; strategyCount[strategy] = strategyCount[strategy] + 1; double aging = std::pow(strategyCount[strategy], 1.1); log << "Aging factor " << aging << "; initial weight " << factor; if ((*it)->getWin()) { factor *= 1.0 + (sameMap ? 0.6 : 0.4) / aging; } else { factor *= 1.0 - (sameMap ? 0.7 : 0.5) / aging; strategyLosses[strategy] = strategyLosses[strategy] + 1; } log << "; updated to " << factor; result[strategy] = factor; } // Analyze the losses for (auto it = strategyLosses.begin(); it != strategyLosses.end(); it++) { // Any strategies that have never lost are given a large boost // When in tournament mode, a similar boost is given to strategies that haven't been played in ParseUtils // This should allow us to avoid getting stuck on a strategy that wins 90% of the time, // if another strategy wins 100% of the time if (it->second == 0) { result[it->first] = result[it->first] * 100; log << "\nBoosting " << it->first << " to " << result[it->first] << " as it has never lost"; } // Any strategies that have been played at least 3 times and always lost are given a large penalty if (it->second >= 3 && strategyCount[it->first] == it->second) { result[it->first] = result[it->first] * 0.1; log << "\nLowering " << it->first << " to " << result[it->first] << " as it has never won"; } } Log().Debug() << log.str(); return result; } bool OpponentModel::expectAirTechSoon() { return _worstCaseExpectedAirTech < (BWAPI::Broodwar->getFrameCount() + BWAPI::UnitTypes::Protoss_Photon_Cannon.buildTime()); } void OpponentModel::setPylonHarassObservation(PylonHarassBehaviour observation) { if ((_pylonHarassBehaviour & (int)observation) == 0) { _pylonHarassBehaviour |= (int)observation; _gameRecord.setPylonHarassBehaviour(_pylonHarassBehaviour); Log().Get() << "Added pylon harass observation: " << (int)observation; } } bool OpponentModel::expectCloakedCombatUnitsSoon() { return _worstCaseExpectedCloakTech < ( BWAPI::Broodwar->getFrameCount() + BWAPI::UnitTypes::Protoss_Observer.buildTime() + BWAPI::UnitTypes::Protoss_Observatory.buildTime() + BWAPI::UnitTypes::Protoss_Robotics_Facility.buildTime()); } OpponentModel & OpponentModel::Instance() { static OpponentModel instance; return instance; }
[ "liuruoze@163.com" ]
liuruoze@163.com
52a5da6aa2915e78ce386244b9a0fe10c64fb2f4
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/mps/include/tencentcloud/mps/v20190612/model/DescribeOutputRTMPPullSettings.h
80776761ef12600aa8ef1d0cdb9bf6ee7b762606
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-cpp
9f5df8220eaaf72f7eaee07b2ede94f89313651f
42a76b812b81d1b52ec6a217fafc8faa135e06ca
refs/heads/master
2023-08-30T03:22:45.269556
2023-08-30T00:45:39
2023-08-30T00:45:39
188,991,963
55
37
Apache-2.0
2023-08-17T03:13:20
2019-05-28T08:56:08
C++
UTF-8
C++
false
false
3,339
h
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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. */ #ifndef TENCENTCLOUD_MPS_V20190612_MODEL_DESCRIBEOUTPUTRTMPPULLSETTINGS_H_ #define TENCENTCLOUD_MPS_V20190612_MODEL_DESCRIBEOUTPUTRTMPPULLSETTINGS_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> #include <tencentcloud/core/AbstractModel.h> #include <tencentcloud/mps/v20190612/model/DescribeOutputRTMPPullServerUrl.h> namespace TencentCloud { namespace Mps { namespace V20190612 { namespace Model { /** * 查询输出的RTMP拉流配置信息。 */ class DescribeOutputRTMPPullSettings : public AbstractModel { public: DescribeOutputRTMPPullSettings(); ~DescribeOutputRTMPPullSettings() = default; void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const; CoreInternalOutcome Deserialize(const rapidjson::Value &value); /** * 获取拉流地址列表。 注意:此字段可能返回 null,表示取不到有效值。 * @return ServerUrls 拉流地址列表。 注意:此字段可能返回 null,表示取不到有效值。 * */ std::vector<DescribeOutputRTMPPullServerUrl> GetServerUrls() const; /** * 设置拉流地址列表。 注意:此字段可能返回 null,表示取不到有效值。 * @param _serverUrls 拉流地址列表。 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetServerUrls(const std::vector<DescribeOutputRTMPPullServerUrl>& _serverUrls); /** * 判断参数 ServerUrls 是否已赋值 * @return ServerUrls 是否已赋值 * */ bool ServerUrlsHasBeenSet() const; private: /** * 拉流地址列表。 注意:此字段可能返回 null,表示取不到有效值。 */ std::vector<DescribeOutputRTMPPullServerUrl> m_serverUrls; bool m_serverUrlsHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_MPS_V20190612_MODEL_DESCRIBEOUTPUTRTMPPULLSETTINGS_H_
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
a70c165b596bbccc88e5eb1611ff81237eb8416e
15419e6b114d5b89e78648dbae52a0aae276b673
/UVa/Comptitive Programming/Ch-03 Problem Solving Paradigms/03 Greedy/UVa 10718 - Bit Mask - AC.cpp
72e1bc147e0df80efacad0e07f3de0f0663eb6dd
[]
no_license
ImnIrdst/ICPC-Practice-2015-TiZii
7cde07617d8ebf90dc8a4baec4d9faec49f79d13
73bb0f84e7a003e154d685fa598002f8b9498878
refs/heads/master
2021-01-10T16:29:34.490848
2016-04-08T04:13:37
2016-04-08T04:13:37
55,749,815
1
0
null
null
null
null
UTF-8
C++
false
false
513
cpp
#include <iostream> using namespace std; void printbits(unsigned int n){ for(int i=31 ; i>=0 ; i--){ if(n & (1<<i)) cout << 1; else cout << 0; }cout << endl; } int main(){ unsigned int N, L, U; while(cin >> N >> L >> U){ unsigned int M = 0; for(int i=31 ; i>=0 ; i--){ unsigned int Mask = (1u << i); if(!(N & Mask) && ((M|Mask) <= U)) M |= Mask; if( (L & Mask) && (M < L)) M |= Mask; } //printbits(N); //printbits(M); cout << M << endl; } }
[ "imn.irdst@gmail.com" ]
imn.irdst@gmail.com
26c2c6a906ea09ca9fcb9cc04c5f806dde40fa2e
e55fb619c1b18b46bb6259702cb0b009c566f802
/app/src/main/cpp/Parser.cpp
a18013f42e9c80685faacdfeef4b057e112f15f9
[]
no_license
lmcoy/CalculatorApp
ef78a9f0340f55ccf798ff414a905ff4101af124
84d31238a7eb354c17f817c2aab74ac93b6d341a
refs/heads/master
2020-03-15T18:09:00.070834
2018-05-05T19:12:02
2018-05-05T19:12:02
132,277,331
0
0
null
null
null
null
UTF-8
C++
false
false
4,813
cpp
// // Copyright © 2017 Lennart Oymanns. All rights reserved. // #include <iostream> #include <map> #include "Error.h" #include "Factor.hpp" #include "Function.hpp" #include "Lexer.hpp" #include "Number.hpp" #include "Parser.hpp" #include "Power.hpp" #include "Summand.hpp" #include "UnaryMinus.hpp" #include "Variable.hpp" using namespace Equation; const Token Parser::NoToken(Token::Type_t::End, "NoToken", 0); NodePtr Parser::Parse(const std::string &expr) { Lexer lexer(expr); tokens = lexer.TokenList(); index = 0; auto nodes = parseSummand(); auto token = readNextToken(); if (token.Type != Token::Type_t::End) { if (token.Type == Token::Type_t::Operator && token.Value == ")") { throw InputEquationError(token.pos - 1, "unmatched ')'"); } if (token.Type == Token::Type_t::Operator && token.Value == "^") { throw InputEquationError(token.pos - 1, "multiple '^' not supported"); } throw InputEquationError(token.pos - 1, "expected end of expression"); } return nodes; } NodePtr Parser::parseSummand() { auto first = parseFactor(); auto summand = std::make_shared<Summand>(first); bool valid = false; auto token = readNextToken(); while (token.Type == Token::Type_t::Operator && (token.Value == "+" || token.Value == "-")) { auto next = parseFactor(); if (token.Value == "+") { summand->AddOp1(next); } else { auto m = std::make_shared<UnaryMinus>(next); summand->AddOp1(m); } valid = true; token = readNextToken(); } unreadToken(); if (valid) { return summand; } return first; } NodePtr Parser::parseFactor() { auto first = parsePower(); auto factor = std::make_shared<Factor>(first); bool valid = false; auto token = readNextToken(); while (token.Type == Token::Type_t::Operator && (token.Value == "*" || token.Value == "/")) { auto next = parsePower(); if (token.Value == "*") { factor->AddOp1(next); } else { auto d = std::make_shared<Power>(next, std::make_shared<Number>(-1l)); factor->AddOp1(d); // factor->AddOp2(next); } valid = true; token = readNextToken(); } unreadToken(); if (valid) { return factor; } return first; } NodePtr Parser::parsePower() { auto base = parseNumber(); auto token = readNextToken(); if (token.Type == Token::Type_t::Operator && token.Value == "^") { auto exponent = parseNumber(); auto power = std::make_shared<Power>(base, exponent); return power; } unreadToken(); return base; } NodePtr Parser::parseNumber() { const Token &token = readNextToken(); if (token.Type == Token::Type_t::Operator && token.Value == "(") { auto v = parseSummand(); auto t = readNextToken(); if (t.Type != Token::Type_t::Operator || token.Value == ")") { throw InputEquationError(t.pos, "missing ')'"); } return v; } if (token.Type == Token::Type_t::Operator && token.Value == "-") { return std::make_shared<UnaryMinus>(parsePower()); } if (token.Type == Token::Type_t::String) { const Token &next = readNextToken(); unreadToken(); if (next.Type == Token::Type_t::Operator && next.Value == "(") { // function unreadToken(); // unread function name return parseFunction(); } return std::make_shared<Variable>(token.Value); } if (token.Type == Token::Type_t::Number) { try { return std::make_shared<Number>(Number(token.Value)); } catch (const std::exception &e) { throw InputEquationError(token.pos, e.what()); } } if (token.Type == Token::Type_t::End) { throw InputEquationError(token.pos, "unexpected end of expression"); } throw InputEquationError(token.pos, "unknown token type"); return 0; } NodePtr Parser::parseFunction() { auto name = readNextToken(); if (name.Type != Token::Type_t::String) { throw InputEquationError(name.pos, "not a valid function name"); } auto open = readNextToken(); if (open.Type != Token::Type_t::Operator || open.Value != "(") { throw InputEquationError(open.pos, "missing '(' after function"); } auto first = parseSummand(); auto fun = std::make_shared<Function>(name.Value); fun->AddArg(first); auto token = readNextToken(); while (token.Type == Token::Type_t::Comma && token.Value == ",") { auto next = parseSummand(); fun->AddArg(next); token = readNextToken(); } if (token.Type != Token::Type_t::Operator || token.Value != ")") { throw InputEquationError(token.pos, "missing ')'"); } return fun; } const Token &Parser::readNextToken() { if (index >= tokens.size()) { return Parser::NoToken; } index += 1; return tokens[index - 1]; } void Parser::unreadToken() { if (index == 0) { return; } index -= 1; }
[ "oymanns@physik.rwth-aachen.de" ]
oymanns@physik.rwth-aachen.de
d1757dfe6457c06785111646e9244387a40faf8d
2da95bb43de6c3da507e437134a7de15a0ec239c
/evalMath/uoper.cpp
485f5775ae7e4cd7979072c614391233c8624f42
[]
no_license
sijad/math-parser
74b4c9f3bde45c744bf4a4779dce5bb97ec18858
227ea182222ab9c2fb36c073bb72df3f94c36f8b
refs/heads/master
2021-01-13T03:33:34.998357
2015-12-30T18:23:13
2016-12-28T09:23:23
77,519,846
0
0
null
null
null
null
UTF-8
C++
false
false
180
cpp
#include "uoper.h" uoper::uoper(std::string name) { this->name_ = name; } std::string uoper::getOper() { return name_; } long double uoper::run(long double n1) { return 0; }
[ "wolaws@gmail.com" ]
wolaws@gmail.com
07939ba85110a5d1ad61ca461f4b8ead6b1d3058
5456502f97627278cbd6e16d002d50f1de3da7bb
/net/quic/core/quic_session.cc
dc80caea75eda27efd900c7ad3af65cc5343e7b2
[ "BSD-3-Clause" ]
permissive
TrellixVulnTeam/Chromium_7C66
72d108a413909eb3bd36c73a6c2f98de1573b6e5
c8649ab2a0f5a747369ed50351209a42f59672ee
refs/heads/master
2023-03-16T12:51:40.231959
2017-12-20T10:38:26
2017-12-20T10:38:26
null
0
0
null
null
null
null
UTF-8
C++
false
false
31,074
cc
// 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 "net/quic/core/quic_session.h" #include "base/memory/ptr_util.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "net/quic/core/crypto/proof_verifier.h" #include "net/quic/core/quic_bug_tracker.h" #include "net/quic/core/quic_connection.h" #include "net/quic/core/quic_flags.h" #include "net/quic/core/quic_flow_controller.h" using base::IntToString; using base::StringPiece; using std::make_pair; using std::max; using std::string; using net::SpdyPriority; namespace net { #define ENDPOINT \ (perspective() == Perspective::IS_SERVER ? "Server: " : " Client: ") QuicSession::QuicSession(QuicConnection* connection, Visitor* owner, const QuicConfig& config) : connection_(connection), visitor_(owner), config_(config), max_open_outgoing_streams_(kDefaultMaxStreamsPerConnection), max_open_incoming_streams_(config_.GetMaxIncomingDynamicStreamsToSend()), next_outgoing_stream_id_(perspective() == Perspective::IS_SERVER ? 2 : 3), largest_peer_created_stream_id_( perspective() == Perspective::IS_SERVER ? 1 : 0), num_dynamic_incoming_streams_(0), num_draining_incoming_streams_(0), num_locally_closed_incoming_streams_highest_offset_(0), error_(QUIC_NO_ERROR), flow_controller_(connection_, 0, perspective(), kMinimumFlowControlSendWindow, config_.GetInitialSessionFlowControlWindowToSend(), perspective() == Perspective::IS_SERVER), currently_writing_stream_id_(0) {} void QuicSession::Initialize() { connection_->set_visitor(this); connection_->SetFromConfig(config_); DCHECK_EQ(kCryptoStreamId, GetCryptoStream()->id()); static_stream_map_[kCryptoStreamId] = GetCryptoStream(); } QuicSession::~QuicSession() { DLOG_IF(WARNING, num_locally_closed_incoming_streams_highest_offset() > max_open_incoming_streams_) << "Surprisingly high number of locally closed peer initiated streams" "still waiting for final byte offset: " << num_locally_closed_incoming_streams_highest_offset(); DLOG_IF(WARNING, GetNumLocallyClosedOutgoingStreamsHighestOffset() > max_open_outgoing_streams_) << "Surprisingly high number of locally closed self initiated streams" "still waiting for final byte offset: " << GetNumLocallyClosedOutgoingStreamsHighestOffset(); } void QuicSession::OnStreamFrame(const QuicStreamFrame& frame) { // TODO(rch) deal with the error case of stream id 0. QuicStreamId stream_id = frame.stream_id; QuicStream* stream = GetOrCreateStream(stream_id); if (!stream) { // The stream no longer exists, but we may still be interested in the // final stream byte offset sent by the peer. A frame with a FIN can give // us this offset. if (frame.fin) { QuicStreamOffset final_byte_offset = frame.offset + frame.data_length; UpdateFlowControlOnFinalReceivedByteOffset(stream_id, final_byte_offset); } return; } stream->OnStreamFrame(frame); } void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) { if (base::ContainsKey(static_stream_map_, frame.stream_id)) { connection()->CloseConnection( QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); return; } QuicStream* stream = GetOrCreateDynamicStream(frame.stream_id); if (!stream) { HandleRstOnValidNonexistentStream(frame); return; // Errors are handled by GetOrCreateStream. } stream->OnStreamReset(frame); } void QuicSession::OnGoAway(const QuicGoAwayFrame& frame) { DCHECK(frame.last_good_stream_id < next_outgoing_stream_id_); } void QuicSession::OnConnectionClosed(QuicErrorCode error, const string& error_details, ConnectionCloseSource source) { DCHECK(!connection_->connected()); if (error_ == QUIC_NO_ERROR) { error_ = error; } while (!dynamic_stream_map_.empty()) { DynamicStreamMap::iterator it = dynamic_stream_map_.begin(); QuicStreamId id = it->first; it->second->OnConnectionClosed(error, source); // The stream should call CloseStream as part of OnConnectionClosed. if (dynamic_stream_map_.find(id) != dynamic_stream_map_.end()) { QUIC_BUG << ENDPOINT << "Stream failed to close under OnConnectionClosed"; CloseStream(id); } } if (visitor_) { visitor_->OnConnectionClosed(connection_->connection_id(), error, error_details); } } void QuicSession::OnWriteBlocked() { if (visitor_) { visitor_->OnWriteBlocked(connection_); } } void QuicSession::OnSuccessfulVersionNegotiation( const QuicVersion& /*version*/) {} void QuicSession::OnPathDegrading() {} void QuicSession::OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) { // Stream may be closed by the time we receive a WINDOW_UPDATE, so we can't // assume that it still exists. QuicStreamId stream_id = frame.stream_id; if (stream_id == kConnectionLevelId) { // This is a window update that applies to the connection, rather than an // individual stream. DVLOG(1) << ENDPOINT << "Received connection level flow control window " "update with byte offset: " << frame.byte_offset; flow_controller_.UpdateSendWindowOffset(frame.byte_offset); return; } QuicStream* stream = GetOrCreateStream(stream_id); if (stream != nullptr) { stream->OnWindowUpdateFrame(frame); } } void QuicSession::OnBlockedFrame(const QuicBlockedFrame& frame) { // TODO(rjshade): Compare our flow control receive windows for specified // streams: if we have a large window then maybe something // had gone wrong with the flow control accounting. DVLOG(1) << ENDPOINT << "Received BLOCKED frame with stream id: " << frame.stream_id; } bool QuicSession::CheckStreamNotBusyLooping(QuicStream* stream, uint64_t previous_bytes_written, bool previous_fin_sent) { if ( // Stream should not be closed. !stream->write_side_closed() && // Not connection flow control blocked. !flow_controller_.IsBlocked() && // Detect lack of forward progress. previous_bytes_written == stream->stream_bytes_written() && previous_fin_sent == stream->fin_sent()) { stream->set_busy_counter(stream->busy_counter() + 1); DVLOG(1) << "Suspected busy loop on stream id " << stream->id() << " stream_bytes_written " << stream->stream_bytes_written() << " fin " << stream->fin_sent() << " count " << stream->busy_counter(); // Wait a few iterations before firing, the exact count is // arbitrary, more than a few to cover a few test-only false // positives. if (stream->busy_counter() > 20) { LOG(ERROR) << "Detected busy loop on stream id " << stream->id() << " stream_bytes_written " << stream->stream_bytes_written() << " fin " << stream->fin_sent(); return false; } } else { stream->set_busy_counter(0); } return true; } void QuicSession::OnCanWrite() { // We limit the number of writes to the number of pending streams. If more // streams become pending, WillingAndAbleToWrite will be true, which will // cause the connection to request resumption before yielding to other // connections. size_t num_writes = write_blocked_streams_.NumBlockedStreams(); if (flow_controller_.IsBlocked()) { // If we are connection level flow control blocked, then only allow the // crypto and headers streams to try writing as all other streams will be // blocked. num_writes = 0; if (write_blocked_streams_.crypto_stream_blocked()) { num_writes += 1; } if (write_blocked_streams_.headers_stream_blocked()) { num_writes += 1; } } if (num_writes == 0) { return; } QuicConnection::ScopedPacketBundler ack_bundler( connection_, QuicConnection::SEND_ACK_IF_QUEUED); for (size_t i = 0; i < num_writes; ++i) { if (!(write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || write_blocked_streams_.HasWriteBlockedDataStreams())) { // Writing one stream removed another!? Something's broken. QUIC_BUG << "WriteBlockedStream is missing"; connection_->CloseConnection(QUIC_INTERNAL_ERROR, "WriteBlockedStream is missing", ConnectionCloseBehavior::SILENT_CLOSE); return; } if (!connection_->CanWriteStreamData()) { return; } currently_writing_stream_id_ = write_blocked_streams_.PopFront(); QuicStream* stream = GetOrCreateStream(currently_writing_stream_id_); if (stream != nullptr && !stream->flow_controller()->IsBlocked()) { // If the stream can't write all bytes it'll re-add itself to the blocked // list. uint64_t previous_bytes_written = stream->stream_bytes_written(); bool previous_fin_sent = stream->fin_sent(); DVLOG(1) << "stream " << stream->id() << " bytes_written " << previous_bytes_written << " fin " << previous_fin_sent; stream->OnCanWrite(); DCHECK(CheckStreamNotBusyLooping(stream, previous_bytes_written, previous_fin_sent)); } currently_writing_stream_id_ = 0; } } bool QuicSession::WillingAndAbleToWrite() const { // If the crypto or headers streams are blocked, we want to schedule a write - // they don't get blocked by connection level flow control. Otherwise only // schedule a write if we are not flow control blocked at the connection // level. return write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || (!flow_controller_.IsBlocked() && write_blocked_streams_.HasWriteBlockedDataStreams()); } bool QuicSession::HasPendingHandshake() const { return write_blocked_streams_.crypto_stream_blocked(); } bool QuicSession::HasOpenDynamicStreams() const { return (dynamic_stream_map_.size() - draining_streams_.size() + locally_closed_streams_highest_offset_.size()) > 0; } void QuicSession::ProcessUdpPacket(const IPEndPoint& self_address, const IPEndPoint& peer_address, const QuicReceivedPacket& packet) { connection_->ProcessUdpPacket(self_address, peer_address, packet); } QuicConsumedData QuicSession::WritevData( QuicStream* stream, QuicStreamId id, QuicIOVector iov, QuicStreamOffset offset, bool fin, QuicAckListenerInterface* ack_notifier_delegate) { // This check is an attempt to deal with potential memory corruption // in which |id| ends up set to 1 (the crypto stream id). If this happen // it might end up resulting in unencrypted stream data being sent. // While this is impossible to avoid given sufficient corruption, this // seems like a reasonable mitigation. if (id == kCryptoStreamId && stream != GetCryptoStream()) { QUIC_BUG << "Stream id mismatch"; connection_->CloseConnection( QUIC_INTERNAL_ERROR, "Non-crypto stream attempted to write data as crypto stream.", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); return QuicConsumedData(0, false); } if (!IsEncryptionEstablished() && id != kCryptoStreamId) { // Do not let streams write without encryption. The calling stream will end // up write blocked until OnCanWrite is next called. return QuicConsumedData(0, false); } QuicConsumedData data = connection_->SendStreamData(id, iov, offset, fin, ack_notifier_delegate); write_blocked_streams_.UpdateBytesForStream(id, data.bytes_consumed); return data; } void QuicSession::SendRstStream(QuicStreamId id, QuicRstStreamErrorCode error, QuicStreamOffset bytes_written) { if (base::ContainsKey(static_stream_map_, id)) { QUIC_BUG << "Cannot send RST for a static stream with ID " << id; return; } if (connection()->connected()) { // Only send a RST_STREAM frame if still connected. connection_->SendRstStream(id, error, bytes_written); } CloseStreamInner(id, true); } void QuicSession::SendGoAway(QuicErrorCode error_code, const string& reason) { if (goaway_sent()) { return; } connection_->SendGoAway(error_code, largest_peer_created_stream_id_, reason); } void QuicSession::CloseStream(QuicStreamId stream_id) { CloseStreamInner(stream_id, false); } void QuicSession::InsertLocallyClosedStreamsHighestOffset( const QuicStreamId id, QuicStreamOffset offset) { locally_closed_streams_highest_offset_[id] = offset; if (IsIncomingStream(id)) { ++num_locally_closed_incoming_streams_highest_offset_; } } void QuicSession::CloseStreamInner(QuicStreamId stream_id, bool locally_reset) { DVLOG(1) << ENDPOINT << "Closing stream " << stream_id; DynamicStreamMap::iterator it = dynamic_stream_map_.find(stream_id); if (it == dynamic_stream_map_.end()) { // When CloseStreamInner has been called recursively (via // QuicStream::OnClose), the stream will already have been deleted // from stream_map_, so return immediately. DVLOG(1) << ENDPOINT << "Stream is already closed: " << stream_id; return; } QuicStream* stream = it->second.get(); // Tell the stream that a RST has been sent. if (locally_reset) { stream->set_rst_sent(true); } closed_streams_.push_back(std::move(it->second)); // If we haven't received a FIN or RST for this stream, we need to keep track // of the how many bytes the stream's flow controller believes it has // received, for accurate connection level flow control accounting. if (!stream->HasFinalReceivedByteOffset()) { InsertLocallyClosedStreamsHighestOffset( stream_id, stream->flow_controller()->highest_received_byte_offset()); } dynamic_stream_map_.erase(it); if (IsIncomingStream(stream_id)) { --num_dynamic_incoming_streams_; } if (draining_streams_.find(stream_id) != draining_streams_.end() && IsIncomingStream(stream_id)) { --num_draining_incoming_streams_; } draining_streams_.erase(stream_id); stream->OnClose(); // Decrease the number of streams being emulated when a new one is opened. connection_->SetNumOpenStreams(dynamic_stream_map_.size()); } void QuicSession::UpdateFlowControlOnFinalReceivedByteOffset( QuicStreamId stream_id, QuicStreamOffset final_byte_offset) { std::map<QuicStreamId, QuicStreamOffset>::iterator it = locally_closed_streams_highest_offset_.find(stream_id); if (it == locally_closed_streams_highest_offset_.end()) { return; } DVLOG(1) << ENDPOINT << "Received final byte offset " << final_byte_offset << " for stream " << stream_id; QuicByteCount offset_diff = final_byte_offset - it->second; if (flow_controller_.UpdateHighestReceivedOffset( flow_controller_.highest_received_byte_offset() + offset_diff)) { // If the final offset violates flow control, close the connection now. if (flow_controller_.FlowControlViolation()) { connection_->CloseConnection( QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, "Connection level flow control violation", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); return; } } flow_controller_.AddBytesConsumed(offset_diff); locally_closed_streams_highest_offset_.erase(it); if (IsIncomingStream(stream_id)) { --num_locally_closed_incoming_streams_highest_offset_; } } bool QuicSession::IsEncryptionEstablished() { return GetCryptoStream()->encryption_established(); } bool QuicSession::IsCryptoHandshakeConfirmed() { return GetCryptoStream()->handshake_confirmed(); } void QuicSession::OnConfigNegotiated() { connection_->SetFromConfig(config_); const QuicVersion version = connection()->version(); uint32_t max_streams = 0; if (version > QUIC_VERSION_34 && config_.HasReceivedMaxIncomingDynamicStreams()) { max_streams = config_.ReceivedMaxIncomingDynamicStreams(); } else { max_streams = config_.MaxStreamsPerConnection(); } set_max_open_outgoing_streams(max_streams); if (version <= QUIC_VERSION_34) { // A small number of additional incoming streams beyond the limit should be // allowed. This helps avoid early connection termination when FIN/RSTs for // old streams are lost or arrive out of order. // Use a minimum number of additional streams, or a percentage increase, // whichever is larger. uint32_t max_incoming_streams = max(max_streams + kMaxStreamsMinimumIncrement, static_cast<uint32_t>(max_streams * kMaxStreamsMultiplier)); set_max_open_incoming_streams(max_incoming_streams); } else { uint32_t max_incoming_streams_to_send = config_.GetMaxIncomingDynamicStreamsToSend(); uint32_t max_incoming_streams = max(max_incoming_streams_to_send + kMaxStreamsMinimumIncrement, static_cast<uint32_t>(max_incoming_streams_to_send * kMaxStreamsMultiplier)); set_max_open_incoming_streams(max_incoming_streams); } if (config_.HasReceivedInitialStreamFlowControlWindowBytes()) { // Streams which were created before the SHLO was received (0-RTT // requests) are now informed of the peer's initial flow control window. OnNewStreamFlowControlWindow( config_.ReceivedInitialStreamFlowControlWindowBytes()); } if (config_.HasReceivedInitialSessionFlowControlWindowBytes()) { OnNewSessionFlowControlWindow( config_.ReceivedInitialSessionFlowControlWindowBytes()); } } void QuicSession::HandleFrameOnNonexistentOutgoingStream( QuicStreamId stream_id) { DCHECK(!IsClosedStream(stream_id)); // Received a frame for a locally-created stream that is not currently // active. This is an error. connection()->CloseConnection( QUIC_INVALID_STREAM_ID, "Data for nonexistent stream", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); } void QuicSession::HandleRstOnValidNonexistentStream( const QuicRstStreamFrame& frame) { // If the stream is neither originally in active streams nor created in // GetOrCreateDynamicStream(), it could be a closed stream in which case its // final received byte offset need to be updated. if (IsClosedStream(frame.stream_id)) { // The RST frame contains the final byte offset for the stream: we can now // update the connection level flow controller if needed. UpdateFlowControlOnFinalReceivedByteOffset(frame.stream_id, frame.byte_offset); } } void QuicSession::OnNewStreamFlowControlWindow(QuicStreamOffset new_window) { if (new_window < kMinimumFlowControlSendWindow) { LOG(ERROR) << "Peer sent us an invalid stream flow control send window: " << new_window << ", below default: " << kMinimumFlowControlSendWindow; if (connection_->connected()) { connection_->CloseConnection( QUIC_FLOW_CONTROL_INVALID_WINDOW, "New stream window too low", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); } return; } // Inform all existing streams about the new window. for (auto const& kv : static_stream_map_) { kv.second->UpdateSendWindowOffset(new_window); } for (auto const& kv : dynamic_stream_map_) { kv.second->UpdateSendWindowOffset(new_window); } } void QuicSession::OnNewSessionFlowControlWindow(QuicStreamOffset new_window) { if (new_window < kMinimumFlowControlSendWindow) { LOG(ERROR) << "Peer sent us an invalid session flow control send window: " << new_window << ", below default: " << kMinimumFlowControlSendWindow; if (connection_->connected()) { connection_->CloseConnection( QUIC_FLOW_CONTROL_INVALID_WINDOW, "New connection window too low", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); } return; } flow_controller_.UpdateSendWindowOffset(new_window); } void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { switch (event) { // TODO(satyamshekhar): Move the logic of setting the encrypter/decrypter // to QuicSession since it is the glue. case ENCRYPTION_FIRST_ESTABLISHED: // Given any streams blocked by encryption a chance to write. OnCanWrite(); break; case ENCRYPTION_REESTABLISHED: // Retransmit originally packets that were sent, since they can't be // decrypted by the peer. connection_->RetransmitUnackedPackets(ALL_INITIAL_RETRANSMISSION); // Given any streams blocked by encryption a chance to write. OnCanWrite(); break; case HANDSHAKE_CONFIRMED: QUIC_BUG_IF(!config_.negotiated()) << ENDPOINT << "Handshake confirmed without parameter negotiation."; // Discard originally encrypted packets, since they can't be decrypted by // the peer. connection_->NeuterUnencryptedPackets(); break; default: LOG(ERROR) << ENDPOINT << "Got unknown handshake event: " << event; } } void QuicSession::OnCryptoHandshakeMessageSent( const CryptoHandshakeMessage& /*message*/) {} void QuicSession::OnCryptoHandshakeMessageReceived( const CryptoHandshakeMessage& /*message*/) {} QuicConfig* QuicSession::config() { return &config_; } void QuicSession::ActivateStream(std::unique_ptr<QuicStream> stream) { QuicStreamId stream_id = stream->id(); DVLOG(1) << ENDPOINT << "num_streams: " << dynamic_stream_map_.size() << ". activating " << stream_id; DCHECK(!base::ContainsKey(dynamic_stream_map_, stream_id)); DCHECK(!base::ContainsKey(static_stream_map_, stream_id)); dynamic_stream_map_[stream_id] = std::move(stream); if (IsIncomingStream(stream_id)) { ++num_dynamic_incoming_streams_; } // Increase the number of streams being emulated when a new one is opened. connection_->SetNumOpenStreams(dynamic_stream_map_.size()); } QuicStreamId QuicSession::GetNextOutgoingStreamId() { QuicStreamId id = next_outgoing_stream_id_; next_outgoing_stream_id_ += 2; return id; } QuicStream* QuicSession::GetOrCreateStream(const QuicStreamId stream_id) { StaticStreamMap::iterator it = static_stream_map_.find(stream_id); if (it != static_stream_map_.end()) { return it->second; } return GetOrCreateDynamicStream(stream_id); } void QuicSession::StreamDraining(QuicStreamId stream_id) { DCHECK(base::ContainsKey(dynamic_stream_map_, stream_id)); if (!base::ContainsKey(draining_streams_, stream_id)) { draining_streams_.insert(stream_id); if (IsIncomingStream(stream_id)) { ++num_draining_incoming_streams_; } } } bool QuicSession::MaybeIncreaseLargestPeerStreamId( const QuicStreamId stream_id) { if (stream_id <= largest_peer_created_stream_id_) { return true; } // Check if the new number of available streams would cause the number of // available streams to exceed the limit. Note that the peer can create // only alternately-numbered streams. size_t additional_available_streams = (stream_id - largest_peer_created_stream_id_) / 2 - 1; size_t new_num_available_streams = GetNumAvailableStreams() + additional_available_streams; if (new_num_available_streams > MaxAvailableStreams()) { DVLOG(1) << ENDPOINT << "Failed to create a new incoming stream with id:" << stream_id << ". There are already " << GetNumAvailableStreams() << " streams available, which would become " << new_num_available_streams << ", which exceeds the limit " << MaxAvailableStreams() << "."; string details = IntToString(new_num_available_streams) + " above " + IntToString(MaxAvailableStreams()); connection()->CloseConnection( QUIC_TOO_MANY_AVAILABLE_STREAMS, details.c_str(), ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); return false; } for (QuicStreamId id = largest_peer_created_stream_id_ + 2; id < stream_id; id += 2) { available_streams_.insert(id); } largest_peer_created_stream_id_ = stream_id; return true; } bool QuicSession::ShouldYield(QuicStreamId stream_id) { if (stream_id == currently_writing_stream_id_) { return false; } return write_blocked_streams()->ShouldYield(stream_id); } QuicStream* QuicSession::GetOrCreateDynamicStream( const QuicStreamId stream_id) { DCHECK(!base::ContainsKey(static_stream_map_, stream_id)) << "Attempt to call GetOrCreateDynamicStream for a static stream"; DynamicStreamMap::iterator it = dynamic_stream_map_.find(stream_id); if (it != dynamic_stream_map_.end()) { return it->second.get(); } if (IsClosedStream(stream_id)) { return nullptr; } if (!IsIncomingStream(stream_id)) { HandleFrameOnNonexistentOutgoingStream(stream_id); return nullptr; } available_streams_.erase(stream_id); if (!MaybeIncreaseLargestPeerStreamId(stream_id)) { return nullptr; } // Check if the new number of open streams would cause the number of // open streams to exceed the limit. if (GetNumOpenIncomingStreams() >= max_open_incoming_streams()) { // Refuse to open the stream. SendRstStream(stream_id, QUIC_REFUSED_STREAM, 0); return nullptr; } return CreateIncomingDynamicStream(stream_id); } void QuicSession::set_max_open_incoming_streams( size_t max_open_incoming_streams) { DVLOG(1) << "Setting max_open_incoming_streams_ to " << max_open_incoming_streams; max_open_incoming_streams_ = max_open_incoming_streams; DVLOG(1) << "MaxAvailableStreams() became " << MaxAvailableStreams(); } void QuicSession::set_max_open_outgoing_streams( size_t max_open_outgoing_streams) { DVLOG(1) << "Setting max_open_outgoing_streams_ to " << max_open_outgoing_streams; max_open_outgoing_streams_ = max_open_outgoing_streams; } bool QuicSession::goaway_sent() const { return connection_->goaway_sent(); } bool QuicSession::goaway_received() const { return connection_->goaway_received(); } bool QuicSession::IsClosedStream(QuicStreamId id) { DCHECK_NE(0u, id); if (IsOpenStream(id)) { // Stream is active return false; } if (!IsIncomingStream(id)) { // Locally created streams are strictly in-order. If the id is in the // range of created streams and it's not active, it must have been closed. return id < next_outgoing_stream_id_; } // For peer created streams, we also need to consider available streams. return id <= largest_peer_created_stream_id_ && !base::ContainsKey(available_streams_, id); } bool QuicSession::IsOpenStream(QuicStreamId id) { DCHECK_NE(0u, id); if (base::ContainsKey(static_stream_map_, id) || base::ContainsKey(dynamic_stream_map_, id)) { // Stream is active return true; } return false; } size_t QuicSession::GetNumOpenIncomingStreams() const { return num_dynamic_incoming_streams_ - num_draining_incoming_streams_ + num_locally_closed_incoming_streams_highest_offset_; } size_t QuicSession::GetNumOpenOutgoingStreams() const { CHECK_GE(GetNumDynamicOutgoingStreams() + GetNumLocallyClosedOutgoingStreamsHighestOffset(), GetNumDrainingOutgoingStreams()); return GetNumDynamicOutgoingStreams() + GetNumLocallyClosedOutgoingStreamsHighestOffset() - GetNumDrainingOutgoingStreams(); } size_t QuicSession::GetNumActiveStreams() const { return dynamic_stream_map_.size() - draining_streams_.size(); } size_t QuicSession::GetNumAvailableStreams() const { return available_streams_.size(); } void QuicSession::MarkConnectionLevelWriteBlocked(QuicStreamId id) { QUIC_BUG_IF(GetOrCreateStream(id) == nullptr) << "Marking unknown stream " << id << " blocked."; write_blocked_streams_.AddStream(id); } bool QuicSession::HasDataToWrite() const { return write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || write_blocked_streams_.HasWriteBlockedDataStreams() || connection_->HasQueuedData(); } void QuicSession::PostProcessAfterData() { closed_streams_.clear(); } size_t QuicSession::GetNumDynamicOutgoingStreams() const { DCHECK_GE(dynamic_stream_map_.size(), num_dynamic_incoming_streams_); return dynamic_stream_map_.size() - num_dynamic_incoming_streams_; } size_t QuicSession::GetNumDrainingOutgoingStreams() const { DCHECK_GE(draining_streams_.size(), num_draining_incoming_streams_); return draining_streams_.size() - num_draining_incoming_streams_; } size_t QuicSession::GetNumLocallyClosedOutgoingStreamsHighestOffset() const { DCHECK_GE(locally_closed_streams_highest_offset_.size(), num_locally_closed_incoming_streams_highest_offset_); return locally_closed_streams_highest_offset_.size() - num_locally_closed_incoming_streams_highest_offset_; } bool QuicSession::IsConnectionFlowControlBlocked() const { return flow_controller_.IsBlocked(); } bool QuicSession::IsStreamFlowControlBlocked() { for (auto const& kv : static_stream_map_) { if (kv.second->flow_controller()->IsBlocked()) { return true; } } for (auto const& kv : dynamic_stream_map_) { if (kv.second->flow_controller()->IsBlocked()) { return true; } } return false; } size_t QuicSession::MaxAvailableStreams() const { return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; } bool QuicSession::IsIncomingStream(QuicStreamId id) const { return id % 2 != next_outgoing_stream_id_ % 2; } } // namespace net
[ "lixiaodonglove7@aliyun.com" ]
lixiaodonglove7@aliyun.com
64abbe4c4835ffc6a2bcc9ebd15d9e579725e8f6
98c987c6be1bd6d07d995e97faaaf5926e318a6b
/OOP/HomeWork/FmiBook/SocialNetwork.cpp
0e98050982d1779399f2f238009d94d64a3290cc
[]
no_license
rokn/FMI
85122e695a22772896632e40d5b5ebc7b5ba791f
d0b07eee8712d952ae11655eac6f1b8a6a4bbe7d
refs/heads/master
2021-09-24T10:13:01.317688
2018-10-07T21:54:50
2018-10-07T21:54:50
108,727,514
0
0
null
null
null
null
UTF-8
C++
false
false
27
cpp
#include "SocialNetwork.h"
[ "amindov@abv.bg" ]
amindov@abv.bg
cf2e2816a5b97ce3bacaf2a3b0008b61e8f19c36
955102cfc720ef4eace8999403b0a2ef4e1e8e68
/Hardware_Week_2_Th/fade_withStates/fade_withStates.ino
a56ac1ea5b6f9407ff8ce91ac6da9abf92e33a8d
[]
no_license
jtallison/LSU-PDM-Spring-2021
2f2bd102e3524e9089dd914cfb674b5beb718a50
1e71b3ab3c1c656236d6124a85a58d63eadd73b1
refs/heads/main
2023-03-18T06:27:53.887906
2021-03-08T20:10:13
2021-03-08T20:10:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,722
ino
// PWM Pin int led = 9; int brightness = 200; int fadeAmount = 5; int pot; int ledModeToggle = 0; int ledOnToggle = 0; int ledModeToggleState = 0; int ledOnToggleState = 0; // States allow us to turn the button from a momentary button to a toggle button // now we can press the button once to switch between two states void setup() { // because we're using a digital pin we have // to set the mode to input or output pinMode(led, OUTPUT); Serial.begin(9600); } void loop() { // toggle between fading and using pot ledModeToggle = digitalRead(2); if (ledModeToggle) { // this only kind of works // see how it polls back and forth between states way too quickly to be useful ledModeToggleState = !ledModeToggleState; } // turn everything on or off ledOnToggle = digitalRead(4); if (ledOnToggle) { ledOnToggleState = !ledOnToggleState; } Serial.println(ledModeToggleState); if (ledModeToggleState && ledOnToggleState) { // Control fade with pot /////////////////////// // read from pot on A0 pot = analogRead(A0); // constrain the pot value 0 - 255 brightness = map(pot, 0, 1023, 0, 255); // set the brightness of pin 9 with pot value analogWrite(led, brightness); } else if (!ledModeToggleState && ledOnToggleState) { // autofade with button press ///////////////////////////// // increase brightness by fadeAmount brightness = brightness + fadeAmount; if (brightness <= 0 || brightness >= 255) { // toggle increase and decrease fadeAmount = -fadeAmount; } analogWrite(led, brightness); } else { // if neither button pressed turn LED off analogWrite(led, 0); } delay(30); }
[ "tatecarson@gmail.com" ]
tatecarson@gmail.com
2af7c096ca61779756e16298ae6eeee0affb3517
dbb50d74406518f58baae0f91e7fb44874ab31e6
/RingingMaster/MethodSelectRow.h
882f4bdb611323ec10693b444464b2c566a95d8a
[]
no_license
lakestephen/ringingmaster_cpp
60f917eb66970e6fc84f9703a229dd0028892632
3d34efa1c4dca560a67a8aee1375df92fdcbeb6f
refs/heads/master
2023-02-20T14:41:35.756431
2021-01-26T19:45:38
2021-01-26T19:45:38
333,197,351
1
0
null
null
null
null
UTF-8
C++
false
false
328
h
// MethodSelectRow.h: interface for the MethodSelectRow class. // #pragma once #include "MethodSelect.h" class MethodSelectRow : public MethodSelect { public: MethodSelectRow(); virtual ~MethodSelectRow(); Ints* getCallPositions(); void setCallPositions(Ints* callPositions); protected: Ints * _callPositions; };
[ "steve.lake@anaplan.com" ]
steve.lake@anaplan.com
ff17f8fe07561a4846adf565b9605a7387d2585c
c07c892d7c9149d0c332fb95af9af13c26b47890
/sessio3/Exprev/bloc-1/MyGLWidget.h
7b7d2af5c9780fca38b19b59c750fc4a97056ad1
[]
no_license
pellax/IDI19-20
0d5167f85f29dc1ebd69063132e1c9cfa154b3be
84ae9b230e85fcd066baa1a9ed35187bbb9f9e5c
refs/heads/master
2020-11-27T01:04:25.200194
2019-12-20T11:29:50
2019-12-20T11:29:50
229,251,460
0
0
null
null
null
null
UTF-8
C++
false
false
1,059
h
#include <QOpenGLFunctions_3_3_Core> #include<QKeyEvent> #include <QOpenGLWidget> #include <QOpenGLShader> #include <QOpenGLShaderProgram> #include "glm/glm.hpp" class MyGLWidget : public QOpenGLWidget, protected QOpenGLFunctions_3_3_Core { Q_OBJECT public: MyGLWidget (QWidget *parent=0); ~MyGLWidget (); protected: // initializeGL - Aqui incluim les inicialitzacions del contexte grafic. virtual void initializeGL (); // paintGL - Mètode cridat cada cop que cal refrescar la finestra. // Tot el que es dibuixa es dibuixa aqui. virtual void paintGL (); // resize - Es cridat quan canvia la mida del widget virtual void resizeGL (int width, int height); virtual void keyPressEvent(QKeyEvent * e); private: void creaBuffers (); void carregaShaders (); // attribute locations void modelTransform(); GLuint vertexLoc,colorLoc,varLoc,transLoc; // Program QOpenGLShaderProgram *program; float scl,tx,ty,tz; GLuint VAO1; GLint ample, alt; };
[ "alejandro.jesus.capella.del@a5s104pc35.fib.upc.es" ]
alejandro.jesus.capella.del@a5s104pc35.fib.upc.es
ede786576c706d92aa0e15c570284c14e6c4c86d
fc4b3c65f3c28c8d9eb8ef521cec6ad99d588d9a
/example_images/src/ofApp.cpp
2ac8b32314bf1a732ccb1f56433143eb5bfbf3ce
[]
no_license
fred-dev/ofxSniffer
3125aa13482552d170f8dcdacae6632f636cc74e
988ce2c511da59296262438a38bf1f5f0c64aa77
refs/heads/master
2021-01-24T01:29:17.598594
2016-02-01T16:23:26
2016-02-01T16:23:26
50,846,694
1
1
null
2016-02-01T14:59:34
2016-02-01T14:59:34
null
UTF-8
C++
false
false
2,623
cpp
// need to know my ip // need to have async and sync options #include "ofApp.h" #include "Poco/RegularExpression.h" #include "Poco/Hash.h" using Poco::RegularExpression; using Poco::Hash; //-------------------------------------------------------------- void ofApp::setup(){ // Add event listener for new http packets ofAddListener(sniffer.httpPacketEvent, this, &ofApp::newHttpPacket); // Start the sniffing sniffer.startSniffing("en0", true); ofBackground(0, 0, 0); } //-------------------------------------------------------------- void ofApp::exit(){ sniffer.stopThread(); } //-------------------------------------------------------------- void ofApp::update(){ if(files.size()) { string url = files.front(); files.pop_front(); ofLog() << "grabbing file"; ofPixels pix; try { bool success = ofLoadImage(pix, ofLoadURL(url).data); size_t hash = Hash<string>()(url); string filename = ofToString(hash)+".jpg"; if(!success) { pix.allocate(1, 1, OF_IMAGE_COLOR); } ofLog() << "saving to " << filename; ofSaveImage(pix, filename); if(pix.getWidth() > 10 && pix.getHeight() > 10) { image.setFromPixels(pix); image.update(); } else { ofLog() << "too small"; } } catch (...) { ofLog() << "error"; } } } //-------------------------------------------------------------- void ofApp::draw(){ ofBackground(0); ofTranslate(ofGetWidth() / 2, ofGetHeight() / 2); if(image.getTexture().isAllocated()) { image.setAnchorPercent(.5, .5); float s = ofGetHeight() / image.getHeight(); ofScale(s, s); image.draw(0, 0); } } //-------------------------------------------------------------- void ofApp::newHttpPacket(ofxSnifferHttpPacket &packet){ if(packet.srcIp == "172.29.5.185") { ofLog() << "skipping self"; return; } string url = "http://" + packet.host + packet.request; cout << "."; if(RegularExpression(".*vidible.*").match(url)) { ofLog() << "ignoring ad"; return; } RegularExpression regex(".*\\.(png|gif|jpe?g).*"); if(regex.match(url)) { ofLog() << "match: " << url; size_t hash = Hash<string>()(url); string filename = ofToString(hash)+".jpg"; if(ofFile(filename).exists()) { ofLog() << "file exists"; return; } files.push_back(url); } }
[ "kyle@kylemcdonald.net" ]
kyle@kylemcdonald.net
1bf7270f1790e6b82b20b8c8e100739d90def328
5838cf8f133a62df151ed12a5f928a43c11772ed
/NT/com/netfx/src/framework/xsp/isapi/processtablemanager.cxx
5cd9bbde77a64991ca850d07eecc26f8ec1685c9
[]
no_license
proaholic/Win2K3
e5e17b2262f8a2e9590d3fd7a201da19771eb132
572f0250d5825e7b80920b6610c22c5b9baaa3aa
refs/heads/master
2023-07-09T06:15:54.474432
2021-08-11T09:09:14
2021-08-11T09:09:14
null
0
0
null
null
null
null
UTF-8
C++
false
false
47,802
cxx
/** * Process Model: CProcessTableManager defn file * * Copyright (c) 1999 Microsoft Corporation */ ///////////////////////////////////////////////////////////////////////////// // This file defines the class CProcessTableManager. This class creates and // holds on to an array of CPUEntry classes. When a request comes in, the // least busy CPU is picked and assigned the request. ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// #include "precomp.h" #include "ProcessTableManager.h" #include "nisapi.h" #include "util.h" #include "platform_apis.h" #include "AckReceiver.h" #include "RequestTableManager.h" #include "httpext6.h" #include "CPUEntry.h" #include "EcbImports.h" #include "process.h" #include "TimeClass.h" #include "HistoryTable.h" #include "_ndll.h" #include "event.h" #include "regaccount.h" #include "Userenv.h" #include "perfcounters.h" ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// #define MIN_PROC_START_WAIT_TIME 30 #define HEALTH_MONITORING_DEFAULT_PERIOD 20 #define DEFAULT_WP_TERMINATE_TIMEOUT 5 #define ROUND_TO_4_BYTES(X) {X += ((X & 3) ? 4 - (X & 3) : 0); } #define MIN_MEMORY_LIMIT 10 #define NUM_PM_PROPERTIES 18 #define SZ_PM_CONFIG_TAG L"processModel" #define DEFAULT_MEMORY_LIMIT_IN_PERCENT 80 #define NUM_PM_PROPERTIES_STRINGS 6 LPWSTR g_szPropValues [NUM_PM_PROPERTIES_STRINGS]; LPCWSTR g_szPMPropertiesStrings [NUM_PM_PROPERTIES_STRINGS] = { L"userName", L"password", L"logLevel", L"comAuthenticationLevel", L"comImpersonationLevel", L"serverErrorMessageFile"}; WCHAR g_szUserName[104] = L""; WCHAR g_szPassword[104] = L""; WCHAR g_szLogLevel[104] = L"errors"; int g_iLogLevel = 1; BOOL g_fInvalidCredentials = FALSE; int __stdcall GetUserNameFromToken ( HANDLE token, LPWSTR buffer, int size); void XspSecureZeroMemory( PVOID pPtr, SIZE_T len); ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Config enum ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Global data CProcessTableManager * CProcessTableManager::g_pProcessTableManager = NULL; LONG g_lCreatingProcessTable = 0; LONG g_lDestroyingProcessTable = 0; WCHAR g_szLogDir[256] = L""; BOOL g_fShuttingDown = FALSE; BOOL g_fHealthMonitorStopped = TRUE; BOOL g_fStopHealthMonitor = FALSE; BOOL g_fLogWorkerProcs = FALSE; BOOL g_fUseXSPProcessModel = FALSE; LPCWSTR g_szPMProperties[NUM_PM_PROPERTIES] = { L"enable", L"timeout", L"idleTimeout", L"shutdownTimeout", L"requestLimit", L"requestQueueLimit", L"memoryLimit", L"cpuMask", L"webGarden", L"requestAcks", L"asyncOption", L"restartQueueLimit", L"pingFrequency", L"pingTimeout", L"responseRestartDeadlockInterval", L"responseDeadlockInterval", L"maxWorkerThreads", L"maxIoThreads" }; DWORD g_dwPropValues[NUM_PM_PROPERTIES]; DWORD g_dwDefaultPropValues[NUM_PM_PROPERTIES] = { 1, 0x7fffffff, 0x7fffffff, 5, 0x7fffffff, 5000, 60, 0xffff, 0, 0, 0, 10, 30, 5, 540, 180, 20, 20 }; DWORD g_dwMaxPhyMemory = 0; DWORD g_dwProcessMemoryLimitInMB = 10; BOOL g_fWebGarden = FALSE; int g_iAsyncOption = 0; DWORD g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_CONNECT; DWORD g_dwRPCImperLevel = RPC_C_IMP_LEVEL_IMPERSONATE; DWORD g_dwMaxWorkerThreads = 25; DWORD g_dwMaxIoThreads = 25; HANDLE g_hToken = INVALID_HANDLE_VALUE; HANDLE g_hProfile = NULL; LONG g_lTokenCreated = 0; BOOL g_fPasswordIsEncrypted = FALSE; DWORD g_dwPassLength = NULL; LPBYTE g_pEncPassword = NULL; PSID g_pSid = NULL; #define SZ_PASSWORD_ENTROPY L"ASP.NET Password from Machine.config file entropy" #define SZ_PASSWORD_PASS L"ASP.NET Password from Machine.config file" //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Functions DWORD GetDebugOnDeadlock() { HKEY hKeyXSP; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGPATH_MACHINE_APP_L, 0, KEY_READ, &hKeyXSP) != ERROR_SUCCESS) return FALSE; // registry key doesn't exists DWORD dwVal = 0, dwSize = sizeof(DWORD); RegQueryValueEx(hKeyXSP, L"DebugOnDeadlock", 0, NULL, (BYTE *) &dwVal, &dwSize); RegCloseKey(hKeyXSP); if (dwVal == 2 || dwVal == 1) return dwVal; else return 0; } BOOL DebugOnHighMemoryConsumption() { HKEY hKeyXSP; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGPATH_MACHINE_APP_L, 0, KEY_READ, &hKeyXSP) != ERROR_SUCCESS) return FALSE; // registry key doesn't exists DWORD dwVal = 0, dwSize = sizeof(DWORD); RegQueryValueEx(hKeyXSP, L"DebugOnHighMem", 0, NULL, (BYTE *) &dwVal, &dwSize); RegCloseKey(hKeyXSP); return (dwVal != 0); } HRESULT GetCredentialFromRegistry( LPCWSTR szReg, LPWSTR szStr, DWORD dwSize); ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// void EncryptPassword( LPWSTR szSrc) { HRESULT hr = S_OK; DATA_BLOB dataIn, dataOut, dataEnt; dataOut.cbData = 0; dataOut.pbData = NULL; g_fPasswordIsEncrypted = FALSE; delete [] g_pEncPassword; g_pEncPassword = NULL; g_dwPassLength = 0; if (szSrc == NULL || szSrc[0] == NULL) EXIT_WITH_HRESULT(E_INVALIDARG); if (lstrcmpiW(szSrc, L"autogenerate") == 0) // No point encrypting autogenerate EXIT(); if (lstrlen(szSrc) > 8 && szSrc[8] == L':') // 8 == lstrlen(L"registry")) { WCHAR c = szSrc[8]; szSrc[8] = NULL; if (_wcsicmp(szSrc, L"registry") == 0) { szSrc[8] = c; EXIT(); // No point encrypting registry key name } szSrc[8] = c; } dataIn.cbData = (lstrlen(szSrc) + 1) * sizeof(WCHAR); dataIn.pbData = (LPBYTE) szSrc; dataOut.cbData = 0; dataOut.pbData = NULL; dataEnt.cbData = (lstrlenW(SZ_PASSWORD_ENTROPY) + 1) * sizeof(WCHAR); dataEnt.pbData = (LPBYTE) SZ_PASSWORD_ENTROPY; if (CryptProtectData(&dataIn, SZ_PASSWORD_PASS, &dataEnt, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &dataOut)) { g_pEncPassword = new BYTE[dataOut.cbData]; ON_OOM_EXIT(g_pEncPassword); memcpy(g_pEncPassword, dataOut.pbData, dataOut.cbData); g_dwPassLength = dataOut.cbData; g_fPasswordIsEncrypted = TRUE; } else { EXIT_WITH_LAST_ERROR(); } Cleanup: // Check if there is something to encrypt and we have not encrypted anything if (szSrc != NULL && szSrc[0] != NULL && !g_fPasswordIsEncrypted) { wcsncpy(g_szPassword, szSrc, ARRAY_SIZE(g_szPassword)-1); g_szPassword[ARRAY_SIZE(g_szPassword)-1] = NULL; } // Destroy the source string if (szSrc != NULL) { XspSecureZeroMemory(szSrc, lstrlen(szSrc) * sizeof(WCHAR)); } if (dataOut.pbData != NULL) LocalFree(dataOut.pbData); } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// void UnEncryptPassword( LPWSTR szDest, DWORD dwSize) { HRESULT hr = S_OK; DATA_BLOB dataIn, dataOut, dataEnt; dataOut.cbData = 0; dataOut.pbData = NULL; if (szDest == NULL || dwSize < 1) EXIT_WITH_HRESULT(E_INVALIDARG); ZeroMemory(szDest, dwSize * sizeof(WCHAR)); if (g_fPasswordIsEncrypted == FALSE) { if (wcsstr(g_szPassword, L"registry:") == g_szPassword || wcsstr(g_szPassword, L"Registry:") == g_szPassword) // starts with "registry:" { GetCredentialFromRegistry(g_szPassword, szDest, dwSize); } else { wcsncpy(szDest, g_szPassword, dwSize-1); } } else { if (g_pEncPassword == NULL) EXIT_WITH_HRESULT(E_UNEXPECTED); dataIn.cbData = g_dwPassLength; dataIn.pbData = g_pEncPassword; dataEnt.cbData = (lstrlenW(SZ_PASSWORD_ENTROPY) + 1) * sizeof(WCHAR); dataEnt.pbData = (LPBYTE) SZ_PASSWORD_ENTROPY; if (!CryptUnprotectData(&dataIn, NULL, &dataEnt, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &dataOut)) { dataOut.pbData = NULL; EXIT_WITH_LAST_ERROR(); } memcpy(szDest, dataOut.pbData, (dataOut.cbData < dwSize * sizeof(WCHAR)) ? dataOut.cbData : dwSize * sizeof(WCHAR)); } szDest[dwSize-1] = NULL; Cleanup: if (dataOut.pbData != NULL) LocalFree(dataOut.pbData); } //////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // /** * Function to decide whether we should use the ASP.NET Process Model */ BOOL UseXSPProcessModel() { WCHAR szRPCAuth [104] = L""; WCHAR szRPCImper [104] = L""; WCHAR szUserName [104] = L""; WCHAR szPassword [104] = L""; ////////////////////////////////////////////////////////////////// // Step 1: Initialize globals g_lCreatingProcessTable = 0; g_lDestroyingProcessTable = 0; g_fShuttingDown = FALSE; g_fHealthMonitorStopped = TRUE; g_fStopHealthMonitor = FALSE; g_fLogWorkerProcs = FALSE; memcpy(g_dwPropValues, g_dwDefaultPropValues, sizeof(g_dwPropValues)); //////////////////////////////////////////////////////////// // Step 3: Parse the config file g_szPropValues[0] = szUserName; g_szPropValues[1] = szPassword; g_szPropValues[2] = g_szLogLevel; g_szPropValues[3] = szRPCAuth; g_szPropValues[4] = szRPCImper; g_szPropValues[5] = g_szCustomErrorFile; g_szCustomErrorFile[0] = NULL; g_fCustomErrorFileChanged = TRUE; BOOL fRet = GetConfigurationFromNativeCode( Names::GlobalConfigFullPathW(), SZ_PM_CONFIG_TAG, g_szPMProperties, g_dwPropValues, NUM_PM_PROPERTIES, g_szPMPropertiesStrings, g_szPropValues, NUM_PM_PROPERTIES_STRINGS, NULL, 0); ASSERT(fRet); g_iAsyncOption = g_dwPropValues[EPMConfig_asyncoption]; if (!fRet) g_dwPropValues[EPMConfig_enable] = 1; if (g_dwMaxPhyMemory == 0) { MEMORYSTATUSEX memStatEx; ZeroMemory(&memStatEx, sizeof(memStatEx)); memStatEx.dwLength = sizeof(memStatEx); if (PlatformGlobalMemoryStatusEx(&memStatEx)) { g_dwMaxPhyMemory = (DWORD) (memStatEx.ullTotalPhys / (1024 * 1024)); } else { // This following code fragment should never run on Win64 #ifdef _WIN64 ASSERTMSG(FALSE, L"GlobalMemoryStatus shouldn't be call on Win64"); #else MEMORYSTATUS memStat; ZeroMemory(&memStat, sizeof(memStat)); GlobalMemoryStatus(&memStat); g_dwMaxPhyMemory = ((DWORD)memStat.dwTotalPhys / (1024 * 1024)); #endif } } g_dwProcessMemoryLimitInMB = (g_dwPropValues[EPMConfig_memorylimit] * g_dwMaxPhyMemory) / 100; if (g_dwProcessMemoryLimitInMB < MIN_MEMORY_LIMIT) g_dwProcessMemoryLimitInMB = MIN_MEMORY_LIMIT; if (_wcsicmp(g_szLogLevel, L"errors") == 0) g_iLogLevel = 1; else if (_wcsicmp(g_szLogLevel, L"none") == 0) g_iLogLevel = 0; else if (_wcsicmp(g_szLogLevel, L"warnings") == 0) g_iLogLevel = 2; else g_iLogLevel = 3; if (_wcsicmp(L"None", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_NONE; else if (_wcsicmp(L"Connect", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_CONNECT; else if (_wcsicmp(L"Call", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_CALL; else if (_wcsicmp(L"Pkt", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_PKT; else if (_wcsicmp(L"PktIntegrity", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_PKT_INTEGRITY; else if (_wcsicmp(L"PktPrivacy", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; else if (_wcsicmp(L"Default", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_DEFAULT; else g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_CONNECT; if (_wcsicmp(L"Anonymous", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_ANONYMOUS; else if (_wcsicmp(L"Identify", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_IDENTIFY; else if (_wcsicmp(L"Impersonate", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_IMPERSONATE; else if (_wcsicmp(L"Delegate", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_DELEGATE; else if (_wcsicmp(L"Default", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_DEFAULT; else g_dwRPCImperLevel = RPC_C_IMP_LEVEL_IMPERSONATE; g_dwMaxWorkerThreads = g_dwPropValues[EPMConfig_maxWorkerThreads]; g_dwMaxIoThreads = g_dwPropValues[EPMConfig_maxIoThreads]; if (szUserName[0] != NULL) { wcsncpy(g_szUserName, szUserName, ARRAY_SIZE(g_szUserName)-1); g_szUserName[ARRAY_SIZE(g_szUserName)-1] = NULL; } EncryptPassword(szPassword); return (g_dwPropValues[EPMConfig_enable] != 0); } ///////////////////////////////////////////////////////////////////////////// BOOL ProcessModelIsEnabled() { g_fUseXSPProcessModel = UseXSPProcessModel(); return g_fUseXSPProcessModel; } ///////////////////////////////////////////////////////////////////////////// HRESULT DllInitProcessModel() { HRESULT hr = S_OK; CRegAccount::CreateTempDir(); if (!g_fUseXSPProcessModel) { hr = HttpCompletion::InitManagedCode(); ON_ERROR_EXIT(); } Cleanup: return hr; } ///////////////////////////////////////////////////////////////////////////// HRESULT DllUninitProcessModel() { HRESULT hr = S_OK; if (!g_fUseXSPProcessModel) { hr = HttpCompletion::UninitManagedCode(); ON_ERROR_CONTINUE(); } g_fShuttingDown = FALSE; g_lCreatingProcessTable = 0; g_lDestroyingProcessTable = 0; g_fHealthMonitorStopped = TRUE; g_fUseXSPProcessModel = FALSE; return hr; } ///////////////////////////////////////////////////////////////////////////// HRESULT ISAPIInitProcessModel() { HRESULT hr; CRegAccount::CreateTempDir(); if (g_fUseXSPProcessModel) { UseXSPProcessModel(); // Read the config.cfg hr = ProcessModelInit(); if (hr) { g_InitHR = hr; g_pInitErrorMessage = "Couldn't create managed " PRODUCT_NAME " runtime component"; EXIT(); } } Cleanup: // always return S_OK to enable descriptive error messages return S_OK; } ///////////////////////////////////////////////////////////////////////////// HRESULT ISAPIUninitProcessModel() { HRESULT hr = S_OK; if (g_fUseXSPProcessModel) { ProcessModelStopHealthMonitor(); } hr = DrainThreadPool(RECOMMENDED_DRAIN_THREAD_POOL_TIMEOUT); ON_ERROR_CONTINUE(); return hr; } //////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Function called by ASPNET_ISAPI to assign a request HRESULT __stdcall AssignRequestUsingXSPProcessModel (EXTENSION_CONTROL_BLOCK * iEcb) { if (g_fShuttingDown == TRUE) return E_FAIL; HRESULT hr = S_OK; if ( CProcessTableManager::g_pProcessTableManager == NULL) { hr = CProcessTableManager::Init(); ON_ERROR_EXIT(); } if ( CProcessTableManager::g_pProcessTableManager == NULL) { EXIT_WITH_HRESULT(E_FAIL); } hr = CProcessTableManager::g_pProcessTableManager->PrivateAssignRequest(iEcb); ON_ERROR_CONTINUE(); if (hr != S_OK && g_fInvalidCredentials) { ReportHttpErrorIndirect(iEcb, IDS_BAD_CREDENTIALS); EcbDoneWithSession(iEcb, 1, 2); hr = S_OK; } Cleanup: return hr; } ///////////////////////////////////////////////////////////////////////////// // Stop the health mon void __stdcall ProcessModelStopHealthMonitor () { g_fStopHealthMonitor = TRUE; g_fShuttingDown = TRUE; if ( CProcessTableManager::g_pProcessTableManager == NULL) return; // Close all pipes for (int iter=0; iter<CProcessTableManager::g_pProcessTableManager->m_iCPUArraySize; iter++) { CProcessTableManager::g_pProcessTableManager->m_pCPUArray[iter].CloseAll(); SwitchToThread(); } CRequestTableManager::DisposeAllRequests(); for(iter=0; g_fHealthMonitorStopped == FALSE && iter<600; iter++) // sleep at most 1 minute Sleep(100); SwitchToThread(); CProcessTableManager::g_pProcessTableManager = NULL; } ///////////////////////////////////////////////////////////////////////////// // Stop the health mon HRESULT __stdcall ProcessModelInit () { HRESULT hr = S_OK; int iter; g_fShuttingDown = FALSE; hr = CProcessTableManager::Init(); ON_ERROR_EXIT(); for (iter=0; iter<CProcessTableManager::g_pProcessTableManager->m_iCPUArraySize; iter++) CProcessTableManager::g_pProcessTableManager->m_pCPUArray[iter].ReplaceActiveProcess(); g_fStopHealthMonitor = FALSE; _beginthread(MonitorHealth, 0, NULL); Cleanup: return hr; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Static functions // Create the process table HRESULT CProcessTableManager::Init() { HRESULT hr = S_OK; if (g_pProcessTableManager == NULL) { // Create it in a thread safe way LONG lVal = InterlockedIncrement(&g_lCreatingProcessTable); if (lVal == 1 && !g_pProcessTableManager) { g_pProcessTableManager = new CProcessTableManager(); ON_OOM_EXIT(g_pProcessTableManager); if (g_pProcessTableManager->IsAlive() == FALSE) { EXIT_WITH_HRESULT(E_OUTOFMEMORY); } } else { for(int iter=0; iter<600 && !g_pProcessTableManager; iter++) // Sleep at most a minute Sleep(100); if (g_pProcessTableManager == NULL) { EXIT_WITH_WIN32_ERROR(ERROR_TIMEOUT); } } InterlockedDecrement(&g_lCreatingProcessTable); } g_lDestroyingProcessTable = 0; g_fShuttingDown = FALSE; Cleanup: return hr; } ///////////////////////////////////////////////////////////////////////////// // Destroy the table void CProcessTableManager::Destroy() { if (g_pProcessTableManager == NULL) return; LONG lVal = InterlockedIncrement(&g_lDestroyingProcessTable); if (lVal == 1 && g_pProcessTableManager) { delete g_pProcessTableManager; g_pProcessTableManager = NULL; g_lCreatingProcessTable = g_lDestroyingProcessTable = 0; } } ///////////////////////////////////////////////////////////////////////////// // Get the number of pending/executing requests LONG CProcessTableManager::NumPendingRequests() { if (g_pProcessTableManager != NULL) return g_pProcessTableManager->PrivateNumPendingRequests(); return 0; } ///////////////////////////////////////////////////////////////////////////// // Get a server variable: also return the space required in bytes: rounded up to the // nearest 4 bytes int CProcessTableManager::GetServerVariable( EXTENSION_CONTROL_BLOCK * pECB, LPCSTR pVarName, LPSTR pBuffer, int bufferSize) { BYTE b[4]; DWORD size = bufferSize; if (bufferSize < 0) { ZeroMemory(&b, sizeof(b)); pBuffer = (LPSTR) &b; size = 0; } BOOL fRet = (*pECB->GetServerVariable)( pECB->ConnID, (LPSTR)pVarName, pBuffer, &size ); if (fRet != 0) { // change all tabs to spaces (ASURT 111082) CHAR *pTab = strchr(pBuffer, '\t'); while (pTab != NULL) { *pTab = ' '; pTab = strchr(pTab+1, '\t'); } return (size - 1); } if (GetLastError() == ERROR_INSUFFICIENT_BUFFER && size > 0) { return -int(size-1); } return 0; } ///////////////////////////////////////////////////////////////////////////// // CProcessEntry * CProcessTableManager::GetProcess(DWORD dwProcNum) { if ( g_pProcessTableManager == NULL) return NULL; for(int iter=0; iter<g_pProcessTableManager->m_iCPUArraySize; iter++) if (g_pProcessTableManager->m_pCPUArray[iter].GetCPUNumber() == (dwProcNum & 0xff)) return g_pProcessTableManager->m_pCPUArray[iter].FindProcess(dwProcNum); return NULL; } ///////////////////////////////////////////////////////////////////////////// // BOOL CProcessTableManager::GetUseCPUAffinity() { return g_fWebGarden; } ///////////////////////////////////////////////////////////////////////////// DWORD CProcessTableManager::GetTerminateTimeout() { return g_dwPropValues[EPMConfig_shutdowntimeout]; } ///////////////////////////////////////////////////////////////////////////// BOOL CProcessTableManager::GetWillRequestsBeAcknowledged() { return g_dwPropValues[EPMConfig_requestacks]; } ///////////////////////////////////////////////////////////////////////////// int CProcessTableManager::NumActiveCPUs() { return (g_pProcessTableManager ? g_pProcessTableManager->m_iCPUArraySize : 1); } ///////////////////////////////////////////////////////////////////////////// DWORD CProcessTableManager::GetRestartQLimit() { return g_dwPropValues[EPMConfig_restartQLimit]; } ///////////////////////////////////////////////////////////////////////////// DWORD CProcessTableManager::GetRequestQLimit() { return g_dwPropValues[EPMConfig_requestqueuelimit]; } ///////////////////////////////////////////////////////////////////////////// void CProcessTableManager::GetPingConfig( DWORD & dwFreq, DWORD & dwTimeout) { dwFreq = g_dwPropValues[EPMConfig_pingFrequency]; dwTimeout = g_dwPropValues[EPMConfig_pingTimeout]; } ///////////////////////////////////////////////////////////////////////////// DWORD CProcessTableManager::GetWPMemoryLimitInMB() { DWORD dwLimit = g_dwProcessMemoryLimitInMB; if (g_pProcessTableManager->m_iCPUArraySize > 1) dwLimit = (dwLimit / g_pProcessTableManager->m_iCPUArraySize); if (dwLimit < MIN_MEMORY_LIMIT) dwLimit = MIN_MEMORY_LIMIT; return dwLimit; } ///////////////////////////////////////////////////////////////////////////// void CProcessTableManager::LogWorkerProcessDeath ( EReasonForDeath eReason, DWORD dwPID) { if (g_iLogLevel == 0 || g_fShuttingDown) return; ASSERT(g_iLogLevel < 4); WORD wType; DWORD dwParam = 0; HRESULT hr = S_OK; DWORD dwEventID; if (eReason & EReasonForDeath_MemoryLimitExeceeded) { wType = EVENTLOG_ERROR_TYPE; dwEventID = IDS_EVENTLOG_RECYCLE_MEM; dwParam = g_dwProcessMemoryLimitInMB / CProcessTableManager::NumActiveCPUs(); } else if (eReason & EReasonForDeath_MaxRequestQLengthExceeded) { wType = EVENTLOG_ERROR_TYPE; dwEventID = IDS_EVENTLOG_RECYCLE_Q_REQ; dwParam = g_dwPropValues[EPMConfig_requestqueuelimit]; } else if (eReason & EReasonForDeath_DeadlockSuspected) { wType = EVENTLOG_ERROR_TYPE; dwEventID = IDS_EVENTLOG_RECYCLE_DEADLOCK; dwParam = g_dwPropValues[EPMConfig_responseDeadlockInterval]; } else if (eReason & EReasonForDeath_TimeoutExpired) { wType = EVENTLOG_INFORMATION_TYPE; dwEventID = IDS_EVENTLOG_RECYCLE_TIME; dwParam = g_dwPropValues[EPMConfig_timeout]; } else if (eReason & EReasonForDeath_IdleTimeoutExpired) { wType = EVENTLOG_INFORMATION_TYPE; dwEventID = IDS_EVENTLOG_RECYCLE_IDLE; dwParam = g_dwPropValues[EPMConfig_idletimeout]; } else if (eReason & EReasonForDeath_MaxRequestsServedExceeded) { wType = EVENTLOG_INFORMATION_TYPE; dwEventID = IDS_EVENTLOG_RECYCLE_REQ; dwParam = g_dwPropValues[EPMConfig_requestlimit]; } else if (eReason & EReasonForDeath_PingFailed) { wType = EVENTLOG_ERROR_TYPE; dwEventID = IDS_EVENTLOG_PING_FAILED; } else if (eReason & EReasonForDeath_ProcessCrash) { wType = EVENTLOG_ERROR_TYPE; dwEventID = IDS_EVENTLOG_PROCESS_CRASH; } else { EXIT(); } if ((g_iLogLevel < 3 && wType == EVENTLOG_INFORMATION_TYPE) || (g_iLogLevel < 2 && wType == EVENTLOG_WARNING_TYPE) ) { EXIT(); } if ((eReason & EReasonForDeath_ProcessCrash) || (eReason & EReasonForDeath_PingFailed)) { hr = XspLogEvent(dwEventID, L"%d", dwPID); ON_ERROR_EXIT(); } else { if (dwEventID == IDS_EVENTLOG_RECYCLE_MEM) hr = XspLogEvent(dwEventID, L"%d^%d^%d", dwPID, dwParam, g_dwPropValues[EPMConfig_memorylimit]); else hr = XspLogEvent(dwEventID, L"%d^%d", dwPID, dwParam); ON_ERROR_EXIT(); } Cleanup: return; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// HANDLE CProcessTableManager::GetWorkerProcessToken() { CreateWPToken(); return g_hToken; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// HANDLE CProcessTableManager::GetWorkerProcessProfile() { CreateWPToken(); return g_hProfile; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// HANDLE CProcessTableManager::GetWorkerProcessSid() { CreateWPToken(); return g_pSid; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// void CProcessTableManager::CreateWPToken() { if (g_lTokenCreated >= 1000) return; if (InterlockedIncrement(&g_lTokenCreated) == 1) { WCHAR szPass[104]; WCHAR szUser[104]; ZeroMemory(szUser, sizeof(szUser)); if (wcsstr(g_szUserName, L"registry:") == g_szUserName || wcsstr(g_szUserName, L"Registry:") == g_szUserName) // starts with "registry:" { GetCredentialFromRegistry(g_szUserName, szUser, ARRAY_SIZE(szUser)); } else { wcsncpy(szUser, g_szUserName, ARRAY_SIZE(szUser)-1); } UnEncryptPassword(szPass, ARRAY_SIZE(szPass)); g_hToken = CRegAccount::CreateWorkerProcessToken(szUser, szPass, &g_pSid); XspSecureZeroMemory(szPass, sizeof(szPass)); if (g_hToken != NULL && g_hToken != INVALID_HANDLE_VALUE) { PROFILEINFO oProfileInfo; WCHAR buf[100]; ZeroMemory(&oProfileInfo, sizeof(oProfileInfo)); ZeroMemory(buf, sizeof(buf)); GetUserNameFromToken(g_hToken, buf, ARRAY_SIZE(buf)); oProfileInfo.dwSize = sizeof(oProfileInfo); oProfileInfo.dwFlags = PI_NOUI; oProfileInfo.lpUserName = buf; if (LoadUserProfile(g_hToken, &oProfileInfo)) g_hProfile = oProfileInfo.hProfile; } SwitchToThread(); g_lTokenCreated = 1000; } else { for(int iter=0; iter<300 && g_lTokenCreated<1000; iter++) Sleep(100); } } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // CTor CProcessTableManager::CProcessTableManager() : m_pCPUArray (NULL), m_iCPUArraySize (0), m_dwHealthMonitorPeriod (HEALTH_MONITORING_DEFAULT_PERIOD) { InitializeCriticalSection(&m_csMonitorHealth); g_fWebGarden = (g_dwPropValues[EPMConfig_webgarden] != 0); if (!g_fWebGarden) { g_dwPropValues[EPMConfig_cpumask] = 1; } else { //////////////////////////////////////////////////////////// // Step 2: Make sure the CPU mask is valid SYSTEM_INFO si; GetSystemInfo(&si); g_dwPropValues[EPMConfig_cpumask] &= si.dwActiveProcessorMask; if (g_dwPropValues[EPMConfig_cpumask] == 0) g_dwPropValues[EPMConfig_cpumask] = 0x1; } //////////////////////////////////////////////////////////// // Step 3: Create the CPUEntry array based on the CPU Mask DWORD dwMask = g_dwPropValues[EPMConfig_cpumask]; for(int iter=0; iter<32; iter++) { if (dwMask & 0x1) m_iCPUArraySize ++; dwMask = dwMask >> 1; } if (m_iCPUArraySize == 0) m_iCPUArraySize = 1; int iNum = 0; m_pCPUArray = new CCPUEntry[m_iCPUArraySize]; if (m_pCPUArray == NULL) return; dwMask = g_dwPropValues[EPMConfig_cpumask]; for(iter=0; iter<32; iter++) { if (dwMask & 0x1) { m_pCPUArray[iNum++].Init(iter); } dwMask = dwMask >> 1; } } ///////////////////////////////////////////////////////////////////////////// // DTor CProcessTableManager::~CProcessTableManager() { delete [] m_pCPUArray; m_pCPUArray = NULL; DeleteCriticalSection(&m_csMonitorHealth); } ///////////////////////////////////////////////////////////////////////////// // Assign a request to a CPU HRESULT CProcessTableManager::PrivateAssignRequest(EXTENSION_CONTROL_BLOCK * iECB) { int iCPUNum = 0; if (m_iCPUArraySize > 1) // If there are more than CPU, find the least // busy one { LONG lMinReqExcuting = 0x7fffffff; DWORD dwMinReqAssigned = 0x7fffffff; for (int iter=0; iter<m_iCPUArraySize; iter++) { LONG dwExec = m_pCPUArray[iter].GetActiveRequestCount(); DWORD dwAss = m_pCPUArray[iter].GetTotalRequestsAssigned(); if (dwExec < lMinReqExcuting || (dwExec == lMinReqExcuting && dwAss < dwMinReqAssigned)) { iCPUNum = iter; lMinReqExcuting = dwExec; dwMinReqAssigned = dwAss; } } } // Assign it return m_pCPUArray[iCPUNum].AssignRequest(iECB); } ///////////////////////////////////////////////////////////////////////////// // Periodically monitor health void CProcessTableManager::PrivateMonitorHealth() { // If there's another thread executing this function, then do nothing BOOL fLock = TryEnterCriticalSection(&m_csMonitorHealth); if (fLock == FALSE) { return; // Some other thread is in here } //////////////////////////////////////////////////////////// // Step 1: For each CPU, evaluate if we want to re-cycle the // active process for (int iter=0; iter<m_iCPUArraySize && g_fStopHealthMonitor == FALSE; iter++) { //////////////////////////////////////////////////////////// // Step 1a: Did we recently try to (unsuccessfully) create a // process? // NOTE: We don't want to get into a loop creating processes. // So, we wait at atleast MIN_PROC_START_WAIT_TIME seconds // before trying again if ( m_tmLastCreateProcessFailure.IsSet() && m_tmLastCreateProcessFailure.AgeInSeconds() < MIN_PROC_START_WAIT_TIME ) { break; } //////////////////////////////////////////////////////////// // Step 1b: Evaluate if we can re-cycle the process CProcessEntry * pProc = m_pCPUArray[iter].GetActiveProcess(); BOOL fRecycle = FALSE; EReasonForDeath eReason = EReasonForDeath_Active; // Conditions under which to recycle: // 1. If the active process is NULL fRecycle = (pProc == NULL); // 2. If the active process is dead if (!fRecycle && pProc->GetUpdatedStatus() == EProcessState_Dead) { fRecycle = TRUE; eReason = EReasonForDeath_ProcessCrash; } // 3. If it's too old if (!fRecycle && pProc->GetAge() >= g_dwPropValues[EPMConfig_timeout]) { fRecycle = TRUE; eReason = EReasonForDeath_TimeoutExpired; } // 4. If it has executed too many requests if (!fRecycle && (DWORD) pProc->GetNumRequestStat(2) >= g_dwPropValues[EPMConfig_requestlimit]) { fRecycle = TRUE; eReason = EReasonForDeath_MaxRequestsServedExceeded; } // 5. If it's been idle too long if (!fRecycle && pProc->GetIdleTime() >= g_dwPropValues[EPMConfig_idletimeout]) { fRecycle = TRUE; eReason = EReasonForDeath_IdleTimeoutExpired; } // 6. If it's request Q is too long -- Functionality removed // if (!fRecycle && DWORD(pProc->GetNumRequestStat(0) + pProc->GetNumRequestStat(1)) > g_dwPropValues[EPMConfig_requestqueuelimit]) // { // fRecycle = TRUE; // eReason = EReasonForDeath_MaxRequestQLengthExceeded; // } // 7. If it's consumed too much memory if (!fRecycle && g_dwPropValues[EPMConfig_memorylimit] < 1000) { if (CProcessTableManager::GetWPMemoryLimitInMB() < pProc->GetMemoryUsed()) { fRecycle = TRUE; eReason = EReasonForDeath_MemoryLimitExeceeded; } } if ( !fRecycle && g_dwPropValues[EPMConfig_responseDeadlockInterval] != 0 && /*pProc->GetNumRequestStat(0) + */ pProc->GetNumRequestStat(1) > (LONG)(g_dwMaxWorkerThreads + g_dwMaxIoThreads) && pProc->GetSecondsSinceLastResponse() > g_dwPropValues[EPMConfig_responseDeadlockInterval] && !pProc->IsProcessUnderDebugger()) { fRecycle = TRUE; eReason = EReasonForDeath_DeadlockSuspected; } ////////////////////////////// // 7. Counter check: If the process is just starting up, don't restart... if (fRecycle && pProc != NULL && pProc->GetUpdatedStatus() == EProcessState_Starting) fRecycle = FALSE; //////////////////////////////////////////////////////////// // Step 2: Recycle the process if (fRecycle == TRUE && g_fStopHealthMonitor == FALSE) { if (pProc != NULL) pProc->UpdateStatusInHistoryTable(EReasonForDeath(eReason | EReasonForDeath_ShuttingDown)); BOOL fDebug = FALSE; if (eReason == EReasonForDeath_MemoryLimitExeceeded) { fDebug = DebugOnHighMemoryConsumption(); } else if (eReason == EReasonForDeath_DeadlockSuspected) { DWORD breakValue = GetDebugOnDeadlock(); fDebug = (breakValue == 1); if (breakValue == 2) { pProc->BreakIntoProcess(); if (IsUnderDebugger()) { DebugBreak(); } } } if (m_pCPUArray[iter].ReplaceActiveProcess(fDebug) == S_OK) m_tmLastCreateProcessFailure.Reset(); else // Record the time of as the last attempted failure m_tmLastCreateProcessFailure.SnapCurrentTime(); } if (pProc != NULL) pProc->Release(); } // End of for-each-cpu-recycle-processs if (g_fStopHealthMonitor != FALSE) return; Sleep(100); // Make sure the thread gets swapped out SwitchToThread(); // Cleanup old processes for (iter=0; iter<m_iCPUArraySize && g_fStopHealthMonitor == FALSE; iter++) m_pCPUArray[iter].CleanUpOldProcesses(); LeaveCriticalSection(&m_csMonitorHealth); } ///////////////////////////////////////////////////////////////////////////// // Get the number of active requests LONG CProcessTableManager::PrivateNumPendingRequests() { LONG lRet = 0; for (int iter=0; iter<m_iCPUArraySize; iter++) { lRet += m_pCPUArray[iter].GetActiveRequestCount(); } return lRet; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// CReadWriteSpinLock g_OnISAPIMachineConfigChangeLock("OnISAPIMachineConfigChange"); void __stdcall OnISAPIMachineConfigChange(int, WCHAR *) { if (!g_fUseXSPProcessModel) return; if (!g_OnISAPIMachineConfigChangeLock.TryAcquireWriterLock()) return; WCHAR szRPCAuth [104] = L""; WCHAR szRPCImper [104] = L""; WCHAR szPassword [104] = L""; WCHAR szUserName [104] = L""; DWORD dwPropValues [NUM_PM_PROPERTIES]; memcpy(dwPropValues, g_dwPropValues, sizeof(g_dwPropValues)); g_szPropValues[0] = szUserName; g_szPropValues[1] = szPassword; g_szPropValues[2] = g_szLogLevel; g_szPropValues[3] = szRPCAuth; g_szPropValues[4] = szRPCImper; g_szPropValues[5] = g_szCustomErrorFile; g_szCustomErrorFile[0] = NULL; g_fCustomErrorFileChanged = TRUE; if (GetConfigurationFromNativeCode(Names::GlobalConfigFullPathW(), SZ_PM_CONFIG_TAG, g_szPMProperties, dwPropValues, NUM_PM_PROPERTIES, g_szPMPropertiesStrings, g_szPropValues, NUM_PM_PROPERTIES_STRINGS, NULL, 0) == FALSE) { g_OnISAPIMachineConfigChangeLock.ReleaseWriterLock(); return; } memcpy(g_dwPropValues, dwPropValues, sizeof(dwPropValues)); g_dwProcessMemoryLimitInMB = (g_dwPropValues[EPMConfig_memorylimit] * g_dwMaxPhyMemory) / 100; if (g_dwProcessMemoryLimitInMB < MIN_MEMORY_LIMIT) g_dwProcessMemoryLimitInMB = MIN_MEMORY_LIMIT; if (_wcsicmp(g_szLogLevel, L"errors") == 0) g_iLogLevel = 1; else if (_wcsicmp(g_szLogLevel, L"none") == 0) g_iLogLevel = 0; else if (_wcsicmp(g_szLogLevel, L"warnings") == 0) g_iLogLevel = 2; else g_iLogLevel = 3; if (_wcsicmp(L"None", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_NONE; else if (_wcsicmp(L"Connect", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_CONNECT; else if (_wcsicmp(L"Call", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_CALL; else if (_wcsicmp(L"Pkt", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_PKT; else if (_wcsicmp(L"PktIntegrity", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_PKT_INTEGRITY; else if (_wcsicmp(L"PktPrivacy", szRPCAuth) == 0) g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; else g_dwRPCAuthLevel = RPC_C_AUTHN_LEVEL_DEFAULT; if (_wcsicmp(L"Anonymous", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_ANONYMOUS; else if (_wcsicmp(L"Identify", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_IDENTIFY; else if (_wcsicmp(L"Impersonate", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_IMPERSONATE; else if (_wcsicmp(L"Delegate", szRPCImper) == 0) g_dwRPCImperLevel = RPC_C_IMP_LEVEL_DELEGATE; else g_dwRPCImperLevel = RPC_C_IMP_LEVEL_DEFAULT; g_dwMaxWorkerThreads = g_dwPropValues[EPMConfig_maxWorkerThreads]; g_dwMaxIoThreads = g_dwPropValues[EPMConfig_maxIoThreads]; if (szUserName[0] != NULL) { wcsncpy(g_szUserName, szUserName, ARRAY_SIZE(g_szUserName)-1); g_szUserName[ARRAY_SIZE(g_szUserName)-1] = NULL; } EncryptPassword(szPassword); g_OnISAPIMachineConfigChangeLock.ReleaseWriterLock(); } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// void __cdecl MonitorHealth(void *) { g_fHealthMonitorStopped = FALSE; int iter; DirMonCompletion * pDirMon = MonitorGlobalConfigFile(OnISAPIMachineConfigChange); while(g_fStopHealthMonitor == FALSE && CProcessTableManager::g_pProcessTableManager != NULL) { CProcessTableManager::g_pProcessTableManager->PrivateMonitorHealth(); // Sleep 2 seconds for(iter=0; iter<20; iter++) { if (g_fStopHealthMonitor) goto Cleanup; Sleep(100); } if (g_fStopHealthMonitor) goto Cleanup; } Cleanup: if (pDirMon != NULL) pDirMon->Close(); g_fHealthMonitorStopped = TRUE; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // This method resets the Requests Queued number to the number of active // requests accross all worker processes, minus the number of requests from // the worker process that died (the "requestsDied" parameter) void CProcessTableManager::ResetRequestQueuedCounter(int requestsDied) { DWORD activeRequests = -requestsDied; CProcessTableManager * tableManager; tableManager = CProcessTableManager::g_pProcessTableManager; // If there is not global instance of table manager, return if (tableManager == NULL) return; for (int iter=0; iter < tableManager->m_iCPUArraySize; iter++) { activeRequests += tableManager->m_pCPUArray[iter].GetActiveRequestCount(); } PerfSetGlobalCounter(ASPNET_REQUESTS_QUEUED_NUMBER, activeRequests); }
[ "blindtiger@foxmail.com" ]
blindtiger@foxmail.com
fd8608389f92c2470e27d6148ee384477f69b3d1
3657bb42387d76fd041d37bf2d69bad7f916f16a
/Boost/The Boost C++ Libraries/src/16.2.2/main.cpp
4325e1e5f78a8b630b8273888cf056e5d955227c
[ "MIT" ]
permissive
goodspeed24e/Programming
61d8652482b3246f1c65f2051f812b2c6d2d40ce
ae73fad022396ea03105aad83293facaeea561ae
refs/heads/master
2016-08-04T02:58:01.477832
2015-03-16T15:12:27
2015-03-16T15:13:33
32,333,164
1
0
null
null
null
null
UTF-8
C++
false
false
401
cpp
#include <boost/cast.hpp> struct father { virtual ~father() { }; }; struct mother { virtual ~mother() { }; }; struct child : public father, public mother { }; void func(father *f) { child *c = boost::polymorphic_downcast<child*>(f); } int main() { child *c = new child; func(c); father *f = new child; mother *m = boost::polymorphic_cast<mother*>(f); }
[ "lin.yongyuanone@gmail.com" ]
lin.yongyuanone@gmail.com
a031e199fced5dd570a1082aeccc13972b749e93
9d6319da9243e6faf09efe34df4e8adc5ddfc521
/StringReverser.cpp
8395adf18b44b41d84d7c09a6e34c90ad9b12d3e
[]
no_license
matanEpel/Ex4
02000fea94fd88c51d60b648cfad2138cd783d7f
7655779a85fecd785540e57f05a2fd4a3a899792
refs/heads/master
2020-12-11T13:21:10.715228
2020-01-20T14:54:03
2020-01-20T14:54:03
233,859,310
0
0
null
2020-01-20T14:49:28
2020-01-14T14:26:26
C++
UTF-8
C++
false
false
177
cpp
// // Created by matan on 1/14/20. // #include "StringReverser.h" string StringReverser::solve(string problem) { reverse(problem.begin(), problem.end()); return problem; }
[ "noreply@github.com" ]
noreply@github.com
d69a7022c934dfe86805fbd046bfed3ccfaeabb4
229119705f615bbb164cd33474fdd808de205ba0
/src/bluez5profilemap.h
9a5a2b7d6e9ee9d86cff8c65778311eea71c4e84
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
webosose/bluetooth-sil-bluez5
6d7827d334ec27e68ecd046b234a99374011a6be
243df75e46434d4aa60114230f2c03ccceb8fec4
refs/heads/master
2023-03-06T03:12:25.878548
2022-10-28T02:18:56
2022-11-17T06:10:35
144,575,093
7
4
null
null
null
null
UTF-8
C++
false
false
4,488
h
// Copyright (c) 2020 LG Electronics, 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. // // SPDX-License-Identifier: Apache-2.0 #ifndef BLUEZ5PROFILEMAP_H #define BLUEZ5PROFILEMAP_H #include <string> #include <map> #include <bluetooth-sil-api.h> #include <bluez5obexprofilebase.h> #include "bluez5profilebase.h" class Bluez5Adapter; class Bluez5ProfileMap : public Bluez5ObexProfileBase, public BluetoothMapProfile { public: Bluez5ProfileMap(Bluez5Adapter *adapter); ~Bluez5ProfileMap(); void connect(const std::string &address, const std::string &instanceName, BluetoothMapCallback callback) final; void disconnect(const std::string &address, const std::string &sessionId, BluetoothMapCallback callback) final; void notifySessionStatus(const std::string &address, bool createdOrRemoved) final; void getMessageFilters(const std::string &sessionKey, const std::string &sessionId, BluetoothMapListFiltersResultCallback callback); void getFolderList(const std::string &sessionKey, const std::string &sessionId, const uint16_t &startOffset, const uint16_t &maxCount, BluetoothMapGetFoldersCallback callback); void setFolder(const std::string &sessionKey, const std::string &sessionId, const std::string &folder, BluetoothResultCallback callback); void getMessageList(const std::string &sessionKey, const std::string &sessionId, const std::string &folder, const BluetoothMapPropertiesList &filters, BluetoothMapGetMessageListCallback callback); void getMessage(const std::string &sessionKey, const std::string &messageHandle, bool attachment, const std::string &destinationFile, BluetoothResultCallback callback); void setMessageStatus(const std::string &sessionKey, const std::string &messageHandle, const std::string &statusIndicator, bool statusValue, BluetoothResultCallback callback); void pushMessage(const std::string &sessionKey, const std::string &sourceFile, const std::string &folder, const std::string &charset, bool transparent, bool retry, BluetoothMapCallback callback); void updateProperties(GVariant *changedProperties); private: Bluez5Adapter *mAdapter; std::map <std::string, Bluez5ObexTransfer*> mTransfersMap; std::string convertSessionKey(const std::string &address); std::string getSessionIdFromSessionPath(const std::string &sessionPath); void createSession(const std::string &address, const std::string &instanceName, BluetoothMapCallback callback); void getFolderListCb(BluezObexMessageAccess1* tObjectMapProxy, BluetoothMapGetFoldersCallback callback, GAsyncResult *result); void parseGetFolderListResponse(GVariant *outFolderList,std::vector<std::string> &folders); GVariant * buildGetFolderListParam(const uint16_t &startOffset, const uint16_t &maxCount); void getMessageListCb(BluezObexMessageAccess1* tObjectMapProxy, BluetoothMapGetMessageListCallback callback, GAsyncResult *result); GVariant * buildGetMessageListParam(const BluetoothMapPropertiesList &filters); void parseGetMessageListResponse(GVariant *outMessageList,BluetoothMessageList &messageList); void addMessageProperties(std::string& key , GVariant* value , BluetoothMapPropertiesList &messageProperties); BluezObexMessage1* createMessageHandleProxyUsingPath(const std::string &objectPath); void removeTransfer(const std::string &objectPath); void startTransfer(const std::string &objectPath, BluetoothResultCallback callback, Bluez5ObexTransfer::TransferType type); void startPushTransfer(const std::string &objectPath, BluetoothMapCallback callback, Bluez5ObexTransfer::TransferType type); void updateActiveTransfer(const std::string &objectPath, Bluez5ObexTransfer *transfer, BluetoothResultCallback callback); GVariant* buildMessageArgs(const std::string &charset, bool transparent, bool retry); void updatePushTransfer(const std::string &objectPath, Bluez5ObexTransfer *transfer, BluetoothMapCallback callback); }; #endif
[ "sathya.krishnan@lge.com" ]
sathya.krishnan@lge.com
7beccc69c76dae7f325d8eb5f5d486ef414d577e
ad523ccbe6c5a76d6599375c52055303474610cd
/src/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.cc
24edc98869177a54fe057ab4d673478c4dda078c
[ "BSD-3-Clause" ]
permissive
carter1029/naiveproxy
cf49b3356d681320fbbea6d8ed64eb8fa07fd109
c2e8c4676edbd7cc4bd9b1f7da1bd6f34c771480
refs/heads/master
2023-03-17T10:02:08.057873
2021-03-03T17:09:51
2021-03-03T17:10:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,744
cc
// Copyright (c) 2018 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 "quic/core/qpack/qpack_header_table.h" #include "absl/strings/string_view.h" #include "quic/core/qpack/qpack_static_table.h" #include "quic/platform/api/quic_logging.h" namespace quic { QpackHeaderTable::QpackHeaderTable() : static_entries_(ObtainQpackStaticTable().GetStaticEntries()), static_index_(ObtainQpackStaticTable().GetStaticIndex()), static_name_index_(ObtainQpackStaticTable().GetStaticNameIndex()), dynamic_table_size_(0), dynamic_table_capacity_(0), maximum_dynamic_table_capacity_(0), max_entries_(0), dropped_entry_count_(0), dynamic_table_entry_referenced_(false) {} QpackHeaderTable::~QpackHeaderTable() { for (auto& entry : observers_) { entry.second->Cancel(); } } const QpackEntry* QpackHeaderTable::LookupEntry(bool is_static, uint64_t index) const { if (is_static) { if (index >= static_entries_.size()) { return nullptr; } return &static_entries_[index]; } if (index < dropped_entry_count_) { return nullptr; } index -= dropped_entry_count_; if (index >= dynamic_entries_.size()) { return nullptr; } return &dynamic_entries_[index]; } QpackHeaderTable::MatchType QpackHeaderTable::FindHeaderField( absl::string_view name, absl::string_view value, bool* is_static, uint64_t* index) const { QpackEntry query(name, value); // Look for exact match in static table. auto index_it = static_index_.find(&query); if (index_it != static_index_.end()) { DCHECK((*index_it)->IsStatic()); *index = (*index_it)->InsertionIndex(); *is_static = true; return MatchType::kNameAndValue; } // Look for exact match in dynamic table. index_it = dynamic_index_.find(&query); if (index_it != dynamic_index_.end()) { DCHECK(!(*index_it)->IsStatic()); *index = (*index_it)->InsertionIndex(); *is_static = false; return MatchType::kNameAndValue; } // Look for name match in static table. auto name_index_it = static_name_index_.find(name); if (name_index_it != static_name_index_.end()) { DCHECK(name_index_it->second->IsStatic()); *index = name_index_it->second->InsertionIndex(); *is_static = true; return MatchType::kName; } // Look for name match in dynamic table. name_index_it = dynamic_name_index_.find(name); if (name_index_it != dynamic_name_index_.end()) { DCHECK(!name_index_it->second->IsStatic()); *index = name_index_it->second->InsertionIndex(); *is_static = false; return MatchType::kName; } return MatchType::kNoMatch; } const QpackEntry* QpackHeaderTable::InsertEntry(absl::string_view name, absl::string_view value) { const uint64_t entry_size = QpackEntry::Size(name, value); if (entry_size > dynamic_table_capacity_) { return nullptr; } const uint64_t index = dropped_entry_count_ + dynamic_entries_.size(); dynamic_entries_.push_back({name, value, /* is_static = */ false, index}); QpackEntry* const new_entry = &dynamic_entries_.back(); // Evict entries after inserting the new entry instead of before // in order to avoid invalidating |name| and |value|. dynamic_table_size_ += entry_size; EvictDownToCurrentCapacity(); auto index_result = dynamic_index_.insert(new_entry); if (!index_result.second) { // An entry with the same name and value already exists. It needs to be // replaced, because |dynamic_index_| tracks the most recent entry for a // given name and value. DCHECK_GT(new_entry->InsertionIndex(), (*index_result.first)->InsertionIndex()); dynamic_index_.erase(index_result.first); auto result = dynamic_index_.insert(new_entry); CHECK(result.second); } auto name_result = dynamic_name_index_.insert({new_entry->name(), new_entry}); if (!name_result.second) { // An entry with the same name already exists. It needs to be replaced, // because |dynamic_name_index_| tracks the most recent entry for a given // name. DCHECK_GT(new_entry->InsertionIndex(), name_result.first->second->InsertionIndex()); dynamic_name_index_.erase(name_result.first); auto result = dynamic_name_index_.insert({new_entry->name(), new_entry}); CHECK(result.second); } // Notify and deregister observers whose threshold is met, if any. while (!observers_.empty()) { auto it = observers_.begin(); if (it->first > inserted_entry_count()) { break; } Observer* observer = it->second; observers_.erase(it); observer->OnInsertCountReachedThreshold(); } return new_entry; } uint64_t QpackHeaderTable::MaxInsertSizeWithoutEvictingGivenEntry( uint64_t index) const { DCHECK_LE(dropped_entry_count_, index); if (index > inserted_entry_count()) { // All entries are allowed to be evicted. return dynamic_table_capacity_; } // Initialize to current available capacity. uint64_t max_insert_size = dynamic_table_capacity_ - dynamic_table_size_; for (const auto& entry : dynamic_entries_) { if (entry.InsertionIndex() >= index) { break; } max_insert_size += entry.Size(); } return max_insert_size; } bool QpackHeaderTable::SetDynamicTableCapacity(uint64_t capacity) { if (capacity > maximum_dynamic_table_capacity_) { return false; } dynamic_table_capacity_ = capacity; EvictDownToCurrentCapacity(); DCHECK_LE(dynamic_table_size_, dynamic_table_capacity_); return true; } bool QpackHeaderTable::SetMaximumDynamicTableCapacity( uint64_t maximum_dynamic_table_capacity) { if (maximum_dynamic_table_capacity_ == 0) { maximum_dynamic_table_capacity_ = maximum_dynamic_table_capacity; max_entries_ = maximum_dynamic_table_capacity / 32; return true; } // If the value is already set, it should not be changed. return maximum_dynamic_table_capacity == maximum_dynamic_table_capacity_; } void QpackHeaderTable::RegisterObserver(uint64_t required_insert_count, Observer* observer) { DCHECK_GT(required_insert_count, 0u); observers_.insert({required_insert_count, observer}); } void QpackHeaderTable::UnregisterObserver(uint64_t required_insert_count, Observer* observer) { auto it = observers_.lower_bound(required_insert_count); while (it != observers_.end() && it->first == required_insert_count) { if (it->second == observer) { observers_.erase(it); return; } ++it; } // |observer| must have been registered. QUIC_NOTREACHED(); } uint64_t QpackHeaderTable::draining_index(float draining_fraction) const { DCHECK_LE(0.0, draining_fraction); DCHECK_LE(draining_fraction, 1.0); const uint64_t required_space = draining_fraction * dynamic_table_capacity_; uint64_t space_above_draining_index = dynamic_table_capacity_ - dynamic_table_size_; if (dynamic_entries_.empty() || space_above_draining_index >= required_space) { return dropped_entry_count_; } auto it = dynamic_entries_.begin(); while (space_above_draining_index < required_space) { space_above_draining_index += it->Size(); ++it; if (it == dynamic_entries_.end()) { return inserted_entry_count(); } } return it->InsertionIndex(); } void QpackHeaderTable::EvictDownToCurrentCapacity() { while (dynamic_table_size_ > dynamic_table_capacity_) { DCHECK(!dynamic_entries_.empty()); QpackEntry* const entry = &dynamic_entries_.front(); const uint64_t entry_size = entry->Size(); DCHECK_GE(dynamic_table_size_, entry_size); dynamic_table_size_ -= entry_size; auto index_it = dynamic_index_.find(entry); // Remove |dynamic_index_| entry only if it points to the same // QpackEntry in |dynamic_entries_|. Note that |dynamic_index_| has a // comparison function that only considers name and value, not actual // QpackEntry* address, so find() can return a different entry if name and // value match. if (index_it != dynamic_index_.end() && *index_it == entry) { dynamic_index_.erase(index_it); } auto name_it = dynamic_name_index_.find(entry->name()); // Remove |dynamic_name_index_| entry only if it points to the same // QpackEntry in |dynamic_entries_|. if (name_it != dynamic_name_index_.end() && name_it->second == entry) { dynamic_name_index_.erase(name_it); } dynamic_entries_.pop_front(); ++dropped_entry_count_; } } } // namespace quic
[ "kizdiv@gmail.com" ]
kizdiv@gmail.com
aab87bacbce8cd32b2c80ea4fbea9fcceacd3dce
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/tcss/include/tencentcloud/tcss/v20201101/model/CreateComponentExportJobResponse.h
a92bf9a512de81c02f94d8c3605d28bacbb6d27a
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-cpp
9f5df8220eaaf72f7eaee07b2ede94f89313651f
42a76b812b81d1b52ec6a217fafc8faa135e06ca
refs/heads/master
2023-08-30T03:22:45.269556
2023-08-30T00:45:39
2023-08-30T00:45:39
188,991,963
55
37
Apache-2.0
2023-08-17T03:13:20
2019-05-28T08:56:08
C++
UTF-8
C++
false
false
2,424
h
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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. */ #ifndef TENCENTCLOUD_TCSS_V20201101_MODEL_CREATECOMPONENTEXPORTJOBRESPONSE_H_ #define TENCENTCLOUD_TCSS_V20201101_MODEL_CREATECOMPONENTEXPORTJOBRESPONSE_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/AbstractModel.h> namespace TencentCloud { namespace Tcss { namespace V20201101 { namespace Model { /** * CreateComponentExportJob返回参数结构体 */ class CreateComponentExportJobResponse : public AbstractModel { public: CreateComponentExportJobResponse(); ~CreateComponentExportJobResponse() = default; CoreInternalOutcome Deserialize(const std::string &payload); std::string ToJsonString() const; /** * 获取导出任务ID,前端拿着任务ID查询任务进度 * @return JobId 导出任务ID,前端拿着任务ID查询任务进度 * */ std::string GetJobId() const; /** * 判断参数 JobId 是否已赋值 * @return JobId 是否已赋值 * */ bool JobIdHasBeenSet() const; private: /** * 导出任务ID,前端拿着任务ID查询任务进度 */ std::string m_jobId; bool m_jobIdHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_TCSS_V20201101_MODEL_CREATECOMPONENTEXPORTJOBRESPONSE_H_
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
1daeb5a400c38cba7a9d361cec018a3cf4484698
aa1351e056e3b87ccf18a36ebe24a9f928ba81ca
/bca_sem2/assignment1/q57.cpp
969640fffcbabbb9f1923ca744f4f2a69ae30f4e
[]
no_license
wisdom-weaver/c_cpp_mini
d13dc9fd4d83228b3c589c419545d44e6640f28b
c9f38ee6a2172f1a035deb60fb727016fff09e1a
refs/heads/main
2023-08-18T20:04:53.371934
2021-09-23T11:52:52
2021-09-23T11:52:52
378,346,514
1
0
null
null
null
null
UTF-8
C++
false
false
390
cpp
#include <iostream> #include <cmath> using namespace std; int main() { cout << "Enter cost price: Rs "; float cp; cin>>cp; cout << "Enter selling price: Rs "; float sp; cin>>sp; if(sp==cp) cout<<"No profit / loss"<<endl; else if(sp>cp) cout<<"profit: "<<(sp-cp)<<endl; else if(sp<cp) cout<<"loss: "<<(cp-sp)<<endl; end: return 0; }
[ "danish.ansari.nox@gmail.com" ]
danish.ansari.nox@gmail.com
bcda4576106f0fccdb6b0a62f2357bac84f40160
de22e1e826e75096c32fd4685b377e2e750f94c8
/lib/ReadWriteGraph/ReadWriteGraph.cpp
4a1a05a955f4e7a8a11b01a9c25a7d68dd51a8f7
[ "MIT" ]
permissive
mchalupa/dg
bb1430ebe5c9957d5f1b1278567674bdc03546ce
df6e4e23d2a0740ec9d9fa38e80032bd80556c95
refs/heads/master
2023-09-05T02:57:01.261394
2022-06-29T12:53:04
2022-12-19T10:12:03
31,018,102
458
146
MIT
2023-05-02T12:43:24
2015-02-19T14:12:47
C++
UTF-8
C++
false
false
4,057
cpp
#include <set> #include <vector> #include "dg/BBlocksBuilder.h" #include "dg/ReadWriteGraph/ReadWriteGraph.h" namespace dg { namespace dda { RWNode UNKNOWN_MEMLOC; RWNode *UNKNOWN_MEMORY = &UNKNOWN_MEMLOC; #ifndef NDEBUG void RWNode::dump() const { std::cout << getID() << "\n"; } void RWNodeCall::dump() const { std::cout << getID() << " calls ["; unsigned n = 0; for (const auto &cv : callees) { if (n++ > 0) { std::cout << ", "; } if (const auto *subg = cv.getSubgraph()) { const auto &nm = subg->getName(); if (nm.empty()) { std::cout << subg; } else { std::cout << nm; } } else { std::cout << cv.getCalledValue()->getID(); } } std::cout << "]\n"; } void RWBBlock::dump() const { std::cout << "bblock " << getID() << "(" << this << ")\n"; for (auto *n : getNodes()) { std::cout << " "; n->dump(); } } #endif bool RWNode::isDynAlloc() const { if (getType() == RWNodeType::DYN_ALLOC) return true; if (const auto *C = RWNodeCall::get(this)) { for (const auto &cv : C->getCallees()) { if (const auto *val = cv.getCalledValue()) { if (val->getType() == RWNodeType::DYN_ALLOC) { return true; } } } } return false; } void RWNodeCall::addCallee(RWSubgraph *s) { callees.emplace_back(s); s->addCaller(this); } void ReadWriteGraph::removeUselessNodes() {} void RWSubgraph::buildBBlocks(bool /*dce*/) { assert(getRoot() && "No root node"); DBG(dda, "Building basic blocks"); BBlocksBuilder<RWBBlock> builder; _bblocks = std::move(builder.buildAndGetBlocks(getRoot())); assert(getRoot()->getBBlock() && "Root node has no BBlock"); // should we eliminate dead code? // The dead code are the nodes that have no basic block assigned // (follows from the DFS nature of the block builder algorithm) /* if (!dce) return; for (auto& nd : _nodes) { if (nd->getBBlock() == nullptr) { nd->isolate(); nd.reset(); } } */ } // split the block on the first call and return the // block containing the rest of the instructions // (or nullptr if there's nothing else to do) static RWBBlock * splitBlockOnFirstCall(RWBBlock *block, std::vector<std::unique_ptr<RWBBlock>> &newblocks) { for (auto *node : block->getNodes()) { if (auto *call = RWNodeCall::get(node)) { if (call->callsOneUndefined()) { // ignore calls that call one udefined function, // those behave just like usual read/write continue; } DBG(dda, "Splitting basic block around " << node->getID()); auto blks = block->splitAround(node); if (blks.first) newblocks.push_back(std::move(blks.first)); if (blks.second) { newblocks.push_back(std::move(blks.second)); return newblocks.back().get(); } return nullptr; } } return nullptr; } void RWSubgraph::splitBBlocksOnCalls() { DBG_SECTION_BEGIN(dda, "Splitting basic blocks on calls"); if (_bblocks.empty()) { DBG_SECTION_END(dda, "Splitting basic blocks on calls finished"); return; } #ifndef NDEBUG auto *entry = _bblocks[0].get(); #endif std::vector<std::unique_ptr<RWBBlock>> newblocks; for (auto &bblock : _bblocks) { auto *cur = bblock.get(); while (cur) { cur = splitBlockOnFirstCall(cur, newblocks); } } for (auto &bblock : newblocks) { _bblocks.push_back(std::move(bblock)); } assert(entry == _bblocks[0].get() && "splitBBlocksOnCalls() changed the entry"); DBG_SECTION_END(dda, "Splitting basic blocks on calls finished"); } } // namespace dda } // namespace dg
[ "mchqwerty@gmail.com" ]
mchqwerty@gmail.com
b6ed4a1d960ad01f0e4b307488224e51ae4ca142
9b25dc90ff4cb62ef7e0de65577e2c13d60c320b
/Codechef/hxor.cpp
d3691ac7cabe8df1f7615b3a5a7bf3a189be8857
[]
no_license
iamvinayvk/Competitive-Programming
1e62ab5a10f9631d24fcdbf8726ce03068e15268
8a28b35665ed9db040479f646c8d3a31b06210f2
refs/heads/master
2021-07-16T21:25:37.678010
2021-03-06T20:56:34
2021-03-06T20:56:34
243,021,712
1
0
null
null
null
null
UTF-8
C++
false
false
3,708
cpp
/** * * @Author : Vinay Kushwaha (iamvinayvk) * * @DateTime : 12/6/2020 1:04:17 PM * */ #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ll long long int #define w(t) int t;cin>>t;while(t--) #define mod 1000000007 #define all(x) x.begin(),x.end() #define F first #define S second #define vi vector<int> #define vll vector<long long> #define FOR(start,end,increment) for(ll i=start;i<end;i+=increment) ll gcd(ll a, ll b) { if(a==0) return b; return gcd(b%a,a); } // void initialize() // { // // To initially generate the // // table algorithmically // BitsSetTable256[0] = 0; // for (int i = 0; i < 256; i++) // { // BitsSetTable256[i] = (i & 1) + // BitsSetTable256[i / 2]; // } // } // int countSetBits(int n) // { // return (BitsSetTable256[n & 0xff] + // BitsSetTable256[(n >> 8) & 0xff] + // BitsSetTable256[(n >> 16) & 0xff] + // BitsSetTable256[n >> 24]); // } int setBitNumber(int n) { // To find the position // of the most significant // set bit int k = (int)(log2(n)); // To return the the value // of the number with set // bit at k-th position return (int)pow(2,k); } int main(){ fast w(t) { ll n,x; cin>>n>>x; vll a(n); // cout<<(1<<2)<<"\n"; vector<vector<ll>> bitsarray(33); for(int i=0;i<n;i++) { cin>>a[i]; for(int j=0;j<32;j++) { if((a[i]&(1<<j))&&i!=n-1&&i!=0) { // bitsarray[j]+=(pow(2,j)); bitsarray[j].push_back(i); // cout<<i<<" "<<j<<"\n"; } } } // for(int i=0;i<32;i++) // { // cout<<i<<"\n"; // for(int j=0;j<bitsarray[i].size();j++) // { // cout<<"bitsarray: "<<bitsarray[i][j]<<"j: "<<j<<" "; // } // cout<<"\n"; // } vector<ll> fre(33); int i; for(i=0;i<n-1;i++) { // ll countBits=__builtin_popcount(a[i]); // cout<<"countBits: "<<countBits<<"\n"; // ll msb_i=setBitNumber(a[i]); // cout<<"MSB: "<<msb_i<<"\n"; for(int j=31;j>=0;j--) { // if(fre[j]<bitsarray[j].size()) // cout<<"bitsarray[j][fre[j]]: "<<bitsarray[j][fre[j]]<<"a[i]: "<<a[i]<<" j:"<<j<<"fre[j]: "<<fre[j]<<"\n"; while((fre[j]<bitsarray[j].size())&&(bitsarray[j][fre[j]]<=i)) fre[j]++; if((a[i]&(1<<j))&&(fre[j]<bitsarray[j].size())&&(bitsarray[j][fre[j]]>i)) { // cout<<j<<"\n"; // cout<<"msb_i: "<<msb_i<<"\n"; // cout<<"fre[j]: "<<fre[j]<<"\n"; // cout<<"j: "<<j<<"\n"; a[bitsarray[j][fre[j]]]^=(1<<j); a[i]^=(1<<j); // msb_i=setBitNumber(a[i]); fre[j]++; x--; // cout<<"a[i]: "<<a[i]<<"\n"; // cout<<"a[j]: "<<a[bitsarray[j][fre[j]]]<<"\n"; // countBits--; // for(int i=0;i<n;i++) // cout<<a[i]<<" "; // cout<<"\n"; } if(x==0) break; } ll count=__builtin_popcount(a[i]); if(count<=x) { a[n-1]^=a[i]; a[i]=0; x-=count; } else if(count>x&&x>0) { int msb_i; while(x>0&&a[i]>0) { msb_i=setBitNumber(a[i]); a[i]^=msb_i; a[n-1]^=msb_i; x--; } } // cout<<"x: "<<x<<"\n"; // for(int i=0;i<n;i++) // cout<<a[i]<<" "; // cout<<"\n"; if(x==0) break; } if(x>0&&(x%n==1)) { // cout<<"x: "<<x<<"\n"; // for(int i=0;i<n;i++) // cout<<a[i]<<" "; // cout<<"\n"; a[n-1]^=1; a[n-2]^=1; } for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<"\n"; } return 0; }
[ "51132814+iamvinayvk@users.noreply.github.com" ]
51132814+iamvinayvk@users.noreply.github.com
6895791384fc91f51a84f5919cfc40d82912be04
d6501a6bce33340716e5d4dd8a3b6a08932d0c0b
/src/structures/Node.h
fd2aa50612eb08753b96bc83888b01976c6f1019
[]
no_license
jakobrj/GPU_INSCY
b315ca2b93b5f4afba2c9b9f3025323447dda8dc
2c4ade55f4e53690f9c57172665c57a4826ce8d2
refs/heads/main
2023-02-24T04:17:08.441824
2021-02-01T09:05:17
2021-02-01T09:05:17
301,943,212
0
1
null
null
null
null
UTF-8
C++
false
false
1,389
h
#ifndef CUDATEST_NODE_H #define CUDATEST_NODE_H #include <map> #include <vector> #include <memory> using namespace std; class Node { public: int count; int cell_no; bool is_leaf; map<int, shared_ptr<Node>> children; map<int, shared_ptr<Node>> s_connections; vector<int> points; Node(int cell_no) : cell_no(cell_no) { this->count = 0; this->is_leaf = false; } Node(shared_ptr <Node> old_node) { this->cell_no = old_node->cell_no; this->count = old_node->count; this->points = old_node->points; this->is_leaf = old_node->is_leaf; } Node(int cell_no, int count, bool is_leaf, vector<int> points) : cell_no(cell_no), count(count), is_leaf(is_leaf) { this->points = points; } Node(int cell_no, int count, bool is_leaf) : cell_no(cell_no), count(count), is_leaf(is_leaf) { } bool operator<(const Node &other) const { return (this->cell_no < other.cell_no); } bool operator==(const Node &other) const { return (this->cell_no == other.cell_no); } void compute_count_shallow() { this->count = 0; for (pair<const int, shared_ptr < Node>> child_pair: this->children) { shared_ptr <Node> child = child_pair.second; this->count += child->count; } } }; #endif //CUDATEST_NODE_H
[ "Vebl8550" ]
Vebl8550
b663ef5ec9015c1b0f9aaf3fc468f3a0dbf7c007
cf8ddfc720bf6451c4ef4fa01684327431db1919
/SDK/ARKSurvivalEvolved_poisonTrap_FPV_RIG_AnimBlueprint_parameters.hpp
03fcc0364ec27004168f579a21cc0e8693dff3fb
[ "MIT" ]
permissive
git-Charlie/ARK-SDK
75337684b11e7b9f668da1f15e8054052a3b600f
c38ca9925309516b2093ad8c3a70ed9489e1d573
refs/heads/master
2023-06-20T06:30:33.550123
2021-07-11T13:41:45
2021-07-11T13:41:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
794
hpp
#pragma once // ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_poisonTrap_FPV_RIG_AnimBlueprint_classes.hpp" namespace sdk { //--------------------------------------------------------------------------- //Parameters //--------------------------------------------------------------------------- // Function poisonTrap_FPV_RIG_AnimBlueprint.poisonTrap_FPV_RIG_AnimBlueprint_C.ExecuteUbergraph_poisonTrap_FPV_RIG_AnimBlueprint struct UpoisonTrap_FPV_RIG_AnimBlueprint_C_ExecuteUbergraph_poisonTrap_FPV_RIG_AnimBlueprint_Params { int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData) }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "sergey.2bite@gmail.com" ]
sergey.2bite@gmail.com
298db7bc84e17472a911f61b580f76941d766f8f
a538b1e0d194b6ccfb91e02e87f4cf50c56bc0a8
/EOC/InputsOutputs/ButtonMenu.cpp
b62ae73584a423c3ae3202ad45db8b4e022b55ca
[]
no_license
forgyn/EOC
7ce913b881a5efc7b623fac24b0ab6b9722f9126
78bf3cddc9eae1851cff877cf1bd61b67c46512d
refs/heads/master
2022-07-12T00:12:18.967508
2020-05-10T14:07:26
2020-05-10T14:07:26
261,299,362
0
0
null
null
null
null
UTF-8
C++
false
false
10,147
cpp
#include "ButtonMenu.h" ButtonMenu::ButtonMenu(float pos_x, float pos_y, float size_x, float size_y, float button_height, RenderWindow* window) : _button_size(button_height) { _window = window; _pos.x = pos_x; _pos.y = pos_y; _size.x = size_x; _size.y = size_y; _background.setPosition(_pos); _background.setSize(_size); _background.setFillColor(Color::Blue); _slider = new Slider(_size.x * 0.1, _size.y, _pos.x + (_size.x * 0.9), _pos.y, _window); _view = new View(FloatRect(_pos.x /*+ (_size.x / 2)*/, _pos.y /*+ (_size.y / 2)*/, _size.x, _size.y)); _view->setViewport(FloatRect(_pos.x / _window->getSize().x, _pos.y / _window->getSize().y, _size.x/_window->getSize().x, _size.y / _window->getSize().y)); _button_clock = new Clock; _actual_size = _size.y; } ButtonMenu::~ButtonMenu(){ for (int i = 0; i < _menu.size(); i++)delete _menu[i]; delete _slider; delete _view; if (_added_background_texture) delete _background_texture; if (_added_button_texture) delete _button_texture; if (_added_slider_background_texture) delete _slider_background_texture; if (_added_slider_texture) delete _slider_texture; delete _button_clock; } void ButtonMenu::addButton(wstring text, Font* font){ _menu.push_back(new TextButton(0.8 * 0.9 * _size.x, _button_size, _pos.x + (_size.x * 0.1 * 0.9), _pos.y + (_button_size * 0.2) + (_menu.size() * _button_size * 1.2), text, _window, font)); if (_loaded_button_texture) { if (_rect_button_texture) { _menu.back()->setBackgroundRectTexture(_button_texture,_button_rect); } else { _menu.back()->setBackgroundTexture(_button_texture); } } else _menu.back()->setColor(Color::Magenta); if(_mod != 2 && _mod != 3)_menu.back()->changeMod(_mod); else _menu.back()->changeMod(1); _actual_size = ((static_cast<float>(_menu.size()) * _button_size * 1.2) - _size.y + (_button_size * 0.2)); } void ButtonMenu::addButton(string text, Font* font) { _menu.push_back(new TextButton(0.8 * 0.9 * _size.x, _button_size, _pos.x + (_size.x * 0.1 * 0.9), _pos.y + (_button_size * 0.2) + (_menu.size() * _button_size * 1.2), text, _window, font)); if (_loaded_button_texture) { if (_rect_button_texture) { _menu.back()->setBackgroundRectTexture(_button_texture, _button_rect); } else { _menu.back()->setBackgroundTexture(_button_texture); } } else _menu.back()->setColor(Color::Magenta); if (_mod != 2 && _mod != 3)_menu.back()->changeMod(_mod); else _menu.back()->changeMod(1); _actual_size = ((static_cast<float>(_menu.size()) * _button_size * 1.2) - _size.y + (_button_size * 0.2)); } void ButtonMenu::update(Event* _event, Mouse* _mouse){ //( (static_cast<float>(_menu.size()) * _button_size * 1.2) - _size.y + (_button_size * 0.2)) if(_background.getGlobalBounds().contains(static_cast<float>(_mouse->getPosition(*_window).x), static_cast<float>(_mouse->getPosition(*_window).y))) { switch (_mod) { case 0: case 1: for (int i = 0; i < _menu.size(); i++) { _menu[i]->update(_event, _mouse); } break; case 2: for (int i = 0; i < _menu.size(); i++) { _menu[i]->update(_event, _mouse); if (_event->type == Event::MouseButtonPressed) if (_menu[i]->isPointed(_mouse)) { if (BUTTON_SELECTED == -1) { BUTTON_SELECTED = i; } else if (BUTTON_SELECTED == i) { BUTTON_SELECTED = -1; } } if (BUTTON_SELECTED != i)_menu[i]->reset(); } break; case 3: for (int i = 0; i < _menu.size(); i++) { _menu[i]->update(_event, _mouse); if (_event->type == Event::MouseButtonPressed) if (_menu[i]->isPointed(_mouse)) { if (BUTTON_SELECTED == i)BUTTON_SELECTED = -1; else BUTTON_SELECTED = i; } } for (int i = 0; i < _menu.size(); i++)if (BUTTON_SELECTED != i)_menu[i]->reset(); break; } if ((((static_cast<float>(_menu.size())) * _button_size))*1.2 >= _size.y) { if (_event->type == Event::MouseWheelMoved) { _slider->setInput(Vector2f(0, _slider->getInput().y + _event->mouseWheel.delta*(-1)*(_size.y/100))); } _slider->update(_event, _mouse); for (int i = 0; i < _menu.size(); i++) { _menu[i]->changePos(Vector2f(_pos.x + (_size.x * 0.1 * 0.9), _pos.y + ((static_cast<float>(i)) * _button_size * 1.2) + (_button_size * 0.2) - ((_slider->getInput().y / 100)*_actual_size))); } } } else _slider->release(); } void ButtonMenu::changeMod(uint8_t mod) { if (mod == 0 || mod == 1 || mod == 2 || mod == 3)_mod = mod; for (int i = 0; i < _menu.size(); i++) { if(_mod == 2 || _mod == 3)_menu[i]->changeMod(1); else _menu[i]->changeMod(_mod); } } void ButtonMenu::setBackgroundTexture(Texture* texture){ if (texture != nullptr) { _background_texture = texture; _loaded_background_texture = true; _added_background_texture = false; _background.setTexture(_background_texture); _background.setFillColor(Color::White); } } void ButtonMenu::addBackgroundTexture(string path){ _background_texture = new Texture; if (_background_texture->loadFromFile(path)) { _loaded_background_texture = true; _added_background_texture = true; _background.setTexture(_background_texture); _background.setFillColor(Color::White); } else { delete _background_texture; } } void ButtonMenu::setBackgroundTextureRect(Texture* texture, IntRect rect) { if (texture != nullptr) { _background_texture = texture; _loaded_background_texture = true; _added_background_texture = false; _background.setTexture(_background_texture); _background.setTextureRect(rect); _background.setFillColor(Color::White); } } void ButtonMenu::addBackgroundTextureRect(string path, IntRect rect){ _background_texture = new Texture; if (_background_texture->loadFromFile(path)) { _loaded_background_texture = true; _added_background_texture = true; _background.setTexture(_background_texture); _background.setTextureRect(rect); _background.setFillColor(Color::White); } else { delete _background_texture; } } void ButtonMenu::setButtonTexture(Texture* texture) { if (texture != nullptr) { _button_texture = texture; _loaded_button_texture = true; _added_button_texture = false; for (int i = 0; i < _menu.size();i++)_menu[i]->setBackgroundTexture(_button_texture); } } void ButtonMenu::addButtonTexture(string path) { _button_texture = new Texture; if (_button_texture->loadFromFile(path)) { _loaded_button_texture = true; _added_button_texture = true; for (int i = 0; i < _menu.size(); i++)_menu[i]->setBackgroundTexture(_button_texture); } else { delete _button_texture; } } void ButtonMenu::setButtonTextureRect(Texture* texture, IntRect rect) { if (texture != nullptr) { _button_texture = texture; _loaded_button_texture = true; _added_button_texture = false; for (int i = 0; i < _menu.size(); i++)_menu[i]->setBackgroundRectTexture(_button_texture,rect); _button_rect = rect; _rect_button_texture = true; } } void ButtonMenu::addButtonTextureRect(string path, IntRect rect) { _button_texture = new Texture; if (_button_texture->loadFromFile(path)) { _loaded_button_texture = true; _added_button_texture = true; for (int i = 0; i < _menu.size(); i++)_menu[i]->setBackgroundRectTexture(_button_texture, rect); _button_rect = rect; _rect_button_texture = true; } else { delete _button_texture; } } void ButtonMenu::setSliderBackgroundTexture(Texture* texture) { if (texture != nullptr) { _slider_background_texture = texture; _loaded_slider_background_texture = true; _added_slider_background_texture = false; _slider->setBackgroundTexture(_slider_background_texture); } } void ButtonMenu::addSliderBackgroundTexture(string path) { _slider_background_texture = new Texture; if (_slider_background_texture->loadFromFile(path)) { _loaded_slider_background_texture = true; _added_slider_background_texture = true; _slider->setBackgroundTexture(_slider_background_texture); } else { delete _slider_background_texture; } } void ButtonMenu::setSliderBackgroundTextureRect(Texture* texture, IntRect rect) { if (texture != nullptr) { _slider_background_texture = texture; _loaded_slider_background_texture = true; _added_slider_background_texture = false; _slider->setBackgroundRectTexture(_slider_background_texture,rect); } } void ButtonMenu::addSliderBackgroundTextureRect(string path, IntRect rect) { _slider_background_texture = new Texture; if (_slider_background_texture->loadFromFile(path)) { _loaded_slider_background_texture = true; _added_slider_background_texture = true; _slider->setBackgroundRectTexture(_slider_background_texture, rect); } else { delete _slider_background_texture; } } void ButtonMenu::setSliderTexture(Texture* texture) { if (texture != nullptr) { _slider_texture = texture; _loaded_slider_texture = true; _added_slider_texture = false; _slider->setSpecialTexture(_slider_texture); } } void ButtonMenu::addSliderTexture(string path) { _slider_texture = new Texture; if (_slider_texture->loadFromFile(path)) { _loaded_slider_texture = true; _added_slider_texture = true; _slider->setSpecialTexture(_slider_texture); } else { delete _slider_texture; } } void ButtonMenu::setSliderTextureRect(Texture* texture, IntRect rect) { if (texture != nullptr) { _slider_texture = texture; _loaded_slider_texture = true; _added_slider_texture = false; _slider->setSpecialRectTexture(_slider_texture,rect); } } void ButtonMenu::addSliderTextureRect(string path, IntRect rect) { _slider_texture = new Texture; if (_slider_texture->loadFromFile(path)) { _loaded_slider_texture = true; _added_slider_texture = true; _slider->setSpecialRectTexture(_slider_texture, rect); } else { delete _slider_texture; } } void ButtonMenu::draw(){ _window->setView(*_view); _window->draw(_background); if (((static_cast<float>(_menu.size()) * _button_size)) * 1.2 >= _size.y) _slider->draw(); for (int i = 0; i < _menu.size(); i++)_menu[i]->draw(); _window->setView(_window->getDefaultView()); } TextButton* ButtonMenu::operator[](size_t n){ return _menu[n]; } void ButtonMenu::reset() { for (int i = 0; i < _menu.size(); i++)_menu[i]->reset(); }
[ "47833059+forgyn@users.noreply.github.com" ]
47833059+forgyn@users.noreply.github.com
e9b20c15b4eaec5012f50feb46b073f9cfb7b738
7943d88e0746ecf085273fe5ece76a4d01665760
/vector.cc
970f5fce861f2e68aaf8c7ebbd56dac6c046905a
[]
no_license
ivanternovyi/table
be538832ebde2c1d5a6e63f2f6f3d3338b623dc0
f5cd172f1ffb7346f3604ef30daecc9cce427b2b
refs/heads/master
2021-01-18T14:29:08.286456
2017-03-08T16:04:55
2017-03-08T16:04:55
84,339,503
0
0
null
null
null
null
UTF-8
C++
false
false
1,813
cc
#include <iostream> #include <string> #include "vector.h" #include "table.h" using namespace std; void vector::add_couple() { couple new_element; new_element.set_couple(); arr[count] = new_element; count++; if(count == quantity) { couple *arr_for_exchange = new couple[count]; for(int counter = 0; counter < quantity; counter++) { arr_for_exchange[counter] = arr[counter]; } delete[] arr; quantity = quantity + 1; arr = new couple[quantity]; for(int counter = 0; counter < quantity - 1; counter++) { arr[counter] = arr_for_exchange[counter]; } delete[] arr_for_exchange; } } void vector::input() { add_couple (); while(cin.get() != 'q') { add_couple (); } } couple vector::get_couple() { count--; return arr[count] ; } int vector::get_quantity() { return this->quantity; } bool vector::is_empty() { return count == 0; } couple& vector::operator[](int index) { return arr[index]; } /* bool test_is_empty() //test method checks whether stack is empty; { bool test_result = true; stack st; test_result &= st.is_empty(); st.push(1); test_result &= !st.is_empty(); st.pop(); test_result &= st.is_empty(); return test_result; } bool test_push_pop() //test methods check correctness of methods push and pop; { stack st; for(int counter = 0; counter < 150; counter++) { st.push(counter); } bool test_result = true; for(int counter = 0; counter < 150; counter++) { test_result &= st.pop() == abs(counter - 149); } return test_result; } int main() { cout << "Stack is working good: " << test_is_empty () << endl; //test if method that dismisses stack works properly ; cout << "Stack is working good: " << test_push_pop () << endl; //test if methods push, pop work properly; return 0; } */
[ "ivanternovyi@gmail.com" ]
ivanternovyi@gmail.com
02781b11f971ca49d7ef46a0413ee7e68693aa6b
fdc8e751f914ed155eafac3577df139e8971c4c6
/SpatialAnchorBuild/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs45.cpp
035f7ff93c6c6b874283cc47ce1b1fe019f29714
[]
no_license
crimsonsooner11/SpatialAnchorDev
abd7ab39bf36ce323c9830d2ac6cd9497ad94529
5d422fb81f3e15c6c1b57dfd99836db07e31da58
refs/heads/main
2023-01-04T05:25:42.521758
2020-10-31T23:23:38
2020-10-31T23:23:38
308,990,723
0
0
null
null
null
null
UTF-8
C++
false
false
143,281
cpp
#include "pch-cpp.hpp" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <limits> #include "vm/CachedCCWBase.h" #include "utils/New.h" // Microsoft.MixedReality.Toolkit.UI.BoundingBox/Handle[] struct HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738; // System.IO.Directory/SearchData[] struct SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D; // UnityEngine.UI.Dropdown/DropdownItem[] struct DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD; // UnityEngine.UI.Dropdown/OptionData[] struct OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5; // System.Diagnostics.Tracing.EventProvider/SessionInfo[] struct SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179; // UnityEngine.EventSystems.EventTrigger/Entry[] struct EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104; // Microsoft.MixedReality.Toolkit.Input.FocusProvider/PointerData[] struct PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693; // Microsoft.MixedReality.Toolkit.Input.FocusProvider/PointerPreferences[] struct PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114; // Microsoft.MixedReality.Toolkit.UI.InteractableColorChildrenTheme/BlocksAndRenderer[] struct BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C; // Microsoft.MixedReality.Toolkit.UI.BoundsControl.Links/Link[] struct LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B; // Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule/PointerData[] struct PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326; struct IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB; struct IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA; struct IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Windows.Foundation.Collections.IIterable`1<System.Object> struct NOVTABLE IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) = 0; }; // Windows.Foundation.Collections.IVectorView`1<System.Object> struct NOVTABLE IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) = 0; }; // Windows.UI.Xaml.Interop.IBindableIterable struct NOVTABLE IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) = 0; }; // Windows.UI.Xaml.Interop.IBindableVector struct NOVTABLE IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() = 0; }; // System.Object // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundingBox/Handle> struct List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9, ____items_1)); } inline HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738* get__items_1() const { return ____items_1; } inline HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738** get_address_of__items_1() { return &____items_1; } inline void set__items_1(HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_StaticFields, ____emptyArray_5)); } inline HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738* get__emptyArray_5() const { return ____emptyArray_5; } inline HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(HandleU5BU5D_t8715D0A6829E35EC3B09205EA318B979AA94D738* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<System.IO.Directory/SearchData> struct List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913, ____items_1)); } inline SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D* get__items_1() const { return ____items_1; } inline SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D** get_address_of__items_1() { return &____items_1; } inline void set__items_1(SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_StaticFields, ____emptyArray_5)); } inline SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D* get__emptyArray_5() const { return ____emptyArray_5; } inline SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(SearchDataU5BU5D_t964E0FCAF461F8E62BAD8ACECBB774852695466D* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<UnityEngine.UI.Dropdown/DropdownItem> struct List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033, ____items_1)); } inline DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD* get__items_1() const { return ____items_1; } inline DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD** get_address_of__items_1() { return &____items_1; } inline void set__items_1(DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_StaticFields, ____emptyArray_5)); } inline DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD* get__emptyArray_5() const { return ____emptyArray_5; } inline DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(DropdownItemU5BU5D_t75625D5C759A1CA80C0FF5FDD75845BCEFA83BDD* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<UnityEngine.UI.Dropdown/OptionData> struct List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4, ____items_1)); } inline OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5* get__items_1() const { return ____items_1; } inline OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5** get_address_of__items_1() { return &____items_1; } inline void set__items_1(OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_StaticFields, ____emptyArray_5)); } inline OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5* get__emptyArray_5() const { return ____emptyArray_5; } inline OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(OptionDataU5BU5D_t76E953160486FF629DE132F60738702D374E11A5* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<System.Diagnostics.Tracing.EventProvider/SessionInfo> struct List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17, ____items_1)); } inline SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179* get__items_1() const { return ____items_1; } inline SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179** get_address_of__items_1() { return &____items_1; } inline void set__items_1(SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_StaticFields, ____emptyArray_5)); } inline SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179* get__emptyArray_5() const { return ____emptyArray_5; } inline SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(SessionInfoU5BU5D_t42BA9C3B2898F9EDC1FF64FF2B6D4C6F8FC4F179* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<UnityEngine.EventSystems.EventTrigger/Entry> struct List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70, ____items_1)); } inline EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104* get__items_1() const { return ____items_1; } inline EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104** get_address_of__items_1() { return &____items_1; } inline void set__items_1(EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_StaticFields, ____emptyArray_5)); } inline EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104* get__emptyArray_5() const { return ____emptyArray_5; } inline EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(EntryU5BU5D_t1BD09D174212E16D909BCDEA8F0187B714CEB104* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.FocusProvider/PointerData> struct List_1_t2E89A87547A74783541C40762E35F6285DC252AA : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t2E89A87547A74783541C40762E35F6285DC252AA, ____items_1)); } inline PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693* get__items_1() const { return ____items_1; } inline PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693** get_address_of__items_1() { return &____items_1; } inline void set__items_1(PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t2E89A87547A74783541C40762E35F6285DC252AA, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t2E89A87547A74783541C40762E35F6285DC252AA, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t2E89A87547A74783541C40762E35F6285DC252AA, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t2E89A87547A74783541C40762E35F6285DC252AA_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t2E89A87547A74783541C40762E35F6285DC252AA_StaticFields, ____emptyArray_5)); } inline PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693* get__emptyArray_5() const { return ____emptyArray_5; } inline PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(PointerDataU5BU5D_t5ACD24FFEB38E4DE625A28F44A1B162BC7334693* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.FocusProvider/PointerPreferences> struct List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34, ____items_1)); } inline PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114* get__items_1() const { return ____items_1; } inline PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114** get_address_of__items_1() { return &____items_1; } inline void set__items_1(PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_StaticFields, ____emptyArray_5)); } inline PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114* get__emptyArray_5() const { return ____emptyArray_5; } inline PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(PointerPreferencesU5BU5D_t28933555C85BEFFB3D6626C988F09D89BB39A114* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.InteractableColorChildrenTheme/BlocksAndRenderer> struct List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771, ____items_1)); } inline BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C* get__items_1() const { return ____items_1; } inline BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C** get_address_of__items_1() { return &____items_1; } inline void set__items_1(BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_StaticFields, ____emptyArray_5)); } inline BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C* get__emptyArray_5() const { return ____emptyArray_5; } inline BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(BlocksAndRendererU5BU5D_tE435E5E271E3BC433DA77E3609D5562C746B9A4C* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.Links/Link> struct List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59, ____items_1)); } inline LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B* get__items_1() const { return ____items_1; } inline LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B** get_address_of__items_1() { return &____items_1; } inline void set__items_1(LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_StaticFields, ____emptyArray_5)); } inline LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B* get__emptyArray_5() const { return ____emptyArray_5; } inline LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(LinkU5BU5D_tB448DD37F90C3E85353AB4BCCD725A6B692F6B5B* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule/PointerData> struct List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4, ____items_1)); } inline PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326* get__items_1() const { return ____items_1; } inline PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326** get_address_of__items_1() { return &____items_1; } inline void set__items_1(PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_StaticFields, ____emptyArray_5)); } inline PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326* get__emptyArray_5() const { return ____emptyArray_5; } inline PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(PointerDataU5BU5D_t208375361677220CFA657104F88B31B8345ED326* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif il2cpp_hresult_t IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue); il2cpp_hresult_t IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue); il2cpp_hresult_t IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable** comReturnValue); il2cpp_hresult_t IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue); il2cpp_hresult_t IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue); il2cpp_hresult_t IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue); il2cpp_hresult_t IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable* ___value1); il2cpp_hresult_t IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable* ___value1); il2cpp_hresult_t IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0); il2cpp_hresult_t IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Il2CppIInspectable* ___value0); il2cpp_hresult_t IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(RuntimeObject* __this); il2cpp_hresult_t IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(RuntimeObject* __this); il2cpp_hresult_t IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable** comReturnValue); il2cpp_hresult_t IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue); il2cpp_hresult_t IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue); il2cpp_hresult_t IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue); // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundingBox/Handle> struct List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t83E71016ABDACC541489F5FBBEF4C3570033D7E9_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<System.IO.Directory/SearchData> struct List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tD4204D52A57CADE11F26F8D3FAC6AF2EA0CB8913_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<UnityEngine.UI.Dropdown/DropdownItem> struct List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t4CFF6A6E1A912AE4990A34B2AA4A1FE2C9FB0033_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<UnityEngine.UI.Dropdown/OptionData> struct List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tAF6577A540702C9F6C407DE69A8FAFB502339DC4_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<System.Diagnostics.Tracing.EventProvider/SessionInfo> struct List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t53BBC0AA893BF75B4925CA24EBF5975C942A4D17_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<UnityEngine.EventSystems.EventTrigger/Entry> struct List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t88A4BE98895C19A1F134BA69882646898AC2BD70_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.FocusProvider/PointerData> struct List_1_t2E89A87547A74783541C40762E35F6285DC252AA_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t2E89A87547A74783541C40762E35F6285DC252AA_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t2E89A87547A74783541C40762E35F6285DC252AA_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t2E89A87547A74783541C40762E35F6285DC252AA_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t2E89A87547A74783541C40762E35F6285DC252AA(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t2E89A87547A74783541C40762E35F6285DC252AA_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t2E89A87547A74783541C40762E35F6285DC252AA_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.FocusProvider/PointerPreferences> struct List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t8DFDC432C51897AF5CA76BE4F2973574234CDE34_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.InteractableColorChildrenTheme/BlocksAndRenderer> struct List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t9293F7EF1767D7D7BF6FDFADF7019A2F6BFEA771_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.BoundsControl.Links/Link> struct List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t066CA55BA9F211059DD9F255F3CA3B9EE9C0EA59_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule/PointerData> struct List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tA6CB456D14BFC987703CE5A9AF7D2EEFAF1B38B4_ComCallableWrapper(obj)); }
[ "44559969+crimsonsooner11@users.noreply.github.com" ]
44559969+crimsonsooner11@users.noreply.github.com
eee77003458984cfedb6b091f7271b4ac0ab4d71
6f9a3105e1170c2c70c6c2a14d5d16ec8135ce76
/frameworks/runtime-src/Classes/image/stb_image.cpp
f7343296f358bbb649dde4629fbc551ba0184e46
[ "MIT" ]
permissive
Kuovane/cocos2dx-swf
c8b1304d391d1954c76595a48cd2c3ef0af846a9
72e4c8ee6bb0f4ab601deba5ab760a2b716f838c
refs/heads/master
2022-12-16T10:58:01.644871
2020-09-08T09:39:52
2020-09-08T09:39:52
274,286,916
0
0
MIT
2020-06-23T02:11:49
2020-06-23T02:11:49
null
UTF-8
C++
false
false
268
cpp
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION #define STB_RECT_PACK_IMPLEMENTATION #define STB_IMAGE_RESIZE_IMPLEMENTATION #include "stb_image.h" #include "stb_image_write.h" #include "stb_rect_pack.h" #include "stb_image_resize.h"
[ "811408414@qq.com" ]
811408414@qq.com
6439daaaf581524056f0ad74a28bf8266f301f86
83e4bc9c01518ae0f42d578cf5a8b8a07236ba48
/Unit9/ChooseSort/SelectSort.cpp
19246bbf6a6f51a69b39203010ad363a708a17dd
[]
no_license
Luolin0826/DataStruct
bb3adb598bb106acba655cc4e039d9226de715ae
578bcb042fd2d6ea6ddef694343039f2bded5548
refs/heads/master
2023-08-30T01:46:22.532999
2021-11-16T14:06:32
2021-11-16T14:06:32
null
0
0
null
null
null
null
GB18030
C++
false
false
3,538
cpp
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXSIZE 20 typedef int KeyType; typedef struct { KeyType key; } DataType; typedef struct { DataType r[MAXSIZE + 1]; // r[0]闲置或充当前哨站 int length; } SqList; //快速选择排序 void SelectSort(SqList* s) { int i, j, t; for (i = 1; i < s->length; i++) { for (j = i + 1, t = i; j <= s->length; j++) { if (s->r[t].key > s->r[j].key) { //选取最小值 t = j; } } s->r[0] = s->r[i]; s->r[i] = s->r[t]; s->r[t] = s->r[0]; } } //堆排序 //大根堆调整 n是断点结点的位置 m是元素个数 void HeapAdjust(SqList* s, int n, int m) { int i, j; DataType tmp = s->r[n]; i = n; for (j = i * 2; j <= m; j = j * 2) { // i是双亲,j是子节点 if (j < m && s->r[j].key < s->r[j + 1].key) { // j<m是为了有右子树 j++; } //这里有错误 不能用s->r[i].key >= s->r[j].key //因为在二层循环时,s.r[i]是没有被赋值成顶点值的,对比元素依旧会按照原来的那个子节点元素来 //所以必须要用最开始记录的tmp的值来做对比 if (tmp.key >= s->r[j].key) { break; } else { s->r[i].key = s->r[j].key; //把 孩子赋值给双亲之后 还要继续判断是否能把双亲插入到孩子结点上 i = j; //如此作为下一级循环的条件 在满足2j<len的条件下 i作为双亲 } } //在循环结束后,我们得到了可插入的位置i,将最开始存储的元素tmp复制到该位置上 //因为在终止条件的作用下 j=j*2,得到的j已经是子节点的下标了; s->r[i] = tmp; } //建立大根堆 void HeapBuild(SqList* s) { for (int i = s->length / 2; i > 0; i--) { HeapAdjust(s, i, s->length); } } //大根堆排序算法 void HeapSort(SqList* s) { int j; DataType tmp; //建立大根堆 HeapBuild(s); //根据大根堆排序 for (j = s->length; j > 0; j--) { //因为大根堆的顶点总是最大值,所以将顶点与最后的节点交换 tmp = s->r[j]; s->r[j] = s->r[1]; s->r[1] = tmp; //下面在排序一趟 让1的位置又是最大支 注意长度要-1 //因为那个位置已经填入了有序的最大值 HeapAdjust(s, 1, j - 1); } } //大根堆插入元素 插入的元素的key void HeapInsert(SqList* s, KeyType key) { HeapBuild(s); s->length++; s->r[s->length].key = key; //将关键子存在堆的最后一个位置 int t = s->length,i; DataType tmp ; for (i = t / 2; i > 0; i = i / 2) { //这里i是双亲结点 if (s->r[i].key > s->r[t].key) { //双亲结点的值大于插入的结点 break; } else { tmp = s->r[i]; s->r[i] = s->r[t]; s->r[t] = tmp; t = i; } } } //赋值操作 n为数组内元素的个数 void InitList(SqList* s, int a[], int n) { s->length = 0; s->r[0].key = 0; for (int i = 1; i <= n; i++) { s->r[i].key = a[i - 1]; s->length++; } } //显示 void PrintfList(SqList s) { for (int i = 1; i <= s.length; i++) { printf("%d ", s.r[i].key); } } int main(int argc, char** argv) { SqList s, p; int a[10] = {0, 1, 8, 3, 7, 5, 6, 4, 2, 9}; InitList(&s, a, 10); InitList(&p, a, 10); //直接插入排序 SelectSort(&s); printf("简单选择排序结果为:"); PrintfList(s); //堆排序 // HeapSort(&p); HeapInsert(&p, 5); HeapSort(&p); printf("\n堆排序结果为:"); PrintfList(p); system("pause"); return 0; }
[ "1015412462@qq.com" ]
1015412462@qq.com
f74229e6a9e45060869cad432eb0e84529602ed4
c112e15b49ec039e27c54ff855aae34f3ec90eac
/Fragmenter/UpdelStorage.cpp
f6ae6a9b13d2fc42743891e75bc9dc17aeadece5
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
socal-ucr/omniscidb-UM
26b39670dc17cc9c964f978bc64ba4c5226bbad9
c6fa9b7a352e8a06447322a02dfeaded5c56603d
refs/heads/master
2023-08-22T12:44:15.489100
2021-03-24T18:45:32
2021-03-26T16:27:32
351,906,896
0
0
null
null
null
null
UTF-8
C++
false
false
57,810
cpp
/* * Copyright 2017 MapD Technologies, 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 <algorithm> #include <boost/variant.hpp> #include <boost/variant/get.hpp> #include <limits> #include <mutex> #include <string> #include <vector> #include "Catalog/Catalog.h" #include "DataMgr/DataMgr.h" #include "DataMgr/FixedLengthArrayNoneEncoder.h" #include "Fragmenter/InsertOrderFragmenter.h" #include "LockMgr/LockMgr.h" #include "Logger/Logger.h" #include "QueryEngine/Execute.h" #include "QueryEngine/TargetValue.h" #include "Shared/DateConverters.h" #include "Shared/TypedDataAccessors.h" #include "Shared/thread_count.h" #include "TargetValueConvertersFactories.h" extern bool g_enable_experimental_string_functions; bool g_enable_auto_metadata_update{true}; namespace Fragmenter_Namespace { inline void wait_cleanup_threads(std::vector<std::future<void>>& threads) { for (auto& t : threads) { t.get(); } threads.clear(); } inline bool is_integral(const SQLTypeInfo& t) { return t.is_integer() || t.is_boolean() || t.is_time() || t.is_timeinterval(); } bool FragmentInfo::unconditionalVacuum_{false}; void InsertOrderFragmenter::updateColumn(const Catalog_Namespace::Catalog* catalog, const TableDescriptor* td, const ColumnDescriptor* cd, const int fragment_id, const std::vector<uint64_t>& frag_offsets, const ScalarTargetValue& rhs_value, const SQLTypeInfo& rhs_type, const Data_Namespace::MemoryLevel memory_level, UpdelRoll& updel_roll) { updateColumn(catalog, td, cd, fragment_id, frag_offsets, std::vector<ScalarTargetValue>(1, rhs_value), rhs_type, memory_level, updel_roll); } static int get_chunks(const Catalog_Namespace::Catalog* catalog, const TableDescriptor* td, const FragmentInfo& fragment, const Data_Namespace::MemoryLevel memory_level, std::vector<std::shared_ptr<Chunk_NS::Chunk>>& chunks) { for (int cid = 1, nc = 0; nc < td->nColumns; ++cid) { if (const auto cd = catalog->getMetadataForColumn(td->tableId, cid)) { ++nc; if (!cd->isVirtualCol) { auto chunk_meta_it = fragment.getChunkMetadataMapPhysical().find(cid); CHECK(chunk_meta_it != fragment.getChunkMetadataMapPhysical().end()); ChunkKey chunk_key{ catalog->getCurrentDB().dbId, td->tableId, cid, fragment.fragmentId}; auto chunk = Chunk_NS::Chunk::getChunk(cd, &catalog->getDataMgr(), chunk_key, memory_level, 0, chunk_meta_it->second->numBytes, chunk_meta_it->second->numElements); chunks.push_back(chunk); } } } return chunks.size(); } struct ChunkToInsertDataConverter { public: virtual ~ChunkToInsertDataConverter() {} virtual void convertToColumnarFormat(size_t row, size_t indexInFragment) = 0; virtual void addDataBlocksToInsertData( Fragmenter_Namespace::InsertData& insertData) = 0; }; template <typename BUFFER_DATA_TYPE, typename INSERT_DATA_TYPE> struct ScalarChunkConverter : public ChunkToInsertDataConverter { using ColumnDataPtr = std::unique_ptr<INSERT_DATA_TYPE, CheckedMallocDeleter<INSERT_DATA_TYPE>>; const Chunk_NS::Chunk* chunk_; ColumnDataPtr column_data_; const ColumnDescriptor* column_descriptor_; const BUFFER_DATA_TYPE* data_buffer_addr_; ScalarChunkConverter(const size_t num_rows, const Chunk_NS::Chunk* chunk) : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) { column_data_ = ColumnDataPtr(reinterpret_cast<INSERT_DATA_TYPE*>( checked_malloc(num_rows * sizeof(INSERT_DATA_TYPE)))); data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->getBuffer()->getMemoryPtr(); } ~ScalarChunkConverter() override {} void convertToColumnarFormat(size_t row, size_t indexInFragment) override { auto buffer_value = data_buffer_addr_[indexInFragment]; auto insert_value = static_cast<INSERT_DATA_TYPE>(buffer_value); column_data_.get()[row] = insert_value; } void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData& insertData) override { DataBlockPtr dataBlock; dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get()); insertData.data.push_back(dataBlock); insertData.columnIds.push_back(column_descriptor_->columnId); } }; struct FixedLenArrayChunkConverter : public ChunkToInsertDataConverter { const Chunk_NS::Chunk* chunk_; const ColumnDescriptor* column_descriptor_; std::unique_ptr<std::vector<ArrayDatum>> column_data_; int8_t* data_buffer_addr_; size_t fixed_array_length_; FixedLenArrayChunkConverter(const size_t num_rows, const Chunk_NS::Chunk* chunk) : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) { column_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows); data_buffer_addr_ = chunk->getBuffer()->getMemoryPtr(); fixed_array_length_ = chunk->getColumnDesc()->columnType.get_size(); } ~FixedLenArrayChunkConverter() override {} void convertToColumnarFormat(size_t row, size_t indexInFragment) override { auto src_value_ptr = data_buffer_addr_ + (indexInFragment * fixed_array_length_); bool is_null = FixedLengthArrayNoneEncoder::is_null(column_descriptor_->columnType, src_value_ptr); (*column_data_)[row] = ArrayDatum( fixed_array_length_, (int8_t*)src_value_ptr, is_null, DoNothingDeleter()); } void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData& insertData) override { DataBlockPtr dataBlock; dataBlock.arraysPtr = column_data_.get(); insertData.data.push_back(dataBlock); insertData.columnIds.push_back(column_descriptor_->columnId); } }; struct ArrayChunkConverter : public FixedLenArrayChunkConverter { ArrayOffsetT* index_buffer_addr_; ArrayChunkConverter(const size_t num_rows, const Chunk_NS::Chunk* chunk) : FixedLenArrayChunkConverter(num_rows, chunk) { index_buffer_addr_ = (StringOffsetT*)(chunk->getIndexBuf() ? chunk->getIndexBuf()->getMemoryPtr() : nullptr); } ~ArrayChunkConverter() override {} void convertToColumnarFormat(size_t row, size_t indexInFragment) override { auto startIndex = index_buffer_addr_[indexInFragment]; auto endIndex = index_buffer_addr_[indexInFragment + 1]; size_t src_value_size = std::abs(endIndex) - std::abs(startIndex); auto src_value_ptr = data_buffer_addr_ + index_buffer_addr_[indexInFragment]; (*column_data_)[row] = ArrayDatum( src_value_size, (int8_t*)src_value_ptr, endIndex < 0, DoNothingDeleter()); } }; struct StringChunkConverter : public ChunkToInsertDataConverter { const Chunk_NS::Chunk* chunk_; const ColumnDescriptor* column_descriptor_; std::unique_ptr<std::vector<std::string>> column_data_; const int8_t* data_buffer_addr_; const StringOffsetT* index_buffer_addr_; StringChunkConverter(size_t num_rows, const Chunk_NS::Chunk* chunk) : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) { column_data_ = std::make_unique<std::vector<std::string>>(num_rows); data_buffer_addr_ = chunk->getBuffer()->getMemoryPtr(); index_buffer_addr_ = (StringOffsetT*)(chunk->getIndexBuf() ? chunk->getIndexBuf()->getMemoryPtr() : nullptr); } ~StringChunkConverter() override {} void convertToColumnarFormat(size_t row, size_t indexInFragment) override { size_t src_value_size = index_buffer_addr_[indexInFragment + 1] - index_buffer_addr_[indexInFragment]; auto src_value_ptr = data_buffer_addr_ + index_buffer_addr_[indexInFragment]; (*column_data_)[row] = std::string((const char*)src_value_ptr, src_value_size); } void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData& insertData) override { DataBlockPtr dataBlock; dataBlock.stringsPtr = column_data_.get(); insertData.data.push_back(dataBlock); insertData.columnIds.push_back(column_descriptor_->columnId); } }; template <typename BUFFER_DATA_TYPE> struct DateChunkConverter : public ChunkToInsertDataConverter { using ColumnDataPtr = std::unique_ptr<int64_t, CheckedMallocDeleter<int64_t>>; const Chunk_NS::Chunk* chunk_; ColumnDataPtr column_data_; const ColumnDescriptor* column_descriptor_; const BUFFER_DATA_TYPE* data_buffer_addr_; DateChunkConverter(const size_t num_rows, const Chunk_NS::Chunk* chunk) : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) { column_data_ = ColumnDataPtr( reinterpret_cast<int64_t*>(checked_malloc(num_rows * sizeof(int64_t)))); data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->getBuffer()->getMemoryPtr(); } ~DateChunkConverter() override {} void convertToColumnarFormat(size_t row, size_t indexInFragment) override { auto buffer_value = data_buffer_addr_[indexInFragment]; auto insert_value = static_cast<int64_t>(buffer_value); column_data_.get()[row] = DateConverters::get_epoch_seconds_from_days(insert_value); } void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData& insertData) override { DataBlockPtr dataBlock; dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get()); insertData.data.push_back(dataBlock); insertData.columnIds.push_back(column_descriptor_->columnId); } }; void InsertOrderFragmenter::updateColumns( const Catalog_Namespace::Catalog* catalog, const TableDescriptor* td, const int fragmentId, const std::vector<TargetMetaInfo> sourceMetaInfo, const std::vector<const ColumnDescriptor*> columnDescriptors, const RowDataProvider& sourceDataProvider, const size_t indexOffFragmentOffsetColumn, const Data_Namespace::MemoryLevel memoryLevel, UpdelRoll& updelRoll, Executor* executor) { updelRoll.is_varlen_update = true; updelRoll.catalog = catalog; updelRoll.logicalTableId = catalog->getLogicalTableId(td->tableId); updelRoll.memoryLevel = memoryLevel; size_t num_entries = sourceDataProvider.getEntryCount(); size_t num_rows = sourceDataProvider.getRowCount(); if (0 == num_rows) { // bail out early return; } TargetValueConverterFactory factory; auto fragment_ptr = getFragmentInfo(fragmentId); auto& fragment = *fragment_ptr; std::vector<std::shared_ptr<Chunk_NS::Chunk>> chunks; get_chunks(catalog, td, fragment, memoryLevel, chunks); std::vector<std::unique_ptr<TargetValueConverter>> sourceDataConverters( columnDescriptors.size()); std::vector<std::unique_ptr<ChunkToInsertDataConverter>> chunkConverters; std::shared_ptr<Chunk_NS::Chunk> deletedChunk; for (size_t indexOfChunk = 0; indexOfChunk < chunks.size(); indexOfChunk++) { auto chunk = chunks[indexOfChunk]; const auto chunk_cd = chunk->getColumnDesc(); if (chunk_cd->isDeletedCol) { deletedChunk = chunk; continue; } auto targetColumnIt = std::find_if(columnDescriptors.begin(), columnDescriptors.end(), [=](const ColumnDescriptor* cd) -> bool { return cd->columnId == chunk_cd->columnId; }); if (targetColumnIt != columnDescriptors.end()) { auto indexOfTargetColumn = std::distance(columnDescriptors.begin(), targetColumnIt); auto sourceDataMetaInfo = sourceMetaInfo[indexOfTargetColumn]; auto targetDescriptor = columnDescriptors[indexOfTargetColumn]; ConverterCreateParameter param{ num_rows, *catalog, sourceDataMetaInfo, targetDescriptor, targetDescriptor->columnType, !targetDescriptor->columnType.get_notnull(), sourceDataProvider.getLiteralDictionary(), g_enable_experimental_string_functions ? executor->getStringDictionaryProxy( sourceDataMetaInfo.get_type_info().get_comp_param(), executor->getRowSetMemoryOwner(), true) : nullptr}; auto converter = factory.create(param); sourceDataConverters[indexOfTargetColumn] = std::move(converter); if (targetDescriptor->columnType.is_geometry()) { // geometry columns are composites // need to skip chunks, depending on geo type switch (targetDescriptor->columnType.get_type()) { case kMULTIPOLYGON: indexOfChunk += 5; break; case kPOLYGON: indexOfChunk += 4; break; case kLINESTRING: indexOfChunk += 2; break; case kPOINT: indexOfChunk += 1; break; default: CHECK(false); // not supported } } } else { if (chunk_cd->columnType.is_varlen() || chunk_cd->columnType.is_fixlen_array()) { std::unique_ptr<ChunkToInsertDataConverter> converter; if (chunk_cd->columnType.is_fixlen_array()) { converter = std::make_unique<FixedLenArrayChunkConverter>(num_rows, chunk.get()); } else if (chunk_cd->columnType.is_string()) { converter = std::make_unique<StringChunkConverter>(num_rows, chunk.get()); } else if (chunk_cd->columnType.is_geometry()) { // the logical geo column is a string column converter = std::make_unique<StringChunkConverter>(num_rows, chunk.get()); } else { converter = std::make_unique<ArrayChunkConverter>(num_rows, chunk.get()); } chunkConverters.push_back(std::move(converter)); } else if (chunk_cd->columnType.is_date_in_days()) { /* Q: Why do we need this? A: In variable length updates path we move the chunk content of column without decoding. Since it again passes through DateDaysEncoder the expected value should be in seconds, but here it will be in days. Therefore, using DateChunkConverter chunk values are being scaled to seconds which then ultimately encoded in days in DateDaysEncoder. */ std::unique_ptr<ChunkToInsertDataConverter> converter; const size_t physical_size = chunk_cd->columnType.get_size(); if (physical_size == 2) { converter = std::make_unique<DateChunkConverter<int16_t>>(num_rows, chunk.get()); } else if (physical_size == 4) { converter = std::make_unique<DateChunkConverter<int32_t>>(num_rows, chunk.get()); } else { CHECK(false); } chunkConverters.push_back(std::move(converter)); } else { std::unique_ptr<ChunkToInsertDataConverter> converter; SQLTypeInfo logical_type = get_logical_type_info(chunk_cd->columnType); int logical_size = logical_type.get_size(); int physical_size = chunk_cd->columnType.get_size(); if (logical_type.is_string()) { // for dicts -> logical = physical logical_size = physical_size; } if (8 == physical_size) { converter = std::make_unique<ScalarChunkConverter<int64_t, int64_t>>( num_rows, chunk.get()); } else if (4 == physical_size) { if (8 == logical_size) { converter = std::make_unique<ScalarChunkConverter<int32_t, int64_t>>( num_rows, chunk.get()); } else { converter = std::make_unique<ScalarChunkConverter<int32_t, int32_t>>( num_rows, chunk.get()); } } else if (2 == chunk_cd->columnType.get_size()) { if (8 == logical_size) { converter = std::make_unique<ScalarChunkConverter<int16_t, int64_t>>( num_rows, chunk.get()); } else if (4 == logical_size) { converter = std::make_unique<ScalarChunkConverter<int16_t, int32_t>>( num_rows, chunk.get()); } else { converter = std::make_unique<ScalarChunkConverter<int16_t, int16_t>>( num_rows, chunk.get()); } } else if (1 == chunk_cd->columnType.get_size()) { if (8 == logical_size) { converter = std::make_unique<ScalarChunkConverter<int8_t, int64_t>>( num_rows, chunk.get()); } else if (4 == logical_size) { converter = std::make_unique<ScalarChunkConverter<int8_t, int32_t>>( num_rows, chunk.get()); } else if (2 == logical_size) { converter = std::make_unique<ScalarChunkConverter<int8_t, int16_t>>( num_rows, chunk.get()); } else { converter = std::make_unique<ScalarChunkConverter<int8_t, int8_t>>( num_rows, chunk.get()); } } else { CHECK(false); // unknown } chunkConverters.push_back(std::move(converter)); } } } static boost_variant_accessor<ScalarTargetValue> SCALAR_TARGET_VALUE_ACCESSOR; static boost_variant_accessor<int64_t> OFFSET_VALUE__ACCESSOR; updelRoll.dirtyChunks[deletedChunk.get()] = deletedChunk; ChunkKey chunkey{updelRoll.catalog->getCurrentDB().dbId, deletedChunk->getColumnDesc()->tableId, deletedChunk->getColumnDesc()->columnId, fragment.fragmentId}; updelRoll.dirtyChunkeys.insert(chunkey); bool* deletedChunkBuffer = reinterpret_cast<bool*>(deletedChunk->getBuffer()->getMemoryPtr()); std::atomic<size_t> row_idx{0}; auto row_converter = [&sourceDataProvider, &sourceDataConverters, &indexOffFragmentOffsetColumn, &chunkConverters, &deletedChunkBuffer, &row_idx](size_t indexOfEntry) -> void { // convert the source data const auto row = sourceDataProvider.getEntryAt(indexOfEntry); if (row.empty()) { return; } size_t indexOfRow = row_idx.fetch_add(1); for (size_t col = 0; col < sourceDataConverters.size(); col++) { if (sourceDataConverters[col]) { const auto& mapd_variant = row[col]; sourceDataConverters[col]->convertToColumnarFormat(indexOfRow, &mapd_variant); } } auto scalar = checked_get( indexOfRow, &row[indexOffFragmentOffsetColumn], SCALAR_TARGET_VALUE_ACCESSOR); auto indexInChunkBuffer = *checked_get(indexOfRow, scalar, OFFSET_VALUE__ACCESSOR); // convert the remaining chunks for (size_t idx = 0; idx < chunkConverters.size(); idx++) { chunkConverters[idx]->convertToColumnarFormat(indexOfRow, indexInChunkBuffer); } // now mark the row as deleted deletedChunkBuffer[indexInChunkBuffer] = true; }; bool can_go_parallel = num_rows > 20000; if (can_go_parallel) { const size_t num_worker_threads = cpu_threads(); std::vector<std::future<void>> worker_threads; for (size_t i = 0, start_entry = 0, stride = (num_entries + num_worker_threads - 1) / num_worker_threads; i < num_worker_threads && start_entry < num_entries; ++i, start_entry += stride) { const auto end_entry = std::min(start_entry + stride, num_rows); worker_threads.push_back(std::async( std::launch::async, [&row_converter](const size_t start, const size_t end) { for (size_t indexOfRow = start; indexOfRow < end; ++indexOfRow) { row_converter(indexOfRow); } }, start_entry, end_entry)); } for (auto& child : worker_threads) { child.wait(); } } else { for (size_t entryIdx = 0; entryIdx < num_entries; entryIdx++) { row_converter(entryIdx); } } Fragmenter_Namespace::InsertData insert_data; insert_data.databaseId = catalog->getCurrentDB().dbId; insert_data.tableId = td->tableId; for (size_t i = 0; i < chunkConverters.size(); i++) { chunkConverters[i]->addDataBlocksToInsertData(insert_data); continue; } for (size_t i = 0; i < sourceDataConverters.size(); i++) { if (sourceDataConverters[i]) { sourceDataConverters[i]->addDataBlocksToInsertData(insert_data); } continue; } insert_data.numRows = num_rows; insert_data.is_default.resize(insert_data.columnIds.size(), false); insertDataNoCheckpoint(insert_data); // update metdata if (!deletedChunk->getBuffer()->hasEncoder()) { deletedChunk->initEncoder(); } deletedChunk->getBuffer()->getEncoder()->updateStats(static_cast<int64_t>(true), false); if (fragment.shadowNumTuples > deletedChunk->getBuffer()->getEncoder()->getNumElems()) { // An append to the same fragment will increase shadowNumTuples. // Update NumElems in this case. Otherwise, use existing NumElems. deletedChunk->getBuffer()->getEncoder()->setNumElems(fragment.shadowNumTuples); } deletedChunk->getBuffer()->setUpdated(); } namespace { inline void update_metadata(SQLTypeInfo const& ti, ChunkUpdateStats& update_stats, int64_t const updated_val, int64_t const old_val, NullSentinelSupplier s = NullSentinelSupplier()) { if (ti.get_notnull()) { set_minmax(update_stats.new_values_stats.min_int64t, update_stats.new_values_stats.max_int64t, updated_val); set_minmax(update_stats.old_values_stats.min_int64t, update_stats.old_values_stats.max_int64t, old_val); } else { set_minmax(update_stats.new_values_stats.min_int64t, update_stats.new_values_stats.max_int64t, update_stats.new_values_stats.has_null, updated_val, s(ti, updated_val)); set_minmax(update_stats.old_values_stats.min_int64t, update_stats.old_values_stats.max_int64t, update_stats.old_values_stats.has_null, old_val, s(ti, old_val)); } } inline void update_metadata(SQLTypeInfo const& ti, ChunkUpdateStats& update_stats, double const updated_val, double const old_val, NullSentinelSupplier s = NullSentinelSupplier()) { if (ti.get_notnull()) { set_minmax(update_stats.new_values_stats.min_double, update_stats.new_values_stats.max_double, updated_val); set_minmax(update_stats.old_values_stats.min_double, update_stats.old_values_stats.max_double, old_val); } else { set_minmax(update_stats.new_values_stats.min_double, update_stats.new_values_stats.max_double, update_stats.new_values_stats.has_null, updated_val, s(ti, updated_val)); set_minmax(update_stats.old_values_stats.min_double, update_stats.old_values_stats.max_double, update_stats.old_values_stats.has_null, old_val, s(ti, old_val)); } } inline void update_metadata(UpdateValuesStats& agg_stats, const UpdateValuesStats& new_stats) { agg_stats.has_null = agg_stats.has_null || new_stats.has_null; agg_stats.max_double = std::max<double>(agg_stats.max_double, new_stats.max_double); agg_stats.min_double = std::min<double>(agg_stats.min_double, new_stats.min_double); agg_stats.max_int64t = std::max<int64_t>(agg_stats.max_int64t, new_stats.max_int64t); agg_stats.min_int64t = std::min<int64_t>(agg_stats.min_int64t, new_stats.min_int64t); } } // namespace std::optional<ChunkUpdateStats> InsertOrderFragmenter::updateColumn( const Catalog_Namespace::Catalog* catalog, const TableDescriptor* td, const ColumnDescriptor* cd, const int fragment_id, const std::vector<uint64_t>& frag_offsets, const std::vector<ScalarTargetValue>& rhs_values, const SQLTypeInfo& rhs_type, const Data_Namespace::MemoryLevel memory_level, UpdelRoll& updel_roll) { updel_roll.catalog = catalog; updel_roll.logicalTableId = catalog->getLogicalTableId(td->tableId); updel_roll.memoryLevel = memory_level; const size_t ncore = cpu_threads(); const auto nrow = frag_offsets.size(); const auto n_rhs_values = rhs_values.size(); if (0 == nrow) { return {}; } CHECK(nrow == n_rhs_values || 1 == n_rhs_values); auto fragment_ptr = getFragmentInfo(fragment_id); auto& fragment = *fragment_ptr; auto chunk_meta_it = fragment.getChunkMetadataMapPhysical().find(cd->columnId); CHECK(chunk_meta_it != fragment.getChunkMetadataMapPhysical().end()); ChunkKey chunk_key{ catalog->getCurrentDB().dbId, td->tableId, cd->columnId, fragment.fragmentId}; auto chunk = Chunk_NS::Chunk::getChunk(cd, &catalog->getDataMgr(), chunk_key, Data_Namespace::CPU_LEVEL, 0, chunk_meta_it->second->numBytes, chunk_meta_it->second->numElements); std::vector<ChunkUpdateStats> update_stats_per_thread(ncore); // parallel update elements std::vector<std::future<void>> threads; const auto segsz = (nrow + ncore - 1) / ncore; auto dbuf = chunk->getBuffer(); auto dbuf_addr = dbuf->getMemoryPtr(); dbuf->setUpdated(); { std::lock_guard<std::mutex> lck(updel_roll.mutex); if (updel_roll.dirtyChunks.count(chunk.get()) == 0) { updel_roll.dirtyChunks.emplace(chunk.get(), chunk); } ChunkKey chunkey{updel_roll.catalog->getCurrentDB().dbId, cd->tableId, cd->columnId, fragment.fragmentId}; updel_roll.dirtyChunkeys.insert(chunkey); } for (size_t rbegin = 0, c = 0; rbegin < nrow; ++c, rbegin += segsz) { threads.emplace_back(std::async( std::launch::async, [=, &update_stats_per_thread, &frag_offsets, &rhs_values] { SQLTypeInfo lhs_type = cd->columnType; // !! not sure if this is a undocumented convention or a bug, but for a sharded // table the dictionary id of a encoded string column is not specified by // comp_param in physical table but somehow in logical table :) comp_param in // physical table is always 0, so need to adapt accordingly... auto cdl = (shard_ < 0) ? cd : catalog->getMetadataForColumn( catalog->getLogicalTableId(td->tableId), cd->columnId); CHECK(cdl); DecimalOverflowValidator decimalOverflowValidator(lhs_type); NullAwareValidator<DecimalOverflowValidator> nullAwareDecimalOverflowValidator( lhs_type, &decimalOverflowValidator); DateDaysOverflowValidator dateDaysOverflowValidator(lhs_type); NullAwareValidator<DateDaysOverflowValidator> nullAwareDateOverflowValidator( lhs_type, &dateDaysOverflowValidator); StringDictionary* stringDict{nullptr}; if (lhs_type.is_string()) { CHECK(kENCODING_DICT == lhs_type.get_compression()); auto dictDesc = const_cast<DictDescriptor*>( catalog->getMetadataForDict(cdl->columnType.get_comp_param())); CHECK(dictDesc); stringDict = dictDesc->stringDict.get(); CHECK(stringDict); } for (size_t r = rbegin; r < std::min(rbegin + segsz, nrow); r++) { const auto roffs = frag_offsets[r]; auto data_ptr = dbuf_addr + roffs * get_element_size(lhs_type); auto sv = &rhs_values[1 == n_rhs_values ? 0 : r]; ScalarTargetValue sv2; // Subtle here is on the two cases of string-to-string assignments, when // upstream passes RHS string as a string index instead of a preferred "real // string". // case #1. For "SET str_col = str_literal", it is hard to resolve temp str // index // in this layer, so if upstream passes a str idx here, an // exception is thrown. // case #2. For "SET str_col1 = str_col2", RHS str idx is converted to LHS // str idx. if (rhs_type.is_string()) { if (const auto vp = boost::get<int64_t>(sv)) { auto dictDesc = const_cast<DictDescriptor*>( catalog->getMetadataForDict(rhs_type.get_comp_param())); if (nullptr == dictDesc) { throw std::runtime_error( "UPDATE does not support cast from string literal to string " "column."); } auto stringDict = dictDesc->stringDict.get(); CHECK(stringDict); sv2 = NullableString(stringDict->getString(*vp)); sv = &sv2; } } if (const auto vp = boost::get<int64_t>(sv)) { auto v = *vp; if (lhs_type.is_string()) { throw std::runtime_error("UPDATE does not support cast to string."); } int64_t old_val; get_scalar<int64_t>(data_ptr, lhs_type, old_val); // Handle special case where date column with date in days encoding stores // metadata in epoch seconds. if (lhs_type.is_date_in_days()) { old_val = DateConverters::get_epoch_seconds_from_days(old_val); } put_scalar<int64_t>(data_ptr, lhs_type, v, cd->columnName, &rhs_type); if (lhs_type.is_decimal()) { nullAwareDecimalOverflowValidator.validate<int64_t>(v); int64_t decimal_val; get_scalar<int64_t>(data_ptr, lhs_type, decimal_val); int64_t target_value = (v == inline_int_null_value<int64_t>() && lhs_type.get_notnull() == false) ? v : decimal_val; update_metadata( lhs_type, update_stats_per_thread[c], target_value, old_val); auto const positive_v_and_negative_d = (v >= 0) && (decimal_val < 0); auto const negative_v_and_positive_d = (v < 0) && (decimal_val >= 0); if (positive_v_and_negative_d || negative_v_and_positive_d) { throw std::runtime_error( "Data conversion overflow on " + std::to_string(v) + " from DECIMAL(" + std::to_string(rhs_type.get_dimension()) + ", " + std::to_string(rhs_type.get_scale()) + ") to (" + std::to_string(lhs_type.get_dimension()) + ", " + std::to_string(lhs_type.get_scale()) + ")"); } } else if (is_integral(lhs_type)) { if (lhs_type.is_date_in_days()) { // Store meta values in seconds if (lhs_type.get_size() == 2) { nullAwareDateOverflowValidator.validate<int16_t>(v); } else { nullAwareDateOverflowValidator.validate<int32_t>(v); } int64_t days; get_scalar<int64_t>(data_ptr, lhs_type, days); const auto seconds = DateConverters::get_epoch_seconds_from_days(days); int64_t target_value = (v == inline_int_null_value<int64_t>() && lhs_type.get_notnull() == false) ? NullSentinelSupplier()(lhs_type, v) : seconds; update_metadata( lhs_type, update_stats_per_thread[c], target_value, old_val); } else { int64_t target_value; if (rhs_type.is_decimal()) { target_value = round(decimal_to_double(rhs_type, v)); } else { target_value = v; } update_metadata( lhs_type, update_stats_per_thread[c], target_value, old_val); } } else { if (rhs_type.is_decimal()) { update_metadata(lhs_type, update_stats_per_thread[c], decimal_to_double(rhs_type, v), double(old_val)); } else { update_metadata(lhs_type, update_stats_per_thread[c], v, old_val); } } } else if (const auto vp = boost::get<double>(sv)) { auto v = *vp; if (lhs_type.is_string()) { throw std::runtime_error("UPDATE does not support cast to string."); } double old_val; get_scalar<double>(data_ptr, lhs_type, old_val); put_scalar<double>(data_ptr, lhs_type, v, cd->columnName); if (lhs_type.is_integer()) { update_metadata( lhs_type, update_stats_per_thread[c], int64_t(v), int64_t(old_val)); } else if (lhs_type.is_fp()) { update_metadata( lhs_type, update_stats_per_thread[c], double(v), double(old_val)); } else { UNREACHABLE() << "Unexpected combination of a non-floating or integer " "LHS with a floating RHS."; } } else if (const auto vp = boost::get<float>(sv)) { auto v = *vp; if (lhs_type.is_string()) { throw std::runtime_error("UPDATE does not support cast to string."); } float old_val; get_scalar<float>(data_ptr, lhs_type, old_val); put_scalar<float>(data_ptr, lhs_type, v, cd->columnName); if (lhs_type.is_integer()) { update_metadata( lhs_type, update_stats_per_thread[c], int64_t(v), int64_t(old_val)); } else { update_metadata(lhs_type, update_stats_per_thread[c], double(v), old_val); } } else if (const auto vp = boost::get<NullableString>(sv)) { const auto s = boost::get<std::string>(vp); const auto sval = s ? *s : std::string(""); if (lhs_type.is_string()) { decltype(stringDict->getOrAdd(sval)) sidx; { std::unique_lock<std::mutex> lock(temp_mutex_); sidx = stringDict->getOrAdd(sval); } int64_t old_val; get_scalar<int64_t>(data_ptr, lhs_type, old_val); put_scalar<int64_t>(data_ptr, lhs_type, sidx, cd->columnName); update_metadata( lhs_type, update_stats_per_thread[c], int64_t(sidx), old_val); } else if (sval.size() > 0) { auto dval = std::atof(sval.data()); if (lhs_type.is_boolean()) { dval = sval == "t" || sval == "true" || sval == "T" || sval == "True"; } else if (lhs_type.is_time()) { throw std::runtime_error( "Date/Time/Timestamp update not supported through translated " "string path."); } if (lhs_type.is_fp() || lhs_type.is_decimal()) { double old_val; get_scalar<double>(data_ptr, lhs_type, old_val); put_scalar<double>(data_ptr, lhs_type, dval, cd->columnName); update_metadata( lhs_type, update_stats_per_thread[c], double(dval), old_val); } else { int64_t old_val; get_scalar<int64_t>(data_ptr, lhs_type, old_val); put_scalar<int64_t>(data_ptr, lhs_type, dval, cd->columnName); update_metadata( lhs_type, update_stats_per_thread[c], int64_t(dval), old_val); } } else { put_null(data_ptr, lhs_type, cd->columnName); update_stats_per_thread[c].new_values_stats.has_null = true; } } else { CHECK(false); } } })); if (threads.size() >= (size_t)cpu_threads()) { wait_cleanup_threads(threads); } } wait_cleanup_threads(threads); // for unit test if (Fragmenter_Namespace::FragmentInfo::unconditionalVacuum_) { if (cd->isDeletedCol) { const auto deleted_offsets = getVacuumOffsets(chunk); if (deleted_offsets.size() > 0) { compactRows(catalog, td, fragment_id, deleted_offsets, memory_level, updel_roll); return {}; } } } ChunkUpdateStats update_stats; for (size_t c = 0; c < ncore; ++c) { update_metadata(update_stats.new_values_stats, update_stats_per_thread[c].new_values_stats); update_metadata(update_stats.old_values_stats, update_stats_per_thread[c].old_values_stats); } CHECK_GT(fragment.shadowNumTuples, size_t(0)); updateColumnMetadata( cd, fragment, chunk, update_stats.new_values_stats, cd->columnType, updel_roll); update_stats.updated_rows_count = nrow; update_stats.fragment_rows_count = fragment.shadowNumTuples; update_stats.chunk = chunk; return update_stats; } void InsertOrderFragmenter::updateColumnMetadata( const ColumnDescriptor* cd, FragmentInfo& fragment, std::shared_ptr<Chunk_NS::Chunk> chunk, const UpdateValuesStats& new_values_stats, const SQLTypeInfo& rhs_type, UpdelRoll& updel_roll) { auto td = updel_roll.catalog->getMetadataForTable(cd->tableId); auto key = std::make_pair(td, &fragment); std::lock_guard<std::mutex> lck(updel_roll.mutex); if (0 == updel_roll.chunkMetadata.count(key)) { updel_roll.chunkMetadata[key] = fragment.getChunkMetadataMapPhysical(); } if (0 == updel_roll.numTuples.count(key)) { updel_roll.numTuples[key] = fragment.shadowNumTuples; } auto& chunkMetadata = updel_roll.chunkMetadata[key]; auto buffer = chunk->getBuffer(); const auto& lhs_type = cd->columnType; auto encoder = buffer->getEncoder(); auto update_stats = [&encoder](auto min, auto max, auto has_null) { static_assert(std::is_same<decltype(min), decltype(max)>::value, "Type mismatch on min/max"); if (has_null) { encoder->updateStats(decltype(min)(), true); } if (max < min) { return; } encoder->updateStats(min, false); encoder->updateStats(max, false); }; if (is_integral(lhs_type) || (lhs_type.is_decimal() && rhs_type.is_decimal())) { update_stats(new_values_stats.min_int64t, new_values_stats.max_int64t, new_values_stats.has_null); } else if (lhs_type.is_fp()) { update_stats(new_values_stats.min_double, new_values_stats.max_double, new_values_stats.has_null); } else if (lhs_type.is_decimal()) { update_stats((int64_t)(new_values_stats.min_double * pow(10, lhs_type.get_scale())), (int64_t)(new_values_stats.max_double * pow(10, lhs_type.get_scale())), new_values_stats.has_null); } else if (!lhs_type.is_array() && !lhs_type.is_geometry() && !(lhs_type.is_string() && kENCODING_DICT != lhs_type.get_compression())) { update_stats(new_values_stats.min_int64t, new_values_stats.max_int64t, new_values_stats.has_null); } buffer->getEncoder()->getMetadata(chunkMetadata[cd->columnId]); } void InsertOrderFragmenter::updateMetadata(const Catalog_Namespace::Catalog* catalog, const MetaDataKey& key, UpdelRoll& updel_roll) { mapd_unique_lock<mapd_shared_mutex> writeLock(fragmentInfoMutex_); if (updel_roll.chunkMetadata.count(key)) { auto& fragmentInfo = *key.second; const auto& chunkMetadata = updel_roll.chunkMetadata[key]; fragmentInfo.shadowChunkMetadataMap = chunkMetadata; fragmentInfo.setChunkMetadataMap(chunkMetadata); fragmentInfo.shadowNumTuples = updel_roll.numTuples[key]; fragmentInfo.setPhysicalNumTuples(fragmentInfo.shadowNumTuples); } } auto InsertOrderFragmenter::getChunksForAllColumns( const TableDescriptor* td, const FragmentInfo& fragment, const Data_Namespace::MemoryLevel memory_level) { std::vector<std::shared_ptr<Chunk_NS::Chunk>> chunks; // coming from updateColumn (on '$delete$' column) we dont have chunks for all columns for (int col_id = 1, ncol = 0; ncol < td->nColumns; ++col_id) { if (const auto cd = catalog_->getMetadataForColumn(td->tableId, col_id)) { ++ncol; if (!cd->isVirtualCol) { auto chunk_meta_it = fragment.getChunkMetadataMapPhysical().find(col_id); CHECK(chunk_meta_it != fragment.getChunkMetadataMapPhysical().end()); ChunkKey chunk_key{ catalog_->getCurrentDB().dbId, td->tableId, col_id, fragment.fragmentId}; auto chunk = Chunk_NS::Chunk::getChunk(cd, &catalog_->getDataMgr(), chunk_key, memory_level, 0, chunk_meta_it->second->numBytes, chunk_meta_it->second->numElements); chunks.push_back(chunk); } } } return chunks; } // get a sorted vector of offsets of rows to vacuum const std::vector<uint64_t> InsertOrderFragmenter::getVacuumOffsets( const std::shared_ptr<Chunk_NS::Chunk>& chunk) { const auto data_buffer = chunk->getBuffer(); const auto data_addr = data_buffer->getMemoryPtr(); const size_t nrows_in_chunk = data_buffer->size(); const size_t ncore = cpu_threads(); const size_t segsz = (nrows_in_chunk + ncore - 1) / ncore; std::vector<std::vector<uint64_t>> deleted_offsets; deleted_offsets.resize(ncore); std::vector<std::future<void>> threads; for (size_t rbegin = 0; rbegin < nrows_in_chunk; rbegin += segsz) { threads.emplace_back(std::async(std::launch::async, [=, &deleted_offsets] { const auto rend = std::min<size_t>(rbegin + segsz, nrows_in_chunk); const auto ithread = rbegin / segsz; CHECK(ithread < deleted_offsets.size()); deleted_offsets[ithread].reserve(segsz); for (size_t r = rbegin; r < rend; ++r) { if (data_addr[r]) { deleted_offsets[ithread].push_back(r); } } })); } wait_cleanup_threads(threads); std::vector<uint64_t> all_deleted_offsets; for (size_t i = 0; i < ncore; ++i) { all_deleted_offsets.insert( all_deleted_offsets.end(), deleted_offsets[i].begin(), deleted_offsets[i].end()); } return all_deleted_offsets; } template <typename T> static void set_chunk_stats(const SQLTypeInfo& col_type, int8_t* data_addr, bool& has_null, T& min, T& max) { T v; const auto can_be_null = !col_type.get_notnull(); const auto is_null = get_scalar<T>(data_addr, col_type, v); if (is_null) { has_null = has_null || (can_be_null && is_null); } else { set_minmax(min, max, v); } } static void set_chunk_metadata(const Catalog_Namespace::Catalog* catalog, FragmentInfo& fragment, const std::shared_ptr<Chunk_NS::Chunk>& chunk, const size_t nrows_to_keep, UpdelRoll& updel_roll) { auto cd = chunk->getColumnDesc(); auto td = catalog->getMetadataForTable(cd->tableId); auto data_buffer = chunk->getBuffer(); std::lock_guard<std::mutex> lck(updel_roll.mutex); const auto key = std::make_pair(td, &fragment); if (0 == updel_roll.chunkMetadata.count(key)) { updel_roll.chunkMetadata[key] = fragment.getChunkMetadataMapPhysical(); } auto& chunkMetadata = updel_roll.chunkMetadata[key]; chunkMetadata[cd->columnId]->numElements = nrows_to_keep; chunkMetadata[cd->columnId]->numBytes = data_buffer->size(); if (updel_roll.dirtyChunks.count(chunk.get()) == 0) { updel_roll.dirtyChunks.emplace(chunk.get(), chunk); } } auto InsertOrderFragmenter::vacuum_fixlen_rows( const FragmentInfo& fragment, const std::shared_ptr<Chunk_NS::Chunk>& chunk, const std::vector<uint64_t>& frag_offsets) { const auto cd = chunk->getColumnDesc(); const auto& col_type = cd->columnType; auto data_buffer = chunk->getBuffer(); auto data_addr = data_buffer->getMemoryPtr(); auto element_size = col_type.is_fixlen_array() ? col_type.get_size() : get_element_size(col_type); int64_t irow_of_blk_to_keep = 0; // head of next row block to keep int64_t irow_of_blk_to_fill = 0; // row offset to fit the kept block size_t nbytes_fix_data_to_keep = 0; auto nrows_to_vacuum = frag_offsets.size(); auto nrows_in_fragment = fragment.getPhysicalNumTuples(); for (size_t irow = 0; irow <= nrows_to_vacuum; irow++) { auto is_last_one = irow == nrows_to_vacuum; auto irow_to_vacuum = is_last_one ? nrows_in_fragment : frag_offsets[irow]; auto maddr_to_vacuum = data_addr; int64_t nrows_to_keep = irow_to_vacuum - irow_of_blk_to_keep; if (nrows_to_keep > 0) { auto nbytes_to_keep = nrows_to_keep * element_size; if (irow_of_blk_to_fill != irow_of_blk_to_keep) { // move curr fixlen row block toward front memmove(maddr_to_vacuum + irow_of_blk_to_fill * element_size, maddr_to_vacuum + irow_of_blk_to_keep * element_size, nbytes_to_keep); } irow_of_blk_to_fill += nrows_to_keep; nbytes_fix_data_to_keep += nbytes_to_keep; } irow_of_blk_to_keep = irow_to_vacuum + 1; } return nbytes_fix_data_to_keep; } auto InsertOrderFragmenter::vacuum_varlen_rows( const FragmentInfo& fragment, const std::shared_ptr<Chunk_NS::Chunk>& chunk, const std::vector<uint64_t>& frag_offsets) { auto data_buffer = chunk->getBuffer(); auto index_buffer = chunk->getIndexBuf(); auto data_addr = data_buffer->getMemoryPtr(); auto indices_addr = index_buffer ? index_buffer->getMemoryPtr() : nullptr; auto index_array = (StringOffsetT*)indices_addr; int64_t irow_of_blk_to_keep = 0; // head of next row block to keep int64_t irow_of_blk_to_fill = 0; // row offset to fit the kept block size_t nbytes_fix_data_to_keep = 0; size_t nbytes_var_data_to_keep = 0; auto nrows_to_vacuum = frag_offsets.size(); auto nrows_in_fragment = fragment.getPhysicalNumTuples(); for (size_t irow = 0; irow <= nrows_to_vacuum; irow++) { auto is_last_one = irow == nrows_to_vacuum; auto irow_to_vacuum = is_last_one ? nrows_in_fragment : frag_offsets[irow]; auto maddr_to_vacuum = data_addr; int64_t nrows_to_keep = irow_to_vacuum - irow_of_blk_to_keep; if (nrows_to_keep > 0) { auto ibyte_var_data_to_keep = nbytes_var_data_to_keep; auto nbytes_to_keep = (is_last_one ? data_buffer->size() : index_array[irow_to_vacuum]) - index_array[irow_of_blk_to_keep]; if (irow_of_blk_to_fill != irow_of_blk_to_keep) { // move curr varlen row block toward front memmove(data_addr + ibyte_var_data_to_keep, data_addr + index_array[irow_of_blk_to_keep], nbytes_to_keep); const auto index_base = index_array[irow_of_blk_to_keep]; for (int64_t i = 0; i < nrows_to_keep; ++i) { auto& index = index_array[irow_of_blk_to_keep + i]; index = ibyte_var_data_to_keep + (index - index_base); } } nbytes_var_data_to_keep += nbytes_to_keep; maddr_to_vacuum = indices_addr; constexpr static auto index_element_size = sizeof(StringOffsetT); nbytes_to_keep = nrows_to_keep * index_element_size; if (irow_of_blk_to_fill != irow_of_blk_to_keep) { // move curr fixlen row block toward front memmove(maddr_to_vacuum + irow_of_blk_to_fill * index_element_size, maddr_to_vacuum + irow_of_blk_to_keep * index_element_size, nbytes_to_keep); } irow_of_blk_to_fill += nrows_to_keep; nbytes_fix_data_to_keep += nbytes_to_keep; } irow_of_blk_to_keep = irow_to_vacuum + 1; } return nbytes_var_data_to_keep; } void InsertOrderFragmenter::compactRows(const Catalog_Namespace::Catalog* catalog, const TableDescriptor* td, const int fragment_id, const std::vector<uint64_t>& frag_offsets, const Data_Namespace::MemoryLevel memory_level, UpdelRoll& updel_roll) { auto fragment_ptr = getFragmentInfo(fragment_id); auto& fragment = *fragment_ptr; auto chunks = getChunksForAllColumns(td, fragment, memory_level); const auto ncol = chunks.size(); std::vector<ChunkUpdateStats> update_stats_per_thread(ncol); // parallel delete columns std::vector<std::future<void>> threads; auto nrows_to_vacuum = frag_offsets.size(); auto nrows_in_fragment = fragment.getPhysicalNumTuples(); auto nrows_to_keep = nrows_in_fragment - nrows_to_vacuum; for (size_t ci = 0; ci < chunks.size(); ++ci) { auto chunk = chunks[ci]; const auto cd = chunk->getColumnDesc(); const auto& col_type = cd->columnType; auto data_buffer = chunk->getBuffer(); auto index_buffer = chunk->getIndexBuf(); auto data_addr = data_buffer->getMemoryPtr(); auto indices_addr = index_buffer ? index_buffer->getMemoryPtr() : nullptr; auto index_array = (StringOffsetT*)indices_addr; bool is_varlen = col_type.is_varlen_indeed(); auto fixlen_vacuum = [=, &update_stats_per_thread, &updel_roll, &frag_offsets, &fragment] { size_t nbytes_fix_data_to_keep; nbytes_fix_data_to_keep = vacuum_fixlen_rows(fragment, chunk, frag_offsets); data_buffer->getEncoder()->setNumElems(nrows_to_keep); data_buffer->setSize(nbytes_fix_data_to_keep); data_buffer->setUpdated(); set_chunk_metadata(catalog, fragment, chunk, nrows_to_keep, updel_roll); auto daddr = data_addr; auto element_size = col_type.is_fixlen_array() ? col_type.get_size() : get_element_size(col_type); for (size_t irow = 0; irow < nrows_to_keep; ++irow, daddr += element_size) { if (col_type.is_fixlen_array()) { auto encoder = dynamic_cast<FixedLengthArrayNoneEncoder*>(data_buffer->getEncoder()); CHECK(encoder); encoder->updateMetadata((int8_t*)daddr); } else if (col_type.is_fp()) { set_chunk_stats(col_type, data_addr, update_stats_per_thread[ci].new_values_stats.has_null, update_stats_per_thread[ci].new_values_stats.min_double, update_stats_per_thread[ci].new_values_stats.max_double); } else { set_chunk_stats(col_type, data_addr, update_stats_per_thread[ci].new_values_stats.has_null, update_stats_per_thread[ci].new_values_stats.min_int64t, update_stats_per_thread[ci].new_values_stats.max_int64t); } } }; auto varlen_vacuum = [=, &updel_roll, &frag_offsets, &fragment] { size_t nbytes_var_data_to_keep; nbytes_var_data_to_keep = vacuum_varlen_rows(fragment, chunk, frag_offsets); data_buffer->getEncoder()->setNumElems(nrows_to_keep); data_buffer->setSize(nbytes_var_data_to_keep); data_buffer->setUpdated(); index_array[nrows_to_keep] = data_buffer->size(); index_buffer->setSize(sizeof(*index_array) * (nrows_to_keep ? 1 + nrows_to_keep : 0)); index_buffer->setUpdated(); set_chunk_metadata(catalog, fragment, chunk, nrows_to_keep, updel_roll); }; if (is_varlen) { threads.emplace_back(std::async(std::launch::async, varlen_vacuum)); } else { threads.emplace_back(std::async(std::launch::async, fixlen_vacuum)); } if (threads.size() >= (size_t)cpu_threads()) { wait_cleanup_threads(threads); } } wait_cleanup_threads(threads); auto key = std::make_pair(td, &fragment); updel_roll.numTuples[key] = nrows_to_keep; for (size_t ci = 0; ci < chunks.size(); ++ci) { auto chunk = chunks[ci]; auto cd = chunk->getColumnDesc(); if (!cd->columnType.is_fixlen_array()) { updateColumnMetadata(cd, fragment, chunk, update_stats_per_thread[ci].new_values_stats, cd->columnType, updel_roll); } } } } // namespace Fragmenter_Namespace bool UpdelRoll::commitUpdate() { if (nullptr == catalog) { return false; } const auto td = catalog->getMetadataForTable(logicalTableId); CHECK(td); ChunkKey chunk_key{catalog->getDatabaseId(), td->tableId}; const auto table_lock = lockmgr::TableDataLockMgr::getWriteLockForTable(chunk_key); // Checkpoint all shards. Otherwise, epochs can go out of sync. if (td->persistenceLevel == Data_Namespace::MemoryLevel::DISK_LEVEL) { auto table_epochs = catalog->getTableEpochs(catalog->getDatabaseId(), logicalTableId); try { // `checkpointWithAutoRollback` is not called here because, if a failure occurs, // `dirtyChunks` has to be cleared before resetting epochs catalog->checkpoint(logicalTableId); } catch (...) { dirtyChunks.clear(); catalog->setTableEpochsLogExceptions(catalog->getDatabaseId(), table_epochs); throw; } } updateFragmenterAndCleanupChunks(); return true; } void UpdelRoll::stageUpdate() { CHECK(catalog); auto db_id = catalog->getDatabaseId(); CHECK(table_descriptor); auto table_id = table_descriptor->tableId; CHECK_EQ(memoryLevel, Data_Namespace::MemoryLevel::CPU_LEVEL); CHECK_EQ(table_descriptor->persistenceLevel, Data_Namespace::MemoryLevel::DISK_LEVEL); const auto table_lock = lockmgr::TableDataLockMgr::getWriteLockForTable({db_id, logicalTableId}); try { catalog->getDataMgr().checkpoint(db_id, table_id, memoryLevel); } catch (...) { dirtyChunks.clear(); throw; } updateFragmenterAndCleanupChunks(); } void UpdelRoll::updateFragmenterAndCleanupChunks() { // for each dirty fragment for (auto& cm : chunkMetadata) { cm.first.first->fragmenter->updateMetadata(catalog, cm.first, *this); } dirtyChunks.clear(); // flush gpu dirty chunks if update was not on gpu if (memoryLevel != Data_Namespace::MemoryLevel::GPU_LEVEL) { for (const auto& chunkey : dirtyChunkeys) { catalog->getDataMgr().deleteChunksWithPrefix( chunkey, Data_Namespace::MemoryLevel::GPU_LEVEL); } } } void UpdelRoll::cancelUpdate() { if (nullptr == catalog) { return; } // TODO: needed? ChunkKey chunk_key{catalog->getDatabaseId(), logicalTableId}; const auto table_lock = lockmgr::TableDataLockMgr::getWriteLockForTable(chunk_key); if (is_varlen_update) { int databaseId = catalog->getDatabaseId(); auto table_epochs = catalog->getTableEpochs(databaseId, logicalTableId); dirtyChunks.clear(); catalog->setTableEpochs(databaseId, table_epochs); } else { const auto td = catalog->getMetadataForTable(logicalTableId); CHECK(td); if (td->persistenceLevel != memoryLevel) { for (auto dit : dirtyChunks) { catalog->getDataMgr().free(dit.first->getBuffer()); dit.first->setBuffer(nullptr); } } } }
[ "dev@aas.io" ]
dev@aas.io
67acdb608bfaa74c9c58163a7f16a62400deabc7
fb66a5cc43d27f33c85320a6dba8b9a8ff4765a9
/gapputils/gapputils.ml/RbmEncoder.cpp
b0b2954de7bd6fe898444ac2d14fd21984dd1ea5
[]
no_license
e-thereal/gapputils
7a211c7d92fd2891703cb16bf94e6e05f0fb3b8a
a9eca31373c820c12f4f5f308c0e2005e4672fd0
refs/heads/master
2021-04-26T16:42:58.303603
2015-09-02T21:32:45
2015-09-02T21:32:45
38,838,767
2
0
null
null
null
null
UTF-8
C++
false
false
1,615
cpp
/* * RbmEncoder.cpp * * Created on: Oct 25, 2011 * Author: tombr */ #include "RbmEncoder.h" #include <capputils/EventHandler.h> #include <capputils/FileExists.h> #include <capputils/FilenameAttribute.h> #include <capputils/InputAttribute.h> #include <capputils/NotEqualAssertion.h> #include <capputils/ObserveAttribute.h> #include <capputils/OutputAttribute.h> #include <capputils/TimeStampAttribute.h> #include <capputils/Verifier.h> #include <capputils/VolatileAttribute.h> #include <capputils/HideAttribute.h> #include <gapputils/ReadOnlyAttribute.h> using namespace capputils::attributes; using namespace gapputils::attributes; namespace gapputils { namespace ml { BeginPropertyDefinitions(RbmEncoder) ReflectableBase(gapputils::workflow::WorkflowElement) DefineProperty(RbmModel, Input("RBM"), ReadOnly(), Volatile(), Observe(Id), TimeStamp(Id)) DefineProperty(VisibleVector, Input("In"), ReadOnly(), Volatile(), Observe(Id), TimeStamp(Id)) DefineProperty(HiddenVector, Output("Out"), ReadOnly(), Volatile(), Observe(Id), TimeStamp(Id)) DefineProperty(SampleHiddens, Observe(Id), TimeStamp(Id)) EndPropertyDefinitions RbmEncoder::RbmEncoder() : _SampleHiddens(true), data(0) { WfeUpdateTimestamp setLabel("RbmEncoder"); Changed.connect(capputils::EventHandler<RbmEncoder>(this, &RbmEncoder::changedHandler)); } RbmEncoder::~RbmEncoder() { if (data) delete data; } void RbmEncoder::changedHandler(capputils::ObservableClass* sender, int eventId) { } void RbmEncoder::writeResults() { if (!data) return; setHiddenVector(data->getHiddenVector()); } } }
[ "brosch.tom@gmail.com" ]
brosch.tom@gmail.com
673ab7198377789fc487b71e6bf5341a12b78c7a
5f49e6ea2788865191dc51e2d8f47a98e30b5fda
/Scene.hpp
d4901b378166e0816c6d6e96e0d4d96c704973ce
[]
no_license
tieran02/SnakeInSpace
f0e17b89e64c02ab83727a53b82faefadd4eceb6
5d714f3f1f8f78b0d24fbc9a21122ddfcafa281f
refs/heads/master
2020-04-03T06:01:46.814542
2018-10-28T11:26:09
2018-10-28T11:26:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,117
hpp
#ifndef SCENE_HPP #define SCENE_HPP #include <string> #include <SFML/Graphics.hpp> #include <vector> #include <list> #include "Entity.hpp" #include "ResourceManager.hpp" class Scene { public: Scene(std::string name); virtual ~Scene(); //pure virtual functions for the scene virtual void Initialize() = 0; virtual void Start() = 0; virtual void Unload() = 0; virtual void Update(sf::RenderWindow& window) = 0; virtual void Render(sf::RenderWindow& window) = 0; //Get the name of the scene const std::string& GetName() {return m_name;} //Set the background colour of a scene void SetBackgorundColor(sf::Color color) {m_backgroundColor = color;} //Get the background colour of the scene const sf::Color& GetBackgorundColor() {return m_backgroundColor;} void AddEntity(Entity& entity); //Add an entity by ref (Add the address the entities list void RemoveEntity(Entity& entity); //Remove an entity by ref (Remove the address the entities list Entity* GetEntityByTag(const std::string& tag); //Get an entity by a tag, returns first instance or nullptr if none found std::vector<Entity*> GetEntitiesByTag(const std::string& tag); //Get all entities with a tag, returns all instances or an empty vector if none found Entity* GetEntityByPos(const Vector2f&); //Get an entity by the position, returns first instance or nullptr if none found Entity* GetEntityByName(const std::string& name); //Get an entity by the name, returns first instance or nullptr if none found std::vector<Entity*> GetAllEntities(); //Get and return all entities in the scene protected: //Name of the scene std::string m_name; //Window background colour of a scene sf::Color m_backgroundColor{sf::Color::Black}; //Scenes resource manager ResourceManager m_resourceManager; //pointers to every entity in the game scene (We don't need to delete the elements as we never allocate NEW memory) std::list<Entity*> m_entities; private: //Check collisions with all other entities void checkCollisions(); }; #endif // SCENE_HPP
[ "tieran.wightman@gmail.com" ]
tieran.wightman@gmail.com
e3d90cb1f2afa2157a026e1ac7dd20e679ffee22
526c0ca1f88240b8defb655e130d947bec4e175a
/baseplus.h
0a00848f1686700cb0a38cb95a5a514b0b0f62bc
[]
no_license
Alvino-Unklab/oop-Alvino
ba7a3d0bbc0585b47a924eb3ab04c15bd7f2e97c
85fd24b25a69e3122d266b3ccd2ab880681acca1
refs/heads/main
2023-04-30T20:53:12.147246
2021-05-15T14:43:32
2021-05-15T14:43:32
340,892,502
0
0
null
2021-05-15T10:47:24
2021-02-21T12:09:25
C++
UTF-8
C++
false
false
459
h
#ifndef BASEPLUS_H #define BASEPLUS_H #include "Commission.h" class BasePlusCommissionEmployee : public CommissionEmployee { public: BasePlusCommissionEmployee( const string &, const string &, const string &, double = 0.0, double = 0.0, double = 0.0 ); void setBaseSalary( double ); double getBaseSalary() const; virtual double earnings() const; virtual void print() const; private: double baseSalary; }; #endif
[ "noreply@github.com" ]
noreply@github.com
17a21a335242819236462c6cc986b61dd2e77326
83ed1e2f176133c03a5f6dfa504b8df15ae71efb
/cpp/secondary/manageSeqDat.cpp
4cd26baab6e94a34c8c916747669a489e10aeba3
[]
no_license
jmborr/code
319db14f28e1dea27f9fc703be629f171e6bd95f
32720b57699bf01803367566cdc5fff2b6bce810
refs/heads/master
2022-03-09T16:11:07.455402
2019-10-28T15:03:01
2019-10-28T15:03:01
23,627,627
0
0
null
null
null
null
UTF-8
C++
false
false
460
cpp
#include<iostream> #include "manageSeqDat.h" using namespace std; int main(){ char *file=new char[200]; int *beginSec=new int[1000]; int *resperSec=new int[1000]; int nSec=0; int i,curr,confidence; char *aa; aa=new char[4]; sprintf(file,"./10gsA.SEQ"); printf("%s\n",file); nSec=initSecSeg(file,beginSec,resperSec); printf("nSec=%d\n",nSec); for(i=0;i<nSec;i++){ printf("%d %d %d\n",i,beginSec[i],resperSec[i]); } return 0; }
[ "borreguero@gmail.com" ]
borreguero@gmail.com
e5055d6d356ce557c4005d434b323bc6198d1bdd
4864da577581e2b80c2273efe9b0eee1be3c6d98
/luminosidad_perfecto_luz_natural.ino
e942e3f9f214a992cda03475b88fd19d30705c10
[]
no_license
nordin001/sprint3
1d30a62a59d7cba64a2050983bdcce9cb0734a6a
0ada8c8818744369a6afcd94262ec2dfa7f5eb8d
refs/heads/master
2023-02-16T20:30:13.041108
2020-12-19T15:20:14
2020-12-19T15:20:14
320,820,006
0
0
null
null
null
null
UTF-8
C++
false
false
2,176
ino
#include <Wire.h> #include <Adafruit_ADS1015.h> Adafruit_ADS1115 ads1115(0x48); // Construct an ads1115 at address 0x48 float sensoriluminacion(int canal_iluminacion){ //int input_pin = canal_iluminacion; int adc0; int16_t iluminacion; adc0=ads1115.readADC_SingleEnded(canal_iluminacion); Serial.print(adc0); iluminacion = map(adc0,0,3000,0,100); Serial.print("Iluminacion: "); Serial.print(iluminacion); Serial.println("%"); delay(1500); if(iluminacion < 15){ Serial.println("//////////////////////////////////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); Serial.println("////////////////////¡OSCURIDAD!///////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); } if(iluminacion>=15 && iluminacion <= 25 ){ Serial.println("//////////////////////////////////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); Serial.println("////////////////////¡NUBLADO!/////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); } if(iluminacion >25){ Serial.println("//////////////////////////////////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); Serial.println("////////////////////¡SOLEADO!/////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); Serial.println("//////////////////////////////////////////////////////////"); } } void setup() { Serial.begin (9600); //Velocidad de funcionamiento del monitor serie Serial.println ("Inicializano..."); ads1115.begin ();//Inicializando ads1115 Serial.println ("Ajustando la ganancia..."); ads1115.setGain (GAIN_ONE); Serial.println ("Tomando medidas del canal AIN2"); } void loop() { sensoriluminacion(2); }
[ "noreply@github.com" ]
noreply@github.com
ae99ef02944600a6db2d84bb5f87e451f96ec5fa
68c21b629d59b276eb563e28c7e26a2678eafab3
/PJONMaster.h
41ea8dc5e49f0f1f8119198360821a2e90391172
[ "Apache-2.0" ]
permissive
raydtang/PJON
261a2d25a5af574b0498ec588c2fa713c7888925
1c2106ce26178205cd7ec781b07c6522961a5eb2
refs/heads/master
2021-08-29T17:13:49.904170
2017-12-14T12:09:56
2017-12-14T12:09:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,961
h
/*-O//\ __ __ |-gfo\ |__| | | | |\ | ™ |!y°o:\ | __| |__| | \| v9.1 |y"s§+`\ multi-master, multi-media communications bus system /so+:-..`\ Copyright 2010-2017 by Giovanni Blu Mitolo gioscarab@gmail.com |+/:ngr-*.`\ |5/:%&-a3f.:;\ \+//u/+g%{osv,,\ \=+&/osw+olds.\\ \:/+-.-°-:+oss\ | | \oy\\ > < ______-| |-__________________________________________________________________ PJONMaster has been created by Giovanni Blu Mitolo with the support of Fred Larsen and is inspired by the work of Thomas Snaidero: "Modular components for eye tracking, in the interest of helping persons with severely impaired motor skills." Master Thesis, IT University of Copenhagen, Denmark, September 2016 PJON™ Dynamic addressing specification: - v1.0 specification/PJON-dynamic-addressing-specification-v1.0.md If you believe in this project and you appreciate our work, please, make a donation. The PJON Foundation is entirely financed by contributions of wise people like you and its resources are solely invested to cover the development and maintainance costs. - Paypal: https://www.paypal.me/PJON - Bitcoin: 1FupxAyDTuAMGz33PtwnhwBm4ppc7VLwpD - Ethereum: 0xf34AEAF3B149454522019781668F9a2d1762559b Thank you and happy tinkering! _____________________________________________________________________________ Copyright 2010-2017 by Giovanni Blu Mitolo gioscarab@gmail.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. */ #pragma once #include <PJON.h> /* Reference to device */ struct Device_reference { uint8_t packet_index = 0; uint32_t registration = 0; uint32_t rid = 0; bool state = 0; }; template<typename Strategy = SoftwareBitBang> class PJONMaster : public PJON<Strategy> { public: Device_reference ids[PJON_MAX_DEVICES]; uint8_t required_config = PJON_ADDRESS_BIT | PJON_TX_INFO_BIT | PJON_CRC_BIT; /* PJONMaster bus default initialization: State: Local (bus_id: 0.0.0.0) Acknowledge: true (Acknowledge is requested) device id: MASTER (254) Mode: PJON_HALF_DUPLEX Sender info: true (Sender info are included in the packet) Strategy: SoftwareBitBang */ PJONMaster() : PJON<Strategy>(PJON_MASTER_ID) { PJON<Strategy>::set_error(static_error_handler); set_error(PJON_dummy_error_handler); set_receiver(PJON_dummy_receiver_handler); delete_id_reference(); }; /* PJONMaster initialization passing bus and device id: uint8_t my_bus = {1, 1, 1, 1}; PJONMaster master(my_bys); */ PJONMaster(const uint8_t *b_id) : PJON<Strategy>(b_id, PJON_MASTER_ID) { PJON<Strategy>::set_error(static_error_handler); set_error(PJON_dummy_error_handler); set_receiver(PJON_dummy_receiver_handler); delete_id_reference(); }; /* Add a device reference: */ bool add_id(uint8_t id, uint32_t rid, bool state) { if(!ids[id - 1].state && !ids[id - 1].rid) { ids[id - 1].rid = rid; ids[id - 1].state = state; return true; } return false; }; /* Confirm a device id sending a repeated broadcast containing: PJON_ID_REQUEST - RID (4 byte random id) - DEVICE ID (the new assigned) */ void approve_id(uint8_t id, uint8_t *b_id, uint32_t rid) { char response[6]; uint16_t state = reserve_id(rid); if(state == PJON_DEVICES_BUFFER_FULL) return; if(state == PJON_FAIL) return negate_id(PJON_NOT_ASSIGNED, b_id, rid); response[0] = PJON_ID_REQUEST; response[1] = (uint32_t)(rid) >> 24; response[2] = (uint32_t)(rid) >> 16; response[3] = (uint32_t)(rid) >> 8; response[4] = (uint32_t)(rid); response[5] = state; ids[response[5] - 1].packet_index = PJON<Strategy>::send_repeatedly( PJON_BROADCAST, b_id, response, 6, PJON_ID_REQUEST_INTERVAL, PJON<Strategy>::config | required_config ); }; /* Master begin function: */ void begin() { PJON<Strategy>::begin(); list_ids(); }; /* Confirm device ID insertion in list: */ bool confirm_id(uint32_t rid, uint8_t id) { if(ids[id - 1].rid == rid && !ids[id - 1].state) { if( (uint32_t)(PJON_MICROS() - ids[id - 1].registration) < PJON_ADDRESSING_TIMEOUT ) { ids[id - 1].state = true; PJON<Strategy>::remove(ids[id - 1].packet_index); return true; } } return false; }; /* Count active devices: */ uint8_t count_active_ids() { uint8_t result = 0; for(uint8_t i = 0; i < PJON_MAX_DEVICES; i++) if(ids[i].state) result++; return result; }; /* Empty a single element or the whole buffer: */ void delete_id_reference(uint8_t id = 0) { if(!id) { for(uint8_t i = 0; i < PJON_MAX_DEVICES; i++) { if(!ids[i].state && ids[i].rid) this->remove(ids[i].packet_index); ids[i].packet_index = 0; ids[i].registration = 0; ids[i].rid = 0; ids[i].state = false; } } else if(id > 0 && id < PJON_MAX_DEVICES) { if(!ids[id - 1].state && ids[id - 1].rid) this->remove(ids[id - 1].packet_index); ids[id - 1].packet_index = 0; ids[id - 1].registration = 0; ids[id - 1].rid = 0; ids[id - 1].state = false; } }; /* Master error handler: */ void error_handler(uint8_t code, uint8_t data) { _master_error(code, data); if(code == PJON_CONNECTION_LOST) delete_id_reference(PJON<Strategy>::packets[data].content[0]); }; static void static_error_handler(uint8_t code, uint8_t data) { PJONMaster<Strategy> *master = _current_pjon_master; if(master != NULL) master->error_handler(code, data); }; /* Remove reserved id which expired (Remove never confirmed ids): */ void free_reserved_ids_expired() { for(uint8_t i = 0; i < PJON_MAX_DEVICES; i++) if(!ids[i].state && ids[i].rid) if( (uint32_t)(PJON_MICROS() - ids[i].registration) < PJON_ADDRESSING_TIMEOUT ) continue; else delete_id_reference(i + 1); }; /* Get DEVICE ID from RID: */ uint8_t get_id_from_rid(uint32_t rid) { for(uint8_t i = 0; i < PJON_MAX_DEVICES; i++) if(rid == ids[i].rid) return i + 1; return PJON_NOT_ASSIGNED; }; /* Check for device rid uniqueness in the reference buffer: */ bool unique_rid(uint32_t rid) { for(uint8_t i = 0; i < PJON_MAX_DEVICES; i++) if(ids[i].rid == rid) return false; return true; }; /* Broadcast a PJON_ID_LIST request to all devices: */ void list_ids() { uint32_t time = PJON_MICROS(); char request = PJON_ID_LIST; while((uint32_t)(PJON_MICROS() - time) < PJON_ADDRESSING_TIMEOUT) { PJON<Strategy>::send_packet( PJON_BROADCAST, this->bus_id, &request, 1, PJON<Strategy>::config | required_config ); receive(PJON_LIST_IDS_TIME); } }; /* Negate a device id request sending a packet to the device containing ID_NEGATE forcing the slave to make a new request. */ void negate_id(uint8_t id, uint8_t *b_id, uint32_t rid) { char response[5] = { PJON_ID_NEGATE, rid >> 24, rid >> 16, rid >> 8, rid}; PJON<Strategy>::send_packet_blocking( id, b_id, response, 5, PJON<Strategy>::config | PJON_ACK_REQ_BIT | required_config ); }; /* Reserve a device id and wait for its confirmation: */ uint16_t reserve_id(uint32_t rid) { if(!unique_rid(rid)) return PJON_FAIL; for(uint8_t i = 0; i < PJON_MAX_DEVICES; i++) if(!ids[i].state && !ids[i].rid) { ids[i].registration = PJON_MICROS(); ids[i].rid = rid; ids[i].state = false; return i + 1; } _master_error(PJON_DEVICES_BUFFER_FULL, PJON_MAX_DEVICES); return PJON_DEVICES_BUFFER_FULL; }; /* Master receive function: */ uint16_t receive() { _current_pjon_master = this; uint16_t received_data = PJON<Strategy>::receive(); if(received_data != PJON_ACK) return received_data; uint8_t overhead = PJON<Strategy>::packet_overhead(this->data[1]); uint8_t CRC_overhead = (this->data[1] & PJON_CRC_BIT) ? 4 : 1; if( (this->last_packet_info.header & PJON_ADDRESS_BIT) && (this->last_packet_info.header & PJON_TX_INFO_BIT) && (this->last_packet_info.header & PJON_CRC_BIT) ) { uint8_t request = this->data[overhead - CRC_overhead]; uint32_t rid = (uint32_t)(this->data[(overhead - CRC_overhead) + 1]) << 24 | (uint32_t)(this->data[(overhead - CRC_overhead) + 2]) << 16 | (uint32_t)(this->data[(overhead - CRC_overhead) + 3]) << 8 | (uint32_t)(this->data[(overhead - CRC_overhead) + 4]); if(request == PJON_ID_REQUEST) approve_id( this->last_packet_info.sender_id, this->last_packet_info.sender_bus_id, rid ); if(request == PJON_ID_CONFIRM) if(!confirm_id(rid, this->data[(overhead - CRC_overhead) + 5])) negate_id( this->last_packet_info.sender_id, this->last_packet_info.sender_bus_id, rid ); if(request == PJON_ID_REFRESH) if(!add_id(this->data[(overhead - CRC_overhead) + 5], rid, 1)) negate_id( this->last_packet_info.sender_id, this->last_packet_info.sender_bus_id, rid ); if(request == PJON_ID_NEGATE) if( this->data[(overhead - CRC_overhead) + 5] == this->last_packet_info.sender_id ) if(rid == ids[this->last_packet_info.sender_id - 1].rid) if( this->bus_id_equality( this->last_packet_info.sender_bus_id, this->bus_id ) ) delete_id_reference(this->last_packet_info.sender_id); } _master_receiver( this->data + (overhead - CRC_overhead), this->data[2] - overhead, this->last_packet_info ); return PJON_ACK; }; /* Try to receive a packet repeatedly with a maximum duration: */ uint16_t receive(uint32_t duration) { uint32_t time = PJON_MICROS(); while((uint32_t)(PJON_MICROS() - time) <= duration) if(receive() == PJON_ACK) return PJON_ACK; return PJON_FAIL; }; /* Master receiver function setter: */ void set_receiver(PJON_Receiver r) { _master_receiver = r; }; /* Master error receiver function: */ void set_error(PJON_Error e) { _master_error = e; }; /* Master packet handling update: */ uint8_t update() { free_reserved_ids_expired(); _current_pjon_master = this; return PJON<Strategy>::update(); }; private: PJON_Receiver _master_receiver; PJON_Error _master_error; static PJONMaster<Strategy> *_current_pjon_master; }; /* Shared callback function definition: */ template<typename Strategy> PJONMaster<Strategy> * PJONMaster<Strategy>::_current_pjon_master = NULL;
[ "gioscarab@gmail.com" ]
gioscarab@gmail.com
4f47bdb88b7233f765f1f3541e4279d869ef3ab6
a55ecbb2f557298294a893258c81623eaab706f1
/test/MissileCommand/MissileCommand/src/MissileCommand.cpp
236c186f105deaa0ce3bf62700ec68623dab8e32
[ "MIT" ]
permissive
Torbjornsson/TDA572-2019
360ff1f98d99bf3ab1e9a28fd671025a0f46fa33
7e281b2ac72600db57e0f128eaedccea133f9701
refs/heads/master
2020-04-17T22:36:47.130807
2019-03-23T18:07:48
2019-03-23T18:07:48
167,001,198
0
0
null
null
null
null
UTF-8
C++
false
false
1,111
cpp
#include "stdio.h" #include <iostream> #include <set> #include "avancezlib.h" #include "Object_pool.h" #include "Component.h" #include "GameObject.h" //Global constants and variables for controlling the game (needs to be here) const float FIRE_TIME_INTERVAL = .05f; const float ROCKET_SPEED = 120.f; float game_speed = 1.f; #include "Rocket.h" #include "player.h" #include "game.h" int main(int argc, char* argv[]){ //Window size const static int width = 640, height = 480; //init engine AvancezLib engine; engine.init(width, height); //Mouse int x, y, tx, ty; //Start game Game game; game.Create(&engine); game.Init(); //FPS char msg[256]; //float deltaTime = 0; float lastTime = engine.getElapsedTime(); //Game loop while(true){ //Calculate time since last frame float newTime = engine.getElapsedTime(); float dt = newTime - lastTime; lastTime = engine.getElapsedTime(); dt = dt * game_speed; engine.processInput(); game.Update(dt); game.Draw(); } //cleanup game.destroy(); engine.destroy(); return 0; }
[ "david.torbjornsson@gmail.com" ]
david.torbjornsson@gmail.com
9d97111890216325c58087c35047d60b9ee90ac3
21f8e51f5e6ae46f959c3b704d7a8352b124ab18
/lab8_2_Coordinator/lab8_2_Coordinator.ino
d748a1ab9aa6e52164864b0dcc8cd2cdaadecd0f
[]
no_license
A-n-d-y-W-e-n/linkitcourse
71097be6ea8e35283994a791ad309dc1bb4220d9
cd2c8eeff8a4517aef68ba1d7fcd6fddd967b5bb
refs/heads/master
2020-12-24T11:10:54.770998
2016-08-27T08:55:27
2016-08-27T08:55:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
154
ino
void setup(){ Serial.begin(9600); Serial1.begin(9600); } void loop(){ if(Serial1.available()>0){ Serial.write(Serial1.read()); } }
[ "hongdao940306@gmail.com" ]
hongdao940306@gmail.com
b99060d1bb6f79cacd433db279fd3a1cdb462a5b
401dd4e1a93194e31474098ff1470dd3c39ffe1f
/src/vpc_resize.h
a612bd970698e5294fd6b2f4fdebd3890edc8cfb
[]
no_license
eric-xie-1211/Atlas200DK_ACL
a7beefee033d3815f6a2098c9c0f0cb70a8edcde
169b013ac2726552465dd944f714913157205911
refs/heads/master
2023-01-06T07:30:08.874112
2020-11-08T08:05:46
2020-11-08T08:05:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
857
h
#ifndef __VPC_RESIZE_H__ #define __VPC_RESIZE_H__ #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" #include "util.h" #include <functional> class VPCResizeEngine { public: VPCResizeEngine(aclrtStream stream); ~VPCResizeEngine(); void Destory(); aclError Init(int src_h, int src_w, int dst_h, int dst_w); aclError Resize(const uint8_t *pdata); uint8_t *GetOutputBuffer(); int GetOutputBufferSize(); void RegisterHandler(std::function<void(uint8_t *)> handler); private: acldvppChannelDesc *channel_desc; acldvppPicDesc *input_desc; acldvppPicDesc *output_desc; acldvppResizeConfig *resize_config; aclrtStream stream; void *dvpp_input_mem; void *dvpp_output_mem; uint8_t *host_output_mem; int output_buffer_size; int input_buffer_size; std::function<void(uint8_t *)> buffer_handler; }; #endif //__VPC_RESIZE_H__
[ "545976176@qq.com" ]
545976176@qq.com
2a85bfd084f8258ac1bc01f2e342bc6180c5e133
4b63bf1720fc6e18596d64299deecdbd17ba46d8
/LR1_TV/Class_Eta.h
67e88fbe5c6c847fae9a0e0fb3958f91d58b9b9c
[]
no_license
PlohovEvg/LR1_TV
a9e610f0bbf2e9eadd7b756f30f0a0a9ab570dce
3b3142a39a92453eec5fbe670a6eea1f38851578
refs/heads/master
2021-02-10T18:16:16.089859
2020-05-11T14:54:51
2020-05-11T14:54:51
244,407,446
0
0
null
null
null
null
UTF-8
C++
false
false
795
h
#pragma once class Eta { int value; int ni; double p; public: Eta():value(1),ni(1){} int GetValue() { return this->value; } int GetNi() { return this->ni; } double GetP() { return this->p; } void IncValue() { this->value++; } void IncNi() { this->ni++; } void SetValue(int k) { this->value = k; } void SetP(double _p) { this->p = _p; } bool operator==(Eta &e) { if (this->value == e.value) { return true; } else { return false; } } bool operator <(Eta &e) { if (this->value < e.value) { return true; } else { return false; } } bool operator >(Eta &e) { if (this->value > e.value) { return true; } else { return false; } } Eta& operator =(const Eta &e) { value = e.value; ni = e.ni; p = e.p; return *this; } };
[ "plohov99@yandex.ru" ]
plohov99@yandex.ru
dd981eaeb1c50a7506f5e94f19ce25c7684ca258
db5ab1b54c6c784581bd75db9072cdcebf1b76f9
/anomaly_detection_util.h
552748d82c71e2a1001fba3ee9c8d218764f6c3f
[]
no_license
ElielLopez/HybridAnomalyDetector
e152a29538db2bf36ac3b9a02169accbc6f2837e
c38a9bdc18ab311b3707c0ac429f66c13b5e5abd
refs/heads/master
2023-02-11T03:15:49.077035
2021-01-09T17:58:00
2021-01-09T17:58:00
324,724,027
0
0
null
null
null
null
UTF-8
C++
false
false
1,106
h
// // Created by eliel on 27/12/2020. // #ifndef EX4_ANOMALY_DETECTION_UTIL_H #define EX4_ANOMALY_DETECTION_UTIL_H float avg(float* x, int size); // returns the variance of X and Y float var(float* x, int size); // returns the covariance of X and Y float cov(float* x, float* y, int size); // returns the Pearson correlation coefficient of X and Y float pearson(float* x, float* y, int size); class Line{ public: float a,b; Line():a(0),b(0){}; Line(float a, float b):a(a),b(b){} float f(float x){ return a*x+b; } }; class Point{ public: float x,y; Point() : x(0), y(0) {}; Point(float x, float y):x(x),y(y){} }; // performs a linear regression and returns the line equation. Line linear_reg(Point** points, int size); // returns the deviation between point p and the line equation of the points. float dev(Point p,Point** points, int size); // returns the deviation between point p and the line. float dev(Point p,Line l); // returns the maximum value. float maximumDeviation(float* x, float* y, int size, Line l); #endif //EX4_ANOMALY_DETECTION_UTIL_H
[ "elielsw1@gmail.com" ]
elielsw1@gmail.com
cc9cbf3eb2325ca7509008329b2581bf5c9503fb
e076c5de657bb75f2bf8d28eed566af0fb76dc80
/health/HealthTableIF.h
d61e67616b02eda6fed74dda24dcff5d5f301eb0
[ "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
AlixAbbasi/fsfw
44a1f0846c5784a92bcbafe181dc0f601a6adc56
c76fc8c703e19d917c45a25710b4642e5923c68a
refs/heads/main
2023-02-19T02:41:27.606768
2021-01-08T15:06:11
2021-01-08T15:06:11
327,934,771
1
0
null
null
null
null
UTF-8
C++
false
false
705
h
#ifndef FSFW_HEALTH_HEALTHTABLEIF_H_ #define FSFW_HEALTH_HEALTHTABLEIF_H_ #include "ManagesHealthIF.h" #include "../objectmanager/ObjectManagerIF.h" #include "../returnvalues/HasReturnvaluesIF.h" class HealthTableIF: public ManagesHealthIF { public: virtual ~HealthTableIF() {} virtual ReturnValue_t registerObject(object_id_t object, HasHealthIF::HealthState initilialState = HasHealthIF::HEALTHY) = 0; virtual size_t getPrintSize() = 0; virtual void printAll(uint8_t *pointer, size_t maxSize) = 0; protected: virtual ReturnValue_t iterate( std::pair<object_id_t,HasHealthIF::HealthState> *value, bool reset = false) = 0; }; #endif /* FRAMEWORK_HEALTH_HEALTHTABLEIF_H_ */
[ "ali@ali.re" ]
ali@ali.re
b506e9d126d03f46060c80fac7063e3d67b1a6b0
30fd2d0e910b9b4339ea5a1f2d4ef079285d3bd7
/Lib/Src/MFCUtil/LayoutManager.cpp
6aebafc36088de749f572b3c6c639a8cc91f7acd
[]
no_license
kiar40k/Big-Numbers
3452c33902f0e63781139541552a2c2e14776839
7c4d6dc52deeeac2ac0cdded5a3b3c2ee510b327
refs/heads/master
2021-06-20T01:46:18.860052
2017-08-05T16:04:58
2017-08-05T16:04:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,588
cpp
#include "pch.h" #pragma warning(disable : 4244) DEFINECLASSNAME(LayoutManager); LayoutManager::LayoutManager() : m_wnd(NULL) { m_currentFontScale = 1; m_font = NULL; } LayoutManager::~LayoutManager() { setFont(NULL); } void LayoutManager::setFont(CFont *font) { if(m_font && (m_font != m_startFont)) { m_font->DeleteObject(); SAFEDELETE(m_font); } m_font = font; } #define BOTHSET(flags, f1,f2) (((flags) & ((f1)|(f2))) == ((f1)|(f2))) void LayoutManager::OnInitDialog(CWnd *wnd, int flags) { if(wnd == NULL) { AfxMessageBox(format(_T("%s::OnInitDialog:wnd==NULL"), s_className).cstr(), MB_ICONSTOP); } if(BOTHSET(flags, FONT_RELATIVE_SIZE, RETAIN_ASPECTRATIO)) { AfxMessageBox(format(_T("%s:Invalid bit-combination for window flags:%s"), s_className, sprintbin((short)flags).cstr()).cstr(), MB_ICONSTOP); return; } m_wnd = wnd; m_flags = flags; resetWinStartSize(); m_startFont = m_wnd->GetFont(); m_font = m_startFont; } void LayoutManager::resetWinStartSize() { m_winStartSize = getClientRect(m_wnd).Size(); m_borderSize = getWindowSize(m_wnd) - m_winStartSize; } CSize LayoutManager::findScaledClientSize(const CSize &size, bool isCorner) const { const CSize oldSize = getClientRect(m_wnd).Size(); const CSize &size0 = m_winStartSize; double scale; if(isCorner || (size.cy == oldSize.cy)) { scale = (double)size.cx / size0.cx; } else { scale = (double)size.cy / size0.cy; } return CSize(round(size0.cx * scale), round(size0.cy * scale)); } static inline bool isCorner(UINT fwSide) { return (fwSide == WMSZ_TOPLEFT) || (fwSide == WMSZ_TOPRIGHT) || (fwSide == WMSZ_BOTTOMLEFT) || (fwSide == WMSZ_BOTTOMRIGHT); } void LayoutManager::OnSizing(UINT fwSide, LPRECT pRect) { if(!isInitialized()) return; if(m_flags & RETAIN_ASPECTRATIO) { const CSize oldClientSize = getClientRect(m_wnd).Size(); const CSize clientSize = CSize(pRect->right - pRect->left, pRect->bottom - pRect->top) - m_borderSize; const CSize newClientSize = findScaledClientSize(clientSize, isCorner(fwSide)); const CSize newWinSize = newClientSize + m_borderSize; const CSize screenSize = getScreenSize(true); const int dw = newClientSize.cx - oldClientSize.cx; const int dh = newClientSize.cy - oldClientSize.cy; #define SETLEFT { pRect->left = pRect->right - newWinSize.cx; } #define SETRIGHT { pRect->right = pRect->left + newWinSize.cx; } #define SETTOP { pRect->top = pRect->bottom - newWinSize.cy; } #define SETBOTTOM { pRect->bottom = pRect->top + newWinSize.cy; } #define ADJUSTWIDTH { if((dw>=0)&&(pRect->right + dw<=screenSize.cx) || (dw<0)&&(pRect->left>=0)) SETRIGHT else SETLEFT } #define ADJUSTHEIGHT { if((dh>=0)&&(pRect->bottom + dh<=screenSize.cy) || (dh<0)&&(pRect->top >=0)) SETBOTTOM else SETTOP } switch(fwSide) { case WMSZ_LEFT : SETLEFT; ADJUSTHEIGHT; break; case WMSZ_RIGHT : SETRIGHT; ADJUSTHEIGHT; break; case WMSZ_TOP : SETTOP; ADJUSTWIDTH; break; case WMSZ_BOTTOM : SETBOTTOM; ADJUSTWIDTH; break; case WMSZ_TOPLEFT : SETTOP; SETLEFT; break; case WMSZ_TOPRIGHT : SETTOP; SETRIGHT; break; case WMSZ_BOTTOMLEFT : SETBOTTOM; SETLEFT; break; case WMSZ_BOTTOMRIGHT: SETBOTTOM; SETRIGHT; break; } } } void LayoutManager::setFontScale(double scale, bool resizeWindow, bool redraw) { checkIsInitialized(); if(scale <= 0) { return; } if(scale == 1) { setFont(m_startFont); } else { setFont(createScaledFont(*m_startFont, scale)); } m_currentFontScale = scale; if(resizeWindow) { setClientRectSize(getWindow(), m_winStartSize*scale); } } void LayoutManager::checkIsInitialized() const { if(!isInitialized()) { AfxMessageBox(format(_T("%s not initialized. Call OnInitDialog"), s_className).cstr(), MB_ICONSTOP); } } CWnd *LayoutManager::getWindow() { checkIsInitialized(); return m_wnd; } const CWnd *LayoutManager::getWindow() const { checkIsInitialized(); return m_wnd; } CWnd *LayoutManager::getChild(int ctrlId) { return getWindow()->GetDlgItem(ctrlId); } const CWnd *LayoutManager::getChild(int ctrlId) const { return getWindow()->GetDlgItem(ctrlId); } CFont *LayoutManager::createScaledFont(const CFont &src, double scale) { // static LOGFONT lf; ((CFont&)src).GetLogFont(&lf); lf.lfHeight = (int)(scale * lf.lfHeight); CFont *nf = new CFont(); TRACE_NEW(nf); nf->CreateFontIndirect(&lf); return nf; }
[ "jesper.gr.mikkelsen@gmail.com" ]
jesper.gr.mikkelsen@gmail.com
f403c0092e8b7a50814b6beec2ea4eb55497d16b
2cf5dadd5fe8f18d6b7a107f3566913698f3f3e1
/系统模块/游戏组件/36.港式五张/游戏客户端/JettonControl.cpp
b65e9d7e93425843f029f6674fa16d75e99394a1
[]
no_license
xiaokaixuan/qipai-game
319a5af77a490daf4c825ca7f54bc0b0bbf5c1a0
fce39d8192c1ea037ff34abec3d6074d56071934
refs/heads/master
2021-01-13T16:23:13.757533
2012-06-11T10:53:16
2012-06-11T10:53:16
54,963,680
1
0
null
2016-03-29T09:35:54
2016-03-29T09:35:53
null
GB18030
C++
false
false
4,275
cpp
#include "StdAfx.h" #include "GameClient.h" #include "JettonControl.h" ////////////////////////////////////////////////////////////////////////// //属性定义 #define LAYER_COUNT 6 //最大层数 #define LAYER_HEIGHT 5 //每层高度 #define RAND_WIDTH 150 //绘画最大宽 #define RAND_HEIGHT 120 //绘画最大高 #define MAX_DRAW 50 //绘画最大筹码数 ////////////////////////////////////////////////////////////////////////// //构造函数 CJettonControl::CJettonControl() { //设置变量 m_lScore=0L; m_BenchmarkPos.SetPoint(0,0); m_DrawMode = enDrawMode_Layer; m_lDrawScore = 0L; //加载位图 HINSTANCE hInst = AfxGetInstanceHandle(); m_PngJetton.LoadImage(hInst,TEXT("JETTON_VIEW")); return; } //析构函数 CJettonControl::~CJettonControl() { } //绘画控件 VOID CJettonControl::DrawJettonControl(CDC * pDC) { //绘画判断 if (m_lScore<=0L) return; //获取属性 INT nJettonHeight=m_PngJetton.GetHeight(); INT nJettonWidth=m_PngJetton.GetWidth()/JETTON_COUNT; //层叠模式 if( enDrawMode_Layer == m_DrawMode ) { //变量定义 LONG lScore=m_lScore; LONG lScoreArray[]={1L,5L,10L,50L,100L,500L,1000L,5000L,10000L,50000L,100000L,500000L,1000000L,5000000L}; //计算筹码 for (WORD i=0;i<LAYER_COUNT;i++) { //获取索引 INT nImageIndex=0; for (INT j=0;j<CountArray(lScoreArray);j++) { if (lScore>=lScoreArray[CountArray(lScoreArray)-j-1]) { //设置变量 nImageIndex=CountArray(lScoreArray)-j-1; lScore-=lScoreArray[CountArray(lScoreArray)-j-1]; break; } } //绘画筹码 INT nXPos=m_BenchmarkPos.x-nJettonWidth/2; INT nYPos=m_BenchmarkPos.y-nJettonHeight/2-i*LAYER_HEIGHT; m_PngJetton.DrawImage(pDC,nXPos,nYPos,nJettonWidth,nJettonHeight,nJettonWidth*nImageIndex,0); //终止判断 if (lScore==0L) break; } } //随机堆放模式 else { INT nXPos,nYPos; WORD i,j = 0; for( i = 0; i < m_JetonDraw.GetCount() && j < MAX_DRAW; i++ ) { tagJettonDraw &jd = m_JetonDraw[i]; for( WORD k = 0; k < jd.wDrawCount; k++ ) { nXPos = m_BenchmarkPos.x + m_DrawExcusions[j].x - nJettonWidth/2; nYPos = m_BenchmarkPos.y + m_DrawExcusions[j].y - nJettonHeight/2; //绘画筹码 m_PngJetton.DrawImage(pDC,nXPos,nYPos,nJettonWidth,nJettonHeight,nJettonWidth*jd.wDrawIndex,0); j++; } } } return; } //基准位置 VOID CJettonControl::SetBenchmarkPos(INT nXPos, INT nYPos) { //设置变量 m_BenchmarkPos.SetPoint(nXPos,nYPos); return; } //设置筹码 VOID CJettonControl::SetScore(LONG lScore) { if( m_lScore != lScore ) { m_lScore = lScore; RectifyControl(); } } //添加筹码 void CJettonControl::AddScore(LONG lScore) { m_lScore += lScore; RectifyControl(); } //调整控件 void CJettonControl::RectifyControl() { //m_lScore为0,或随机堆放模式时 if( m_lScore == 0 || enDrawMode_Rand == m_DrawMode && m_lDrawScore != m_lScore ) { LONG lDrawScore; if( m_lDrawScore > m_lScore ) { lDrawScore = m_lScore; m_JetonDraw.RemoveAll(); m_DrawExcusions.RemoveAll(); } else lDrawScore = m_lScore - m_lDrawScore; m_lDrawScore = m_lScore; if( lDrawScore > 0L ) { LONG lJettons[] = {1L,5L,10L,50L,100L,500L,1000L,5000L,10000L,50000L,100000L,500000L,1000000L,5000000L}; for( int i = CountArray(lJettons)-1; ; i-- ) { if( lDrawScore >= lJettons[i] ) { //绘画结构 tagJettonDraw jd; jd.wDrawCount = (WORD)(lDrawScore/lJettons[i]); jd.wDrawIndex = i; m_JetonDraw.Add(jd); lDrawScore -= jd.wDrawCount*lJettons[i]; //添加位置 for( WORD j = 0; j < jd.wDrawCount; j++ ) { CPoint pt(rand()%RAND_WIDTH,rand()%RAND_HEIGHT); m_DrawExcusions.Add(pt); } } if( lDrawScore == 0 ) break; } } } } //设置绘画模式 void CJettonControl::SetDrawMode( enDrawMode DrawMode ) { if( m_DrawMode != DrawMode ) { m_DrawMode = DrawMode; RectifyControl(); } } //////////////////////////////////////////////////////////////////////////
[ "pybmfc@gmail.com" ]
pybmfc@gmail.com
90c4a221cfdd14d22a7af2fe6ef50b7618ec5054
5e65683b70e744a886ffcb029806ccc5c00fa2ba
/cpp/Utilities.h
a6232f73ee494151ffe65a1984256d608dfd4ed5
[]
no_license
SunriseChen/DesignPatterns
e9064e4320203d115d325a848fd77b7a5f5da26e
595efac47182cc0dd9a3168327f33b917d0a50b1
refs/heads/master
2021-01-12T03:07:10.082138
2018-04-15T14:54:45
2018-04-15T14:54:45
78,161,049
0
0
null
null
null
null
UTF-8
C++
false
false
552
h
#pragma once #include <string> namespace std { template<typename T> static basic_string<T> & trim_left(basic_string<T> &str); template<typename T> static basic_string<T> & trim_right(basic_string<T> &str); template<typename T> static basic_string<T> & trim(basic_string<T> &str); template<typename T> static basic_string<T> & tolower(basic_string<T> &str); template<typename T> static basic_string<T> & toupper(basic_string<T> &str); template<typename T> static basic_string<T> & remove_space(basic_string<T> &str); } #include "Utilities.hpp"
[ "sunrise0918@gmail.com" ]
sunrise0918@gmail.com
625e089654d362622c941dbc71feb80c04532db7
d2ce3d8140e3dc6740ce19ba8ef146fb9ab40fe9
/Chunk.h
f28b5e65bae71d5c8002a305dbc72244e275c64a
[]
no_license
bsalha1/MCBot
6cb5f7d45d5ff8723c18b030e49a596d2c844052
84bf5fde5035c2963c27c1de92f93605894c22e9
refs/heads/master
2023-07-15T15:44:31.662172
2021-09-04T21:33:50
2021-09-04T21:33:50
352,841,693
4
2
null
null
null
null
UTF-8
C++
false
false
898
h
#pragma once #include <list> #include <array> #include "ChunkSection.h" #include "Buffer.h" namespace McBot { class Chunk { private: int x; int z; int num_chunk_sections; uint16_t primary_bit_mask; std::array<uint8_t, 256> biome_index; std::array<ChunkSection, 16> chunk_sections; public: Chunk(); Chunk(int x, int z, uint16_t primary_bit_mask); int GetBlockID(int x, int y, int z); int GetBlockID(Vector<int> location); int GetBlockID(Vector<double> location); void UpdateBlock(int x, int y, int z, int block_id); void UpdateBlock(Vector<int> location, int block_id); void AddSection(int i, ChunkSection section); std::list<Vector<int>> GetBlockCoordinates(int block_id); void SetBiomeIndex(std::array<uint8_t, 256> biome_index); // Local Variable Access // int GetNumSections(); uint16_t GetPrimaryBitMask(); int GetX(); int GetZ(); }; }
[ "bsalha1@gmail.com" ]
bsalha1@gmail.com
e476df3548c81f66cceda19d45dd575af9018782
0c644d9604f248080bf49073ae61c4ff02a0feab
/C07/p372-9/소스.cpp
12e7c26492a0cc3c99b72049eb094565891a572f
[]
no_license
0083tony/Core-C-Programming
12bbcc3b5b6dbdda692678cd95590e28f8bfe64f
d846e1544e170c4d010d88a09cf2fd5f91adaf6d
refs/heads/master
2020-08-10T00:19:16.341746
2019-11-08T10:57:04
2019-11-08T10:57:04
214,206,173
2
1
null
null
null
null
UHC
C++
false
false
433
cpp
#include<stdio.h> int main(void) { int arr[12]; int a; printf("1 ~ 12월 까지 핸드폰 요금을 입력하세요.\n"); // 배열에 요금을 저장 for (int j = 0; j < 12; j++) { scanf_s("%d", &arr[j]); } // 2000원당 * 한개로 출력 == 요금 / 2000 for (int i = 0; i < 12; i++) { printf("\n%2d월 %d: ", i + 1, arr[i]); a = arr[i] / 2000; for (int l = 0; l < a; l++) { printf("*"); } } return 0; }
[ "0083tony@gmail.com" ]
0083tony@gmail.com
dc65e93b041453884b326aac83967b755a5fb4f1
45e8df26d895fce1ffced77e2fc7c87aa5fcec71
/codeforces/699/A/sol-1.cc
8e663e141228130eb49fa328507d2839436aae2d
[]
no_license
mikehung/competitive-programming
5c4b429942357bfbe3c8ff2820d5cb5b7c5dc828
50713dc5973f2ea42220ac0248c3d1a6d90fcc15
refs/heads/master
2021-06-20T08:21:36.837057
2021-01-01T01:29:56
2021-01-01T01:31:55
153,595,870
1
0
null
null
null
null
UTF-8
C++
false
false
736
cc
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define debug(args...) { dbg,args; cerr << endl; } #else #define debug(args...) // do nothing #endif struct debugger { template<typename T> debugger& operator , (const T& v) { cerr << v << ' '; return *this; } } dbg; int main() { int n, pos; map<int, char> m; string directions; cin >> n >> directions; for (int i = 0; i < n; ++i) { cin >> pos; m[pos] = directions[i]; } int ans = -1; for (auto it = m.begin(); next(it) != m.end(); ++it) { if (it->second == 'R' && next(it)->second == 'L') { if (ans == -1 || ans > (next(it)->first - it->first)/2) ans = (next(it)->first - it->first)/2; } } cout << ans << '\n'; }
[ "mikehung@synology.com" ]
mikehung@synology.com
902b0f4d3a1f67c515bdf17677af95306277b6b2
3f01b448ac8217b909c9cb5524c7038307da83bf
/simpleCulculator.cpp
4f22099498042db26d624a3a741176c1909e8e20
[]
no_license
Lyman-Smoker/AlgorithmLearing
4ba826996003ebc800dfad6ce5a328ff06e57f44
dff52dd526775eac8a97b34d19c5245772be5e55
refs/heads/master
2021-07-15T07:25:31.968529
2021-05-26T09:20:20
2021-05-26T09:20:20
248,276,924
1
0
null
null
null
null
UTF-8
C++
false
false
3,986
cpp
// // Created by lym on 2020-11-05. // 堆栈简单应用 // 简易计算器:读一个只包含+,-,*,/的非负整数计算表达式,并计算该式子的值,精确到小数点后两位 // #include <iostream> #include <stdio.h> #include <stack> using namespace std; char str[220]; //保存表达式字符串 /* * 优先级矩阵 * 若mat[i][j]==1,则表示i号运算符优先级大于j号运算符 * 运算符编码规则为+为1,-为2,*为3,/为4 * 认为添加在表达式首尾的标记运算符0号 */ int mat[][5]={ 1,0,0,0,0, 1,0,0,0,0, 1,0,0,0,0, 1,1,1,0,0, 1,1,1,0,0, }; stack<int> op;//运算符栈,保存运算符编号 stack<double> in;//数字栈,运算结果可能存在浮点数,所以保存元素为double void getOp(bool &reto, int& retn, int&i){ /* * 获得表达式中下一个元素函数 * 若函数运行结束时,引用变量reto为true,则表示该元素为一个运算符,其编号保存在引用变量retn中; * 否则,表示该元素为一个数字,其值保存在引用变量retn中。 * 引用变量i表示遍历到的数字串下标 */ if(i==0 && op.empty()){ //若此时遍历字符串第一字符且运算符栈为空,我们认为添加编号为0的标记字符 reto=true; retn=0; return; } if(str[i]==0){ //若遍历字符为空字符,则表示已遍历完 reto=true; retn=0; return; } if(str[i]>='0'&&str[i]<='9'){ //若当前字符为数字 reto=false; } else{ reto=true; if(str[i]=='+'){ retn=1; } else if(str[i]=='-'){ retn=2; } else if(str[i]=='*'){ retn=3; } else if(str[i]=='/'){ retn=4; } i+=2;//跳过概运算字符和该运算字符后的空格 return; } //结果为数字时,执行以下代码 retn=0; for(;str[i]!=' '&&str[i]!=0;i++) { //若字符串未遍历完且下个字符不是空格,依次遍历后面的数字 retn *= 10; retn += str[i] - '0'; } if (str[i]==' ') //若后面为空格,则跳过该空格 i++; return; } int main(){ while(gets(str)){ if(str[0]=='0'&&str[1]==0) break; bool retop= true; int retnum=-1; int idx=0; while(!op.empty()) op.pop(); while(!in.empty()) in.pop(); while(true){ getOp(retop,retnum,idx); if(!retop){ //若为数字 in.push((double)retnum);//将数字压进栈中 } else{ double tmp; if (op.empty() || mat[retnum][op.top()]==1) op.push(retnum); else{ while(mat[retnum][op.top()]==0){ //只要当前运算符优先级小于栈顶元素运算符,则重复循环 int ret=op.top(); op.pop(); double b=in.top(); in.pop(); double a=in.top(); in.pop(); if (ret==1) tmp=a+b; else if(ret==2) tmp=a-b; else if(ret==3) tmp=a*b; else tmp=a/b; in.push(tmp); //将结果压回数字栈 } op.push(retnum); } } if(op.size()==2&&op.top()==0) //如果只有两个元素,且其栈顶元素为标记运算符,则表示表示表达式求值结束 break; } printf("%.2f\n",in.top()); } return 0; }
[ "noreply@github.com" ]
noreply@github.com
ea7e6897d08ace311db8e2274ff908004aac0dbc
c2486df973729fb40c023c7c008c0a3ea7621f08
/BUTTON/round buttons/round button/round button/main.cpp
02cc274bf962b3472978ff37bff48fb7e962b89a
[]
no_license
orf53975/WINAPI1-
060bf79cc022feefd1130ab4c00b5b2c43b09380
840bc8f4071d19bffeba3bbbef8070bf1273e3a8
refs/heads/master
2021-10-12T01:37:03.515294
2018-11-12T14:30:29
2018-11-12T14:30:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,223
cpp
// RoundButton.cpp : implementation file // // Round Buttons! // // Written by Chris Maunder (cmaunder@mail.com) // Copyright (c) 1997,1998. // // Modified: 2 Feb 1998 - Fix vis problem, CRgn resource leak, // button reposition code redone. CJM. // // This code may be used in compiled form in any way you desire. This // file may be redistributed unmodified by any means PROVIDING it is // not sold for profit without the authors written consent, and // providing that this notice and the authors name is included. If // the source code in this file is used in any commercial application // then a simple email would be nice. // // This file is provided "as is" with no expressed or implied warranty. // The author accepts no liability if it causes any damage to your // computer, causes your pet cat to fall ill, increases baldness or // makes you car start emitting strange noises when you start it up. // // Expect bugs. // // Please use and enjoy. Please let me know of any bugs/mods/improvements // that you have found/implemented and I will fix/incorporate them into this // file. // ///////////////////////////////////////////////////////////////////////////// //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by TestApp.rc // #define IDD_TESTAPP_DIALOG 102 #define IDR_MAINFRAME 128 #define IDC_BUTTON1 1000 #define IDC_BUTTON2 1001 #define IDC_BUTTON3 1002 #define IDC_CHECK1 1003 #define IDC_USESMOOTHING 1003 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1004 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif #include "math.h" #include "RoundButton.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // prototypes COLORREF GetColour(double dAngle, COLORREF crBright, COLORREF crDark); void DrawCircle(CDC* pDC, CPoint p, LONG lRadius, COLORREF crColour, BOOL bDashed = FALSE); void DrawCircle(CDC* pDC, CPoint p, LONG lRadius, COLORREF crBright, COLORREF crDark); // Calculate colour for a point at the given angle by performing a linear // interpolation between the colours crBright and crDark based on the cosine // of the angle between the light source and the point. // // Angles are measured from the +ve x-axis (i.e. (1,0) = 0 degrees, (0,1) = 90 degrees ) // But remember: +y points down! COLORREF GetColour(double dAngle, COLORREF crBright, COLORREF crDark) { #define Rad2Deg 180.0/3.1415 #define LIGHT_SOURCE_ANGLE -2.356 // -2.356 radians = -135 degrees, i.e. From top left ASSERT(dAngle > -3.1416 && dAngle < 3.1416); double dAngleDifference = LIGHT_SOURCE_ANGLE - dAngle; if (dAngleDifference < -3.1415) dAngleDifference = 6.293 + dAngleDifference; else if (dAngleDifference > 3.1415) dAngleDifference = 6.293 - dAngleDifference; double Weight = 0.5*(cos(dAngleDifference)+1.0); BYTE Red = (BYTE) (Weight*GetRValue(crBright) + (1.0-Weight)*GetRValue(crDark)); BYTE Green = (BYTE) (Weight*GetGValue(crBright) + (1.0-Weight)*GetGValue(crDark)); BYTE Blue = (BYTE) (Weight*GetBValue(crBright) + (1.0-Weight)*GetBValue(crDark)); //TRACE("LightAngle = %0.0f, Angle = %3.0f, Diff = %3.0f, Weight = %0.2f, RGB %3d,%3d,%3d\n", // LIGHT_SOURCE_ANGLE*Rad2Deg, dAngle*Rad2Deg, dAngleDifference*Rad2Deg, Weight,Red,Green,Blue); return RGB(Red, Green, Blue); } void DrawCircle(CDC* pDC, CPoint p, LONG lRadius, COLORREF crColour, BOOL bDashed) { const int nDashLength = 1; LONG lError, lXoffset, lYoffset; int nDash = 0; BOOL bDashOn = TRUE; //Check to see that the coordinates are valid ASSERT( (p.x + lRadius <= LONG_MAX) && (p.y + lRadius <= LONG_MAX) ); ASSERT( (p.x - lRadius >= LONG_MIN) && (p.y - lRadius >= LONG_MIN) ); //Set starting values lXoffset = lRadius; lYoffset = 0; lError = -lRadius; do { if (bDashOn) { pDC->SetPixelV(p.x + lXoffset, p.y + lYoffset, crColour); pDC->SetPixelV(p.x + lXoffset, p.y - lYoffset, crColour); pDC->SetPixelV(p.x + lYoffset, p.y + lXoffset, crColour); pDC->SetPixelV(p.x + lYoffset, p.y - lXoffset, crColour); pDC->SetPixelV(p.x - lYoffset, p.y + lXoffset, crColour); pDC->SetPixelV(p.x - lYoffset, p.y - lXoffset, crColour); pDC->SetPixelV(p.x - lXoffset, p.y + lYoffset, crColour); pDC->SetPixelV(p.x - lXoffset, p.y - lYoffset, crColour); } //Advance the error term and the constant X axis step lError += lYoffset++; //Check to see if error term has overflowed if ((lError += lYoffset) >= 0) lError -= --lXoffset * 2; if (bDashed && (++nDash == nDashLength)) { nDash = 0; bDashOn = !bDashOn; } } while (lYoffset <= lXoffset); //Continue until halfway point } void DrawCircle(CDC* pDC, CPoint p, LONG lRadius, COLORREF crBright, COLORREF crDark) { LONG lError, lXoffset, lYoffset; //Check to see that the coordinates are valid ASSERT( (p.x + lRadius <= LONG_MAX) && (p.y + lRadius <= LONG_MAX) ); ASSERT( (p.x - lRadius >= LONG_MIN) && (p.y - lRadius >= LONG_MIN) ); //Set starting values lXoffset = lRadius; lYoffset = 0; lError = -lRadius; do { const double Pi = 3.141592654, Pi_on_2 = Pi * 0.5, Three_Pi_on_2 = Pi * 1.5; COLORREF crColour; double dAngle = atan2(lYoffset, lXoffset); //Draw the current pixel, reflected across all eight arcs crColour = GetColour(dAngle, crBright, crDark); pDC->SetPixelV(p.x + lXoffset, p.y + lYoffset, crColour); crColour = GetColour(Pi_on_2 - dAngle, crBright, crDark); pDC->SetPixelV(p.x + lYoffset, p.y + lXoffset, crColour); crColour = GetColour(Pi_on_2 + dAngle, crBright, crDark); pDC->SetPixelV(p.x - lYoffset, p.y + lXoffset, crColour); crColour = GetColour(Pi - dAngle, crBright, crDark); pDC->SetPixelV(p.x - lXoffset, p.y + lYoffset, crColour); crColour = GetColour(-Pi + dAngle, crBright, crDark); pDC->SetPixelV(p.x - lXoffset, p.y - lYoffset, crColour); crColour = GetColour(-Pi_on_2 - dAngle, crBright, crDark); pDC->SetPixelV(p.x - lYoffset, p.y - lXoffset, crColour); crColour = GetColour(-Pi_on_2 + dAngle, crBright, crDark); pDC->SetPixelV(p.x + lYoffset, p.y - lXoffset, crColour); crColour = GetColour(-dAngle, crBright, crDark); pDC->SetPixelV(p.x + lXoffset, p.y - lYoffset, crColour); //Advance the error term and the constant X axis step lError += lYoffset++; //Check to see if error term has overflowed if ((lError += lYoffset) >= 0) lError -= --lXoffset * 2; } while (lYoffset <= lXoffset); //Continue until halfway point } ///////////////////////////////////////////////////////////////////////////// // CRoundButton CRoundButton::CRoundButton() { m_bDrawDashedFocusCircle = TRUE; } CRoundButton::~CRoundButton() { m_rgn.DeleteObject(); } BEGIN_MESSAGE_MAP(CRoundButton, CButton) //{{AFX_MSG_MAP(CRoundButton) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRoundButton message handlers void CRoundButton::PreSubclassWindow() { CButton::PreSubclassWindow(); ModifyStyle(0, BS_OWNERDRAW); CRect rect; GetClientRect(rect); // Resize the window to make it square rect.bottom = rect.right = min(rect.bottom,rect.right); // Get the vital statistics of the window m_ptCentre = rect.CenterPoint(); m_nRadius = rect.bottom/2-1; // Set the window region so mouse clicks only activate the round section // of the button m_rgn.DeleteObject(); SetWindowRgn(NULL, FALSE); m_rgn.CreateEllipticRgnIndirect(rect); SetWindowRgn(m_rgn, TRUE); // Convert client coords to the parents client coords ClientToScreen(rect); CWnd* pParent = GetParent(); if (pParent) pParent->ScreenToClient(rect); // Resize the window MoveWindow(rect.left, rect.top, rect.Width(), rect.Height(), TRUE); } void CRoundButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { ASSERT(lpDrawItemStruct != NULL); CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); CRect rect = lpDrawItemStruct->rcItem; UINT state = lpDrawItemStruct->itemState; UINT nStyle = GetStyle(); int nRadius = m_nRadius; int nSavedDC = pDC->SaveDC(); pDC->SelectStockObject(NULL_BRUSH); pDC->FillSolidRect(rect, ::GetSysColor(COLOR_BTNFACE)); // Draw the focus circle around the button if ((state & ODS_FOCUS) && m_bDrawDashedFocusCircle) DrawCircle(pDC, m_ptCentre, nRadius--, RGB(0,0,0)); // Draw the raised/sunken edges of the button (unless flat) if (nStyle & BS_FLAT) { DrawCircle(pDC, m_ptCentre, nRadius--, RGB(0,0,0)); DrawCircle(pDC, m_ptCentre, nRadius--, ::GetSysColor(COLOR_3DHIGHLIGHT)); } else { if ((state & ODS_SELECTED)) { DrawCircle(pDC, m_ptCentre, nRadius--, ::GetSysColor(COLOR_3DDKSHADOW), ::GetSysColor(COLOR_3DHIGHLIGHT)); DrawCircle(pDC, m_ptCentre, nRadius--, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DLIGHT)); } else { DrawCircle(pDC, m_ptCentre, nRadius--, ::GetSysColor(COLOR_3DHIGHLIGHT), ::GetSysColor(COLOR_3DDKSHADOW)); DrawCircle(pDC, m_ptCentre, nRadius--, ::GetSysColor(COLOR_3DLIGHT), ::GetSysColor(COLOR_3DSHADOW)); } } // draw the text if there is any CString strText; GetWindowText(strText); if (!strText.IsEmpty()) { CRgn rgn; rgn.CreateEllipticRgn(m_ptCentre.x-nRadius, m_ptCentre.y-nRadius, m_ptCentre.x+nRadius, m_ptCentre.y+nRadius); pDC->SelectClipRgn(&rgn); CSize Extent = pDC->GetTextExtent(strText); CPoint pt = CPoint( m_ptCentre.x - Extent.cx/2, m_ptCentre.x - Extent.cy/2 ); if (state & ODS_SELECTED) pt.Offset(1,1); pDC->SetBkMode(TRANSPARENT); if (state & ODS_DISABLED) pDC->DrawState(pt, Extent, strText, DSS_DISABLED, TRUE, 0, (HBRUSH)NULL); else pDC->TextOut(pt.x, pt.y, strText); pDC->SelectClipRgn(NULL); rgn.DeleteObject(); } // Draw the focus circle on the inside of the button if ((state & ODS_FOCUS) && m_bDrawDashedFocusCircle) DrawCircle(pDC, m_ptCentre, nRadius-2, RGB(0,0,0), TRUE); pDC->RestoreDC(nSavedDC); }
[ "vaxoalavidze97@gmail.com" ]
vaxoalavidze97@gmail.com
d6b6c07cf77444fe2a4c4f3d071618f5f2d8d420
5f515cb94f98565397e15c6f80064cfa49563696
/collisions/CCollisionBrute.cpp
6672ae478f9eea72af2bb111d4d2c93de45a9f9e
[]
no_license
eruffaldi/chai3dproxy
3e2208b9b06b2baf77297a9ba175ea032413f6a0
c2fad3c8c34678c403e8cf49250ad594da0141c5
refs/heads/master
2021-01-10T12:39:09.945290
2016-02-15T11:29:45
2016-02-15T11:29:45
51,745,295
2
0
null
null
null
null
UTF-8
C++
false
false
4,973
cpp
//============================================================================== /* Software License Agreement (BSD License) Copyright (c) 2003-2016, CHAI3D. (www.chai3d.org) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of CHAI3D nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \author <http://www.chai3d.org> \author Chris Sewell \author Francois Conti \version 3.1.1 $Rev: 1869 $ */ //============================================================================== //------------------------------------------------------------------------------ #include "collisions/CCollisionBrute.h" //------------------------------------------------------------------------------ using namespace std; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ namespace chai3d { //------------------------------------------------------------------------------ //============================================================================== /*! Constructor of cCollisionBrute. \param a_elements List of geometry elements. */ //============================================================================== cCollisionBrute::cCollisionBrute(cGenericArrayPtr a_elements) { // radius padding around elements m_radiusAroundElements = 0.0; // list of geometrical entities m_elements = a_elements; } //============================================================================== /*! This method checks if the given line segment intersects any element of the object. This method is called "brute force" because all elements are checked by invoking their collision-detection methods. This method is simple but very inefficient. \param a_object Object for which collision detector is being used. \param a_segmentPointA Initial point of segment. \param a_segmentPointB End point of segment. \param a_recorder Recorder which stores all collision events. \param a_settings Structure which contains some rules about how the collision detection should be performed. \return __true__ if the line segment intersects one or more elements. */ //============================================================================== bool cCollisionBrute::computeCollision(cGenericObject* a_object, cVector3d& a_segmentPointA, cVector3d& a_segmentPointB, cCollisionRecorder& a_recorder, cCollisionSettings& a_settings) { bool hit = false; // check all elements for collision int numElements = m_elements->getNumElements(); for (int i=0; i<numElements; i++) { if (m_elements->m_allocated[i]) { if (m_elements->computeCollision(i, a_object, a_segmentPointA, a_segmentPointB, a_recorder, a_settings)) { hit = true; } } } // return result return (hit); } //------------------------------------------------------------------------------ } // namespace chai3d //------------------------------------------------------------------------------
[ "emanuele.ruffaldi@gmail.com" ]
emanuele.ruffaldi@gmail.com
b306c7659209b68f728df48515041d4bed4c1e24
0bf46c80b6bbd93c0f3fb09fbd52cace6a1d9786
/PhatEngine/include/phat/PhatPlane.h
822623015adead810e89851e6e7d487d3d931fcf
[ "MIT" ]
permissive
pluspingya/PhatEngine
89ca3071048ea1b5f9e4a2057074dc9bf87807bf
2f78ce01a84fe8b97376064d922aaba7fee52bac
refs/heads/master
2020-06-08T18:13:37.918982
2013-08-07T02:55:58
2013-08-07T02:55:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,020
h
// // PhatPlane.h // PhatEngine // // Created by Plus Pingya on 7/31/13. // Copyright (c) 2013 Plus Pingya. All rights reserved. // Contact pluspingya@gmail.com #ifndef PHATPLANE_H_INCLUDED #define PHATPLANE_H_INCLUDED #include <phat/PhatContext.h> #include <phat/PhatObj3D.h> #include <phat/PhatTexture.h> enum BLENDMODE { NORMAL, NORMAL_ONE, GROW, GROW_TEST }; class PhatPlane: public PhatObj3D { private: void _initialize(vec2f size); void _release(); void _tweening(); public: BLENDMODE Blendmode; void *UserData; PhatTexture *Texture; bool TweenActive; bool TweenConstantly; float TweenSpeed; vec3f TweenDistination; PhatPlane(); PhatPlane(vec2f size); ~PhatPlane(); void Update(); void Render(PhatContext *context); void Render(PhatContext *context, PhatTexture *texture); void Tween(vec3f start, vec3f distination, float speed, bool constantly); }; #endif //PHATPLANE_H_INCLUDED
[ "pluspingya@gmail.com" ]
pluspingya@gmail.com
8504d74145aec7c6acc4c348fbf349ada6dd0d8a
43a54d76227b48d851a11cc30bbe4212f59e1154
/sms/src/v20210111/model/DescribeSignListStatus.cpp
c18e5d39ee407324ce71de6f905c98a962084e61
[ "Apache-2.0" ]
permissive
make1122/tencentcloud-sdk-cpp
175ce4d143c90d7ea06f2034dabdb348697a6c1c
2af6954b2ee6c9c9f61489472b800c8ce00fb949
refs/heads/master
2023-06-04T03:18:47.169750
2021-06-18T03:00:01
2021-06-18T03:00:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,180
cpp
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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 <tencentcloud/sms/v20210111/model/DescribeSignListStatus.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Sms::V20210111::Model; using namespace std; DescribeSignListStatus::DescribeSignListStatus() : m_signIdHasBeenSet(false), m_internationalHasBeenSet(false), m_statusCodeHasBeenSet(false), m_reviewReplyHasBeenSet(false), m_signNameHasBeenSet(false), m_createTimeHasBeenSet(false) { } CoreInternalOutcome DescribeSignListStatus::Deserialize(const rapidjson::Value &value) { string requestId = ""; if (value.HasMember("SignId") && !value["SignId"].IsNull()) { if (!value["SignId"].IsUint64()) { return CoreInternalOutcome(Error("response `DescribeSignListStatus.SignId` IsUint64=false incorrectly").SetRequestId(requestId)); } m_signId = value["SignId"].GetUint64(); m_signIdHasBeenSet = true; } if (value.HasMember("International") && !value["International"].IsNull()) { if (!value["International"].IsUint64()) { return CoreInternalOutcome(Error("response `DescribeSignListStatus.International` IsUint64=false incorrectly").SetRequestId(requestId)); } m_international = value["International"].GetUint64(); m_internationalHasBeenSet = true; } if (value.HasMember("StatusCode") && !value["StatusCode"].IsNull()) { if (!value["StatusCode"].IsInt64()) { return CoreInternalOutcome(Error("response `DescribeSignListStatus.StatusCode` IsInt64=false incorrectly").SetRequestId(requestId)); } m_statusCode = value["StatusCode"].GetInt64(); m_statusCodeHasBeenSet = true; } if (value.HasMember("ReviewReply") && !value["ReviewReply"].IsNull()) { if (!value["ReviewReply"].IsString()) { return CoreInternalOutcome(Error("response `DescribeSignListStatus.ReviewReply` IsString=false incorrectly").SetRequestId(requestId)); } m_reviewReply = string(value["ReviewReply"].GetString()); m_reviewReplyHasBeenSet = true; } if (value.HasMember("SignName") && !value["SignName"].IsNull()) { if (!value["SignName"].IsString()) { return CoreInternalOutcome(Error("response `DescribeSignListStatus.SignName` IsString=false incorrectly").SetRequestId(requestId)); } m_signName = string(value["SignName"].GetString()); m_signNameHasBeenSet = true; } if (value.HasMember("CreateTime") && !value["CreateTime"].IsNull()) { if (!value["CreateTime"].IsUint64()) { return CoreInternalOutcome(Error("response `DescribeSignListStatus.CreateTime` IsUint64=false incorrectly").SetRequestId(requestId)); } m_createTime = value["CreateTime"].GetUint64(); m_createTimeHasBeenSet = true; } return CoreInternalOutcome(true); } void DescribeSignListStatus::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const { if (m_signIdHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "SignId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_signId, allocator); } if (m_internationalHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "International"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_international, allocator); } if (m_statusCodeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "StatusCode"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_statusCode, allocator); } if (m_reviewReplyHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ReviewReply"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_reviewReply.c_str(), allocator).Move(), allocator); } if (m_signNameHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "SignName"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_signName.c_str(), allocator).Move(), allocator); } if (m_createTimeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "CreateTime"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_createTime, allocator); } } uint64_t DescribeSignListStatus::GetSignId() const { return m_signId; } void DescribeSignListStatus::SetSignId(const uint64_t& _signId) { m_signId = _signId; m_signIdHasBeenSet = true; } bool DescribeSignListStatus::SignIdHasBeenSet() const { return m_signIdHasBeenSet; } uint64_t DescribeSignListStatus::GetInternational() const { return m_international; } void DescribeSignListStatus::SetInternational(const uint64_t& _international) { m_international = _international; m_internationalHasBeenSet = true; } bool DescribeSignListStatus::InternationalHasBeenSet() const { return m_internationalHasBeenSet; } int64_t DescribeSignListStatus::GetStatusCode() const { return m_statusCode; } void DescribeSignListStatus::SetStatusCode(const int64_t& _statusCode) { m_statusCode = _statusCode; m_statusCodeHasBeenSet = true; } bool DescribeSignListStatus::StatusCodeHasBeenSet() const { return m_statusCodeHasBeenSet; } string DescribeSignListStatus::GetReviewReply() const { return m_reviewReply; } void DescribeSignListStatus::SetReviewReply(const string& _reviewReply) { m_reviewReply = _reviewReply; m_reviewReplyHasBeenSet = true; } bool DescribeSignListStatus::ReviewReplyHasBeenSet() const { return m_reviewReplyHasBeenSet; } string DescribeSignListStatus::GetSignName() const { return m_signName; } void DescribeSignListStatus::SetSignName(const string& _signName) { m_signName = _signName; m_signNameHasBeenSet = true; } bool DescribeSignListStatus::SignNameHasBeenSet() const { return m_signNameHasBeenSet; } uint64_t DescribeSignListStatus::GetCreateTime() const { return m_createTime; } void DescribeSignListStatus::SetCreateTime(const uint64_t& _createTime) { m_createTime = _createTime; m_createTimeHasBeenSet = true; } bool DescribeSignListStatus::CreateTimeHasBeenSet() const { return m_createTimeHasBeenSet; }
[ "tencentcloudapi@tenent.com" ]
tencentcloudapi@tenent.com
5a66f61fb16d3740e38c89de990f91cb0ad823f4
fb323b61682f958169b5cab2140aec785075a1cd
/src/libtxtdet/textdetector.cpp
64ed57409299d088ef3bb0efd6b9b7cfad3d442e
[]
no_license
Styku/Screentone
04eb9b91ac445cedc3e60193744f2d0ef964dcce
cc0fa2e7f296a89801b96bbaa2a7a58a2c97e9e0
refs/heads/master
2020-08-09T07:09:55.888951
2019-10-19T22:21:44
2019-10-19T22:21:44
214,030,668
0
0
null
null
null
null
UTF-8
C++
false
false
2,564
cpp
#include "textdetector.h" using std::vector; using cv::Mat; using cv::Point; namespace ar { SimpleTextDetector::SimpleTextDetector() { setLetterSpacing(13, 3); setParagraphSpacing(17, 25); } std::vector<BoundingBox> SimpleTextDetector::detect(Mat frame) const { Mat frame_gray, frame_sobel, frame_bin; cvtColor(frame, frame_gray, cv::COLOR_BGR2GRAY); cv::Sobel(frame_gray, frame_sobel, CV_8U, 1, 0); cv::threshold(frame_sobel, frame_bin, binarization_threshold, 255, cv::THRESH_BINARY); cv::morphologyEx(frame_bin, frame_bin, cv::MORPH_CLOSE, element_lines); if(grouping == TextGroupingType::Paragraphs) { cv::morphologyEx(frame_bin, frame_bin, cv::MORPH_CLOSE, element_paragraphs1); cv::morphologyEx(frame_bin, frame_bin, cv::MORPH_OPEN, element_paragraphs2); } vector<vector<Point>> contours, poly; vector<BoundingBox> text_boxes; findContours(frame_bin, contours, cv::ContourApproximationModes::CHAIN_APPROX_SIMPLE, cv::CONTOURS_MATCH_I1); for(auto& c : contours) { vector<Point> poly; cv::approxPolyDP( cv::Mat(c), poly, 3, true ); BoundingBox bbox = boundingRect(Mat(poly)); //TODO: expand boxes by a value based on morph kernel (faster than MORPH_DILUTE) //TODO: add debug flag, do not modify frame by default cv::rectangle(frame, bbox, cv::Scalar(100, 0, 255)); text_boxes.push_back(bbox); } return text_boxes; } std::unique_ptr<TextDetector> SimpleTextDetector::create() { return std::make_unique<SimpleTextDetector>(*this); } SimpleTextDetector& SimpleTextDetector::setLetterSpacing(int w, int h) { element_lines = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(w, h) ); return *this; } SimpleTextDetector& SimpleTextDetector::setParagraphSpacing(int max_line_h, int min_line_w) { element_paragraphs1 = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(1, max_line_h) ); element_paragraphs2 = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(min_line_w, 1) ); return *this; } SimpleTextDetector &SimpleTextDetector::setGrouping(TextGroupingType grouping) { this->grouping = grouping; return *this; } SimpleTextDetector &SimpleTextDetector::setThreshold(int threshold) { this->binarization_threshold = threshold; return *this; } }
[ "brtstyczen@gmail.com" ]
brtstyczen@gmail.com
05483cfc1a74b513d4b1660452074b530258f02b
fb734077dd1724a8b3eb3f080346159b8fb76faf
/oj.yukisaki/data structure/coding recuperation/1126.cpp
87bc8f82ab797016ead6937a6e93afb862a92315
[]
no_license
LibroWu/Codes
b0e208d2ad707f5f231e71d6c851f71e22e89071
cf792cb0ee95b1b941be8a371eebb506efbabfc0
refs/heads/master
2023-06-10T01:24:42.044308
2021-07-01T12:59:31
2021-07-01T12:59:31
318,105,198
0
0
null
null
null
null
UTF-8
C++
false
false
1,524
cpp
// // Created by libro on 2021/4/12. // #include <iostream> using namespace std; class Heap { private: void swap(long long &a, long long &b) { a = a ^ b, b = a ^ b, a = a ^ b; } public: long long top, p[1000005]; Heap() : top(0) {} void push(long long x) { p[++top] = x; long long child = top; while (child > 1) { if (p[child >> 1] > p[child]) { swap(p[child], p[child >> 1]); child = child >> 1; } else break; } } long long front() { return p[1]; } bool empty() { return top; } void pop() { p[1] = p[top--]; long long pa = 1, child; while (pa << 1 <= top) { if (((pa << 1 | 1) > top) || p[pa << 1] < p[pa << 1 | 1]) child = pa << 1; else child = pa << 1 | 1; if (p[pa] > p[child]) { swap(p[pa], p[child]); pa = child; } else break; } } } h; int n, m; int main() { cin >> n >> m; int t = n - (n - m) % (m - 1) + m - 1; for (int i = 0; i < (t - n) % (m - 1); ++i) { h.push(0); } long long x; for (int i = 0; i < n; ++i) { cin >> x; h.push(x); } long long ans = 0, sum = 0; while (h.top > 1) { sum = 0; for (int i = 0; i < m; ++i) { sum += h.front(); h.pop(); } h.push(sum); ans += sum; } cout << ans << '\n'; }
[ "731096310@qq.com" ]
731096310@qq.com
e8278122b93c74cd39a6cdd6bcdb5fcda334d48f
23fd4aaee7cfb2ff3692bd355866cba8e416896a
/ConsoleApplication1/ConsoleApplication1/No64mergeSortedArray.cpp
b1721966781212dbfdf666cdf095d5b1fa3b1bda
[]
no_license
dreamcanfly/lintcode
f940b8a32ff7125fe0b7281928d462d2b9448c5d
aaf915fdd65a665704596a4a8500af5e84dfda60
refs/heads/master
2021-01-02T22:56:20.384457
2017-11-15T04:25:20
2017-11-15T04:25:20
99,425,220
0
0
null
null
null
null
UTF-8
C++
false
false
1,300
cpp
#include "stdafx.h" using namespace std; class Solution { public: /** * @param A: sorted integer array A which has m elements, * but size of A is m+n * @param B: sorted integer array B which has n elements * @return: void */ void mergeSortedArray(int A[], int m, int B[], int n) { // write your code here if (m == 0) { for (int i = 0; i < n; i++) { A[i] = B[i]; } return; } int *ACopy = new int[m]; for (int i = 0; i < m; i++) { ACopy[i] = A[i]; } int posInACp = 0; int posInB = 0; int posInA = 0; while (posInACp < m && posInB < n) { while(posInACp < m && posInB < n && ACopy[posInACp] <= B[posInB]) { A[posInA] = ACopy[posInACp]; posInACp++; posInA++; } while(posInACp < m && posInB < n && ACopy[posInACp] > B[posInB]) { A[posInA] = B[posInB]; posInB++; posInA++; } } while (posInACp < m) { A[posInA] = ACopy[posInACp]; posInA++; posInACp++; } while (posInB < n) { A[posInA] = B[posInB]; posInA++; posInB++; } } }; //int main() //{ // int A[] = { 1,2,3,6,0,0 }; // int B[] = { 4,5 }; // int m = 4; // int n = 2; // Solution s; // s.mergeSortedArray(A, m, B, n); // for (int i = 0; i < m + n; i++) // { // cout << A[i] << " "; // } // return 0; //}
[ "406226842@qq.com" ]
406226842@qq.com
bf01cc2ba9d946c1dc8465de139f80a849d09735
3ed6c576a3cdd870c1247262cbbd4f9f292a190b
/UniOpusTest/iOS/usc/ASRVadWapper.cpp
ee8e11bdc2ddbac085870ebe7c42feb41e6d9ece
[]
no_license
pxhmeiyangyang/UniOpus
ca8665d321135e65e48a3fb51745e9dc827b5e33
5cc0ab16151e5e3e641f74815ccab00637a342b1
refs/heads/master
2021-01-20T20:32:26.484390
2016-07-01T06:10:06
2016-07-01T06:10:06
62,272,586
0
0
null
null
null
null
UTF-8
C++
false
false
1,654
cpp
// // ASRVadWapper.cpp // usc // // Created by hejinlai on 12-11-15. // Copyright (c) 2012年 yunzhisheng. All rights reserved. // #include "ASRVadWapper.h" #include "string.h" #include "AsrVad.h" #define INPUT_BUFFER_LEN (8000*2) // 500ms #define VAD_BUFFER_LEN (4000*2) // 250ms ASRVadWapper::ASRVadWapper() { vad = new AsrVAD(); } int ASRVadWapper::init() { if (vad != NULL) { return vad->init(); } return -1; } void ASRVadWapper::setVadTimeout(int frontTimeout, int backTimeout) { if (vad != NULL) { vad->setVadSilTime(frontTimeout, backTimeout); } } void ASRVadWapper::reset() { if (vad != NULL) { vad->reset(); } } int ASRVadWapper::isActive(char *pcm, int len, int *energy) { int status = vad->process((short*)pcm, len/(sizeof(short)), energy); if(status == 1 || status == 2){ return 0; }else if(status == 0 || status == 3){ return 1; }else{ return 0; } } int ASRVadWapper::isVadTimeout(char *pcm, int len, int *volumn) { // 拷贝录音数据,防止程序崩溃 char *pcmData = new char[len]; memcpy(pcmData, pcm, len); int offset = 0; do { int readLen = (len-offset)>VAD_BUFFER_LEN?VAD_BUFFER_LEN:(len-offset); int r = isActive(pcmData + offset, readLen, volumn); if (r == 0) { // 释放资源 delete [] pcmData; return VADTimeout; } offset += readLen; }while(offset < len); // 释放资源 delete [] pcmData; return 0; } ASRVadWapper::~ASRVadWapper() { delete vad; vad = NULL; }
[ "peixinhua@unisound.com" ]
peixinhua@unisound.com
77405e2221a70dc38f03732e7d4eb8f2c36f9c9e
1446a45de06399c141ad722b70f8a4e2f88f01c8
/boost_1_34_1/boost_1_34_1/libs/spirit/example/fundamental/distinct/distinct_parser_dynamic.cpp
b5720724ea6cb665ea959e3d5a42d89c2b1356b5
[ "LicenseRef-scancode-unknown-license-reference", "BSL-1.0" ]
permissive
Thrinaria/Codebase
270d2b837242e113d733a7e6405b5294faede534
85e541a9d1e57f7bf30b5114e5e0a2063275a75d
refs/heads/master
2021-01-01T20:34:47.359877
2015-01-30T06:04:42
2015-01-30T06:04:42
29,504,087
3
4
null
2015-01-25T01:55:41
2015-01-20T00:41:11
C++
UTF-8
C++
false
false
1,712
cpp
/*============================================================================= Copyright (c) 2003 Vaclav Vesely http://spirit.sourceforge.net/ Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #include <cassert> #include <iostream> #include <boost/cstdlib.hpp> #include <boost/spirit/core.hpp> #include <boost/spirit/utility/distinct.hpp> using namespace std; using namespace boost; using namespace spirit; struct my_grammar: public grammar<my_grammar> { template <typename ScannerT> struct definition { typedef rule<ScannerT> rule_t; // keyword_p for ASN.1 dynamic_distinct_parser<ScannerT> keyword_p; definition(my_grammar const& self) : keyword_p(alnum_p | ('-' >> ~ch_p('-'))) // ASN.1 has quite complex naming rules { top = keyword_p("asn-declare") // use keyword_p instead of std_p >> !str_p("--") >> keyword_p("ident") ; } rule_t top; rule_t const& start() const { return top; } }; }; int main() { my_grammar gram; parse_info<> info; info = parse("asn-declare ident", gram, space_p); assert(info.full); // valid input info = parse("asn-declare--ident", gram, space_p); assert(info.full); // valid input info = parse("asn-declare-ident", gram, space_p); assert(!info.hit); // invalid input return exit_success; }
[ "thrin_d@live.nl" ]
thrin_d@live.nl
180a722b6aae17549ac5bec5e72d9ec7a0ac565f
b8fd1b4073e0e086d1890aedaa33d0ad6abb8a92
/cpp_envelope/my_intrusive_ptr.h
27b23b502fcd15e5cf02bb5bda01d26cd7d27bbe
[ "MIT" ]
permissive
yakir22/ts2cpp
9becc202747db7879ab04f4297bfeb6f168f2730
a0600683e3695415bd38ec562fe63e9311f41db5
refs/heads/master
2020-03-11T08:38:33.997379
2018-10-23T06:47:58
2018-10-23T06:47:58
129,888,926
11
0
null
null
null
null
UTF-8
C++
false
false
8,616
h
#ifndef BOOST_SMART_PTR_my_intrusive_ptr_HPP_INCLUDED #define BOOST_SMART_PTR_my_intrusive_ptr_HPP_INCLUDED // // my_intrusive_ptr.hpp // // Copyright (c) 2001, 2002 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) // // See http://www.boost.org/libs/smart_ptr/ for documentation. // #include <boost/config.hpp> #include <boost/assert.hpp> #include <boost/detail/workaround.hpp> #include <boost/smart_ptr/detail/sp_convertible.hpp> #include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/smart_ptr/detail/sp_noexcept.hpp> #include <boost/config/no_tr1/functional.hpp> // for std::less #if !defined(BOOST_NO_IOSTREAM) #if !defined(BOOST_NO_IOSFWD) #include <iosfwd> // for std::basic_ostream #else #include <ostream> #endif #endif namespace boost { // // my_intrusive_ptr // // A smart pointer that uses intrusive reference counting. // // Relies on unqualified calls to // // void my_intrusive_ptr_add_ref(T * p); // void my_intrusive_ptr_release(T * p); // // (p != 0) // // The object is responsible for destroying itself. // template<class T> class my_intrusive_ptr { private: typedef my_intrusive_ptr this_type; public: typedef T element_type; BOOST_CONSTEXPR my_intrusive_ptr() BOOST_SP_NOEXCEPT : px( 0 ) { } my_intrusive_ptr( T * p, bool add_ref = true ): px( p ) { if( px != 0 && add_ref ) my_intrusive_ptr_add_ref( px ); } #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) template<class U> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) my_intrusive_ptr( my_intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() ) #else my_intrusive_ptr( my_intrusive_ptr<U> const & rhs ) #endif : px( rhs.get() ) { if( px != 0 ) my_intrusive_ptr_add_ref( px ); } #endif my_intrusive_ptr(my_intrusive_ptr const & rhs): px( rhs.px ) { if( px != 0 ) my_intrusive_ptr_add_ref( px ); } ~my_intrusive_ptr() { if( px != 0 ) my_intrusive_ptr_release( px ); } #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) template<class U> my_intrusive_ptr & operator=(my_intrusive_ptr<U> const & rhs) { this_type(rhs).swap(*this); return *this; } #endif // Move support #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) my_intrusive_ptr(my_intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px ) { if (rhs.px) rhs.px->mMemorySpace = MemorySpace::None; rhs.px = 0; } my_intrusive_ptr & operator=(my_intrusive_ptr && rhs) BOOST_SP_NOEXCEPT { this_type( static_cast< my_intrusive_ptr && >( rhs ) ).swap(*this); return *this; } template<class U> friend class my_intrusive_ptr; template<class U> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) my_intrusive_ptr(my_intrusive_ptr<U> && rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty()) #else my_intrusive_ptr(my_intrusive_ptr<U> && rhs) #endif : px( rhs.px ) { rhs.px = 0; } template<class U> my_intrusive_ptr & operator=(my_intrusive_ptr<U> && rhs) BOOST_SP_NOEXCEPT { this_type( static_cast< my_intrusive_ptr<U> && >( rhs ) ).swap(*this); return *this; } #endif my_intrusive_ptr & operator=(my_intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } my_intrusive_ptr & operator=(T * rhs) { this_type(rhs).swap(*this); return *this; } void reset() { this_type().swap( *this ); } void reset( T * rhs ) { this_type( rhs ).swap( *this ); } void reset( T * rhs, bool add_ref ) { this_type( rhs, add_ref ).swap( *this ); } T * get() const BOOST_SP_NOEXCEPT { return px; } T * detach() BOOST_SP_NOEXCEPT { T * ret = px; px = 0; return ret; } T & operator*() const BOOST_SP_NOEXCEPT_WITH_ASSERT { BOOST_ASSERT( px != 0 ); return *px; } T * operator->() const BOOST_SP_NOEXCEPT_WITH_ASSERT { BOOST_ASSERT( px != 0 ); return px; } // implicit conversion to "bool" #include <boost/smart_ptr/detail/operator_bool.hpp> void swap(my_intrusive_ptr & rhs) BOOST_SP_NOEXCEPT { T * tmp = px; px = rhs.px; rhs.px = tmp; } private: T * px; }; template<class T, class U> inline bool operator==(my_intrusive_ptr<T> const & a, my_intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT { return a.get() == b.get(); } template<class T, class U> inline bool operator!=(my_intrusive_ptr<T> const & a, my_intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT { return a.get() != b.get(); } template<class T, class U> inline bool operator==(my_intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT { return a.get() == b; } template<class T, class U> inline bool operator!=(my_intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT { return a.get() != b; } template<class T, class U> inline bool operator==(T * a, my_intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT { return a == b.get(); } template<class T, class U> inline bool operator!=(T * a, my_intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT { return a != b.get(); } #if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 // Resolve the ambiguity between our op!= and the one in rel_ops template<class T> inline bool operator!=(my_intrusive_ptr<T> const & a, my_intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT { return a.get() != b.get(); } #endif #if !defined( BOOST_NO_CXX11_NULLPTR ) template<class T> inline bool operator==( my_intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } template<class T> inline bool operator==( boost::detail::sp_nullptr_t, my_intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } template<class T> inline bool operator!=( my_intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, my_intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } #endif template<class T> inline bool operator<(my_intrusive_ptr<T> const & a, my_intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT { return std::less<T *>()(a.get(), b.get()); } template<class T> void swap(my_intrusive_ptr<T> & lhs, my_intrusive_ptr<T> & rhs) BOOST_SP_NOEXCEPT { lhs.swap(rhs); } // mem_fn support template<class T> T * get_pointer(my_intrusive_ptr<T> const & p) BOOST_SP_NOEXCEPT { return p.get(); } template<class T, class U> my_intrusive_ptr<T> static_pointer_cast(my_intrusive_ptr<U> const & p) { return static_cast<T *>(p.get()); } template<class T, class U> my_intrusive_ptr<T> const_pointer_cast(my_intrusive_ptr<U> const & p) { return const_cast<T *>(p.get()); } template<class T, class U> my_intrusive_ptr<T> dynamic_pointer_cast(my_intrusive_ptr<U> const & p) { return dynamic_cast<T *>(p.get()); } // operator<< #if !defined(BOOST_NO_IOSTREAM) #if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) ) template<class Y> std::ostream & operator<< (std::ostream & os, my_intrusive_ptr<Y> const & p) { os << p.get(); return os; } #else // in STLport's no-iostreams mode no iostream symbols can be used #ifndef _STLP_NO_IOSTREAMS # if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT) // MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL using std::basic_ostream; template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, my_intrusive_ptr<Y> const & p) # else template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, my_intrusive_ptr<Y> const & p) # endif { os << p.get(); return os; } #endif // _STLP_NO_IOSTREAMS #endif // __GNUC__ < 3 #endif // !defined(BOOST_NO_IOSTREAM) // hash_value template< class T > struct hash; template< class T > std::size_t hash_value( boost::my_intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT { return boost::hash< T* >()( p.get() ); } } // namespace boost #endif // #ifndef BOOST_SMART_PTR_my_intrusive_ptr_HPP_INCLUDED
[ "yakir22@gmail.com" ]
yakir22@gmail.com
32f29d9adea3d5cc670d710ae70204d78e914734
4862db69a770ef7fb47de3d8f14aa4b2173ea6aa
/alvofinal/alvofinal.ino
8902979b4c69300874a39c2e9edc2707b3fdddc8
[]
no_license
santos-hacker-clube/robofredo_aula
db4f402f9f3b1f1de3c99aace1285a67bb9acdc9
a9717f2ac345224a560a00ce7b26a5287ec27964
refs/heads/master
2020-04-02T03:06:50.105731
2018-10-21T16:28:15
2018-10-21T16:28:15
153,946,855
1
1
null
null
null
null
UTF-8
C++
false
false
1,582
ino
#include <ESP8266WiFi.h> extern "C" { #include <espnow.h> } #ifndef UNIT_TEST #include <Arduino.h> #endif #include <IRremoteESP8266.h> #include <IRrecv.h> #include <IRutils.h> #define WIFI_CHANNEL 1 //MAC ADDRESS OF THE DEVICE YOU ARE SENDING TO byte remoteMac[] = {0xA0, 0x20, 0xA6, 0x25, 0x1F, 0x35}; const byte dataLength=7; byte cnt=0; byte rcvData[dataLength]; byte result; // An IR detector/demodulator is connected to GPIO pin 14(D5 on a NodeMCU // board). const uint16_t kRecvPin = 14; IRrecv irrecv(kRecvPin); decode_results results; void setup() { Serial.begin(115200); WiFi.mode(WIFI_STA); WiFi.begin(); Serial.print("\r\n\r\nDevice MAC: "); Serial.println(WiFi.macAddress()); Serial.println("\r\nESP_Now Controller."); esp_now_init(); delay(10); esp_now_set_self_role(ESP_NOW_ROLE_CONTROLLER); esp_now_add_peer(remoteMac, ESP_NOW_ROLE_COMBO, WIFI_CHANNEL, NULL, 0); irrecv.enableIRIn(); // Start the receiver while (!Serial) // Wait for the serial connection to be establised. delay(50); Serial.println(); Serial.print("IRrecvDemo is now running and waiting for IR message on Pin "); Serial.println(kRecvPin); } void loop() { for(cnt=0; cnt<dataLength; cnt++) { rcvData[cnt]++; } if (irrecv.decode(&results)) { // print() & println() can't handle printing long longs. (uint64_t) serialPrintUint64(results.value, HEX); Serial.println(""); result = esp_now_send(remoteMac, rcvData, dataLength); Serial.println(result); irrecv.resume(); // Receive the next value } delay(100); }
[ "yhan.christian@live.com" ]
yhan.christian@live.com
55f3732a1873662beee9730214d8d5a1fd95b73c
e73b82d4b4e42c6f05f6192330fea29556520d6d
/generic/viaduct/fabulous/constids.inc
69b2e4f98dd9329cb03567d34666660db58a1539
[ "ISC" ]
permissive
YosysHQ/nextpnr
cefc79c55298964ac8c9e9f0cd88a51bde099793
e08471dfaf49c1c0eb0ea53a85db5f42b5833a53
refs/heads/master
2023-08-25T19:05:24.812785
2023-08-24T06:55:53
2023-08-24T07:20:44
143,147,942
1,115
252
ISC
2023-09-14T07:42:48
2018-08-01T11:39:03
C++
UTF-8
C++
false
false
1,201
inc
X(FABULOUS_LC) X(FABULOUS_COMB) X(FABULOUS_FF) X(SET_NORESET) X(ASYNC_SR) X(NEG_CLK) X(FF) X(LATCH_NOFF) X(IO_1_bidirectional_frame_config_pass) X(InPass4_frame_config) X(OutPass4_frame_config) X(InPass4_frame_config_mux) X(OutPass4_frame_config_mux) X(RegFile_32x4) X(MULADD) X(MUX8LUT_frame_config) X(MUX8LUT_frame_config_mux) X(CLK) X(I) X(T) X(O) X(Q) X(Ci) X(Co) X(X0Y0) X(REG_CLK) X(LUT_CLK) X(global_clock) X(Global_Clock) X(O2Q) X(WRITE_DATA) X(WRITE_ADDRESS) X(READ_DATA) X(READ_ADDRESS) X(DSP_DATA_OUT) X(DSP_DATA_IN) X(DSP_CLR) X(carry_in) X(carry_out) X(LUTFF) X(LUTFF_E) X(LUTFF_SR) X(LUTFF_SS) X(LUTFF_ESR) X(LUTFF_ESS) X(LUTFF_R) X(LUTFF_S) X(LUTFF_ER) X(LUTFF_ES) X(LUTFF_N) X(LUTFF_NE) X(LUTFF_NSR) X(LUTFF_NSS) X(LUTFF_NESR) X(LUTFF_NESS) X(LUTFF_NR) X(LUTFF_NS) X(LUTFF_NER) X(LUTFF_NES) X(clr) X(__disconnected) X(INIT) X(E) X(C) X(D) X(S) X(R) X(SR) X(EN) X(BEL) X(PAD) X(LUT1) X(LUT4_HA) X(BelBegin) X(BelEnd) X(GlobalClk) X(CFG) X(FABULOUS_MUX2) X(FABULOUS_MUX4) X(FABULOUS_MUX8) X(M_AB) X(M_AD) X(M_EF) X(M_AH) X(I0MUX) X(GND0) X(GND) X(VCC0) X(VCC) X(VDD0) X(VDD) X(_CONST0_DRV) X(_CONST1_DRV) X(_CONST0) X(_CONST1) X(_LUT_PERM) X(_LUT_PERM_IN) X(I_reg)
[ "gatecat@ds0.me" ]
gatecat@ds0.me
f2ef552b433bb6a7c242bbb2ff313615ca51a136
d0b237d01abc0caa0034b1cf0ef79f005573d906
/ZOJ_1008_GnomeTetravex.cpp
8d0bdea721c705c3367239119c0f4b1bd2f15c30
[]
no_license
shadowmydx/poj
7e68f266d4631cbdafa480f4812ac810e59b1b72
0066fa9f7bb02890ac3a1dca1c7667176add2f6f
refs/heads/master
2021-01-23T06:54:45.782431
2014-10-15T09:52:58
2014-10-15T09:52:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,274
cpp
#include <stdio.h> typedef struct vex { int top; int right; int down; int left; }vex; vex target[30]; int n,length; vex result[6][6]; int visit[30]; int haveSol(int x,int y) { if(x >= n) return 1; int flag = 0; int x1 = x - 1; int y1 = y; int x2 = x; int y2 = y - 1; int nextY = y + 1; int nextX = x; if(nextY >= n) { nextX = x + 1; nextY = 0; } for(int i = 0;i < length;i++) { if(visit[i] == 0) { if(x1 >= 0 && y2 >= 0) { if(target[i].top == result[x1][y1].down && target[i].left == result[x2][y2].right) { result[x][y] = target[i]; visit[i] = 1; flag = haveSol(nextX,nextY); if(!flag)visit[i] = 0; } } else if(x1 >= 0) { if(target[i].top == result[x1][y1].down) { result[x][y] = target[i]; visit[i] = 1; flag = haveSol(nextX,nextY); if(!flag) { visit[i] = 0; } } } else if(y2 >= 0) { if(target[i].left == result[x2][y2].right) { result[x][y] = target[i]; visit[i] = 1; flag = haveSol(nextX,nextY); if(!flag)visit[i] = 0; } } else { result[x][y] = target[i]; visit[i] = 1; flag = haveSol(nextX,nextY); if(!flag)visit[i] = 0; } if(flag == 1)break; } } return flag; } int main(void) { while(scanf("%d",&n)) { if(0 == n)break; length = n * n; for(int i = 0;i < length;i++) { vex tmp; scanf("%d%d%d%d",&tmp.top,&tmp.right,&tmp.down,&tmp.left); target[i] = tmp; } if(haveSol(0,0)) printf("Possible\n"); else printf("Impossible\n"); } return 0; }
[ "shadowmydx@gmail.com" ]
shadowmydx@gmail.com
7d199da72f177c6b45a2b3ec8b27e116de93fbf2
5694a3e32ffc0ddb83ed03e5e6c81a87940bd101
/343.1.cpp
5b16ed9c965e80ec6c632718fdbbd253291f1002
[]
no_license
maknunlakme/Uva-Solutions
50bcce1436a002898a826ca61ed22ebb8af441f7
e4e25ffb0c0e78a0d540307f4118d65b0567709b
refs/heads/master
2020-04-08T12:04:16.973329
2018-11-27T12:53:49
2018-11-27T12:53:49
159,332,232
0
0
null
null
null
null
UTF-8
C++
false
false
1,454
cpp
#include<iostream> #include<string> #include<cmath> using namespace std; long long int baseconvert(int base,string line) { int length=line.length(); long long int i,j,total=0,temp,temp1; for(i=length-1,j=0; i>-1; i--,j++) { if(line[i]>='0'&&line[i]<='9') { temp=line[i]-'0'; } else if(line[i]>='A'&&line[i]<='Z') { temp=line[i]-'7'; } if(temp>=base) { return -1; } temp1=ceil(temp*pow(base,j)); total+=temp1; } return total; } int main() { long long int i,j,base_a,base_b,temp; string a,b; bool double_break; while(cin>>a>>b) { base_a=0; base_b=0; for(i=2; i<=36; i++) { temp=baseconvert(i,a); if(temp>-1) { for(j=2; j<=36; j++) { if(temp==baseconvert(j,b)) { base_a=i; base_b=j; i=40; j=40; break; } } } } if(base_a==0&&base_b==0) { cout<<a<<" is not equal to "<<b<<" in any base 2..36"<<endl; } else { cout<<a<<" (base "<<base_a<<") = "<<b<<" (base "<<base_b<<")"<<endl; } } return 0; }
[ "maknunsmail@gmail.com" ]
maknunsmail@gmail.com
abe5cf1198586f4d4da86d77e29df8d16257cbab
f7c2e7038e94181a130086182562c93194e89cca
/Spoj/NSTEPS.cpp
d75939870c94c7b09c0269829fba17e81f4fe906
[]
no_license
PrajwalaTM/accepted
d836749488fe0089c6519c89462df667d85f3d01
0d305186950c6bb3a56b99e6c08a6cc039d4824d
refs/heads/master
2021-06-18T20:22:23.916516
2017-05-05T15:43:44
2017-05-05T15:43:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
367
cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf("%d",&t); while(t--) { int x,y,ans; scanf("%d%d",&x,&y); if(x==y){ if(x%2) ans=2*x-1; else ans=2*x; } else if (x==y+2) { if(!(x%2)) ans=x+y; else ans=x+y-1; } else ans=-1; if(ans!=-1) printf("%d\n",ans); else printf("No Number\n"); } }
[ "prajwala.tm@gmail.com" ]
prajwala.tm@gmail.com
c328bbd86c45ad3bc72789d8df4d0b3f72acfa1f
45dc7f6d8ce52e34dae8c3eb72625b4820364bc0
/vendor/github.com/cloudflare/cfssl/vendor/github.com/google/certificate-transparency/go/merkletree/merkle_tree_go.cc
427bde8bffad6bbd336699d168cebbdeedbd4775
[ "Apache-2.0", "BSD-2-Clause" ]
permissive
getcfs/megacfs
c8c4879de93f6051de8621cf2186ad742a030498
4de1a888fab4c112bed1d458f8c93019f8e47094
refs/heads/master
2020-05-21T20:31:56.281633
2017-05-05T22:24:33
2017-05-05T22:24:33
60,365,871
7
12
null
2017-05-05T22:24:34
2016-06-03T17:32:32
Go
UTF-8
C++
false
false
4,072
cc
#include "merkletree/merkle_tree.h" #include <assert.h> #include <cstdlib> #include <cstring> #include <memory> #include <vector> #include "merkle_tree_go.h" extern "C" { // Some hollow functions to cast the void* types into what they really // are, they're only really here to provide a little bit of type // safety. Hopefully these should all be optimized away into oblivion // by the compiler. static inline MerkleTree* MT(TREE tree) { assert(tree); return static_cast<MerkleTree*>(tree); } static inline Sha256Hasher* H(HASHER hasher) { assert(hasher); return static_cast<Sha256Hasher*>(hasher); } HASHER NewSha256Hasher() { return new Sha256Hasher; } TREE NewMerkleTree(HASHER hasher) { return new MerkleTree(std::unique_ptr<SerialHasher>(H(hasher))); } void DeleteMerkleTree(TREE tree) { delete MT(tree); } size_t NodeSize(TREE tree) { return MT(tree)->NodeSize(); } size_t LeafCount(TREE tree) { return MT(tree)->LeafCount(); } size_t LeafHash(TREE tree, size_t leaf, void* buf, size_t buf_len) { const MerkleTree* t(MT(tree)); const size_t nodesize(t->NodeSize()); if (buf == NULL || buf_len < nodesize) { return 0; } const std::string& hash = t->LeafHash(leaf); assert(nodesize == hash.size()); memcpy(buf, hash.data(), nodesize); return nodesize; } size_t LevelCount(TREE tree) { const MerkleTree* t(MT(tree)); return t->LevelCount(); } size_t AddLeaf(TREE tree, void* leaf, size_t leaf_len) { MerkleTree* t(MT(tree)); return t->AddLeaf(std::string(static_cast<char*>(leaf), leaf_len)); } size_t AddLeafHash(TREE tree, void* hash, size_t hash_len) { MerkleTree* t(MT(tree)); return t->AddLeafHash( std::string(static_cast<char*>(hash), hash_len)); } size_t CurrentRoot(TREE tree, void* buf, size_t buf_len) { MerkleTree* t(MT(tree)); const size_t nodesize(t->NodeSize()); if (buf == NULL || buf_len < nodesize) { return 0; } const std::string& hash = t->CurrentRoot(); assert(nodesize == hash.size()); memcpy(buf, hash.data(), nodesize); return nodesize; } size_t RootAtSnapshot(TREE tree, size_t snapshot, void* buf, size_t buf_len) { MerkleTree* t(MT(tree)); const size_t nodesize(t->NodeSize()); if (buf == nullptr || buf_len < nodesize) { return 0; } const std::string& hash = t->RootAtSnapshot(snapshot); assert(nodesize == hash.size()); memcpy(buf, hash.data(), nodesize); return nodesize; } // Copies the fixed-length entries from |path| into the GoSlice // pointed to by |dst|, one after the other in the same order. // |num_copied| is set to the number of entries copied. bool CopyNodesToSlice(const std::vector<std::string>& path, void* dst, size_t dst_len, size_t nodesize, size_t* num_copied) { assert(dst); assert(num_copied); if (dst_len < path.size() * nodesize) { *num_copied = 0; return false; } char *e(static_cast<char*>(dst)); for (int i = 0; i < path.size(); ++i) { assert(nodesize == path[i].size()); memcpy(e, path[i].data(), nodesize); e += nodesize; } *num_copied = path.size(); return true; } bool PathToCurrentRoot(TREE tree, size_t leaf, void* out, size_t out_len, size_t* num_entries) { MerkleTree* t(MT(tree)); const std::vector<std::string> path = t->PathToCurrentRoot(leaf); return CopyNodesToSlice(path, out, out_len, t->NodeSize(), num_entries); } bool PathToRootAtSnapshot(TREE tree, size_t leaf, size_t snapshot, void *out, size_t out_len, size_t *num_entries) { MerkleTree* t(MT(tree)); const std::vector<std::string> path = t->PathToRootAtSnapshot(leaf, snapshot); return CopyNodesToSlice(path, out, out_len, t->NodeSize(), num_entries); } bool SnapshotConsistency(TREE tree, size_t snapshot1, size_t snapshot2, void* out, size_t out_len, size_t* num_entries) { MerkleTree* t(MT(tree)); const std::vector<std::string> path = t->SnapshotConsistency(snapshot1, snapshot2); return CopyNodesToSlice(path, out, out_len, t->NodeSize(), num_entries); } } // extern "C"
[ "gregory.holt@gmail.com" ]
gregory.holt@gmail.com
8d6e4ab35915038245a9c2aeb63987746caf5ec8
0915cc680123206fd1c67eb1b4f8edeb021b7cbf
/Chapter-7-Arrays/7.12 If You Plan to Continue in Computer Science: Introduction to the STL vector/7-24.cpp
1b6b70f5a5838149fb243888e46bb10adaf3ff33
[ "MIT" ]
permissive
Usman032/DelMarCSi.cpp
cc5a1994061e009b378757503476ccb298a7d5e2
6dd7905daea510452691fd25b0e3b0d2da0b06aa
refs/heads/master
2022-01-03T02:42:07.317325
2018-03-14T20:58:27
2018-03-14T20:58:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,505
cpp
//************************************************************** // This program stores, in two vectors, the hours worked by 5 // employees, and their hourly pay rates. // // By: Jesus Hilario Hernandez // Last Updated: November 11th, 2016 //************************************************************** #include <iostream> #include <vector> // Needed to define vectors #include <iomanip> using namespace std; int main() { const int NUM_EMPLOYEES = 5; // Numbers of employees vector<int> hours(NUM_EMPLOYEES); // A vector of integers vector<double> payRate(NUM_EMPLOYEES); // A vector of doubles int index; // Loop counter // Input the data. cout << "Enter the hours worked by " << NUM_EMPLOYEES; cout << " employees and their hourly rates.\n"; for (index = 0; index < NUM_EMPLOYEES; index++) { cout << "Hours worked by employees #" << (index + 1); cout << ": "; cin >> hours[index]; cout << "Hourly pay rate for employee #"; cout << (index + 1) << ": "; cin >> payRate[index]; } // Display each empolyee's gross pay. cout << "\nHere is the gross pay for each employee:\n"; cout << fixed << showpoint << setprecision(2); for (int index = 0; index < NUM_EMPLOYEES; index++) { double grossPay = hours[index] * payRate[index]; cout << "Employee #" << (index + 1); cout << ": $" << grossPay << endl; } return 0; }
[ "jesushilariohernandez@gmail.com" ]
jesushilariohernandez@gmail.com
0f9ef4ade7ea785938f3e059f1b057550b6c5be3
6ced41da926682548df646099662e79d7a6022c5
/aws-cpp-sdk-globalaccelerator/include/aws/globalaccelerator/model/CreateCustomRoutingEndpointGroupRequest.h
9b06a5137e66eb870188f363bb742faba07f7121
[ "Apache-2.0", "MIT", "JSON" ]
permissive
irods/aws-sdk-cpp
139104843de529f615defa4f6b8e20bc95a6be05
2c7fb1a048c96713a28b730e1f48096bd231e932
refs/heads/main
2023-07-25T12:12:04.363757
2022-08-26T15:33:31
2022-08-26T15:33:31
141,315,346
0
1
Apache-2.0
2022-08-26T17:45:09
2018-07-17T16:24:06
C++
UTF-8
C++
false
false
11,399
h
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/globalaccelerator/GlobalAccelerator_EXPORTS.h> #include <aws/globalaccelerator/GlobalAcceleratorRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/globalaccelerator/model/CustomRoutingDestinationConfiguration.h> #include <utility> #include <aws/core/utils/UUID.h> namespace Aws { namespace GlobalAccelerator { namespace Model { /** */ class AWS_GLOBALACCELERATOR_API CreateCustomRoutingEndpointGroupRequest : public GlobalAcceleratorRequest { public: CreateCustomRoutingEndpointGroupRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "CreateCustomRoutingEndpointGroup"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline const Aws::String& GetListenerArn() const{ return m_listenerArn; } /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline bool ListenerArnHasBeenSet() const { return m_listenerArnHasBeenSet; } /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline void SetListenerArn(const Aws::String& value) { m_listenerArnHasBeenSet = true; m_listenerArn = value; } /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline void SetListenerArn(Aws::String&& value) { m_listenerArnHasBeenSet = true; m_listenerArn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline void SetListenerArn(const char* value) { m_listenerArnHasBeenSet = true; m_listenerArn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithListenerArn(const Aws::String& value) { SetListenerArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithListenerArn(Aws::String&& value) { SetListenerArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the listener for a custom routing * endpoint.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithListenerArn(const char* value) { SetListenerArn(value); return *this;} /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline const Aws::String& GetEndpointGroupRegion() const{ return m_endpointGroupRegion; } /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline bool EndpointGroupRegionHasBeenSet() const { return m_endpointGroupRegionHasBeenSet; } /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline void SetEndpointGroupRegion(const Aws::String& value) { m_endpointGroupRegionHasBeenSet = true; m_endpointGroupRegion = value; } /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline void SetEndpointGroupRegion(Aws::String&& value) { m_endpointGroupRegionHasBeenSet = true; m_endpointGroupRegion = std::move(value); } /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline void SetEndpointGroupRegion(const char* value) { m_endpointGroupRegionHasBeenSet = true; m_endpointGroupRegion.assign(value); } /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithEndpointGroupRegion(const Aws::String& value) { SetEndpointGroupRegion(value); return *this;} /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithEndpointGroupRegion(Aws::String&& value) { SetEndpointGroupRegion(std::move(value)); return *this;} /** * <p>The Amazon Web Services Region where the endpoint group is located. A * listener can have only one endpoint group in a specific Region.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithEndpointGroupRegion(const char* value) { SetEndpointGroupRegion(value); return *this;} /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline const Aws::Vector<CustomRoutingDestinationConfiguration>& GetDestinationConfigurations() const{ return m_destinationConfigurations; } /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline bool DestinationConfigurationsHasBeenSet() const { return m_destinationConfigurationsHasBeenSet; } /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline void SetDestinationConfigurations(const Aws::Vector<CustomRoutingDestinationConfiguration>& value) { m_destinationConfigurationsHasBeenSet = true; m_destinationConfigurations = value; } /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline void SetDestinationConfigurations(Aws::Vector<CustomRoutingDestinationConfiguration>&& value) { m_destinationConfigurationsHasBeenSet = true; m_destinationConfigurations = std::move(value); } /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithDestinationConfigurations(const Aws::Vector<CustomRoutingDestinationConfiguration>& value) { SetDestinationConfigurations(value); return *this;} /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithDestinationConfigurations(Aws::Vector<CustomRoutingDestinationConfiguration>&& value) { SetDestinationConfigurations(std::move(value)); return *this;} /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline CreateCustomRoutingEndpointGroupRequest& AddDestinationConfigurations(const CustomRoutingDestinationConfiguration& value) { m_destinationConfigurationsHasBeenSet = true; m_destinationConfigurations.push_back(value); return *this; } /** * <p>Sets the port range and protocol for all endpoints (virtual private cloud * subnets) in a custom routing endpoint group to accept client traffic on.</p> */ inline CreateCustomRoutingEndpointGroupRequest& AddDestinationConfigurations(CustomRoutingDestinationConfiguration&& value) { m_destinationConfigurationsHasBeenSet = true; m_destinationConfigurations.push_back(std::move(value)); return *this; } /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline const Aws::String& GetIdempotencyToken() const{ return m_idempotencyToken; } /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline bool IdempotencyTokenHasBeenSet() const { return m_idempotencyTokenHasBeenSet; } /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline void SetIdempotencyToken(const Aws::String& value) { m_idempotencyTokenHasBeenSet = true; m_idempotencyToken = value; } /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline void SetIdempotencyToken(Aws::String&& value) { m_idempotencyTokenHasBeenSet = true; m_idempotencyToken = std::move(value); } /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline void SetIdempotencyToken(const char* value) { m_idempotencyTokenHasBeenSet = true; m_idempotencyToken.assign(value); } /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithIdempotencyToken(const Aws::String& value) { SetIdempotencyToken(value); return *this;} /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithIdempotencyToken(Aws::String&& value) { SetIdempotencyToken(std::move(value)); return *this;} /** * <p>A unique, case-sensitive identifier that you provide to ensure the * idempotency—that is, the uniqueness—of the request.</p> */ inline CreateCustomRoutingEndpointGroupRequest& WithIdempotencyToken(const char* value) { SetIdempotencyToken(value); return *this;} private: Aws::String m_listenerArn; bool m_listenerArnHasBeenSet; Aws::String m_endpointGroupRegion; bool m_endpointGroupRegionHasBeenSet; Aws::Vector<CustomRoutingDestinationConfiguration> m_destinationConfigurations; bool m_destinationConfigurationsHasBeenSet; Aws::String m_idempotencyToken; bool m_idempotencyTokenHasBeenSet; }; } // namespace Model } // namespace GlobalAccelerator } // namespace Aws
[ "aws-sdk-cpp-automation@github.com" ]
aws-sdk-cpp-automation@github.com
81465782d651d518b603162400404788b963ac22
e7e497b20442a4220296dea1550091a457df5a38
/main_project/feed/cwf_feed/ugc_action.h
c0a1902c3fcdf34ed58352f61032cb16553054e8
[]
no_license
gunner14/old_rr_code
cf17a2dedf8dfcdcf441d49139adaadc770c0eea
bb047dc88fa7243ded61d840af0f8bad22d68dee
refs/heads/master
2021-01-17T18:23:28.154228
2013-12-02T23:45:33
2013-12-02T23:45:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
735
h
#ifndef XCE_FEED_UGC_ACTION_H__ #define XCE_FEED_UGC_ACTION_H__ #include <string> #include "feed/cwf_feed/action.h" namespace xce { struct UgcFeedAction : public cwf::BaseAction { bool Match(const std::string& url) const; cwf::HttpStatusCode Process(cwf::Request*, cwf::Response*); #if 0 virtual cwf::User* Authorize(cwf::Request*); virtual const std::string& template_name() const { return ""; } virtual bool Match(const std::string& url) const; virtual cwf::HttpStatusCode GenerateHeader(cwf::Request* request, cwf::Header* header); virtual ctemplate::TemplateDictionary* Process(cwf::Request* request); FeedTypeAction() : template_name_("replylist.tpl") {} #endif }; } #endif // XCE_FEED_UGC_ACTION_H__
[ "liyong19861014@gmail.com" ]
liyong19861014@gmail.com
b44b7cd778525218d43eccf25dde8805b3bc710a
0d0233c38d632a8baa5b1447ad151043eb8ab822
/5 - 3.cpp
8620bcebede50bcfeffd11da0eaf4e26e2b81404
[]
no_license
chegainthegithub/HW
9480fc3d2c95368d7a99315a56421b46b25b49b4
24599853e65b731c9952a96a9344035ff4b493db
refs/heads/master
2021-01-02T09:20:06.730020
2015-05-12T12:32:41
2015-05-12T12:32:41
26,775,793
0
0
null
null
null
null
UTF-8
C++
false
false
809
cpp
#include <iostream> using namespace std; int main() { int n,x,u,d,k; cin >> n; int *m = new int[n]; for(int i=0;i<n;i++) { cin >> m[i]; } for(int i=1;i<n;i++) { u = i; d = 0; while((u-d) > 1) { if(m[i] >= m[(u+d)/2]) { d = (u+d)/2; } else { u = (u+d)/2; } } k = i; while(k>u) { x = m[k]; m[k] = m[k-1]; m[k-1] = x; k--; } if(m[k]<m[k-1]) { x = m[k]; m[k] = m[k-1]; m[k-1] = x; } } for(int i=0;i<n;i++) { cout << m[i] << ' '; } delete[] m; return 0; }
[ "chegevara.4151@gmail.com" ]
chegevara.4151@gmail.com
ad62e2d6bdc2dd2a0cfb18b33fefc1015c3e9af2
849b89a374eff25ed283be1dfbf79079e88e33ee
/src/sigma/sigmaplus_prover.h
975c11856d49551f5a5882fce35c55543cc8c40e
[]
no_license
SpecialCoins/BitcoinZero
03ca6c8fa27837412d2f8794dfae41956562bf94
0db1fca31f5b86a84d32aadde9aee9b9a0b235a8
refs/heads/master
2023-04-15T11:44:16.958930
2023-04-04T15:07:01
2023-04-04T15:07:01
223,017,498
17
10
null
2022-06-21T15:45:16
2019-11-20T20:03:11
C
UTF-8
C++
false
false
810
h
#ifndef BZX_SIGMA_SIGMAPLUS_PROVER_H #define BZX_SIGMA_SIGMAPLUS_PROVER_H #include "r1_proof_generator.h" #include "sigmaplus_proof.h" #include <cstddef> namespace sigma { template <class Exponent, class GroupElement> class SigmaPlusProver{ public: SigmaPlusProver(const GroupElement& g, const std::vector<GroupElement>& h_gens, std::size_t n, std::size_t m); void proof(const std::vector<GroupElement>& commits, std::size_t l, const Exponent& r, bool fPadding, SigmaPlusProof<Exponent, GroupElement>& proof_out); private: GroupElement g_; std::vector<GroupElement> h_; std::size_t n_; std::size_t m_; }; } // namespace sigma #include "sigmaplus_prover.hpp" #endif // BZX_SIGMA_SIGMAPLUS_PROVER_H
[ "93263160+SPC-beta@users.noreply.github.com" ]
93263160+SPC-beta@users.noreply.github.com
6528aac497f9a39e93a108f87c63fa1e77efadc4
6d34fa23c708320b2e42d120d107f187106302e3
/orca/gporca/libgpopt/include/gpopt/search/CJobGroupExploration.h
0e1398dbb4bbdbfc5cb60d490d95e40d3d795715
[ "Apache-2.0" ]
permissive
joe2hpimn/dg16.oss
a38ca233ba5c9f803f9caa99016a4c7560da9f08
2c4275c832b3e4b715b7475726db6757b127030c
refs/heads/master
2021-08-23T19:11:49.831210
2017-12-06T05:23:22
2017-12-06T05:23:22
113,322,478
2
1
null
2017-12-06T13:50:44
2017-12-06T13:50:44
null
UTF-8
C++
false
false
3,373
h
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2011 EMC Corp. // // @filename: // CJobGroupExploration.h // // @doc: // Group exploration job // // @owner: // // // @test: // // //--------------------------------------------------------------------------- #ifndef GPOPT_CJobGroupExploration_H #define GPOPT_CJobGroupExploration_H #include "gpos/base.h" #include "gpopt/search/CJobGroup.h" #include "gpopt/search/CJobStateMachine.h" namespace gpopt { using namespace gpos; //--------------------------------------------------------------------------- // @class: // CJobGroupExploration // // @doc: // Group exploration job // //--------------------------------------------------------------------------- class CJobGroupExploration : public CJobGroup { public: // transition events of group exploration enum EEvent { eevStartedExploration, // started group exploration eevNewChildren, // new children have been added to group eevExplored, // group exploration is complete eevSentinel }; // states of group exploration job enum EState { estInitialized = 0, // initial state estExploringChildren, // exploring group expressions estCompleted, // done exploration estSentinel }; private: // shorthand for job state machine typedef CJobStateMachine<EState, estSentinel, EEvent, eevSentinel> JSM; // job state machine JSM m_jsm; // start exploration action static EEvent EevtStartExploration(CSchedulerContext *psc, CJob *pj); // explore child group expressions action static EEvent EevtExploreChildren(CSchedulerContext *psc, CJob *pj); // private copy ctor CJobGroupExploration(const CJobGroupExploration&); public: // ctor CJobGroupExploration(); // dtor ~CJobGroupExploration(); // initialize job void Init(CGroup *pgroup); // get first unscheduled expression virtual CGroupExpression *PgexprFirstUnsched() { return CJobGroup::PgexprFirstUnschedLogical(); } // schedule exploration jobs for of all new group expressions virtual BOOL FScheduleGroupExpressions(CSchedulerContext *psc); // schedule a new group exploration job static void ScheduleJob ( CSchedulerContext *psc, CGroup *pgroup, CJob *pjParent ); // job's function virtual BOOL FExecute(CSchedulerContext *psc); #ifdef GPOS_DEBUG // print function virtual IOstream &OsPrint(IOstream &os); // dump state machine diagram in graphviz format virtual IOstream &OsDiagramToGraphviz ( IMemoryPool *pmp, IOstream &os, const WCHAR *wszTitle ) const { (void) m_jsm.OsDiagramToGraphviz(pmp, os, wszTitle); return os; } // compute unreachable states void Unreachable ( IMemoryPool *pmp, EState **ppestate, ULONG *pulSize ) const { m_jsm.Unreachable(pmp, ppestate, pulSize); } #endif // GPOS_DEBUG // conversion function static CJobGroupExploration *PjConvert ( CJob *pj ) { GPOS_ASSERT(NULL != pj); GPOS_ASSERT(EjtGroupExploration == pj->Ejt()); return dynamic_cast<CJobGroupExploration*>(pj); } }; // class CJobGroupExploration } #endif // !GPOPT_CJobGroupExploration_H // EOF
[ "fengttt@gmail.com" ]
fengttt@gmail.com
f9102df2fc88bfc696462d9e767745eb9582bcae
785df77400157c058a934069298568e47950e40b
/include/StbGMaker_HullCreator_Shape.hxx
47fef0bb930dce196a4c7edb5680f64c467a473e
[]
no_license
amir5200fx/Tonb
cb108de09bf59c5c7e139435e0be008a888d99d5
ed679923dc4b2e69b12ffe621fc5a6c8e3652465
refs/heads/master
2023-08-31T08:59:00.366903
2023-08-31T07:42:24
2023-08-31T07:42:24
230,028,961
9
3
null
2023-07-20T16:53:31
2019-12-25T02:29:32
C++
UTF-8
C++
false
false
1,095
hxx
#pragma once #ifndef _StbGMaker_HullCreator_Shape_Header #define _StbGMaker_HullCreator_Shape_Header #include <StbGMaker_HullCreator.hxx> namespace tnbLib { namespace stbGmakerLib { class HullCreator_Shape : public StbGMaker_HullCreator { /*Private Data*/ std::shared_ptr<marineLib::Shape_Hull> theHull_; TNB_SERIALIZATION(TnbStbGMaker_EXPORT); public: TnbStbGMaker_EXPORT HullCreator_Shape ( const std::shared_ptr<marineLib::Shape_Hull>& theHull ); TnbStbGMaker_EXPORT HullCreator_Shape ( const Standard_Integer theIndex, const word& theName, const std::shared_ptr<marineLib::Shape_Hull>& theHull ); Standard_Boolean HasShape() const override { return Standard_True; } const auto& Shape() const { return theHull_; } TnbStbGMaker_EXPORT Standard_Integer CreateWorkingPlane ( const Standard_Real x ) override; TnbStbGMaker_EXPORT void ExportAs ( std::shared_ptr<Marine_Model>& theModel ) const override; }; } } #endif // !_StbGMaker_HullCreator_Shape_Header
[ "aasoleimani86@gmail.com" ]
aasoleimani86@gmail.com
0fe379e67afd1aabc26d040dcc78c94e7465a9c0
0ba6faa4c7f94a355f4719c9d09be477a2ab58e2
/virtualcontest/20200510_模擬/B.cpp
01404a8fb6d4950b494b814806f5ba023e1807c7
[]
no_license
k2font/atcoder
a97d851bae3c5ea210accd493e6e33df2869e038
d2b7b8e6dbb843330f477b922bd4e2d2928ed810
refs/heads/master
2023-05-15T06:51:43.771882
2021-06-05T07:03:11
2021-06-05T07:03:11
278,045,287
0
0
null
null
null
null
UTF-8
C++
false
false
1,094
cpp
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define all(x) (x).begin(),(x).end() using ll = long long; string char_to_string(char val) { return string(1, val); } int char_to_int(char val) { return val - '0'; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } int vector_finder(std::vector<ll> vec, int number) { auto itr = std::find(vec.begin(), vec.end(), number); size_t index = std::distance( vec.begin(), itr ); if (index != vec.size()) { // 発見できたとき return 1; } else { // 発見できなかったとき return 0; } } int main() { double N; cin >> N; vector<double> a(N); REP(i, N) cin >> a[i]; double avg = accumulate(all(a), 0) / N; double ans = 0; double tmp = pow(10, 8); REP(i, N) { if(abs(avg - a[i]) < tmp) { ans = i; tmp = abs(avg - a[i]); } } cout << ans << endl; }
[ "shoichiro.kouno@gmail.com" ]
shoichiro.kouno@gmail.com
0078b010794ded1b163b598b9144d62d84c48c00
f7101b9b215c7e578ecb9d96a7b1b0d1d06f2675
/SSE_PACKED_INTEGER/src/funcs.cc
718ee9b685f51b5b42338b83b9633c1f1d1d6868
[]
no_license
tonychen007/Intel.Assembly
d966acfc65c4c1789c7511372fb351325839c023
82166563a99a09d0a6101d3b84192986a2a987f6
refs/heads/master
2023-01-08T20:30:00.349844
2020-11-05T02:59:40
2020-11-05T02:59:40
289,485,578
1
0
null
null
null
null
UTF-8
C++
false
false
4,629
cc
#include <stdio.h> #include <string.h> #include <chrono> #define _USE_MATH_DEFINES #include <math.h> #include "../header/MiscDef.h" #include "../header/xmmVal.h" using namespace std; void ssePackedAdd() { __declspec(align(16)) XmmVal a; __declspec(align(16)) XmmVal b; __declspec(align(16)) XmmVal c[2]; char buf[256] = { '\0' }; FILL_XMMVAL_16(a.i16, 10, 200, 30, -32766, 50, 60, 32000, -32000); FILL_XMMVAL_16(b.i16, 100, -200, 32760, -400, 500, -600, 1200, -950); ssePackedAdd16(&a, &b, c); printf("Result for ssePackedAdd\n"); printf("Signed:\n"); printf("a: %s\n", a.ToString_i16(buf, sizeof(buf))); printf("b: %s\n", b.ToString_i16(buf, sizeof(buf))); printf("c: %s\n", c[0].ToString_i16(buf, sizeof(buf))); printf("\n"); printf("Saturatrd:\n"); printf("c: %s\n", c[1].ToString_i16(buf, sizeof(buf))); } void ssePackedSubDWord() { __declspec(align(16)) XmmVal a; __declspec(align(16)) XmmVal b; __declspec(align(16)) XmmVal c; memset(&c, 0, sizeof(c)); char buf[256] = { '\0' }; FILL_XMMVAL_32(a.i32, 800, 500, 1000, 900); FILL_XMMVAL_32(b.i32, 250, -2000, -40, 1200); ssePackedSub32(&a, &b, &c); printf("Result for ssePackedSub32\n"); printf("Signed double-word:\n"); printf("a: %s\n", a.ToString_i32(buf, sizeof(buf))); printf("b: %s\n", b.ToString_i32(buf, sizeof(buf))); printf("c: %s\n", c.ToString_i32(buf, sizeof(buf))); printf("\n"); } void ssePackSubWord() { __declspec(align(16)) XmmVal a; __declspec(align(16)) XmmVal b; __declspec(align(16)) XmmVal c[3]; memset(&c, 0, sizeof(c)); char buf[256] = { '\0' }; FILL_XMMVAL_16(a.i16, 10, 200, 30, -32766, 50, 60, 32000, -32000); FILL_XMMVAL_16(b.i16, 100, -200, 32760, 400, 500, -600, 1200, -950); ssePackedSub16(&a, &b, c); // psubsw printf("Saturated word:\n"); printf("a: %s\n", a.ToString_i16(buf, sizeof(buf))); printf("b: %s\n", b.ToString_i16(buf, sizeof(buf))); printf("c: %s\n", c[0].ToString_i16(buf, sizeof(buf))); printf("\n"); // psubw printf("Signed word:\n"); printf("a: %s\n", a.ToString_i16(buf, sizeof(buf))); printf("b: %s\n", b.ToString_i16(buf, sizeof(buf))); printf("c: %s\n", c[1].ToString_i16(buf, sizeof(buf))); printf("\n"); // psubusw printf("Unsinged saturated word:\n"); printf("a: %s\n", a.ToString_u16(buf, sizeof(buf))); printf("b: %s\n", b.ToString_u16(buf, sizeof(buf))); printf("c: %s\n", c[2].ToString_u16(buf, sizeof(buf))); printf("\n"); } void ssePackedMul() { __declspec(align(16)) XmmVal a; __declspec(align(16)) XmmVal b; __declspec(align(16)) XmmVal c[2]; char buf[256] = { '\0' }; FILL_XMMVAL_32(a.i32, 150000, 0, 0, 0); FILL_XMMVAL_32(b.i32, 150000, 0, 0, 0); ssePackedMul32(&a, &b, c); printf("Result for ssePackedMul32\n"); printf("pmulld - store low result, high bit is truncated:\n"); printf("a: %s\n", a.ToString_i32(buf, sizeof(buf))); printf("b: %s\n", b.ToString_i32(buf, sizeof(buf))); printf("c: %s\n", c[0].ToString_i32(buf, sizeof(buf))); printf("c: %s\n", c[0].ToString_x32(buf, sizeof(buf))); printf("\n"); printf("pmuldq:\n"); printf("c: %s\n", c[1].ToString_i64(buf, sizeof(buf))); printf("c: %s\n", c[1].ToString_x64(buf, sizeof(buf))); printf("\n"); } void ssePackedFundamentalTest() { ssePackedAdd(); printf("\n"); ssePackedSubDWord(); ssePackSubWord(); printf("\n"); ssePackedMul(); } void sseHistogramTest() { const int buff_size = 1024 * 1024 * 16; const int histo_size = 256; Uint8* pixel = (Uint8*)_aligned_malloc(buff_size, 32); Uint32* histo1 = (Uint32*)_aligned_malloc(histo_size * sizeof(Uint32), 16); Uint32* histo2 = (Uint32*)_aligned_malloc(histo_size * sizeof(Uint32), 16); if (pixel == nullptr || histo1 == nullptr || histo2 == nullptr) return; srand(0); auto st = chrono::system_clock::now(); for (int i = 0; i < buff_size; i++) { pixel[i] = rand() % 255; } auto ed = chrono::system_clock::now(); chrono::duration<float, milli> ep = ed - st; printf("fill data, time is: %f mills\n", ep.count()); memset(histo1, 0, histo_size); { auto st = chrono::system_clock::now(); for (Uint32 i = 0; i < buff_size; i++) histo1[pixel[i]]++; auto ed = chrono::system_clock::now(); chrono::duration<float, milli> ep = ed - st; printf("cpp histo version, time is: %f mills\n", ep.count()); } { auto st = chrono::system_clock::now(); sseHistogram(histo2, pixel, buff_size); auto ed = chrono::system_clock::now(); chrono::duration<float, milli> ep = ed - st; printf("asm histo version, time is: %f mills\n", ep.count()); } int cmp = memcmp(histo1, histo2, histo_size); (cmp == 0) ? printf("two histos are the same\n") : printf("two histos are the diffs\n"); }
[ "1@1.com" ]
1@1.com
2cdf32ba1a899073743385b5a27a78db169cffa7
126f3a35085c55d9090373fe4f7dbf836664402a
/count-complete-tree-nodes.cc
cfc04a2bfcd299ed35ca832ca9efc938178a3738
[]
no_license
XiangmingWang/leetcode_review
0ff5f5b67323464d8ea8ccdb6be2e4660c42b2b0
8c955cad8eb37a4130617142196f311c3cf72186
refs/heads/master
2021-05-04T07:48:33.091400
2016-12-19T15:30:58
2016-12-19T15:30:58
70,694,204
0
0
null
2016-10-24T03:20:04
2016-10-12T11:42:05
C++
UTF-8
C++
false
false
1,180
cc
//https://leetcode.com/problems/count-complete-tree-nodes/ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int countNodes(TreeNode* root) { if (!root) return 0; int level = 0; bool flag = checkBalance(root, level); if (flag) return countCompleteNodes(level); else { return countNodes(root->left) + countNodes(root->right) + 1; } } int countCompleteNodes(int level) { if (level == 1) return 1; int now = 1; int sum = 0; for (int i = 1; i <= level; ++i) { sum += now; now *= 2; } return sum; } bool checkBalance(TreeNode* root, int& level) { TreeNode* node = root; int left_level = 0, right_level = 0; while (node) { ++left_level; node = node->left; } node = root; while (node) { ++right_level; node = node->right; } level = min(left_level, right_level); return (left_level == right_level); } };
[ "washiwxm@gmail.com" ]
washiwxm@gmail.com
c9510cb0c8cbab62826977e984aa5ec8dda042e1
ce26f794966f37e2cd3a7e73c92f1d0575fd32e6
/QLock/CHK.h
85c81e6682af393d19f493a5fb57412325764a3c
[]
no_license
Tarferi/QLock
db8153cfe07b0032473d6d047a56391d997517d5
48d09e739bf4ebcff51c68adfcce91a41ba30553
refs/heads/master
2020-06-22T02:47:51.360705
2019-07-19T16:41:01
2019-07-19T16:41:01
197,614,478
1
0
null
null
null
null
UTF-8
C++
false
false
396
h
#pragma once #include "common.h" #include "Section.h" #include "ReadBuffer.h" class MapFile; class CHK { public: CHK(char* data, unsigned int size); ~CHK(); bool write(WriteBuffer* buffer); Section* getSection(const char* name); Array<Section*> sections; bool isValid() { return this->valid; } private: ReadBuffer* buffer; bool valid; bool parse(); };
[ "Tom@DESKTOP-OKDR18E" ]
Tom@DESKTOP-OKDR18E
61909c1e255dd7dfcc2cd5b027865e3f31eb1ec8
d9ca6242e272366c66ed9cec2801cd6dc98f5c74
/Kursachello1/regCompare.cpp
7159198ce7af38e4f0a234b81b788ce1bba68ee4
[]
no_license
sergey-nevar/CourseProject
acef8fef1ca567dce5b17a1eb7fc5eaa152a1d63
d85b50982607dffa4fa3ec5102bf0f336ce16bac
refs/heads/master
2021-01-02T22:17:05.127439
2015-06-06T05:02:50
2015-06-06T05:02:50
31,503,305
0
0
null
null
null
null
UTF-8
C++
false
false
4,304
cpp
#include "regCompare.h" void RegCompare::compareFiles(const QString& name1, const QString& name2){ RegElement element1, element2; bool end1Fl = false, end2Fl = false, fl = false; int subKeysCount = 0, currentLevel = 0; QFile file1(name1); if (!file1.exists()) return; file1.open(QIODevice::ReadOnly | QIODevice::Text); QTextStream stream1(&file1); QFile file2(name2); if (!file2.exists()) return; file2.open(QIODevice::ReadOnly | QIODevice::Text); QTextStream stream2(&file2); stream1.setCodec("UTF-8"); stream2.setCodec("UTF-8"); while(true){ if(!fl){ if(!read(stream1, element1)){ end1Fl = true; break; } if(!read(stream2, element2)){ end2Fl = true; break; } } else fl = false; // 0 - elements are not equal // 1 - RegPath are not equal // 2 - default values are not equal // 3 - values of hives are not equal switch(element1.compare(element2)){ case 0: break; case 1: if(element1.getRegPath().compare(element2.getRegPath()) > 0){ currentLevel = element2.getLevel(); newHives.push_back(element2); while(true){ if(!read(stream2, element2)){ end2Fl = true; break; } if(element2.getLevel() > currentLevel) subKeysCount++; else break; } newHives.last().setSubKeysCount(subKeysCount); if(element1.getRegPath().compare(element2.getRegPath())){ currentLevel = element1.getLevel(); deletedHives.push_back(element1); subKeysCount = 0; while(true){ if(!read(stream1, element1)){ end1Fl = true; break; } if(element1.getLevel() > currentLevel) subKeysCount++; else break; } deletedHives.last().setSubKeysCount(subKeysCount); } } else{ currentLevel = element1.getLevel(); deletedHives.push_back(element1); while(true){ if(!read(stream1, element1)){ end1Fl = true; break; } if(element1.getLevel() > currentLevel) subKeysCount++; else break; } deletedHives.last().setSubKeysCount(subKeysCount); if(element1.getRegPath().compare(element2.getRegPath())){ currentLevel = element2.getLevel(); subKeysCount = 0; newHives.push_back(element2); while(true){ if(!read(stream2, element2)){ end2Fl = true; break; } if(element2.getLevel() > currentLevel) subKeysCount++; else break; } newHives.last().setSubKeysCount(subKeysCount); } } fl = true; subKeysCount = 0; break; case 2: changedDefaultValues.push_back(element2); break; case 3: changedKeys.push_back(element2); break; } } if(end1Fl){ while(true){ if(!read(stream2, element2)) break; newHives.push_back(element2); } } if(end2Fl){ while(true){ deletedHives.push_back(element1); if(!read(stream1, element1)) break; } } for(int i = 0; i < newHives.size(); i++) for(int j = 0; j < deletedHives.size(); j++) if(!newHives[i].compare(deletedHives[j])){ newHives.remove(i--); deletedHives.remove(j); break; } for(int i = 0; i < newHives.size(); i++) for(int j = 0; j < deletedHives.size(); j++) if(newHives[i].checkDifferences(deletedHives[j])){ renamedKeys.push_back(newHives[i]); newHives.remove(i--); deletedHives.remove(j); break; } file1.close(); file2.close(); } bool RegCompare::read(QTextStream &stream, RegElement& element){ element.clearAll(); QString buf = stream.readLine(300); if(!buf.size()) return false; if(buf[0] == L'['){ element.setRegPath(buf); buf = stream.readLine(300); if(!buf.size()) return true; } if(buf[0] == L'@'){ element.setDefValue(buf); buf = stream.readLine(300); if(!buf.size()) return true; } if(buf[0] == L'"') element.pushData(buf); while(true){ buf = stream.readLine(300); if(!buf.size()) return true; else element.pushData(buf); } } void RegCompare::clear(){ newHives.clear(); deletedHives.clear(); renamedKeys.clear(); changedDefaultValues.clear(); changedKeys.clear(); } RegCompare::RegCompare(void){ } RegCompare::~RegCompare(void){ }
[ "serega.nevar@gmail.com" ]
serega.nevar@gmail.com
f5dafbebb940dfec4bb64281d8f6826f863452d9
32a920c302b320908e62e748d71ad120e6de907e
/contests/VJUDGE_YusufSholeh/UVA/11159/8315791_AC_0ms_0kB.cpp
f4fd53ddc3d8189770a4a063fc22aeacd0b7cd98
[]
no_license
yusufsholeh/kactl
12d1e20f48e0efbb6447bb5dc3e1592cc745aab6
aaa2fbc0801514c039d38a90da84224c54a2f53d
refs/heads/master
2023-06-11T12:16:07.335688
2023-05-26T08:39:03
2023-05-26T08:39:03
155,297,663
0
9
null
2018-10-30T00:01:56
2018-10-30T00:01:56
null
UTF-8
C++
false
false
1,140
cpp
#include<bits/stdc++.h> using namespace std; #define MAX 1005 int n; vector<int> v[MAX]; int vis[MAX]; int with[MAX]; int flag[MAX]; int day = 0; bool match(int x) { int size = v[x].size(); for(int i = 0; i < size; i++) { int next = v[x][i]; if (vis[next] != day) { vis[next] = day; if (with[next] == -1 || match(with[next])) { with[next] = x; return true; } } } return false; } int arr1[MAX]; int arr2[MAX]; int main() { // srand(time(NULL)); int tc; scanf("%d",&tc); for(int cs = 1; cs <= tc; cs++) { int n, m; scanf("%d",&n);for(int i = 1; i <= n; i++) scanf("%d",&arr1[i]); scanf("%d",&m);for(int i = 1; i <= m; i++) scanf("%d",&arr2[i]); for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { if (arr1[i] == 0 && arr2[j] == 0) { v[i].push_back(j); } if (arr1[i] != 0 && arr2[j] % arr1[i] == 0) { v[i].push_back(j); } } } int ans = 0; memset(with,-1,sizeof(with)); for(int i = 0; i < MAX; i++) { day++; if (match(i)) ans++; } printf("Case %d: ",cs); printf("%d\n",ans); for(int i = 0; i < MAX; i++) v[i].clear(); } }
[ "yfsholeh@gmail.com" ]
yfsholeh@gmail.com
973ded62688e84e8d36fd7afa709d15836afbff8
64534a2cfb924e1804859797f9858b79132131b5
/src/gep/include/gep/exception.h
bd56914073b850935df5cf633723afd9a9e1de4e
[]
no_license
marijnz/bouncingballs
5b098aaa4890b35d74d75feb9997971f44de2cf2
5083307b4045a3304326998d88eac147b9d927d7
refs/heads/master
2020-07-20T11:57:18.650249
2015-01-28T18:11:51
2015-01-28T18:11:51
29,972,843
1
0
null
null
null
null
UTF-8
C++
false
false
1,059
h
#pragma once #include <exception> #include <string> namespace gep { class Exception : public std::exception { private: std::string m_msg; public: Exception(const std::string& msg) : m_msg(msg) {} virtual const char* what() const override { return m_msg.c_str(); } }; class LoadingError : public Exception { public: LoadingError(const std::string& msg) : Exception(msg) {} }; class ScriptException : public Exception { public: ScriptException(const std::string& msg) : Exception(msg) {} }; class ScriptLoadException : public ScriptException { public: ScriptLoadException(const std::string& msg) : ScriptException(msg) {} }; class ScriptExecutionException : public ScriptException { public: ScriptExecutionException(const std::string& msg) : ScriptException(msg) {} }; class EventException : public Exception { public: EventException(const std::string& msg) : Exception(msg) {} }; };
[ "me@arcomul.nl" ]
me@arcomul.nl
d8757e746f8f6405ac6d610084e2b79f1001d209
b7e97047616d9343be5b9bbe03fc0d79ba5a6143
/src/protocols/simple_moves/SwitchResidueTypeSetMover.cc
6dda0bc31fcb020386359621c42c3a4726f757cc
[]
no_license
achitturi/ROSETTA-main-source
2772623a78e33e7883a453f051d53ea6cc53ffa5
fe11c7e7cb68644f404f4c0629b64da4bb73b8f9
refs/heads/master
2021-05-09T15:04:34.006421
2018-01-26T17:10:33
2018-01-26T17:10:33
119,081,547
1
3
null
null
null
null
UTF-8
C++
false
false
4,401
cc
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*- // vi: set ts=2 noet: // // (c) Copyright Rosetta Commons Member Institutions. // (c) This file is part of the Rosetta software suite and is made available under license. // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. // (c) For more information, see http://www.rosettacommons.org. Questions about this can be // (c) addressed to University of Washington CoMotion, email: license@uw.edu. /// @file SwitchResidueTypeSetMover.cc /// @brief switch between residue type sets (e.g. centroid and all atom) // Unit headers #include <protocols/simple_moves/SwitchResidueTypeSetMover.hh> #include <protocols/simple_moves/SwitchResidueTypeSetMoverCreator.hh> #include <basic/Tracer.hh> using basic::T; using basic::Error; using basic::Warning; static THREAD_LOCAL basic::Tracer TR( "protocols.simple_moves.SwitchResidueTypeSetMover" ); #include <utility> #include <utility/tag/Tag.hh> #include <core/chemical/ResidueType.hh> #include <core/kinematics/Jump.hh> #include <core/util/SwitchResidueTypeSet.hh> #include <utility/vector0.hh> #include <utility/vector1.hh> // XSD XRW Includes #include <utility/tag/XMLSchemaGeneration.hh> #include <protocols/moves/mover_schemas.hh> namespace protocols { namespace simple_moves { // XRW TEMP std::string // XRW TEMP SwitchResidueTypeSetMoverCreator::keyname() const // XRW TEMP { // XRW TEMP return SwitchResidueTypeSetMover::mover_name(); // XRW TEMP } // XRW TEMP protocols::moves::MoverOP // XRW TEMP SwitchResidueTypeSetMoverCreator::create_mover() const { // XRW TEMP return protocols::moves::MoverOP( new SwitchResidueTypeSetMover ); // XRW TEMP } // XRW TEMP std::string // XRW TEMP SwitchResidueTypeSetMover::mover_name() // XRW TEMP { // XRW TEMP return "SwitchResidueTypeSetMover"; // XRW TEMP } SwitchResidueTypeSetMover::SwitchResidueTypeSetMover() : moves::Mover("SwitchResidueTypeSetMover") {} SwitchResidueTypeSetMover::SwitchResidueTypeSetMover( std::string type_set_tag_in ) : moves::Mover("SwitchResidueTypeSetMover"), type_set_tag_(std::move( type_set_tag_in )) {} std::string SwitchResidueTypeSetMover::get_residue_type_set() const { return type_set_tag_; } void SwitchResidueTypeSetMover::apply( Pose & pose ) { core::util::switch_to_residue_type_set( pose, type_set_tag_ ); } // XRW TEMP std::string // XRW TEMP SwitchResidueTypeSetMover::get_name() const { // XRW TEMP return SwitchResidueTypeSetMover::mover_name(); // XRW TEMP } void SwitchResidueTypeSetMover::show(std::ostream & output) const { Mover::show(output); output << "Residue type set: " << get_residue_type_set() << std::endl; } moves::MoverOP SwitchResidueTypeSetMover::clone() const { return moves::MoverOP( new SwitchResidueTypeSetMover( *this ) ); } moves::MoverOP SwitchResidueTypeSetMover::fresh_instance() const { return moves::MoverOP( new SwitchResidueTypeSetMover ); } void SwitchResidueTypeSetMover::parse_my_tag( utility::tag::TagCOP tag, basic::datacache::DataMap &, protocols::filters::Filters_map const &, protocols::moves::Movers_map const &, core::pose::Pose const & ) { if ( tag->hasOption("set") ) type_set_tag_ = tag->getOption<std::string>("set"); } std::string SwitchResidueTypeSetMover::get_name() const { return mover_name(); } std::string SwitchResidueTypeSetMover::mover_name() { return "SwitchResidueTypeSetMover"; } void SwitchResidueTypeSetMover::provide_xml_schema( utility::tag::XMLSchemaDefinition & xsd ) { // TO DO! using namespace utility::tag; AttributeList attlist; // TO DO: add attributes to this list attlist + XMLSchemaAttribute("set", xs_string, "XRW TO DO"); protocols::moves::xsd_type_definition_w_attributes( xsd, mover_name(), "XRW TO DO", attlist ); } std::string SwitchResidueTypeSetMoverCreator::keyname() const { return SwitchResidueTypeSetMover::mover_name(); } protocols::moves::MoverOP SwitchResidueTypeSetMoverCreator::create_mover() const { return protocols::moves::MoverOP( new SwitchResidueTypeSetMover ); } void SwitchResidueTypeSetMoverCreator::provide_xml_schema( utility::tag::XMLSchemaDefinition & xsd ) const { SwitchResidueTypeSetMover::provide_xml_schema( xsd ); } std::ostream &operator<< (std::ostream &os, SwitchResidueTypeSetMover const &mover) { mover.show(os); return os; } } // simple_moves } // protocols
[ "achitturi17059@gmail.com" ]
achitturi17059@gmail.com
3b4d4964c7ae31e894b5bed5b1b98893ce7bb378
bd953d48b66a58291af4f104a453f3299bf0fdd7
/ext/src/google-perftools-1.6/src/packed-cache-inl.h
31c9004c9009dc8cf411f3247b227bc39f4f3922
[ "BSD-3-Clause", "Ruby" ]
permissive
presidentbeef/perftools.rb
8bf979f510b77612618edd059c19037e32d6b9f0
51f022bd5cbb2d562a4353f7e9706bf9164f7a1c
refs/heads/master
2023-09-02T07:27:17.820752
2011-12-22T19:56:30
2011-12-22T19:56:30
2,983,918
0
0
null
null
null
null
UTF-8
C++
false
false
9,620
h
// Copyright (c) 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // --- // Author: Geoff Pike // // This file provides a minimal cache that can hold a <key, value> pair // with little if any wasted space. The types of the key and value // must be unsigned integral types or at least have unsigned semantics // for >>, casting, and similar operations. // // Synchronization is not provided. However, the cache is implemented // as an array of cache entries whose type is chosen at compile time. // If a[i] is atomic on your hardware for the chosen array type then // raciness will not necessarily lead to bugginess. The cache entries // must be large enough to hold a partial key and a value packed // together. The partial keys are bit strings of length // kKeybits - kHashbits, and the values are bit strings of length kValuebits. // // In an effort to use minimal space, every cache entry represents // some <key, value> pair; the class provides no way to mark a cache // entry as empty or uninitialized. In practice, you may want to have // reserved keys or values to get around this limitation. For example, in // tcmalloc's PageID-to-sizeclass cache, a value of 0 is used as // "unknown sizeclass." // // Usage Considerations // -------------------- // // kHashbits controls the size of the cache. The best value for // kHashbits will of course depend on the application. Perhaps try // tuning the value of kHashbits by measuring different values on your // favorite benchmark. Also remember not to be a pig; other // programs that need resources may suffer if you are. // // The main uses for this class will be when performance is // critical and there's a convenient type to hold the cache's // entries. As described above, the number of bits required // for a cache entry is (kKeybits - kHashbits) + kValuebits. Suppose // kKeybits + kValuebits is 43. Then it probably makes sense to // chose kHashbits >= 11 so that cache entries fit in a uint32. // // On the other hand, suppose kKeybits = kValuebits = 64. Then // using this class may be less worthwhile. You'll probably // be using 128 bits for each entry anyway, so maybe just pick // a hash function, H, and use an array indexed by H(key): // void Put(K key, V value) { a_[H(key)] = pair<K, V>(key, value); } // V GetOrDefault(K key, V default) { const pair<K, V> &p = a_[H(key)]; ... } // etc. // // Further Details // --------------- // // For caches used only by one thread, the following is true: // 1. For a cache c, // (c.Put(key, value), c.GetOrDefault(key, 0)) == value // and // (c.Put(key, value), <...>, c.GetOrDefault(key, 0)) == value // if the elided code contains no c.Put calls. // // 2. Has(key) will return false if no <key, value> pair with that key // has ever been Put. However, a newly initialized cache will have // some <key, value> pairs already present. When you create a new // cache, you must specify an "initial value." The initialization // procedure is equivalent to Clear(initial_value), which is // equivalent to Put(k, initial_value) for all keys k from 0 to // 2^kHashbits - 1. // // 3. If key and key' differ then the only way Put(key, value) may // cause Has(key') to change is that Has(key') may change from true to // false. Furthermore, a Put() call that doesn't change Has(key') // doesn't change GetOrDefault(key', ...) either. // // Implementation details: // // This is a direct-mapped cache with 2^kHashbits entries; the hash // function simply takes the low bits of the key. We store whole keys // if a whole key plus a whole value fits in an entry. Otherwise, an // entry is the high bits of a key and a value, packed together. // E.g., a 20 bit key and a 7 bit value only require a uint16 for each // entry if kHashbits >= 11. // // Alternatives to this scheme will be added as needed. #ifndef TCMALLOC_PACKED_CACHE_INL_H_ #define TCMALLOC_PACKED_CACHE_INL_H_ #include "config.h" #ifdef HAVE_STDINT_H #include <stdint.h> #endif #include "base/basictypes.h" // for COMPILE_ASSERT #include "internal_logging.h" #include <stddef.h> // A safe way of doing "(1 << n) - 1" -- without worrying about overflow // Note this will all be resolved to a constant expression at compile-time #define N_ONES_(IntType, N) \ ( (N) == 0 ? 0 : ((static_cast<IntType>(1) << ((N)-1))-1 + \ (static_cast<IntType>(1) << ((N)-1))) ) // The types K and V provide upper bounds on the number of valid keys // and values, but we explicitly require the keys to be less than // 2^kKeybits and the values to be less than 2^kValuebits. The size of // the table is controlled by kHashbits, and the type of each entry in // the cache is T. See also the big comment at the top of the file. template <int kKeybits, typename T> class PackedCache { public: typedef uintptr_t K; typedef size_t V; static const int kHashbits = 12; static const int kValuebits = 7; static const bool kUseWholeKeys = kKeybits + kValuebits <= 8 * sizeof(T); explicit PackedCache(V initial_value) { COMPILE_ASSERT(kKeybits <= sizeof(K) * 8, key_size); COMPILE_ASSERT(kValuebits <= sizeof(V) * 8, value_size); COMPILE_ASSERT(kHashbits <= kKeybits, hash_function); COMPILE_ASSERT(kKeybits - kHashbits + kValuebits <= kTbits, entry_size_must_be_big_enough); Clear(initial_value); } void Put(K key, V value) { ASSERT(key == (key & kKeyMask)); ASSERT(value == (value & kValueMask)); array_[Hash(key)] = KeyToUpper(key) | value; } bool Has(K key) const { ASSERT(key == (key & kKeyMask)); return KeyMatch(array_[Hash(key)], key); } V GetOrDefault(K key, V default_value) const { // As with other code in this class, we touch array_ as few times // as we can. Assuming entries are read atomically (e.g., their // type is uintptr_t on most hardware) then certain races are // harmless. ASSERT(key == (key & kKeyMask)); T entry = array_[Hash(key)]; return KeyMatch(entry, key) ? EntryToValue(entry) : default_value; } void Clear(V value) { ASSERT(value == (value & kValueMask)); for (int i = 0; i < 1 << kHashbits; i++) { ASSERT(kUseWholeKeys || KeyToUpper(i) == 0); array_[i] = kUseWholeKeys ? (value | KeyToUpper(i)) : value; } } private: // We are going to pack a value and the upper part of a key (or a // whole key) into an entry of type T. The UPPER type is for the // upper part of a key, after the key has been masked and shifted // for inclusion in an entry. typedef T UPPER; static V EntryToValue(T t) { return t & kValueMask; } // If we have space for a whole key, we just shift it left. // Otherwise kHashbits determines where in a K to find the upper // part of the key, and kValuebits determines where in the entry to // put it. static UPPER KeyToUpper(K k) { if (kUseWholeKeys) { return static_cast<T>(k) << kValuebits; } else { const int shift = kHashbits - kValuebits; // Assume kHashbits >= kValuebits. It'd be easy to lift this assumption. return static_cast<T>(k >> shift) & kUpperMask; } } static size_t Hash(K key) { return static_cast<size_t>(key) & N_ONES_(size_t, kHashbits); } // Does the entry match the relevant part of the given key? static bool KeyMatch(T entry, K key) { return kUseWholeKeys ? (entry >> kValuebits == key) : ((KeyToUpper(key) ^ entry) & kUpperMask) == 0; } static const int kTbits = 8 * sizeof(T); static const int kUpperbits = kUseWholeKeys ? kKeybits : kKeybits - kHashbits; // For masking a K. static const K kKeyMask = N_ONES_(K, kKeybits); // For masking a T. static const T kUpperMask = N_ONES_(T, kUpperbits) << kValuebits; // For masking a V or a T. static const V kValueMask = N_ONES_(V, kValuebits); // array_ is the cache. Its elements are volatile because any // thread can write any array element at any time. volatile T array_[1 << kHashbits]; }; #undef N_ONES_ #endif // TCMALLOC_PACKED_CACHE_INL_H_
[ "jcollins@attinteractive.com" ]
jcollins@attinteractive.com
c56b8106202443b882497efb0998f874f365095b
55540f3e86f1d5d86ef6b5d295a63518e274efe3
/components/network/thread/openthread/src/core/common/pool.hpp
279655f14f58d5f57e13052d9b691a64a83a816b
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
bouffalolab/bl_iot_sdk
bc5eaf036b70f8c65dd389439062b169f8d09daa
b90664de0bd4c1897a9f1f5d9e360a9631d38b34
refs/heads/master
2023-08-31T03:38:03.369853
2023-08-16T08:50:33
2023-08-18T09:13:27
307,347,250
244
101
Apache-2.0
2023-08-28T06:29:02
2020-10-26T11:16:30
C
UTF-8
C++
false
false
5,959
hpp
/* * Copyright (c) 2020, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** * @file * This file includes definitions for a generic object pool. */ #ifndef POOL_HPP_ #define POOL_HPP_ #include "openthread-core-config.h" #include "common/array.hpp" #include "common/linked_list.hpp" #include "common/non_copyable.hpp" namespace ot { class Instance; /** * @addtogroup core-pool * * @brief * This module includes definitions for OpenThread object pool. * * @{ * */ /** * This template class represents an object pool. * * @tparam Type The object type. Type should provide `GetNext() and `SetNext()` so that it can be added to a * linked list. * @tparam kPoolSize Specifies the pool size (maximum number of objects in the pool). * */ template <class Type, uint16_t kPoolSize> class Pool : private NonCopyable { public: /** * This constructor initializes the pool. * */ Pool(void) : mFreeList() { for (Type &entry : mPool) { mFreeList.Push(entry); } } /** * This constructor initializes the pool. * * This constructor version requires the `Type` class to provide method `void Init(Instance &)` to initialize * each `Type` entry object. This can be realized by the `Type` class inheriting from `InstaceLocatorInit()`. * * @param[in] aInstance A reference to the OpenThread instance. * */ explicit Pool(Instance &aInstance) : mFreeList() { for (Type &entry : mPool) { entry.Init(aInstance); mFreeList.Push(entry); } } /** * This method allocates a new object from the pool. * * @returns A pointer to the newly allocated object, or `nullptr` if all entries from the pool are already * allocated. * */ Type *Allocate(void) { return mFreeList.Pop(); } /** * This method frees a previously allocated object. * * The @p aEntry MUST be an entry from the pool previously allocated using `Allocate()` method and not yet freed. * An already freed entry MUST not be freed again. * * @param[in] aEntry The pool object entry to free. * */ void Free(Type &aEntry) { mFreeList.Push(aEntry); } /** * This method frees all previously allocated objects. * */ void FreeAll(void) { mFreeList.Clear(); for (Type &entry : mPool) { mFreeList.Push(entry); } } /** * This method returns the pool size. * * @returns The pool size (maximum number of objects in the pool). * */ uint16_t GetSize(void) const { return kPoolSize; } /** * This method indicates whether or not a given `Type` object is from the pool. * * @param[in] aObject A reference to a `Type` object. * * @retval TRUE if @p aObject is from the pool. * @retval FALSE if @p aObject is not from the pool. * */ bool IsPoolEntry(const Type &aObject) const { return (&mPool[0] <= &aObject) && (&aObject < GetArrayEnd(mPool)); } /** * This method returns the associated index of a given entry from the pool. * * The @p aEntry MUST be from the pool, otherwise the behavior of this method is undefined. * * @param[in] aEntry A reference to an entry from the pool. * * @returns The associated index of @p aEntry. * */ uint16_t GetIndexOf(const Type &aEntry) const { return static_cast<uint16_t>(&aEntry - mPool); } /** * This method retrieves a pool entry at a given index. * * The @p aIndex MUST be from an earlier call to `GetIndexOf()`. * * @param[in] aIndex An index. * * @returns A reference to entry at index @p aIndex. * */ Type &GetEntryAt(uint16_t aIndex) { return mPool[aIndex]; } /** * This method retrieves a pool entry at a given index. * * The @p aIndex MUST be from an earlier call to `GetIndexOf()`. * * @param[in] aIndex An index. * * @returns A reference to entry at index @p aIndex. * */ const Type &GetEntryAt(uint16_t aIndex) const { return mPool[aIndex]; } private: LinkedList<Type> mFreeList; Type mPool[kPoolSize]; }; /** * @} * */ } // namespace ot #endif // POOL_HPP_
[ "qwang@bouffalolab.com" ]
qwang@bouffalolab.com
45c6b65dbb2aae7da7ac83c57dffd93050e0c67d
63809ec98915b171fc457776fbc4803732e0280e
/Vector/vector.cpp
2be1acbfdba9d189e94563ccb197851fc80af01c
[]
no_license
moyahuang/C-Assist
c2bf0a0e14318cc7329b2003bbe939698fc7aac6
af95e19db96f31c26da22bfded67fe5ec0e17fc3
refs/heads/master
2021-11-03T17:35:59.765452
2019-04-02T14:50:10
2019-04-02T14:50:10
179,098,724
0
0
null
null
null
null
UTF-8
C++
false
false
236
cpp
#include <iostream> #include <vector> #include <string> int main(){ std::vector<std::string> langs={"C++","C","Java","Perl","Javascript"}; for(std::string lang: langs) { std::cout<<lang<<" "; } return 0; }
[ "moyahuang@foxmail.com" ]
moyahuang@foxmail.com
328044763538ee48c3755b485288baf9244ab71b
3b9b4049a8e7d38b49e07bb752780b2f1d792851
/src/chrome/browser/extensions/api/mdns/mdns_api_unittest.cc
962fde4e0ff22ac3f403c97ba734311d81ef5c3e
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
webosce/chromium53
f8e745e91363586aee9620c609aacf15b3261540
9171447efcf0bb393d41d1dc877c7c13c46d8e38
refs/heads/webosce
2020-03-26T23:08:14.416858
2018-08-23T08:35:17
2018-09-20T14:25:18
145,513,343
0
2
Apache-2.0
2019-08-21T22:44:55
2018-08-21T05:52:31
null
UTF-8
C++
false
false
16,450
cc
// Copyright 2015 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 "chrome/browser/extensions/api/mdns/mdns_api.h" #include <stddef.h> #include <memory> #include <utility> #include <vector> #include "base/memory/linked_ptr.h" #include "base/memory/ptr_util.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_service_test_base.h" #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/common/extensions/api/mdns.h" #include "content/public/browser/browser_context.h" #include "content/public/test/mock_render_process_host.h" #include "extensions/browser/event_listener_map.h" #include "extensions/browser/event_router_factory.h" #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/manifest_constants.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" using testing::_; using testing::Return; using testing::ReturnRef; namespace extensions { namespace { const char kExtId[] = "mbflcebpggnecokmikipoihdbecnjfoj"; const char kService1[] = "service1"; const char kService2[] = "service2"; // Registers a new EventListener for |service_types| in |listener_list|. void AddEventListener( const std::string& extension_id, const std::string& service_type, extensions::EventListenerMap::ListenerList* listener_list) { std::unique_ptr<base::DictionaryValue> filter(new base::DictionaryValue); filter->SetString(kEventFilterServiceTypeKey, service_type); listener_list->push_back(make_linked_ptr( EventListener::ForExtension(kEventFilterServiceTypeKey, extension_id, nullptr, std::move(filter)) .release())); } class NullDelegate : public EventListenerMap::Delegate { public: void OnListenerAdded(const EventListener* listener) override {} void OnListenerRemoved(const EventListener* listener) override {} }; // Testing subclass of MDnsAPI which replaces calls to core browser components // that we don't want to have to instantiate or mock for these tests. class MockedMDnsAPI : public MDnsAPI { public: explicit MockedMDnsAPI(content::BrowserContext* context) : MDnsAPI(context) {} public: MOCK_CONST_METHOD2(IsMDnsAllowed, bool(const std::string& extension_id, const std::string& service_type)); MOCK_METHOD0(GetEventListeners, const extensions::EventListenerMap::ListenerList&()); }; std::unique_ptr<KeyedService> MockedMDnsAPITestingFactoryFunction( content::BrowserContext* context) { return base::WrapUnique(new MockedMDnsAPI(context)); } std::unique_ptr<KeyedService> MDnsAPITestingFactoryFunction( content::BrowserContext* context) { return base::WrapUnique(new MDnsAPI(context)); } std::unique_ptr<KeyedService> BuildEventRouter( content::BrowserContext* context) { return base::WrapUnique( new extensions::EventRouter(context, ExtensionPrefs::Get(context))); } // For ExtensionService interface when it requires a path that is not used. base::FilePath bogus_file_pathname(const std::string& name) { return base::FilePath(FILE_PATH_LITERAL("//foobar_nonexistent")) .AppendASCII(name); } class MockDnsSdRegistry : public DnsSdRegistry { public: explicit MockDnsSdRegistry(extensions::MDnsAPI* api) : api_(api) {} virtual ~MockDnsSdRegistry() {} MOCK_METHOD1(AddObserver, void(DnsSdObserver* observer)); MOCK_METHOD1(RemoveObserver, void(DnsSdObserver* observer)); MOCK_METHOD1(RegisterDnsSdListener, void(const std::string& service_type)); MOCK_METHOD1(UnregisterDnsSdListener, void(const std::string& service_type)); MOCK_METHOD1(Publish, void(const std::string&)); MOCK_METHOD0(ForceDiscovery, void(void)); void DispatchMDnsEvent(const std::string& service_type, const DnsSdServiceList& services) { api_->OnDnsSdEvent(service_type, services); } private: extensions::DnsSdRegistry::DnsSdObserver* api_; }; class MockEventRouter : public EventRouter { public: explicit MockEventRouter(content::BrowserContext* browser_context, ExtensionPrefs* extension_prefs) : EventRouter(browser_context, extension_prefs) {} virtual ~MockEventRouter() {} virtual void BroadcastEvent(std::unique_ptr<Event> event) { BroadcastEventPtr(event.get()); } MOCK_METHOD1(BroadcastEventPtr, void(Event* event)); }; std::unique_ptr<KeyedService> MockEventRouterFactoryFunction( content::BrowserContext* context) { return base::WrapUnique( new MockEventRouter(context, ExtensionPrefs::Get(context))); } class EventServiceListSizeMatcher : public testing::MatcherInterface<const Event&> { public: explicit EventServiceListSizeMatcher(size_t expected_size) : expected_size_(expected_size) {} virtual bool MatchAndExplain(const Event& e, testing::MatchResultListener* listener) const { if (!e.event_args) { *listener << "event.event_arg is null when it shouldn't be"; return false; } if (e.event_args->GetSize() != 1) { *listener << "event.event_arg.GetSize() should be 1 but is " << e.event_args->GetSize(); return false; } const base::ListValue* services = nullptr; { const base::Value* out; e.event_args->Get(0, &out); services = static_cast<const base::ListValue*>(out); } if (!services) { *listener << "event's service list argument is not a ListValue"; return false; } *listener << "number of services is " << services->GetSize(); return static_cast<testing::Matcher<size_t>>(testing::Eq(expected_size_)) .MatchAndExplain(services->GetSize(), listener); } virtual void DescribeTo(::std::ostream* os) const { *os << "is an onServiceList event where the number of services is " << expected_size_; } virtual void DescribeNegationTo(::std::ostream* os) const { *os << "isn't an onServiceList event where the number of services is " << expected_size_; } private: size_t expected_size_; }; inline testing::Matcher<const Event&> EventServiceListSize( size_t expected_size) { return testing::MakeMatcher(new EventServiceListSizeMatcher(expected_size)); } } // namespace class MDnsAPITest : public extensions::ExtensionServiceTestBase { public: void SetUp() override { extensions::ExtensionServiceTestBase::SetUp(); // Set up browser_context(). InitializeEmptyExtensionService(); // A custom TestingFactoryFunction is required for an MDnsAPI to actually be // constructed. MDnsAPI::GetFactoryInstance()->SetTestingFactory(browser_context(), GetMDnsFactory()); EventRouterFactory::GetInstance()->SetTestingFactory(browser_context(), &BuildEventRouter); // Do some sanity checking ASSERT_TRUE(MDnsAPI::Get(browser_context())); // constructs MDnsAPI ASSERT_TRUE(EventRouter::Get(browser_context())); // constructs EventRouter registry_ = new MockDnsSdRegistry(MDnsAPI::Get(browser_context())); EXPECT_CALL(*dns_sd_registry(), AddObserver(MDnsAPI::Get(browser_context()))) .Times(1); MDnsAPI::Get(browser_context()) ->SetDnsSdRegistryForTesting(std::unique_ptr<DnsSdRegistry>(registry_)); render_process_host_.reset( new content::MockRenderProcessHost(browser_context())); } // Returns the mDNS API factory function (mock vs. real) to use for the test. virtual BrowserContextKeyedServiceFactory::TestingFactoryFunction GetMDnsFactory() { return MDnsAPITestingFactoryFunction; } void TearDown() override { EXPECT_CALL(*dns_sd_registry(), RemoveObserver(MDnsAPI::Get(browser_context()))) .Times(1); render_process_host_.reset(); extensions::ExtensionServiceTestBase::TearDown(); } virtual MockDnsSdRegistry* dns_sd_registry() { return registry_; } // Constructs an extension according to the parameters that matter most to // MDnsAPI the local unit tests. const scoped_refptr<extensions::Extension> CreateExtension( std::string name, bool is_platform_app, std::string extension_id) { base::DictionaryValue manifest; manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); manifest.SetString(extensions::manifest_keys::kName, name); if (is_platform_app) { // Setting app.background.page = "background.html" is sufficient to make // the extension type TYPE_PLATFORM_APP. manifest.Set(extensions::manifest_keys::kPlatformAppBackgroundPage, new base::StringValue("background.html")); } std::string error; return extensions::Extension::Create( bogus_file_pathname(name), extensions::Manifest::INVALID_LOCATION, manifest, Extension::NO_FLAGS, extension_id, &error); } content::RenderProcessHost* render_process_host() const { return render_process_host_.get(); } private: // The registry is owned by MDnsAPI, but MDnsAPI does not have an accessor // for it, so use a private member. MockDnsSdRegistry* registry_; std::unique_ptr<content::RenderProcessHost> render_process_host_; }; class MDnsAPIMaxServicesTest : public MDnsAPITest { public: MockEventRouter* event_router() { return static_cast<MockEventRouter*>(EventRouter::Get(browser_context())); } }; class MDnsAPIDiscoveryTest : public MDnsAPITest { public: BrowserContextKeyedServiceFactory::TestingFactoryFunction GetMDnsFactory() override { return MockedMDnsAPITestingFactoryFunction; } void SetUp() override { MDnsAPITest::SetUp(); mdns_api_ = static_cast<MockedMDnsAPI*>(MDnsAPI::Get(browser_context())); EXPECT_CALL(*mdns_api_, IsMDnsAllowed(_, _)).WillRepeatedly(Return(true)); } protected: MockedMDnsAPI* mdns_api_; }; TEST_F(MDnsAPIDiscoveryTest, ServiceListenersAddedAndRemoved) { EventRouterFactory::GetInstance()->SetTestingFactory( browser_context(), &MockEventRouterFactoryFunction); extensions::EventListenerMap::ListenerList listeners; extensions::EventListenerInfo listener_info( kEventFilterServiceTypeKey, kExtId, GURL(), browser_context()); EXPECT_CALL(*mdns_api_, GetEventListeners()) .WillRepeatedly(ReturnRef(listeners)); // Listener #1 added with kService1. AddEventListener(kExtId, kService1, &listeners); EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener(kService1)); mdns_api_->OnListenerAdded(listener_info); // Listener #2 added with kService2. AddEventListener(kExtId, kService2, &listeners); EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener(kService2)); mdns_api_->OnListenerAdded(listener_info); // No-op. mdns_api_->OnListenerAdded(listener_info); // Listener #3 added with kService2. Should trigger a refresh of kService2. AddEventListener(kExtId, kService2, &listeners); EXPECT_CALL(*dns_sd_registry(), Publish(kService2)); mdns_api_->OnListenerAdded(listener_info); // Listener #3 removed, should be a no-op since there is still a live // listener for kService2. listeners.pop_back(); mdns_api_->OnListenerRemoved(listener_info); // Listener #2 removed, should unregister kService2. listeners.pop_back(); EXPECT_CALL(*dns_sd_registry(), UnregisterDnsSdListener(kService2)); mdns_api_->OnListenerRemoved(listener_info); // Listener #1 removed, should unregister kService1. listeners.pop_back(); EXPECT_CALL(*dns_sd_registry(), UnregisterDnsSdListener(kService1)); mdns_api_->OnListenerRemoved(listener_info); // No-op. mdns_api_->OnListenerAdded(listener_info); // Listener #4 added with kService1. AddEventListener(kExtId, kService1, &listeners); EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener(kService1)); mdns_api_->OnListenerAdded(listener_info); } TEST_F(MDnsAPIMaxServicesTest, OnServiceListDoesNotExceedLimit) { EventRouterFactory::GetInstance()->SetTestingFactory( browser_context(), &MockEventRouterFactoryFunction); // This check should change when the [value=2048] changes in the IDL file. EXPECT_EQ(2048, api::mdns::MAX_SERVICE_INSTANCES_PER_EVENT); // Dispatch an mDNS event with more service instances than the max, and ensure // that the list is truncated by inspecting the argument to MockEventRouter's // BroadcastEvent method. DnsSdRegistry::DnsSdServiceList services; for (int i = 0; i < api::mdns::MAX_SERVICE_INSTANCES_PER_EVENT + 10; ++i) { services.push_back(DnsSdService()); } EXPECT_CALL( *event_router(), BroadcastEventPtr(testing::Pointee(EventServiceListSize( static_cast<size_t>(api::mdns::MAX_SERVICE_INSTANCES_PER_EVENT))))) .Times(1); dns_sd_registry()->DispatchMDnsEvent("_testing._tcp.local", services); } TEST_F(MDnsAPITest, ExtensionRespectsWhitelist) { scoped_refptr<extensions::Extension> extension = CreateExtension("Dinosaur networker", false, kExtId); ExtensionRegistry::Get(browser_context())->AddEnabled(extension); ASSERT_EQ(Manifest::TYPE_EXTENSION, extension.get()->GetType()); // There is a whitelist of mdns service types extensions may access, which // includes "_testing._tcp.local" and exludes "_trex._tcp.local" { base::DictionaryValue filter; filter.SetString(kEventFilterServiceTypeKey, "_trex._tcp.local"); ASSERT_TRUE(dns_sd_registry()); // Test that the extension is able to listen to a non-whitelisted service EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener("_trex._tcp.local")) .Times(0); EventRouter::Get(browser_context()) ->AddFilteredEventListener(api::mdns::OnServiceList::kEventName, render_process_host(), kExtId, filter, false); EXPECT_CALL(*dns_sd_registry(), UnregisterDnsSdListener("_trex._tcp.local")) .Times(0); EventRouter::Get(browser_context()) ->RemoveFilteredEventListener(api::mdns::OnServiceList::kEventName, render_process_host(), kExtId, filter, false); } { base::DictionaryValue filter; filter.SetString(kEventFilterServiceTypeKey, "_testing._tcp.local"); ASSERT_TRUE(dns_sd_registry()); // Test that the extension is able to listen to a whitelisted service EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener("_testing._tcp.local")); EventRouter::Get(browser_context()) ->AddFilteredEventListener(api::mdns::OnServiceList::kEventName, render_process_host(), kExtId, filter, false); EXPECT_CALL(*dns_sd_registry(), UnregisterDnsSdListener("_testing._tcp.local")); EventRouter::Get(browser_context()) ->RemoveFilteredEventListener(api::mdns::OnServiceList::kEventName, render_process_host(), kExtId, filter, false); } } TEST_F(MDnsAPITest, PlatformAppsNotSubjectToWhitelist) { scoped_refptr<extensions::Extension> extension = CreateExtension("Dinosaur networker", true, kExtId); ExtensionRegistry::Get(browser_context())->AddEnabled(extension); ASSERT_TRUE(extension.get()->is_platform_app()); base::DictionaryValue filter; filter.SetString(kEventFilterServiceTypeKey, "_trex._tcp.local"); ASSERT_TRUE(dns_sd_registry()); // Test that the extension is able to listen to a non-whitelisted service EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener("_trex._tcp.local")); EventRouter::Get(browser_context()) ->AddFilteredEventListener(api::mdns::OnServiceList::kEventName, render_process_host(), kExtId, filter, false); EXPECT_CALL(*dns_sd_registry(), UnregisterDnsSdListener("_trex._tcp.local")); EventRouter::Get(browser_context()) ->RemoveFilteredEventListener(api::mdns::OnServiceList::kEventName, render_process_host(), kExtId, filter, false); } } // namespace extensions
[ "changhyeok.bae@lge.com" ]
changhyeok.bae@lge.com
21df1889faf15261ed0ce0ade5c8ac08f5c45dfd
b02b68bf92724d9dea0644c5a3a5b60fe6811e87
/src/GNDStk/Node/test/ctor.test.cpp
6c8529f79399876d7be01bcb537fbf2fbb456d2d
[ "BSD-2-Clause" ]
permissive
njoy/GNDStk
c7c86390acd969a40102e5fb120f00a16a9f5408
208d078db20abce5baa5185b4c50be52f094444a
refs/heads/master
2023-08-19T03:48:33.362623
2021-11-04T14:44:10
2021-11-04T14:44:10
210,242,550
2
1
NOASSERTION
2023-07-19T19:42:11
2019-09-23T01:47:06
C++
UTF-8
C++
false
false
5,955
cpp
#include "catch.hpp" #include "GNDStk.hpp" using namespace njoy::GNDStk; // ------------------------ // yyyymmdd // ------------------------ struct yyyymmdd; void convert(const yyyymmdd &from, Node &to); struct yyyymmdd { int year, month, day; yyyymmdd(const int year, const int month, const int day) : year(year), month(month), day(day) { } // implicit conversion to Node operator Node() const { Node n; convert(*this,n); return n; } }; // convert() yyyymmdd to a Node. Sort of contrived - it just makes a Node // with these as metadata. Used later, to exercise certain constructors. void convert(const yyyymmdd &from, Node &to) { CHECK(to.empty()); // it *should* come here this way to.add("Year", from.year ); to.add("Month",from.month); to.add("Day", from.day ); }; // ------------------------ // mmddyyyy // ------------------------ struct mmddyyyy { int month, day, year; mmddyyyy(const int month, const int day, const int year) : month(month), day(day), year(year) { } // implicit conversion to yyyymmdd operator yyyymmdd() const { return yyyymmdd(year,month,day); } }; // convert() mmddyyyy to a Node. void convert(const mmddyyyy &from, Node &to) { CHECK(to.empty()); // it *should* come here this way to.add("Month",from.month); to.add("Day", from.day ); to.add("Year", from.year ); }; // ------------------------ // Scenario // ------------------------ SCENARIO("Testing GNDStk Node constructors") { // ------------------------ // default // ------------------------ WHEN("A Node is default constructed") { Node n; CHECK(n.empty()); } // ------------------------ // move // ------------------------ WHEN("A default Node is move constructed") { Node n(std::move(Node{})); CHECK(n.empty()); } WHEN("A Node with substantial content is move constructed") { Node n(std::move(Node{} = Tree("n-008_O_016.xml").top())); CHECK(n == Tree("n-008_O_016.xml").top()); } // ------------------------ // copy // ------------------------ WHEN("A tree's top-level Node is copy constructed") { Tree t("n-008_O_016.xml"); Node n(t.top()); std::ostringstream osst; osst << t.top(); std::ostringstream ossn; ossn << n; CHECK(osst.str() == ossn.str()); } // ------------------------ // string (the Node's name) // ------------------------ WHEN("A Node is constructed from just a name (no metadata/children)") { Node n("NodeName"); CHECK(n.name == "NodeName"); CHECK(n.metadata.size() == 0); CHECK(n.children.size() == 0); } // ------------------------ // Child<*> (from which // we get the Node's name // ------------------------ WHEN("A Node is constructed from a Child") { Node n(basic::child::reactionSuite); CHECK(n.name == "reactionSuite"); CHECK(n.metadata.size() == 0); CHECK(n.children.size() == 0); } // ------------------------ // Child<void>, Node // ------------------------ GIVEN("A Node with some metadata and children") { // to be used... Node nv("one"); nv.add("key1","value1"); nv.add("key2","value2"); nv.add("child1"); Node nd("two"); nd.add("key1","value1"); nd.add("child1"); nd.add("child2"); // Child<void,one> WHEN("Another Node is constructed from (Child<one>,Node)") { Node n(Child<void,Allow::one>("ONE"),nv); CHECK(n.name == "ONE"); // name taken from the Child, not from nv CHECK(n.metadata.size() == 2); CHECK(n.children.size() == 1); } // Child<void,many>, just to be different from the <one> case above WHEN("Another Node is constructed from (Child<many>,Node)") { Node n(Child<void,Allow::many>("TWO"),nd); CHECK(n.name == "TWO"); // as above CHECK(n.metadata.size() == 1); CHECK(n.children.size() == 2); } // With a yyyymmdd, which can implcitly convert to a Node WHEN("Another Node is constructed from (Child<many>,type)") { Node n(Child<void,Allow::many>("THREE"),yyyymmdd{1776,7,4}); CHECK(n.name == "THREE"); CHECK(n.metadata.size() == 3); CHECK(n.meta("Year" ) == "1776"); CHECK(n.meta("Month") == "7"); CHECK(n.meta("Day" ) == "4"); CHECK(n.children.size() == 0); } } // ------------------------ // Child<TYPE>, TYPE // ------------------------ GIVEN("Some Child<type> objects") { const Child<yyyymmdd,Allow::one> ymd("YearMonthDay",yyyymmdd{0,0,0}); const Child<mmddyyyy,Allow::one> mdy("MonthDayYear",mmddyyyy{0,0,0}); WHEN("A Node is constructed with (Child<type>,type)") { Node n(ymd,yyyymmdd{1776,7,4}); CHECK(n.name == "YearMonthDay"); CHECK(n.metadata.size() == 3); CHECK(n.meta("Year" ) == "1776"); CHECK(n.meta("Month") == "7"); CHECK(n.meta("Day" ) == "4"); CHECK(n.children.size() == 0); } WHEN("A Node is constructed with (Child<type>,type)") { Node n(mdy,mmddyyyy{6,21,1788}); CHECK(n.name == "MonthDayYear"); CHECK(n.metadata.size() == 3); CHECK(n.meta("Year" ) == "1788"); CHECK(n.meta("Month") == "6"); CHECK(n.meta("Day" ) == "21"); CHECK(n.children.size() == 0); } // mix things up a bit, considering that // mmddyyyy has a conversion to yyyymmdd WHEN("Same, with (Child<type>, other type convertible to type)") { Node n(ymd,mmddyyyy{6,21,1788}); CHECK(n.name == "YearMonthDay"); CHECK(n.metadata.size() == 3); CHECK(n.meta("Year" ) == "1788"); CHECK(n.meta("Month") == "6"); CHECK(n.meta("Day" ) == "21"); CHECK(n.children.size() == 0); } } }
[ "kipnflip@gmail.com" ]
kipnflip@gmail.com
689c5c3b08c635a9984cd8f400e076dec149d4b5
14c03eeb411aa3dc14f7060a8694491eb67e2fd1
/src/api/console.cpp
2cc32caca3e09d91dc8bbf87085f25a780b1dfc7
[ "OpenSSL", "ISC", "MIT", "BSL-1.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
uyuang/pipy
8ab884422a3e3bfde29a848158ed29a2d72b5e6f
d54c0aaae262756f35ebf8256bd4dae7617b8444
refs/heads/main
2023-05-15T01:20:44.941420
2021-06-09T05:56:10
2021-06-09T05:56:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,774
cpp
/* * Copyright (c) 2019 by flomesh.io * * Unless prior written consent has been obtained from the copyright * owner, the following shall not be allowed. * * 1. The distribution of any source codes, header files, make files, * or libraries of the software. * * 2. Disclosure of any source codes pertaining to the software to any * additional parties. * * 3. Alteration or removal of any notices in or on the software or * within the documentation included within the software. * * ALL SOURCE CODE AS WELL AS ALL DOCUMENTATION INCLUDED WITH THIS * SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION, 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 "console.hpp" #include "logging.hpp" #include <sstream> namespace pjs { using namespace pipy; template<> void ClassDef<Console>::init() { ctor(); // console.log method("log", [](Context &ctx, Object *, Value &result) { std::stringstream ss; for (int i = 0; i < ctx.argc(); i++) { if (i > 0) ss << ' '; auto str = ctx.arg(i).to_string(); ss << str->c_str(); str->release(); } const auto &s = ss.str(); size_t i = 0; while (i < s.length()) { auto j = 0; while (j < s.length() && s[j] != '\n') j++; Log::info("[pjs] %s", s.substr(i, j - i).c_str()); i = j + 1; } }); } } // namespace pjs
[ "pajamacoder@flomesh.io" ]
pajamacoder@flomesh.io
34fa186aa11057fa74488663b3e928e33f62c030
6d5c2d08c5d16bcd2a4ea2f9afcea86b9b6093b1
/PIN2PIN_E/src_SPECIES/EBLevelSpecies.cpp
4408c0b58d3b86465f6b1663da4fd3fcd5a1cf29
[]
no_license
lmassa/VTPlasmaCombustion
49154932af5b185c553e55254dbb86d45769e3ae
31886322f83911d2d626ab8e729c97b5af7c8679
refs/heads/master
2021-09-01T00:08:23.845809
2017-12-23T17:35:47
2017-12-23T17:35:47
115,207,614
0
0
null
null
null
null
UTF-8
C++
false
false
23,072
cpp
#ifdef CH_LANG_CC /* * _______ __ * / ___/ / ___ __ _ / / ___ * / /__/ _ \/ _ \/ V \/ _ \/ _ \ * \___/_//_/\___/_/_/_/_.__/\___/ * Please refer to Copyright.txt, in Chombo's root directory. */ #endif #include "DebugOut.H" #include "EBLevelSpecies.H" #include "BaseIVFactory.H" #include "BaseIFFactory.H" #include "BaseIFFAB.H" #include "EBFluxFAB.H" #include "FaceIterator.H" #include "REAL.H" #include "EBCellFactory.H" #include "FaceIterator.H" #include <cstdio> #include "EBAMRIO.H" #include "EBArith.H" #include "NamespaceHeader.H" int EBLevelSpecies::s_timestep = 0; /*****************************/ /*****************************/ EBLevelSpecies::EBLevelSpecies() { m_isDefined = false; m_ebPatchSpecies = NULL; m_SFD = false; } /*****************************/ /*****************************/ void EBLevelSpecies::define(const DisjointBoxLayout& a_thisDBL, const DisjointBoxLayout& a_coarDBL, const EBISLayout& a_thisEBISL, const EBISLayout& a_coarEBISL, const ProblemDomain& a_domain, const int& a_nRefine, const RealVect& a_dx, const bool& a_useMassRedist, const bool& a_doSmushing, const bool& a_doRZCoords, const bool& a_hasSourceTerm, const EBPatchSpeciesFactory* const a_patchSpecies, const bool& a_hasCoarser, const bool& a_hasFiner) { CH_TIME("EBLevelSpecies::define"); CH_assert(a_dx[0] > 0.0); CH_assert(a_nRefine > 0); m_isDefined = true; m_thisGrids = a_thisDBL; m_thisEBISL = a_thisEBISL; m_refRatCrse= a_nRefine; m_dx = a_dx; m_domain = a_domain; m_hasCoarser= a_hasCoarser; m_hasFiner= a_hasFiner; m_doSmushing = a_doSmushing; m_doRZCoords = a_doRZCoords; m_hasSourceTerm = a_hasSourceTerm; m_useMassRedist = false;//lucanote hardwired m_useFlattening = false; //lucanote hardwired if (m_doRZCoords && !m_hasSourceTerm) { MayDay::Error("LG: RZ implies need of a source term--inconsistent inputs"); } if (m_hasCoarser) { m_coarGrids = a_coarDBL; m_coarEBISL = a_coarEBISL; } //lucacancel // delete seem to be able to delete this pointer becasue of the Plasma Physics stuff //not threadsafe //if (m_ebPatchSpecies != NULL) delete m_ebPatchSpecies; m_ebPatchSpecies = a_patchSpecies->create(); m_ebPatchSpecies->define(m_domain, m_dx); // Determing the number of ghost cells necessary here m_nGhost = 4; m_nCons = m_ebPatchSpecies->numConserved(); m_nFlux = m_ebPatchSpecies->numFluxes(); //define redistribution object for this level //for now set to volume weighting m_ebLevelRedist.define(m_thisGrids, m_thisEBISL, m_domain, m_nCons); if (m_hasCoarser) { CH_TIME("coarse_stuff_defs"); ProblemDomain domainCrse = coarsen(m_domain, m_refRatCrse); //patcher is defined with the number of conserved vars. m_patcher.define(m_thisGrids, m_coarGrids, m_thisEBISL, m_coarEBISL, domainCrse, m_refRatCrse, m_nCons, m_nGhost); } m_irregSetsSmall.define(m_thisGrids); for (DataIterator dit = m_thisGrids.dataIterator(); dit.ok(); ++dit) { const EBISBox& ebisBox = m_thisEBISL[dit()]; if (!ebisBox.isAllCovered()) { const Box& thisBox = m_thisGrids.get(dit()); m_irregSetsSmall[dit()] = ebisBox.getIrregIVS(thisBox); } } for (int faceDir = 0; faceDir < SpaceDim; faceDir++) { CH_TIME("flux_interpolant_defs"); EBArith::defineFluxInterpolant(m_fluxInterpolants[faceDir], m_irregSetsGrown [faceDir], m_thisGrids, m_thisEBISL, m_domain, m_nFlux, faceDir); } { CH_TIME("EBIrregFlux_defs"); BaseIVFactory<Real> cellFactorySmall(m_thisEBISL, m_irregSetsSmall); m_nonConsDivergence.define(m_thisGrids, m_nCons, IntVect::Zero, cellFactorySmall); m_ebIrregFaceFlux.define(m_thisGrids, m_nCons, IntVect::Zero, cellFactorySmall); } { CH_TIME("coarse-fine_ivs_defs"); //ebpatch needs coarse-fine IVS to know where to drop order for interpolation m_cfIVS.define(m_thisGrids); for (DataIterator ditOuter = m_thisGrids.dataIterator(); ditOuter.ok(); ++ditOuter) { const EBISBox& ebisBox = m_thisEBISL[ditOuter()]; if (!ebisBox.isAllCovered()) { // make a grown box of the grid and then subtract off each grid in the //domain to make the coarse-fine IVS // CFIVS = grow(b, 1) - sum(bi) Box grownBox = grow(m_thisGrids.get(ditOuter()), 1); grownBox &= m_domain; IntVectSet complementIVS(grownBox); for (LayoutIterator litInner = m_thisGrids.layoutIterator(); litInner.ok(); ++litInner) { Box innerBox = m_thisGrids.get(litInner()); complementIVS -= innerBox; } m_cfIVS[ditOuter()] = complementIVS; } } } { CH_TIME("flattening_defs"); //create temp data with the correct number of ghost cells IntVect ivGhost = m_nGhost*IntVect::Unit; EBCellFactory factory(m_thisEBISL); IntVect flatGhostIV = 3*IntVect::Unit; m_flattening.define(m_thisGrids, 1, flatGhostIV, factory); } } /*****************************/ void EBLevelSpecies::setVelTempPtrs(LevelData<EBFluxFAB>* a_faceVelocity, LevelData<EBCellFAB>* a_cellVelocity, LevelData<EBCellFAB>* a_cellTemperature) { m_faceVelocity=a_faceVelocity; m_cellVelocity=a_cellVelocity; m_cellTemperature=a_cellTemperature; } /*****************************/ void EBLevelSpecies:: floorConserved(LevelData<EBCellFAB>& a_consState, Real a_time, Real a_dt) { for (DataIterator dit = m_thisGrids.dataIterator(); dit.ok(); ++dit) { EBCellFAB& consState = a_consState[dit()]; const IntVectSet& cfivs = m_cfIVS[dit()]; const EBISBox& ebisBox = m_thisEBISL[dit()]; const Box& cellBox = m_thisGrids.get(dit()); m_ebPatchSpecies->setValidBox(cellBox, ebisBox, cfivs, a_time, a_dt); m_ebPatchSpecies->floorConserved(consState, cellBox); } } /*****************************/ void EBLevelSpecies:: fillConsState(LevelData<EBCellFAB>& a_consState, const LevelData<EBCellFAB>& a_consStateCoarseOld, const LevelData<EBCellFAB>& a_consStateCoarseNew, const Real& a_time, const Real& a_coarTimeOld, const Real& a_coarTimeNew) { Interval consInterv(0, m_nCons-1); Interval fluxInterv(0, m_nFlux-1); if (m_hasCoarser) { m_patcher.interpolate(a_consState, a_consStateCoarseOld, a_consStateCoarseNew, a_coarTimeOld, a_coarTimeNew, Max(a_time,a_coarTimeOld), consInterv); } // Exchange all the data between grids a_consState.exchange(consInterv); } /***************/ void EBLevelSpecies:: computeFlattening(Real a_time, Real a_dt, LevelData<EBCellFAB>& a_consState) { CH_TIME("eblevelgodunov::compute_flattening"); //compute flattening coefficients. this saves a ghost cell. woo hoo. int ibox = 0; bool verbose = false; for (DataIterator dit = m_thisGrids.dataIterator(); dit.ok(); ++dit) { EBCellFAB& consState = a_consState[dit()]; const EBISBox& ebisBox = m_thisEBISL[dit()]; if (!ebisBox.isAllCovered()) { const Box& cellBox = m_thisGrids.get(dit()); const IntVectSet& cfivs = m_cfIVS[dit()]; m_ebPatchSpecies->setValidBox(cellBox, ebisBox, cfivs, a_time, a_dt); m_ebPatchSpecies->setCoveredConsVals(consState); int nPrim = m_ebPatchSpecies->numPrimitives(); EBCellFAB primState(ebisBox, consState.getRegion(), nPrim); int logflag = 0; //debug //verbose = true; //end debug m_ebPatchSpecies->consToPrim(primState, consState, consState.getRegion(), logflag, verbose); EBCellFAB& flatteningFAB = m_flattening[dit()]; //this will set the stuff over the coarse-fine interface flatteningFAB.setVal(1.); if (m_ebPatchSpecies->usesFlattening()) { m_ebPatchSpecies->computeFlattening(flatteningFAB, primState, cellBox); } ibox++; } } Interval zerointerv(0,0); m_flattening.exchange(zerointerv); } /***************/ Real EBLevelSpecies:: doIrregularUpdate(EBFluxRegister& a_fineFluxRegister, EBFluxRegister& a_coarFluxRegister, LevelData<BaseIVFAB<Real> >& a_massDiff, Real a_time, Real a_dt, LevelData<EBCellFAB>& a_consState) { //now do the irregular update and the max wave speed Real maxWaveSpeed = 1.0e-12; int ibox = 0; Interval consInterv(0, m_nCons-1); Interval fluxInterv(0, m_nFlux-1); for (DataIterator dit = m_thisGrids.dataIterator(); dit.ok(); ++dit, ibox++) { const Box& cellBox = m_thisGrids.get(dit()); const EBISBox& ebisBox = m_thisEBISL[dit()]; if (!ebisBox.isAllCovered()) { const IntVectSet& cfivs = m_cfIVS[dit()]; EBCellFAB& consState = a_consState[dit()]; BaseIVFAB<Real>& redMass = a_massDiff[dit()]; EBFluxFAB& advVel = (*m_faceVelocity)[dit]; EBCellFAB& cellVel= (*m_cellVelocity)[dit]; EBCellFAB& cellTemp=(*m_cellTemperature)[dit]; m_ebPatchSpecies->setVelocities(cellVel, advVel); m_ebPatchSpecies->setValidBox(cellBox, ebisBox, cfivs, a_time, a_dt); BaseIFFAB<Real> centroidFlux[SpaceDim]; const BaseIFFAB<Real>* interpolantGrid[SpaceDim]; const IntVectSet& ivsIrregSmall = m_irregSetsSmall[dit()]; for (int idir = 0; idir < SpaceDim; idir++) { const BaseIFFAB<Real>& interpol = m_fluxInterpolants[idir][dit()]; interpolantGrid[idir] = &interpol; BaseIFFAB<Real>& fluxDir= centroidFlux[idir]; fluxDir.define(ivsIrregSmall, ebisBox.getEBGraph(), idir, m_nFlux); } m_ebPatchSpecies->interpolateFluxToCentroids(centroidFlux, interpolantGrid, ivsIrregSmall); Real maxWaveSpeedGrid = 0.0; //update the state and interpolate the flux const BaseIVFAB<Real>& nonConsDiv = m_nonConsDivergence[dit()]; const BaseIVFAB<Real>& ebIrregFlux = m_ebIrregFaceFlux[dit()]; m_ebPatchSpecies->irregularUpdate(consState, maxWaveSpeedGrid, redMass, centroidFlux, ebIrregFlux, nonConsDiv, cellBox, ivsIrregSmall); m_ebLevelRedist.increment(redMass, dit(), consInterv); maxWaveSpeed = Max(maxWaveSpeed, maxWaveSpeedGrid); //do fluxregister mambo /* Coarse flux register is flux register with the coarse level. Fine flux register is the flux register with the fine level. To the finer level FR, this level is the coarse level. To the coarser level FR, this level is the fine level. */ for (int idir = 0; idir < SpaceDim; idir++) { Real scale = a_dt; BaseIFFAB<Real> fluxRegFlux; if (m_doRZCoords) { //gather fluxes into flux-register compatible form fluxRegFlux.define(ivsIrregSmall, ebisBox.getEBGraph(), idir, m_nCons); m_ebPatchSpecies->assembleFluxIrr(fluxRegFlux, centroidFlux[idir], idir, cellBox, ivsIrregSmall); } if (m_hasFiner) { a_fineFluxRegister.incrementCoarseIrregular(centroidFlux[idir], scale,dit(), consInterv, idir); } if (m_hasCoarser) { for (SideIterator sit; sit.ok(); ++sit) { a_coarFluxRegister.incrementFineIrregular(centroidFlux[idir], scale, dit(), consInterv, idir,sit()); } } } } //!ebisBox.isAllCovered() }// end of loop over grids. a_consState.exchange(consInterv); return maxWaveSpeed; } /*****************************/ Real EBLevelSpecies:: step(LevelData<EBCellFAB>& a_consState, LevelData<BaseIVFAB<Real> >& a_massDiff, LevelData<EBCellFAB>& a_source, EBFluxRegister& a_fineFluxRegister, EBFluxRegister& a_coarFluxRegister, const LevelData<EBCellFAB>& a_consStateCoarseOld, const LevelData<EBCellFAB>& a_consStateCoarseNew, const Real& a_time, const Real& a_coarTimeOld, const Real& a_coarTimeNew, const Real& a_dt) { CH_TIME("levelgodunov_step"); Interval consInterv(0, m_nCons-1); Interval fluxInterv(0, m_nFlux-1); CH_assert(isDefined()); CH_assert(a_consState.disjointBoxLayout() == m_thisGrids); m_hasSourceTerm = a_source.isDefined(); EBPatchGodunov::s_conservativeSource = true; EBPatchGodunov::s_curComp = 1; { CH_TIME("fillConsState"); //cf interpolation and exchange fillConsState(a_consState, a_consStateCoarseOld, a_consStateCoarseNew, a_time, a_coarTimeOld, a_coarTimeNew); } { CH_TIME("early_coarse_fine"); m_ebLevelRedist.setToZero(); // clear flux registers with fine level //remember this level is the coarse level to the fine FR if (m_hasFiner) { a_fineFluxRegister.setToZero(); } } if(m_useFlattening) //should be always false { CH_TIME("computeFlattening"); //compute flattening coefficients. this saves a ghost cell. woo hoo. computeFlattening(a_time, a_dt, a_consState); } { CH_TIME("doRegularUpdate"); //this includes copying flux into flux interpolant and updating //regular grids and incrementing flux registers. doRegularUpdate(a_fineFluxRegister, a_coarFluxRegister, a_time, a_dt, a_consState, a_source); } Real maxWaveSpeed; { CH_TIME("doIrregularUpdate"); //this does irregular update and deals with flux registers. //also computes the mass increment maxWaveSpeed = doIrregularUpdate(a_fineFluxRegister, a_coarFluxRegister, a_massDiff, a_time, a_dt, a_consState); } if (m_doSmushing) { CH_TIME("smushing"); if (m_useMassRedist) { //if use mass weighting, need to //fix weights of redistribution object int densityIndex = m_ebPatchSpecies->densityIndex(); a_consState.exchange(consInterv); m_ebLevelRedist.resetWeights(a_consState, densityIndex); } //do fluxregister samba //redistribute mass at this level. Redistribution to other //levels (including reredist) is handled in EBAMRSpecies::postTimeStep m_ebLevelRedist.redistribute(a_consState, consInterv); } { CH_TIME("floors"); floorConserved(a_consState, a_time, a_dt); } //max wave speed already gets broadcast maxWaveSpeed = getMaxWaveSpeed(a_consState); // Find the minimum of dt's over this level Real dtNew = m_dx[0] / maxWaveSpeed; //return the maximum stable time step return dtNew; } /***************/ void EBLevelSpecies:: doRegularUpdate(EBFluxRegister& a_fineFluxRegister, EBFluxRegister& a_coarFluxRegister, Real a_time, Real a_dt, LevelData<EBCellFAB>& a_consState, const LevelData<EBCellFAB>& a_source) { bool verbose = false; int ibox = 0; Interval consInterv(0, m_nCons-1); Interval fluxInterv(0, m_nFlux-1); if (m_SFD) { floorConserved(*m_qbar, a_time, a_dt); } for (DataIterator dit = m_thisGrids.dataIterator(); dit.ok(); ++dit, ibox++) { const Box& cellBox = m_thisGrids.get(dit()); const EBISBox& ebisBox = m_thisEBISL[dit()]; if (!ebisBox.isAllCovered()) { const IntVectSet& cfivs = m_cfIVS[dit()]; EBCellFAB& consState = a_consState[dit()]; EBFluxFAB& advVel = (*m_faceVelocity)[dit]; EBCellFAB& cellVel= (*m_cellVelocity)[dit]; EBCellFAB& cellTemp=(*m_cellTemperature)[dit]; m_ebPatchSpecies->setVelocities(cellVel, advVel); m_ebPatchSpecies->setValidBox(cellBox, ebisBox, cfivs, a_time, a_dt); if (m_SFD) { MayDay::Error("Luca: Not dealing with SFD yet"); } EBFluxFAB flux(ebisBox, cellBox, m_nFlux); BaseIVFAB<Real>& nonConsDiv = m_nonConsDivergence[dit()]; BaseIVFAB<Real>& ebIrregFlux = m_ebIrregFaceFlux[dit()]; flux.setVal(7.89); ebIrregFlux.setVal(7.89); const IntVectSet& ivsIrreg = m_irregSetsSmall[dit()]; const EBCellFAB& flatteningFAB = m_flattening[dit()]; m_ebPatchSpecies->regularUpdate(consState, flux, ebIrregFlux, nonConsDiv,flatteningFAB, a_source[dit()], cellBox, ivsIrreg, dit(),verbose); //do fluxregister cha-cha /* Coarse flux register is flux register with the coarse level. Fine flux register is the flux register with the fine level. To the finer level FR, this level is the coarse level. To the coarser level FR, this level is the fine level. */ for (int idir = 0; idir < SpaceDim; idir++) { Real scale = a_dt; EBFaceFAB fluxRegFlux; if (m_doRZCoords) { //gather fluxes into flux-register compatible form fluxRegFlux.define(ebisBox, cellBox, idir, m_nCons); m_ebPatchSpecies->assembleFluxReg(fluxRegFlux, flux[idir], idir, cellBox); } if (m_hasFiner) { a_fineFluxRegister.incrementCoarseRegular(flux[idir], scale,dit(), consInterv, idir); } if (m_hasCoarser) { for (SideIterator sit; sit.ok(); ++sit) { a_coarFluxRegister.incrementFineRegular(flux[idir],scale, dit(), consInterv, idir,sit()); } } } //copy fluxes into sparse interpolant for (int faceDir = 0; faceDir < SpaceDim; faceDir++) { IntVectSet ivsIrregGrown = m_irregSetsGrown[faceDir][dit()]; ivsIrregGrown &= cellBox; FaceStop::WhichFaces stopCrit = FaceStop::SurroundingWithBoundary; BaseIFFAB<Real>& interpol = m_fluxInterpolants[faceDir][dit()]; interpol.setVal(7.7777e7); EBFaceFAB& fluxDir = flux[faceDir]; for (FaceIterator faceit(ivsIrregGrown, ebisBox.getEBGraph(), faceDir, stopCrit); faceit.ok(); ++faceit) { for (int ivar = 0; ivar < m_nFlux; ivar++) { interpol(faceit(), ivar) = fluxDir(faceit(), ivar); } } } } } for (int faceDir = 0; faceDir < SpaceDim; faceDir++) { m_fluxInterpolants[faceDir].exchange(fluxInterv); } } /*****************************/ Real EBLevelSpecies::getMaxWaveSpeed(const LevelData<EBCellFAB>& a_state, LevelData<EBCellFAB>* a_cellVelocity) { m_cellVelocity=a_cellVelocity; return getMaxWaveSpeed(a_state); } /*****************************/ Real EBLevelSpecies::getMaxWaveSpeed(const LevelData<EBCellFAB>& a_state) { CH_assert(a_state.disjointBoxLayout() == m_thisGrids); Real speed = 0.0; for (DataIterator dit = m_thisGrids.dataIterator(); dit.ok(); ++dit) { const Box& validBox = m_thisGrids.get(dit()); const EBISBox& ebisBox= m_thisEBISL[dit()]; if (!ebisBox.isAllCovered()) { //place holder not used maxWaveSpeed calc Real time = 0.0; const IntVectSet& cfivs = m_cfIVS[dit()]; EBCellFAB& cellVel= (*m_cellVelocity)[dit]; m_ebPatchSpecies->setVelocities(cellVel); m_ebPatchSpecies->setValidBox(validBox, ebisBox, cfivs, time, time); Real speedOverBox = m_ebPatchSpecies->getMaxWaveSpeed(a_state[dit()], validBox); speed = Max(speed,speedOverBox); } } // gather speed Vector<Real> all_speeds; gather(all_speeds,speed,uniqueProc(SerialTask::compute)); if (procID() == uniqueProc(SerialTask::compute)) { speed = all_speeds[0]; for (int i = 1; i < all_speeds.size (); ++i) { speed = Max(speed,all_speeds[i]); } } broadcast(speed,uniqueProc(SerialTask::compute)); return speed; } /*****************************/ bool EBLevelSpecies::isDefined() const { return m_isDefined; } /*****************************/ /*****************************/ //lucaadd void EBLevelSpecies::getQbar(LevelData<EBCellFAB>* a_qbar,Real a_chi) { m_SFD = true; m_chi = a_chi; m_qbar = a_qbar; } /*****************************/ /*****************************/ EBLevelSpecies::~EBLevelSpecies() { if (m_ebPatchSpecies != NULL) delete m_ebPatchSpecies; } /*****************************/ /*****************************/ #include "NamespaceFooter.H"
[ "lucamassa@Tests-iMac.local" ]
lucamassa@Tests-iMac.local
98baebd0d7d85640d8daaec65352079c02f81cc5
34b5db1ef69b226e3d2dcd7efadf15fce7108acd
/ref/yy.cpp
64c5b0a71902136e29eec2014861e7f20755a75e
[]
no_license
lv-zheng/cvtruck
5065378641a2b951d0167460e654787a09dc77f1
37692ff7967dd0ec068333a699e5a84763232da8
refs/heads/master
2020-04-02T03:35:34.100745
2016-06-03T13:46:34
2016-06-03T13:46:34
61,922,239
0
0
null
null
null
null
UTF-8
C++
false
false
883
cpp
#include "stdafx.h" #include <iostream> #include <string.h> #include "truck.hpp" int maintt(int argc, char **argv) { using namespace lvzheng; if (argc != 2) { std::cerr << "Usage: " << argv[0] << " <serial-port>" << std::endl; return 1; } auto truck = create_truck(argv[1]); std::cout << "READY" << std::endl; std::string s; while (1) { std::cout << "truck> "; if (s == "w") truck->go(truck::direction::FORWARD, truck::strength::LIGHT); else if (s == "s") truck->go(truck::direction::BACKWARD, truck::strength::LIGHT); else if (s == "a") truck->go(truck::direction::LEFT, truck::strength::LIGHT); else if (s == "d") truck->go(truck::direction::RIGHT, truck::strength::LIGHT); else if (s == "") truck->stop(); else if (s == "q") { truck->stop(); break; } else { std::cout << "Unknown command" << std::endl; } } return 0; }
[ "lv.zheng.2015@gmail.com" ]
lv.zheng.2015@gmail.com
2985c0f4684b5e390d26885e88d1b93bdff51027
4a01d244add9313d7a98f49951033e83fa9c11ca
/src/mpm/OLED.cpp
1d41aabc7b21b427f3222773587ca2745ade0207
[]
no_license
the-future-machine/MiniPredictionMachines
32fa13242f7f91e4b77dbac7a224493ba72002e2
6afe93fc9fbdc3d9fe579030b0f2a7207723a6fd
refs/heads/master
2021-01-08T23:00:56.279242
2017-08-07T14:31:57
2017-08-07T14:31:57
242,168,038
0
0
null
2020-02-21T15:15:55
2020-02-21T15:15:54
null
UTF-8
C++
false
false
21
cpp
../oled_test/OLED.cpp
[ "matthewg42@gmail.com" ]
matthewg42@gmail.com
10835629961be3697f4ef488e10e7ec0053ba5ae
1e018556f02f2b1eb729d52e704bcc6b7f9f5f7b
/audio/common/Semantic/jhcGraphlet.cpp
32ff28f535fb8bcf8bce9bfcc21f67b32c0b3b42
[ "Apache-2.0" ]
permissive
ghas-results/ALIA
3e9de2e4d98e0376c43d7a10ce568d64a9023ab1
4dc5e76c3280ece5471eddca875c6b7fa35e6beb
refs/heads/master
2023-08-10T03:40:25.889007
2020-07-20T02:19:49
2020-07-20T02:19:49
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,184
cpp
// jhcGraphlet.cpp : a collection of specific semantic nodes and links // // Written by Jonathan H. Connell, jconnell@alum.mit.edu // /////////////////////////////////////////////////////////////////////////// // // Copyright 2017-2020 IBM Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////////// #include <math.h> #include "Semantic/jhcGraphlet.h" /////////////////////////////////////////////////////////////////////////// // Creation and Initialization // /////////////////////////////////////////////////////////////////////////// //= Default destructor does necessary cleanup. jhcGraphlet::~jhcGraphlet () { } //= Default constructor initializes certain values. jhcGraphlet::jhcGraphlet () { *blank = '\0'; ni = 0; } /////////////////////////////////////////////////////////////////////////// // Configuration // /////////////////////////////////////////////////////////////////////////// //= Copy some other description using local nodes. void jhcGraphlet::Copy (const jhcGraphlet& ref) { int i; // copy items ni = ref.ni; for (i = 0; i < ni; i++) desc[i] = ref.desc[i]; } //= Copy some other description but use node substitutions from bindings. // returns 1 if successful, 0 if some reference nodes had no bindings int jhcGraphlet::CopyBind (const jhcGraphlet& ref, const jhcBindings& sub) { jhcNetNode *alt; int i, ok = 1; // copy items ni = ref.ni; for (i = 0; i < ni; i++) if ((alt = sub.LookUp(ref.desc[i])) == NULL) ok = 0; else desc[i] = alt; return ok; } //= Add some node (local or remote) to description. // returns item if successful, NULL for problem jhcNetNode *jhcGraphlet::AddItem (jhcNetNode *item) { if (item == NULL) return NULL; if (ni >= gmax) { jprintf(">>> More than %d items in jhcGraphlet::Add !\n", gmax); return NULL; } if (!InList(item)) desc[ni++] = item; return item; } //= Designate which node in graphlet is the most important. // returns main node if successful, NULL if not enough space to add jhcNetNode *jhcGraphlet::SetMain (jhcNetNode *main) { int i; // find node in description else add it for (i = 0; i < ni; i++) if (desc[i] == main) break; if (i >= ni) if (AddItem(main) == NULL) return NULL; // move it to the front (swap with original) if (i > 0) { desc[i] = desc[0]; desc[0] = main; } return main; } //= Remove old main node (if any) and set main to given node. // returns 1 if successful, 0 for problem int jhcGraphlet::ReplaceMain (jhcNetNode *main) { if (main == NULL) return 0; desc[0] = main; if (ni <= 0) ni = 1; return 1; } //= Make the last node added be the main node of the graphlet. jhcNetNode *jhcGraphlet::MainLast () { return SetMain(Item(NumItems() - 1)); } //= Make sure the main node is not a naked object. // rejects: obj-4, self-1 -lex- you jhcNetNode *jhcGraphlet::MainProp () { jhcNetNode *main = Main(); int i; if (main != NULL) if (main->LexNode() || (!main->VerbTag() && (main->NumArgs() <= 0))) for (i = 0; i < ni; i++) if (!desc[i]->LexNode() && (desc[i]->VerbTag() || (desc[i]->NumArgs() > 0))) return SetMain(desc[i]); return main; } //= Set belief of all nodes to their pending values (blf0). // returns number of changes made int jhcGraphlet::ActualizeAll (int ver) const { int i, chg = 0; for (i = 0; i < ni; i++) chg += desc[i]->Actualize(ver); return chg; } /////////////////////////////////////////////////////////////////////////// // List Access // /////////////////////////////////////////////////////////////////////////// //= Returns next node in list, transitioning from halo to main if needed. // call with prev = NULL to get first node jhcNetNode *jhcGraphlet::NextNode (const jhcNetNode *prev) const { int i; // search for index of previous node if (prev == NULL) return desc[0]; for (i = 0; i < ni; i++) if (desc[i] == prev) break; // report next node in array (if any) if (++i < ni) return desc[i]; return NULL; } //= Determine whether a given node is already in the description list. bool jhcGraphlet::InList (const jhcNetNode *n) const { int i; for (i = 0; i < ni; i++) if (desc[i] == n) return true; return false; } /////////////////////////////////////////////////////////////////////////// // Writing Functions // /////////////////////////////////////////////////////////////////////////// //= Save description focusing on relations. // assumes first line indented properly if lvl <= 0 (no CR on last line) // detail: 0 no extras, 1 show belief, 2 show tags, 3 show both // return: 1 = success, 0 = bad format, -1 = file error int jhcGraphlet::Save (FILE *out, int lvl, int detail) const { const jhcNetNode *n; int i, lvl2 = lvl, kmax = 3, nmax = 1, rmax = 3; // ignore if empty, else get printing field sizes if (ni <= 0) return 0; for (i = 0; i < ni; i++) desc[i]->TxtSizes(kmax, nmax, rmax); // format as (node -link-> arg), allow main node to be naked for (i = 0; i < ni; i++) { n = desc[i]; if ((i == 0) || (n->NumArgs() > 0) || !n->Blank() || (n->Literal() != NULL) || ((n->tags != 0) && (detail >= 2))) lvl2 = n->Save(out, lvl2, kmax, nmax, rmax, this, detail); } return((ferror(out) != 0) ? -1 : 1); }
[ "jconnell@us.ibm.com" ]
jconnell@us.ibm.com
1fa57c27ee363cf0dfb64f13b27dbc83975c353a
20e7990890414b27083c10b46b8dbdd91de87094
/C_Tutorships/some_Cpp_functions/CAP15/P360.CPP
c7988f5c011cab26a6438ee7f8cc11270a60344b
[]
no_license
agudeloandres/C_Struct_Files
eb3aa9a62c596939a79f1e13c2f5cc04543592ec
cafe017f5dad4cec5d1ea2fabf4d6c646c99a23b
refs/heads/master
2021-01-10T14:04:32.468058
2015-10-22T04:12:02
2015-10-22T04:12:02
44,718,124
0
0
null
null
null
null
UTF-8
C++
false
false
354
cpp
#include "dos.h" #include "conio.h" #undef poke void main() { unsigned seg,desplaza; int i; seg = 0xb000; /* Donde inicia memoria de video */ /* para un video monocromo */ desplaza = 0x0 + 10; /* Desplazamiento de 10 posiciones */ poke (seg, desplaza, 0x7041); /* Se escribe el caracter 'A', en */ /* invertido */ getch(); }
[ "agudeloandres@gmail.com" ]
agudeloandres@gmail.com
375a1868b43c7297343080c88b4fafacbf07f74e
62c87d66b28bdfa79b80a5b6148d2ecaea92d05e
/096_Unique Binary Search Trees.cpp
ce6fba7e5e854917b6e38ecccf4bb823c32849a7
[]
no_license
ivanzjj/Leetcode
33a5e51d4d9ecd4fb4eea11a48e9291c4d657018
1ab4a1943a9408a74d07356f1076d0e8b03a73be
refs/heads/master
2021-01-10T10:28:01.022182
2015-06-18T08:34:55
2015-06-18T08:34:55
36,235,435
0
0
null
null
null
null
UTF-8
C++
false
false
418
cpp
class Solution { public: vector<int> dp; int dfs (int n){ if (n == 0) return dp[n] = 1; if (dp[n] != -1) return dp[n]; dp[n] = 0; for (int i=0;i<n;i++){ dp[n] += dfs(i)*dfs(n-i-1); } return dp[n]; } int numTrees(int n) { dp.resize (n+1); fill_n (dp.begin(), n+1, -1); return dfs (n); } };
[ "ivanzjjcsu@gmail.com" ]
ivanzjjcsu@gmail.com
c1276f3a0962fb20e87e1a77f786efb1e09d5a31
d2c4729caca2b8433c749b2f0cc57214bd4014d4
/tests/custom-flags/main.cpp
da02b0aab38c899d2d28515a98ea3b99df52c9f1
[]
no_license
Crystalix007/Flexible-CAP
580fde9e6c189daa126e99c822c8bcfb4ce15698
91853bea45ec377018cd686c032096b7e1a916cf
refs/heads/master
2021-06-27T18:01:59.796849
2021-03-28T15:58:39
2021-03-28T19:24:51
211,517,684
0
0
null
2020-12-06T20:16:18
2019-09-28T15:03:10
C++
UTF-8
C++
false
false
1,421
cpp
#include "customflagsArgGrammarDriver.hpp" #include <sstream> using Result = customflagsArgGrammar::Driver::Result; int main(int argc, char* argv[]) { customflagsArgGrammar::Driver driver{ argc, argv }; auto res = driver.parse(); if (res != Result::success) { if (res == Result::completedAction) { return 0; } return -1; } std::cout << "program"; if (auto hasHelp = driver.getArg(customflagsArgGrammar::FlagArg::help)) { std::cout << " --help"; } if (auto hasVersion = driver.getArg(customflagsArgGrammar::FlagArg::version)) { std::cout << " --version"; } if (auto hasFlag1 = driver.getArg(customflagsArgGrammar::FlagArg::flag1)) { std::cout << " --flag1"; } if (auto hasFlag2 = driver.getArg(customflagsArgGrammar::ParamArg::flag2)) { std::cout << " --flag2 (" << hasFlag2.value()[0] << ")"; } if (auto hasFlag3 = driver.getArg(customflagsArgGrammar::ParamArg::flag3)) { std::cout << " --flag3 (" << hasFlag3.value()[0] << ", " << hasFlag3.value()[1] << ")"; } if (auto hasFlag4 = driver.getArg(customflagsArgGrammar::ParamArg::flag4)) { std::cout << " --flag4 (" << hasFlag4.value()[0] << ", " << hasFlag4.value()[1] << ")"; } if (auto hasFlag5 = driver.getArg(customflagsArgGrammar::ParamArg::flag5)) { std::cout << " --flag5 (" << hasFlag5.value()[0] << ", " << hasFlag5.value()[1] << ", " << hasFlag5.value()[2] << ")"; } std::cout << std::endl; return 0; }
[ "michaelkuc6@gmail.com" ]
michaelkuc6@gmail.com
d4441ecb212c5e2acb52a559f956cf8df52c86c2
fb5b25b4fbe66c532672c14dacc520b96ff90a04
/export/release/windows/obj/src/flixel/util/_FlxColor/FlxColor_Impl_.cpp
1814110bf66751fcb79e3121174dc3e01dec8837
[ "Apache-2.0" ]
permissive
Tyrcnex/tai-mod
c3849f817fe871004ed171245d63c5e447c4a9c3
b83152693bb3139ee2ae73002623934f07d35baf
refs/heads/main
2023-08-15T07:15:43.884068
2021-09-29T23:39:23
2021-09-29T23:39:23
383,313,424
1
0
null
null
null
null
UTF-8
C++
false
false
285,394
cpp
#include <hxcpp.h> #ifndef INCLUDED_95f339a1d026d52c #define INCLUDED_95f339a1d026d52c #include "hxMath.h" #endif #ifndef INCLUDED_EReg #include <EReg.h> #endif #ifndef INCLUDED_Std #include <Std.h> #endif #ifndef INCLUDED_StringTools #include <StringTools.h> #endif #ifndef INCLUDED_flixel_math_FlxMath #include <flixel/math/FlxMath.h> #endif #ifndef INCLUDED_flixel_util__FlxColor_FlxColor_Impl_ #include <flixel/util/_FlxColor/FlxColor_Impl_.h> #endif #ifndef INCLUDED_haxe_IMap #include <haxe/IMap.h> #endif #ifndef INCLUDED_haxe_ds_StringMap #include <haxe/ds/StringMap.h> #endif HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_88_fromInt,"flixel.util._FlxColor.FlxColor_Impl_","fromInt",0xdc40c740,"flixel.util._FlxColor.FlxColor_Impl_.fromInt","flixel/util/FlxColor.hx",88,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_101_fromRGB,"flixel.util._FlxColor.FlxColor_Impl_","fromRGB",0xdc47795e,"flixel.util._FlxColor.FlxColor_Impl_.fromRGB","flixel/util/FlxColor.hx",101,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_116_fromRGBFloat,"flixel.util._FlxColor.FlxColor_Impl_","fromRGBFloat",0x9c52075e,"flixel.util._FlxColor.FlxColor_Impl_.fromRGBFloat","flixel/util/FlxColor.hx",116,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_132_fromCMYK,"flixel.util._FlxColor.FlxColor_Impl_","fromCMYK",0xd85d276b,"flixel.util._FlxColor.FlxColor_Impl_.fromCMYK","flixel/util/FlxColor.hx",132,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_147_fromHSB,"flixel.util._FlxColor.FlxColor_Impl_","fromHSB",0xdc3fed48,"flixel.util._FlxColor.FlxColor_Impl_.fromHSB","flixel/util/FlxColor.hx",147,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_162_fromHSL,"flixel.util._FlxColor.FlxColor_Impl_","fromHSL",0xdc3fed52,"flixel.util._FlxColor.FlxColor_Impl_.fromHSL","flixel/util/FlxColor.hx",162,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_183_fromString,"flixel.util._FlxColor.FlxColor_Impl_","fromString",0x7279f720,"flixel.util._FlxColor.FlxColor_Impl_.fromString","flixel/util/FlxColor.hx",183,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_220_getHSBColorWheel,"flixel.util._FlxColor.FlxColor_Impl_","getHSBColorWheel",0xaedeb29e,"flixel.util._FlxColor.FlxColor_Impl_.getHSBColorWheel","flixel/util/FlxColor.hx",220,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_232_interpolate,"flixel.util._FlxColor.FlxColor_Impl_","interpolate",0x463d27dc,"flixel.util._FlxColor.FlxColor_Impl_.interpolate","flixel/util/FlxColor.hx",232,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_251_gradient,"flixel.util._FlxColor.FlxColor_Impl_","gradient",0x6325b7f5,"flixel.util._FlxColor.FlxColor_Impl_.gradient","flixel/util/FlxColor.hx",251,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_258_gradient,"flixel.util._FlxColor.FlxColor_Impl_","gradient",0x6325b7f5,"flixel.util._FlxColor.FlxColor_Impl_.gradient","flixel/util/FlxColor.hx",258,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_276_multiply,"flixel.util._FlxColor.FlxColor_Impl_","multiply",0xd3736029,"flixel.util._FlxColor.FlxColor_Impl_.multiply","flixel/util/FlxColor.hx",276,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_285_add,"flixel.util._FlxColor.FlxColor_Impl_","add",0x199e323c,"flixel.util._FlxColor.FlxColor_Impl_.add","flixel/util/FlxColor.hx",285,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_294_subtract,"flixel.util._FlxColor.FlxColor_Impl_","subtract",0x30f7f319,"flixel.util._FlxColor.FlxColor_Impl_.subtract","flixel/util/FlxColor.hx",294,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_305_getComplementHarmony,"flixel.util._FlxColor.FlxColor_Impl_","getComplementHarmony",0xe82411cf,"flixel.util._FlxColor.FlxColor_Impl_.getComplementHarmony","flixel/util/FlxColor.hx",305,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_316_getAnalogousHarmony,"flixel.util._FlxColor.FlxColor_Impl_","getAnalogousHarmony",0x6a6ddffa,"flixel.util._FlxColor.FlxColor_Impl_.getAnalogousHarmony","flixel/util/FlxColor.hx",316,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_331_getSplitComplementHarmony,"flixel.util._FlxColor.FlxColor_Impl_","getSplitComplementHarmony",0x65102b17,"flixel.util._FlxColor.FlxColor_Impl_.getSplitComplementHarmony","flixel/util/FlxColor.hx",331,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_346_getTriadicHarmony,"flixel.util._FlxColor.FlxColor_Impl_","getTriadicHarmony",0x8ea1774f,"flixel.util._FlxColor.FlxColor_Impl_.getTriadicHarmony","flixel/util/FlxColor.hx",346,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_360_to24Bit,"flixel.util._FlxColor.FlxColor_Impl_","to24Bit",0xaa37506b,"flixel.util._FlxColor.FlxColor_Impl_.to24Bit","flixel/util/FlxColor.hx",360,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_372_toHexString,"flixel.util._FlxColor.FlxColor_Impl_","toHexString",0x94bdbc2c,"flixel.util._FlxColor.FlxColor_Impl_.toHexString","flixel/util/FlxColor.hx",372,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_383_toWebString,"flixel.util._FlxColor.FlxColor_Impl_","toWebString",0x5e0aaea5,"flixel.util._FlxColor.FlxColor_Impl_.toWebString","flixel/util/FlxColor.hx",383,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_392_getColorInfo,"flixel.util._FlxColor.FlxColor_Impl_","getColorInfo",0x327dc480,"flixel.util._FlxColor.FlxColor_Impl_.getColorInfo","flixel/util/FlxColor.hx",392,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_411_getDarkened,"flixel.util._FlxColor.FlxColor_Impl_","getDarkened",0xd9fa3a4f,"flixel.util._FlxColor.FlxColor_Impl_.getDarkened","flixel/util/FlxColor.hx",411,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_425_getLightened,"flixel.util._FlxColor.FlxColor_Impl_","getLightened",0xe2b011ed,"flixel.util._FlxColor.FlxColor_Impl_.getLightened","flixel/util/FlxColor.hx",425,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_438_getInverted,"flixel.util._FlxColor.FlxColor_Impl_","getInverted",0x422fc6c6,"flixel.util._FlxColor.FlxColor_Impl_.getInverted","flixel/util/FlxColor.hx",438,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_455_setRGB,"flixel.util._FlxColor.FlxColor_Impl_","setRGB",0x421acf50,"flixel.util._FlxColor.FlxColor_Impl_.setRGB","flixel/util/FlxColor.hx",455,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_473_setRGBFloat,"flixel.util._FlxColor.FlxColor_Impl_","setRGBFloat",0x51a7e42c,"flixel.util._FlxColor.FlxColor_Impl_.setRGBFloat","flixel/util/FlxColor.hx",473,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_492_setCMYK,"flixel.util._FlxColor.FlxColor_Impl_","setCMYK",0x8b750539,"flixel.util._FlxColor.FlxColor_Impl_.setCMYK","flixel/util/FlxColor.hx",492,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_510_setHSB,"flixel.util._FlxColor.FlxColor_Impl_","setHSB",0x4213433a,"flixel.util._FlxColor.FlxColor_Impl_.setHSB","flixel/util/FlxColor.hx",510,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_526_setHSL,"flixel.util._FlxColor.FlxColor_Impl_","setHSL",0x42134344,"flixel.util._FlxColor.FlxColor_Impl_.setHSL","flixel/util/FlxColor.hx",526,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_536_setHSChromaMatch,"flixel.util._FlxColor.FlxColor_Impl_","setHSChromaMatch",0x8f5af4c7,"flixel.util._FlxColor.FlxColor_Impl_.setHSChromaMatch","flixel/util/FlxColor.hx",536,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_561__new,"flixel.util._FlxColor.FlxColor_Impl_","_new",0x4f82ece6,"flixel.util._FlxColor.FlxColor_Impl_._new","flixel/util/FlxColor.hx",561,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_571_getThis,"flixel.util._FlxColor.FlxColor_Impl_","getThis",0xa3c49faf,"flixel.util._FlxColor.FlxColor_Impl_.getThis","flixel/util/FlxColor.hx",571,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_576_validate,"flixel.util._FlxColor.FlxColor_Impl_","validate",0x3dca4e9b,"flixel.util._FlxColor.FlxColor_Impl_.validate","flixel/util/FlxColor.hx",576,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_584_get_red,"flixel.util._FlxColor.FlxColor_Impl_","get_red",0xab118b83,"flixel.util._FlxColor.FlxColor_Impl_.get_red","flixel/util/FlxColor.hx",584,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_589_get_green,"flixel.util._FlxColor.FlxColor_Impl_","get_green",0x6e5e3175,"flixel.util._FlxColor.FlxColor_Impl_.get_green","flixel/util/FlxColor.hx",589,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_594_get_blue,"flixel.util._FlxColor.FlxColor_Impl_","get_blue",0xf9ba7c28,"flixel.util._FlxColor.FlxColor_Impl_.get_blue","flixel/util/FlxColor.hx",594,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_599_get_alpha,"flixel.util._FlxColor.FlxColor_Impl_","get_alpha",0xf607ca10,"flixel.util._FlxColor.FlxColor_Impl_.get_alpha","flixel/util/FlxColor.hx",599,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_604_get_redFloat,"flixel.util._FlxColor.FlxColor_Impl_","get_redFloat",0x28fb0f19,"flixel.util._FlxColor.FlxColor_Impl_.get_redFloat","flixel/util/FlxColor.hx",604,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_609_get_greenFloat,"flixel.util._FlxColor.FlxColor_Impl_","get_greenFloat",0x97159be7,"flixel.util._FlxColor.FlxColor_Impl_.get_greenFloat","flixel/util/FlxColor.hx",609,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_614_get_blueFloat,"flixel.util._FlxColor.FlxColor_Impl_","get_blueFloat",0x58cea854,"flixel.util._FlxColor.FlxColor_Impl_.get_blueFloat","flixel/util/FlxColor.hx",614,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_619_get_alphaFloat,"flixel.util._FlxColor.FlxColor_Impl_","get_alphaFloat",0xe2f5f16c,"flixel.util._FlxColor.FlxColor_Impl_.get_alphaFloat","flixel/util/FlxColor.hx",619,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_623_set_red,"flixel.util._FlxColor.FlxColor_Impl_","set_red",0x9e131c8f,"flixel.util._FlxColor.FlxColor_Impl_.set_red","flixel/util/FlxColor.hx",623,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_631_set_green,"flixel.util._FlxColor.FlxColor_Impl_","set_green",0x51af1d81,"flixel.util._FlxColor.FlxColor_Impl_.set_green","flixel/util/FlxColor.hx",631,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_639_set_blue,"flixel.util._FlxColor.FlxColor_Impl_","set_blue",0xa817d59c,"flixel.util._FlxColor.FlxColor_Impl_.set_blue","flixel/util/FlxColor.hx",639,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_647_set_alpha,"flixel.util._FlxColor.FlxColor_Impl_","set_alpha",0xd958b61c,"flixel.util._FlxColor.FlxColor_Impl_.set_alpha","flixel/util/FlxColor.hx",647,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_655_set_redFloat,"flixel.util._FlxColor.FlxColor_Impl_","set_redFloat",0x3df4328d,"flixel.util._FlxColor.FlxColor_Impl_.set_redFloat","flixel/util/FlxColor.hx",655,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_661_set_greenFloat,"flixel.util._FlxColor.FlxColor_Impl_","set_greenFloat",0xb735845b,"flixel.util._FlxColor.FlxColor_Impl_.set_greenFloat","flixel/util/FlxColor.hx",661,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_667_set_blueFloat,"flixel.util._FlxColor.FlxColor_Impl_","set_blueFloat",0x9dd48a60,"flixel.util._FlxColor.FlxColor_Impl_.set_blueFloat","flixel/util/FlxColor.hx",667,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_673_set_alphaFloat,"flixel.util._FlxColor.FlxColor_Impl_","set_alphaFloat",0x0315d9e0,"flixel.util._FlxColor.FlxColor_Impl_.set_alphaFloat","flixel/util/FlxColor.hx",673,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_680_get_cyan,"flixel.util._FlxColor.FlxColor_Impl_","get_cyan",0xfa6d7eb1,"flixel.util._FlxColor.FlxColor_Impl_.get_cyan","flixel/util/FlxColor.hx",680,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_685_get_magenta,"flixel.util._FlxColor.FlxColor_Impl_","get_magenta",0xbba26d5b,"flixel.util._FlxColor.FlxColor_Impl_.get_magenta","flixel/util/FlxColor.hx",685,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_690_get_yellow,"flixel.util._FlxColor.FlxColor_Impl_","get_yellow",0xdee9d882,"flixel.util._FlxColor.FlxColor_Impl_.get_yellow","flixel/util/FlxColor.hx",690,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_695_get_black,"flixel.util._FlxColor.FlxColor_Impl_","get_black",0x8962f871,"flixel.util._FlxColor.FlxColor_Impl_.get_black","flixel/util/FlxColor.hx",695,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_699_set_cyan,"flixel.util._FlxColor.FlxColor_Impl_","set_cyan",0xa8cad825,"flixel.util._FlxColor.FlxColor_Impl_.set_cyan","flixel/util/FlxColor.hx",699,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_705_set_magenta,"flixel.util._FlxColor.FlxColor_Impl_","set_magenta",0xc60f7467,"flixel.util._FlxColor.FlxColor_Impl_.set_magenta","flixel/util/FlxColor.hx",705,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_711_set_yellow,"flixel.util._FlxColor.FlxColor_Impl_","set_yellow",0xe26776f6,"flixel.util._FlxColor.FlxColor_Impl_.set_yellow","flixel/util/FlxColor.hx",711,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_717_set_black,"flixel.util._FlxColor.FlxColor_Impl_","set_black",0x6cb3e47d,"flixel.util._FlxColor.FlxColor_Impl_.set_black","flixel/util/FlxColor.hx",717,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_723_get_hue,"flixel.util._FlxColor.FlxColor_Impl_","get_hue",0xab0a02ea,"flixel.util._FlxColor.FlxColor_Impl_.get_hue","flixel/util/FlxColor.hx",723,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_736_get_brightness,"flixel.util._FlxColor.FlxColor_Impl_","get_brightness",0x252b65df,"flixel.util._FlxColor.FlxColor_Impl_.get_brightness","flixel/util/FlxColor.hx",736,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_741_get_saturation,"flixel.util._FlxColor.FlxColor_Impl_","get_saturation",0xb65babe0,"flixel.util._FlxColor.FlxColor_Impl_.get_saturation","flixel/util/FlxColor.hx",741,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_746_get_lightness,"flixel.util._FlxColor.FlxColor_Impl_","get_lightness",0x5544981f,"flixel.util._FlxColor.FlxColor_Impl_.get_lightness","flixel/util/FlxColor.hx",746,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_750_set_hue,"flixel.util._FlxColor.FlxColor_Impl_","set_hue",0x9e0b93f6,"flixel.util._FlxColor.FlxColor_Impl_.set_hue","flixel/util/FlxColor.hx",750,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_756_set_saturation,"flixel.util._FlxColor.FlxColor_Impl_","set_saturation",0xd67b9454,"flixel.util._FlxColor.FlxColor_Impl_.set_saturation","flixel/util/FlxColor.hx",756,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_762_set_brightness,"flixel.util._FlxColor.FlxColor_Impl_","set_brightness",0x454b4e53,"flixel.util._FlxColor.FlxColor_Impl_.set_brightness","flixel/util/FlxColor.hx",762,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_768_set_lightness,"flixel.util._FlxColor.FlxColor_Impl_","set_lightness",0x9a4a7a2b,"flixel.util._FlxColor.FlxColor_Impl_.set_lightness","flixel/util/FlxColor.hx",768,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_775_maxColor,"flixel.util._FlxColor.FlxColor_Impl_","maxColor",0x2d604224,"flixel.util._FlxColor.FlxColor_Impl_.maxColor","flixel/util/FlxColor.hx",775,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_780_minColor,"flixel.util._FlxColor.FlxColor_Impl_","minColor",0x7a7a5c76,"flixel.util._FlxColor.FlxColor_Impl_.minColor","flixel/util/FlxColor.hx",780,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_785_boundChannel,"flixel.util._FlxColor.FlxColor_Impl_","boundChannel",0x855280aa,"flixel.util._FlxColor.FlxColor_Impl_.boundChannel","flixel/util/FlxColor.hx",785,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_20_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",20,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_21_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",21,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_22_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",22,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_23_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",23,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_25_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",25,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_26_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",26,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_27_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",27,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_28_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",28,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_29_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",29,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_30_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",30,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_31_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",31,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_32_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",32,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_33_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",33,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_34_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",34,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_35_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",35,0x9335c333) HX_LOCAL_STACK_FRAME(_hx_pos_0c1a490149f50aaa_54_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/system/macros/FlxMacroUtil.hx",54,0x8cc0f087) HX_LOCAL_STACK_FRAME(_hx_pos_fda63b7a1987bfd7_78_boot,"flixel.util._FlxColor.FlxColor_Impl_","boot",0x517f5bb7,"flixel.util._FlxColor.FlxColor_Impl_.boot","flixel/util/FlxColor.hx",78,0x9335c333) namespace flixel{ namespace util{ namespace _FlxColor{ void FlxColor_Impl__obj::__construct() { } Dynamic FlxColor_Impl__obj::__CreateEmpty() { return new FlxColor_Impl__obj; } void *FlxColor_Impl__obj::_hx_vtable = 0; Dynamic FlxColor_Impl__obj::__Create(::hx::DynamicArray inArgs) { ::hx::ObjectPtr< FlxColor_Impl__obj > _hx_result = new FlxColor_Impl__obj(); _hx_result->__construct(); return _hx_result; } bool FlxColor_Impl__obj::_hx_isInstanceOf(int inClassId) { return inClassId==(int)0x00000001 || inClassId==(int)0x5b84291f; } int FlxColor_Impl__obj::TRANSPARENT; int FlxColor_Impl__obj::WHITE; int FlxColor_Impl__obj::GRAY; int FlxColor_Impl__obj::BLACK; int FlxColor_Impl__obj::GREEN; int FlxColor_Impl__obj::LIME; int FlxColor_Impl__obj::YELLOW; int FlxColor_Impl__obj::ORANGE; int FlxColor_Impl__obj::RED; int FlxColor_Impl__obj::PURPLE; int FlxColor_Impl__obj::BLUE; int FlxColor_Impl__obj::BROWN; int FlxColor_Impl__obj::PINK; int FlxColor_Impl__obj::MAGENTA; int FlxColor_Impl__obj::CYAN; ::haxe::ds::StringMap FlxColor_Impl__obj::colorLookup; ::EReg FlxColor_Impl__obj::COLOR_REGEX; int FlxColor_Impl__obj::fromInt(int Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_88_fromInt) HXDLIN( 88) return ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(Value); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,fromInt,return ) int FlxColor_Impl__obj::fromRGB(int Red,int Green,int Blue,::hx::Null< int > __o_Alpha){ int Alpha = __o_Alpha.Default(255); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_101_fromRGB) HXLINE( 102) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXLINE( 103) { HXLINE( 103) color = (color & -16711681); HXDLIN( 103) int color1; HXDLIN( 103) if ((Red > 255)) { HXLINE( 103) color1 = 255; } else { HXLINE( 103) if ((Red < 0)) { HXLINE( 103) color1 = 0; } else { HXLINE( 103) color1 = Red; } } HXDLIN( 103) color = (color | (color1 << 16)); } HXDLIN( 103) { HXLINE( 103) color = (color & -65281); HXDLIN( 103) int color2; HXDLIN( 103) if ((Green > 255)) { HXLINE( 103) color2 = 255; } else { HXLINE( 103) if ((Green < 0)) { HXLINE( 103) color2 = 0; } else { HXLINE( 103) color2 = Green; } } HXDLIN( 103) color = (color | (color2 << 8)); } HXDLIN( 103) { HXLINE( 103) color = (color & -256); HXDLIN( 103) int color3; HXDLIN( 103) if ((Blue > 255)) { HXLINE( 103) color3 = 255; } else { HXLINE( 103) if ((Blue < 0)) { HXLINE( 103) color3 = 0; } else { HXLINE( 103) color3 = Blue; } } HXDLIN( 103) color = (color | color3); } HXDLIN( 103) { HXLINE( 103) color = (color & 16777215); HXDLIN( 103) int color4; HXDLIN( 103) if ((Alpha > 255)) { HXLINE( 103) color4 = 255; } else { HXLINE( 103) if ((Alpha < 0)) { HXLINE( 103) color4 = 0; } else { HXLINE( 103) color4 = Alpha; } } HXDLIN( 103) color = (color | (color4 << 24)); } HXDLIN( 103) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC4(FlxColor_Impl__obj,fromRGB,return ) int FlxColor_Impl__obj::fromRGBFloat(Float Red,Float Green,Float Blue,::hx::Null< Float > __o_Alpha){ Float Alpha = __o_Alpha.Default(1); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_116_fromRGBFloat) HXLINE( 117) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXLINE( 118) { HXLINE( 118) int Value = ::Math_obj::round((Red * ( (Float)(255) ))); HXDLIN( 118) color = (color & -16711681); HXDLIN( 118) int color1; HXDLIN( 118) if ((Value > 255)) { HXLINE( 118) color1 = 255; } else { HXLINE( 118) if ((Value < 0)) { HXLINE( 118) color1 = 0; } else { HXLINE( 118) color1 = Value; } } HXDLIN( 118) color = (color | (color1 << 16)); } HXDLIN( 118) { HXLINE( 118) int Value1 = ::Math_obj::round((Green * ( (Float)(255) ))); HXDLIN( 118) color = (color & -65281); HXDLIN( 118) int color2; HXDLIN( 118) if ((Value1 > 255)) { HXLINE( 118) color2 = 255; } else { HXLINE( 118) if ((Value1 < 0)) { HXLINE( 118) color2 = 0; } else { HXLINE( 118) color2 = Value1; } } HXDLIN( 118) color = (color | (color2 << 8)); } HXDLIN( 118) { HXLINE( 118) int Value2 = ::Math_obj::round((Blue * ( (Float)(255) ))); HXDLIN( 118) color = (color & -256); HXDLIN( 118) int color3; HXDLIN( 118) if ((Value2 > 255)) { HXLINE( 118) color3 = 255; } else { HXLINE( 118) if ((Value2 < 0)) { HXLINE( 118) color3 = 0; } else { HXLINE( 118) color3 = Value2; } } HXDLIN( 118) color = (color | color3); } HXDLIN( 118) { HXLINE( 118) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 118) color = (color & 16777215); HXDLIN( 118) int color4; HXDLIN( 118) if ((Value3 > 255)) { HXLINE( 118) color4 = 255; } else { HXLINE( 118) if ((Value3 < 0)) { HXLINE( 118) color4 = 0; } else { HXLINE( 118) color4 = Value3; } } HXDLIN( 118) color = (color | (color4 << 24)); } HXDLIN( 118) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC4(FlxColor_Impl__obj,fromRGBFloat,return ) int FlxColor_Impl__obj::fromCMYK(Float Cyan,Float Magenta,Float Yellow,Float Black,::hx::Null< Float > __o_Alpha){ Float Alpha = __o_Alpha.Default(1); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_132_fromCMYK) HXLINE( 133) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXLINE( 134) { HXLINE( 134) Float Value = ((( (Float)(1) ) - Cyan) * (( (Float)(1) ) - Black)); HXDLIN( 134) { HXLINE( 134) int Value1 = ::Math_obj::round((Value * ( (Float)(255) ))); HXDLIN( 134) color = (color & -16711681); HXDLIN( 134) int color1; HXDLIN( 134) if ((Value1 > 255)) { HXLINE( 134) color1 = 255; } else { HXLINE( 134) if ((Value1 < 0)) { HXLINE( 134) color1 = 0; } else { HXLINE( 134) color1 = Value1; } } HXDLIN( 134) color = (color | (color1 << 16)); } } HXDLIN( 134) { HXLINE( 134) Float Value2 = ((( (Float)(1) ) - Magenta) * (( (Float)(1) ) - Black)); HXDLIN( 134) { HXLINE( 134) int Value3 = ::Math_obj::round((Value2 * ( (Float)(255) ))); HXDLIN( 134) color = (color & -65281); HXDLIN( 134) int color2; HXDLIN( 134) if ((Value3 > 255)) { HXLINE( 134) color2 = 255; } else { HXLINE( 134) if ((Value3 < 0)) { HXLINE( 134) color2 = 0; } else { HXLINE( 134) color2 = Value3; } } HXDLIN( 134) color = (color | (color2 << 8)); } } HXDLIN( 134) { HXLINE( 134) Float Value4 = ((( (Float)(1) ) - Yellow) * (( (Float)(1) ) - Black)); HXDLIN( 134) { HXLINE( 134) int Value5 = ::Math_obj::round((Value4 * ( (Float)(255) ))); HXDLIN( 134) color = (color & -256); HXDLIN( 134) int color3; HXDLIN( 134) if ((Value5 > 255)) { HXLINE( 134) color3 = 255; } else { HXLINE( 134) if ((Value5 < 0)) { HXLINE( 134) color3 = 0; } else { HXLINE( 134) color3 = Value5; } } HXDLIN( 134) color = (color | color3); } } HXDLIN( 134) { HXLINE( 134) int Value6 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 134) color = (color & 16777215); HXDLIN( 134) int color4; HXDLIN( 134) if ((Value6 > 255)) { HXLINE( 134) color4 = 255; } else { HXLINE( 134) if ((Value6 < 0)) { HXLINE( 134) color4 = 0; } else { HXLINE( 134) color4 = Value6; } } HXDLIN( 134) color = (color | (color4 << 24)); } HXDLIN( 134) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC5(FlxColor_Impl__obj,fromCMYK,return ) int FlxColor_Impl__obj::fromHSB(Float Hue,Float Saturation,Float Brightness,::hx::Null< Float > __o_Alpha){ Float Alpha = __o_Alpha.Default(1); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_147_fromHSB) HXLINE( 148) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXLINE( 149) Float chroma = (Brightness * Saturation); HXDLIN( 149) Float match = (Brightness - chroma); HXDLIN( 149) Float Hue1 = Hue; HXDLIN( 149) Float Chroma = chroma; HXDLIN( 149) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 149) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 149) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 149) Chroma = (Chroma + match); HXDLIN( 149) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 149) { HXLINE( 149) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 149) color = (color & -16711681); HXDLIN( 149) int color1; HXDLIN( 149) if ((Value > 255)) { HXLINE( 149) color1 = 255; } else { HXLINE( 149) if ((Value < 0)) { HXLINE( 149) color1 = 0; } else { HXLINE( 149) color1 = Value; } } HXDLIN( 149) color = (color | (color1 << 16)); } HXDLIN( 149) { HXLINE( 149) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 149) color = (color & -65281); HXDLIN( 149) int color2; HXDLIN( 149) if ((Value1 > 255)) { HXLINE( 149) color2 = 255; } else { HXLINE( 149) if ((Value1 < 0)) { HXLINE( 149) color2 = 0; } else { HXLINE( 149) color2 = Value1; } } HXDLIN( 149) color = (color | (color2 << 8)); } HXDLIN( 149) { HXLINE( 149) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 149) color = (color & -256); HXDLIN( 149) int color3; HXDLIN( 149) if ((Value2 > 255)) { HXLINE( 149) color3 = 255; } else { HXLINE( 149) if ((Value2 < 0)) { HXLINE( 149) color3 = 0; } else { HXLINE( 149) color3 = Value2; } } HXDLIN( 149) color = (color | color3); } HXDLIN( 149) { HXLINE( 149) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 149) color = (color & 16777215); HXDLIN( 149) int color4; HXDLIN( 149) if ((Value3 > 255)) { HXLINE( 149) color4 = 255; } else { HXLINE( 149) if ((Value3 < 0)) { HXLINE( 149) color4 = 0; } else { HXLINE( 149) color4 = Value3; } } HXDLIN( 149) color = (color | (color4 << 24)); } } break; case (int)1: { HXLINE( 149) { HXLINE( 149) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 149) color = (color & -16711681); HXDLIN( 149) int color1; HXDLIN( 149) if ((Value > 255)) { HXLINE( 149) color1 = 255; } else { HXLINE( 149) if ((Value < 0)) { HXLINE( 149) color1 = 0; } else { HXLINE( 149) color1 = Value; } } HXDLIN( 149) color = (color | (color1 << 16)); } HXDLIN( 149) { HXLINE( 149) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 149) color = (color & -65281); HXDLIN( 149) int color2; HXDLIN( 149) if ((Value1 > 255)) { HXLINE( 149) color2 = 255; } else { HXLINE( 149) if ((Value1 < 0)) { HXLINE( 149) color2 = 0; } else { HXLINE( 149) color2 = Value1; } } HXDLIN( 149) color = (color | (color2 << 8)); } HXDLIN( 149) { HXLINE( 149) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 149) color = (color & -256); HXDLIN( 149) int color3; HXDLIN( 149) if ((Value2 > 255)) { HXLINE( 149) color3 = 255; } else { HXLINE( 149) if ((Value2 < 0)) { HXLINE( 149) color3 = 0; } else { HXLINE( 149) color3 = Value2; } } HXDLIN( 149) color = (color | color3); } HXDLIN( 149) { HXLINE( 149) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 149) color = (color & 16777215); HXDLIN( 149) int color4; HXDLIN( 149) if ((Value3 > 255)) { HXLINE( 149) color4 = 255; } else { HXLINE( 149) if ((Value3 < 0)) { HXLINE( 149) color4 = 0; } else { HXLINE( 149) color4 = Value3; } } HXDLIN( 149) color = (color | (color4 << 24)); } } break; case (int)2: { HXLINE( 149) { HXLINE( 149) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 149) color = (color & -16711681); HXDLIN( 149) int color1; HXDLIN( 149) if ((Value > 255)) { HXLINE( 149) color1 = 255; } else { HXLINE( 149) if ((Value < 0)) { HXLINE( 149) color1 = 0; } else { HXLINE( 149) color1 = Value; } } HXDLIN( 149) color = (color | (color1 << 16)); } HXDLIN( 149) { HXLINE( 149) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 149) color = (color & -65281); HXDLIN( 149) int color2; HXDLIN( 149) if ((Value1 > 255)) { HXLINE( 149) color2 = 255; } else { HXLINE( 149) if ((Value1 < 0)) { HXLINE( 149) color2 = 0; } else { HXLINE( 149) color2 = Value1; } } HXDLIN( 149) color = (color | (color2 << 8)); } HXDLIN( 149) { HXLINE( 149) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 149) color = (color & -256); HXDLIN( 149) int color3; HXDLIN( 149) if ((Value2 > 255)) { HXLINE( 149) color3 = 255; } else { HXLINE( 149) if ((Value2 < 0)) { HXLINE( 149) color3 = 0; } else { HXLINE( 149) color3 = Value2; } } HXDLIN( 149) color = (color | color3); } HXDLIN( 149) { HXLINE( 149) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 149) color = (color & 16777215); HXDLIN( 149) int color4; HXDLIN( 149) if ((Value3 > 255)) { HXLINE( 149) color4 = 255; } else { HXLINE( 149) if ((Value3 < 0)) { HXLINE( 149) color4 = 0; } else { HXLINE( 149) color4 = Value3; } } HXDLIN( 149) color = (color | (color4 << 24)); } } break; case (int)3: { HXLINE( 149) { HXLINE( 149) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 149) color = (color & -16711681); HXDLIN( 149) int color1; HXDLIN( 149) if ((Value > 255)) { HXLINE( 149) color1 = 255; } else { HXLINE( 149) if ((Value < 0)) { HXLINE( 149) color1 = 0; } else { HXLINE( 149) color1 = Value; } } HXDLIN( 149) color = (color | (color1 << 16)); } HXDLIN( 149) { HXLINE( 149) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 149) color = (color & -65281); HXDLIN( 149) int color2; HXDLIN( 149) if ((Value1 > 255)) { HXLINE( 149) color2 = 255; } else { HXLINE( 149) if ((Value1 < 0)) { HXLINE( 149) color2 = 0; } else { HXLINE( 149) color2 = Value1; } } HXDLIN( 149) color = (color | (color2 << 8)); } HXDLIN( 149) { HXLINE( 149) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 149) color = (color & -256); HXDLIN( 149) int color3; HXDLIN( 149) if ((Value2 > 255)) { HXLINE( 149) color3 = 255; } else { HXLINE( 149) if ((Value2 < 0)) { HXLINE( 149) color3 = 0; } else { HXLINE( 149) color3 = Value2; } } HXDLIN( 149) color = (color | color3); } HXDLIN( 149) { HXLINE( 149) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 149) color = (color & 16777215); HXDLIN( 149) int color4; HXDLIN( 149) if ((Value3 > 255)) { HXLINE( 149) color4 = 255; } else { HXLINE( 149) if ((Value3 < 0)) { HXLINE( 149) color4 = 0; } else { HXLINE( 149) color4 = Value3; } } HXDLIN( 149) color = (color | (color4 << 24)); } } break; case (int)4: { HXLINE( 149) { HXLINE( 149) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 149) color = (color & -16711681); HXDLIN( 149) int color1; HXDLIN( 149) if ((Value > 255)) { HXLINE( 149) color1 = 255; } else { HXLINE( 149) if ((Value < 0)) { HXLINE( 149) color1 = 0; } else { HXLINE( 149) color1 = Value; } } HXDLIN( 149) color = (color | (color1 << 16)); } HXDLIN( 149) { HXLINE( 149) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 149) color = (color & -65281); HXDLIN( 149) int color2; HXDLIN( 149) if ((Value1 > 255)) { HXLINE( 149) color2 = 255; } else { HXLINE( 149) if ((Value1 < 0)) { HXLINE( 149) color2 = 0; } else { HXLINE( 149) color2 = Value1; } } HXDLIN( 149) color = (color | (color2 << 8)); } HXDLIN( 149) { HXLINE( 149) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 149) color = (color & -256); HXDLIN( 149) int color3; HXDLIN( 149) if ((Value2 > 255)) { HXLINE( 149) color3 = 255; } else { HXLINE( 149) if ((Value2 < 0)) { HXLINE( 149) color3 = 0; } else { HXLINE( 149) color3 = Value2; } } HXDLIN( 149) color = (color | color3); } HXDLIN( 149) { HXLINE( 149) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 149) color = (color & 16777215); HXDLIN( 149) int color4; HXDLIN( 149) if ((Value3 > 255)) { HXLINE( 149) color4 = 255; } else { HXLINE( 149) if ((Value3 < 0)) { HXLINE( 149) color4 = 0; } else { HXLINE( 149) color4 = Value3; } } HXDLIN( 149) color = (color | (color4 << 24)); } } break; case (int)5: { HXLINE( 149) { HXLINE( 149) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 149) color = (color & -16711681); HXDLIN( 149) int color1; HXDLIN( 149) if ((Value > 255)) { HXLINE( 149) color1 = 255; } else { HXLINE( 149) if ((Value < 0)) { HXLINE( 149) color1 = 0; } else { HXLINE( 149) color1 = Value; } } HXDLIN( 149) color = (color | (color1 << 16)); } HXDLIN( 149) { HXLINE( 149) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 149) color = (color & -65281); HXDLIN( 149) int color2; HXDLIN( 149) if ((Value1 > 255)) { HXLINE( 149) color2 = 255; } else { HXLINE( 149) if ((Value1 < 0)) { HXLINE( 149) color2 = 0; } else { HXLINE( 149) color2 = Value1; } } HXDLIN( 149) color = (color | (color2 << 8)); } HXDLIN( 149) { HXLINE( 149) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 149) color = (color & -256); HXDLIN( 149) int color3; HXDLIN( 149) if ((Value2 > 255)) { HXLINE( 149) color3 = 255; } else { HXLINE( 149) if ((Value2 < 0)) { HXLINE( 149) color3 = 0; } else { HXLINE( 149) color3 = Value2; } } HXDLIN( 149) color = (color | color3); } HXDLIN( 149) { HXLINE( 149) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 149) color = (color & 16777215); HXDLIN( 149) int color4; HXDLIN( 149) if ((Value3 > 255)) { HXLINE( 149) color4 = 255; } else { HXLINE( 149) if ((Value3 < 0)) { HXLINE( 149) color4 = 0; } else { HXLINE( 149) color4 = Value3; } } HXDLIN( 149) color = (color | (color4 << 24)); } } break; } HXDLIN( 149) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC4(FlxColor_Impl__obj,fromHSB,return ) int FlxColor_Impl__obj::fromHSL(Float Hue,Float Saturation,Float Lightness,::hx::Null< Float > __o_Alpha){ Float Alpha = __o_Alpha.Default(1); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_162_fromHSL) HXLINE( 163) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXLINE( 164) Float chroma = ((( (Float)(1) ) - ::Math_obj::abs(((( (Float)(2) ) * Lightness) - ( (Float)(1) )))) * Saturation); HXDLIN( 164) Float match = (Lightness - (chroma / ( (Float)(2) ))); HXDLIN( 164) Float Hue1 = Hue; HXDLIN( 164) Float Chroma = chroma; HXDLIN( 164) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 164) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 164) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 164) Chroma = (Chroma + match); HXDLIN( 164) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 164) { HXLINE( 164) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 164) color = (color & -16711681); HXDLIN( 164) int color1; HXDLIN( 164) if ((Value > 255)) { HXLINE( 164) color1 = 255; } else { HXLINE( 164) if ((Value < 0)) { HXLINE( 164) color1 = 0; } else { HXLINE( 164) color1 = Value; } } HXDLIN( 164) color = (color | (color1 << 16)); } HXDLIN( 164) { HXLINE( 164) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 164) color = (color & -65281); HXDLIN( 164) int color2; HXDLIN( 164) if ((Value1 > 255)) { HXLINE( 164) color2 = 255; } else { HXLINE( 164) if ((Value1 < 0)) { HXLINE( 164) color2 = 0; } else { HXLINE( 164) color2 = Value1; } } HXDLIN( 164) color = (color | (color2 << 8)); } HXDLIN( 164) { HXLINE( 164) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 164) color = (color & -256); HXDLIN( 164) int color3; HXDLIN( 164) if ((Value2 > 255)) { HXLINE( 164) color3 = 255; } else { HXLINE( 164) if ((Value2 < 0)) { HXLINE( 164) color3 = 0; } else { HXLINE( 164) color3 = Value2; } } HXDLIN( 164) color = (color | color3); } HXDLIN( 164) { HXLINE( 164) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 164) color = (color & 16777215); HXDLIN( 164) int color4; HXDLIN( 164) if ((Value3 > 255)) { HXLINE( 164) color4 = 255; } else { HXLINE( 164) if ((Value3 < 0)) { HXLINE( 164) color4 = 0; } else { HXLINE( 164) color4 = Value3; } } HXDLIN( 164) color = (color | (color4 << 24)); } } break; case (int)1: { HXLINE( 164) { HXLINE( 164) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 164) color = (color & -16711681); HXDLIN( 164) int color1; HXDLIN( 164) if ((Value > 255)) { HXLINE( 164) color1 = 255; } else { HXLINE( 164) if ((Value < 0)) { HXLINE( 164) color1 = 0; } else { HXLINE( 164) color1 = Value; } } HXDLIN( 164) color = (color | (color1 << 16)); } HXDLIN( 164) { HXLINE( 164) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 164) color = (color & -65281); HXDLIN( 164) int color2; HXDLIN( 164) if ((Value1 > 255)) { HXLINE( 164) color2 = 255; } else { HXLINE( 164) if ((Value1 < 0)) { HXLINE( 164) color2 = 0; } else { HXLINE( 164) color2 = Value1; } } HXDLIN( 164) color = (color | (color2 << 8)); } HXDLIN( 164) { HXLINE( 164) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 164) color = (color & -256); HXDLIN( 164) int color3; HXDLIN( 164) if ((Value2 > 255)) { HXLINE( 164) color3 = 255; } else { HXLINE( 164) if ((Value2 < 0)) { HXLINE( 164) color3 = 0; } else { HXLINE( 164) color3 = Value2; } } HXDLIN( 164) color = (color | color3); } HXDLIN( 164) { HXLINE( 164) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 164) color = (color & 16777215); HXDLIN( 164) int color4; HXDLIN( 164) if ((Value3 > 255)) { HXLINE( 164) color4 = 255; } else { HXLINE( 164) if ((Value3 < 0)) { HXLINE( 164) color4 = 0; } else { HXLINE( 164) color4 = Value3; } } HXDLIN( 164) color = (color | (color4 << 24)); } } break; case (int)2: { HXLINE( 164) { HXLINE( 164) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 164) color = (color & -16711681); HXDLIN( 164) int color1; HXDLIN( 164) if ((Value > 255)) { HXLINE( 164) color1 = 255; } else { HXLINE( 164) if ((Value < 0)) { HXLINE( 164) color1 = 0; } else { HXLINE( 164) color1 = Value; } } HXDLIN( 164) color = (color | (color1 << 16)); } HXDLIN( 164) { HXLINE( 164) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 164) color = (color & -65281); HXDLIN( 164) int color2; HXDLIN( 164) if ((Value1 > 255)) { HXLINE( 164) color2 = 255; } else { HXLINE( 164) if ((Value1 < 0)) { HXLINE( 164) color2 = 0; } else { HXLINE( 164) color2 = Value1; } } HXDLIN( 164) color = (color | (color2 << 8)); } HXDLIN( 164) { HXLINE( 164) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 164) color = (color & -256); HXDLIN( 164) int color3; HXDLIN( 164) if ((Value2 > 255)) { HXLINE( 164) color3 = 255; } else { HXLINE( 164) if ((Value2 < 0)) { HXLINE( 164) color3 = 0; } else { HXLINE( 164) color3 = Value2; } } HXDLIN( 164) color = (color | color3); } HXDLIN( 164) { HXLINE( 164) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 164) color = (color & 16777215); HXDLIN( 164) int color4; HXDLIN( 164) if ((Value3 > 255)) { HXLINE( 164) color4 = 255; } else { HXLINE( 164) if ((Value3 < 0)) { HXLINE( 164) color4 = 0; } else { HXLINE( 164) color4 = Value3; } } HXDLIN( 164) color = (color | (color4 << 24)); } } break; case (int)3: { HXLINE( 164) { HXLINE( 164) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 164) color = (color & -16711681); HXDLIN( 164) int color1; HXDLIN( 164) if ((Value > 255)) { HXLINE( 164) color1 = 255; } else { HXLINE( 164) if ((Value < 0)) { HXLINE( 164) color1 = 0; } else { HXLINE( 164) color1 = Value; } } HXDLIN( 164) color = (color | (color1 << 16)); } HXDLIN( 164) { HXLINE( 164) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 164) color = (color & -65281); HXDLIN( 164) int color2; HXDLIN( 164) if ((Value1 > 255)) { HXLINE( 164) color2 = 255; } else { HXLINE( 164) if ((Value1 < 0)) { HXLINE( 164) color2 = 0; } else { HXLINE( 164) color2 = Value1; } } HXDLIN( 164) color = (color | (color2 << 8)); } HXDLIN( 164) { HXLINE( 164) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 164) color = (color & -256); HXDLIN( 164) int color3; HXDLIN( 164) if ((Value2 > 255)) { HXLINE( 164) color3 = 255; } else { HXLINE( 164) if ((Value2 < 0)) { HXLINE( 164) color3 = 0; } else { HXLINE( 164) color3 = Value2; } } HXDLIN( 164) color = (color | color3); } HXDLIN( 164) { HXLINE( 164) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 164) color = (color & 16777215); HXDLIN( 164) int color4; HXDLIN( 164) if ((Value3 > 255)) { HXLINE( 164) color4 = 255; } else { HXLINE( 164) if ((Value3 < 0)) { HXLINE( 164) color4 = 0; } else { HXLINE( 164) color4 = Value3; } } HXDLIN( 164) color = (color | (color4 << 24)); } } break; case (int)4: { HXLINE( 164) { HXLINE( 164) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 164) color = (color & -16711681); HXDLIN( 164) int color1; HXDLIN( 164) if ((Value > 255)) { HXLINE( 164) color1 = 255; } else { HXLINE( 164) if ((Value < 0)) { HXLINE( 164) color1 = 0; } else { HXLINE( 164) color1 = Value; } } HXDLIN( 164) color = (color | (color1 << 16)); } HXDLIN( 164) { HXLINE( 164) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 164) color = (color & -65281); HXDLIN( 164) int color2; HXDLIN( 164) if ((Value1 > 255)) { HXLINE( 164) color2 = 255; } else { HXLINE( 164) if ((Value1 < 0)) { HXLINE( 164) color2 = 0; } else { HXLINE( 164) color2 = Value1; } } HXDLIN( 164) color = (color | (color2 << 8)); } HXDLIN( 164) { HXLINE( 164) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 164) color = (color & -256); HXDLIN( 164) int color3; HXDLIN( 164) if ((Value2 > 255)) { HXLINE( 164) color3 = 255; } else { HXLINE( 164) if ((Value2 < 0)) { HXLINE( 164) color3 = 0; } else { HXLINE( 164) color3 = Value2; } } HXDLIN( 164) color = (color | color3); } HXDLIN( 164) { HXLINE( 164) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 164) color = (color & 16777215); HXDLIN( 164) int color4; HXDLIN( 164) if ((Value3 > 255)) { HXLINE( 164) color4 = 255; } else { HXLINE( 164) if ((Value3 < 0)) { HXLINE( 164) color4 = 0; } else { HXLINE( 164) color4 = Value3; } } HXDLIN( 164) color = (color | (color4 << 24)); } } break; case (int)5: { HXLINE( 164) { HXLINE( 164) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 164) color = (color & -16711681); HXDLIN( 164) int color1; HXDLIN( 164) if ((Value > 255)) { HXLINE( 164) color1 = 255; } else { HXLINE( 164) if ((Value < 0)) { HXLINE( 164) color1 = 0; } else { HXLINE( 164) color1 = Value; } } HXDLIN( 164) color = (color | (color1 << 16)); } HXDLIN( 164) { HXLINE( 164) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 164) color = (color & -65281); HXDLIN( 164) int color2; HXDLIN( 164) if ((Value1 > 255)) { HXLINE( 164) color2 = 255; } else { HXLINE( 164) if ((Value1 < 0)) { HXLINE( 164) color2 = 0; } else { HXLINE( 164) color2 = Value1; } } HXDLIN( 164) color = (color | (color2 << 8)); } HXDLIN( 164) { HXLINE( 164) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 164) color = (color & -256); HXDLIN( 164) int color3; HXDLIN( 164) if ((Value2 > 255)) { HXLINE( 164) color3 = 255; } else { HXLINE( 164) if ((Value2 < 0)) { HXLINE( 164) color3 = 0; } else { HXLINE( 164) color3 = Value2; } } HXDLIN( 164) color = (color | color3); } HXDLIN( 164) { HXLINE( 164) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 164) color = (color & 16777215); HXDLIN( 164) int color4; HXDLIN( 164) if ((Value3 > 255)) { HXLINE( 164) color4 = 255; } else { HXLINE( 164) if ((Value3 < 0)) { HXLINE( 164) color4 = 0; } else { HXLINE( 164) color4 = Value3; } } HXDLIN( 164) color = (color | (color4 << 24)); } } break; } HXDLIN( 164) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC4(FlxColor_Impl__obj,fromHSL,return ) ::Dynamic FlxColor_Impl__obj::fromString(::String str){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_183_fromString) HXLINE( 184) ::Dynamic result = null(); HXLINE( 185) str = ::StringTools_obj::trim(str); HXLINE( 187) if (::flixel::util::_FlxColor::FlxColor_Impl__obj::COLOR_REGEX->match(str)) { HXLINE( 189) ::String hexColor = (HX_("0x",48,2a,00,00) + ::flixel::util::_FlxColor::FlxColor_Impl__obj::COLOR_REGEX->matched(2)); HXLINE( 190) result = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(::Std_obj::parseInt(hexColor)); HXLINE( 191) if ((hexColor.length == 8)) { HXLINE( 193) int Value = ::Math_obj::round(( (Float)(255) )); HXDLIN( 193) result = (( (int)(result) ) & 16777215); HXDLIN( 193) int result1; HXDLIN( 193) if ((Value > 255)) { HXLINE( 193) result1 = 255; } else { HXLINE( 193) if ((Value < 0)) { HXLINE( 193) result1 = 0; } else { HXLINE( 193) result1 = Value; } } HXDLIN( 193) result = (( (int)(result) ) | (result1 << 24)); } } else { HXLINE( 198) str = str.toUpperCase(); HXLINE( 199) { HXLINE( 199) ::Dynamic key = ::flixel::util::_FlxColor::FlxColor_Impl__obj::colorLookup->keys(); HXDLIN( 199) while(( (bool)(key->__Field(HX_("hasNext",6d,a5,46,18),::hx::paccDynamic)()) )){ HXLINE( 199) ::String key1 = ( (::String)(key->__Field(HX_("next",f3,84,02,49),::hx::paccDynamic)()) ); HXLINE( 201) if ((key1.toUpperCase() == str)) { HXLINE( 203) result = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(::flixel::util::_FlxColor::FlxColor_Impl__obj::colorLookup->get(key1)); HXLINE( 204) goto _hx_goto_6; } } _hx_goto_6:; } } HXLINE( 209) return result; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,fromString,return ) ::Array< int > FlxColor_Impl__obj::getHSBColorWheel(::hx::Null< int > __o_Alpha){ int Alpha = __o_Alpha.Default(255); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_220_getHSBColorWheel) HXDLIN( 220) ::Array< int > _g = ::Array_obj< int >::__new(0); HXDLIN( 220) { HXDLIN( 220) int _g1 = 0; HXDLIN( 220) while((_g1 < 360)){ HXDLIN( 220) _g1 = (_g1 + 1); HXDLIN( 220) int c = (_g1 - 1); HXDLIN( 220) _g->push(::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(c) ),((Float)1.0),((Float)1.0),Alpha)); } } HXDLIN( 220) return _g; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,getHSBColorWheel,return ) int FlxColor_Impl__obj::interpolate(int Color1,int Color2,::hx::Null< Float > __o_Factor){ Float Factor = __o_Factor.Default(((Float)0.5)); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_232_interpolate) HXLINE( 233) int r = ::Std_obj::_hx_int(((( (Float)((((Color2 >> 16) & 255) - ((Color1 >> 16) & 255))) ) * Factor) + ((Color1 >> 16) & 255))); HXLINE( 234) int g = ::Std_obj::_hx_int(((( (Float)((((Color2 >> 8) & 255) - ((Color1 >> 8) & 255))) ) * Factor) + ((Color1 >> 8) & 255))); HXLINE( 235) int b = ::Std_obj::_hx_int(((( (Float)(((Color2 & 255) - (Color1 & 255))) ) * Factor) + (Color1 & 255))); HXLINE( 236) int a = ::Std_obj::_hx_int(((( (Float)((((Color2 >> 24) & 255) - ((Color1 >> 24) & 255))) ) * Factor) + ((Color1 >> 24) & 255))); HXLINE( 238) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXDLIN( 238) { HXLINE( 238) color = (color & -16711681); HXDLIN( 238) int color1; HXDLIN( 238) if ((r > 255)) { HXLINE( 238) color1 = 255; } else { HXLINE( 238) if ((r < 0)) { HXLINE( 238) color1 = 0; } else { HXLINE( 238) color1 = r; } } HXDLIN( 238) color = (color | (color1 << 16)); } HXDLIN( 238) { HXLINE( 238) color = (color & -65281); HXDLIN( 238) int color2; HXDLIN( 238) if ((g > 255)) { HXLINE( 238) color2 = 255; } else { HXLINE( 238) if ((g < 0)) { HXLINE( 238) color2 = 0; } else { HXLINE( 238) color2 = g; } } HXDLIN( 238) color = (color | (color2 << 8)); } HXDLIN( 238) { HXLINE( 238) color = (color & -256); HXDLIN( 238) int color3; HXDLIN( 238) if ((b > 255)) { HXLINE( 238) color3 = 255; } else { HXLINE( 238) if ((b < 0)) { HXLINE( 238) color3 = 0; } else { HXLINE( 238) color3 = b; } } HXDLIN( 238) color = (color | color3); } HXDLIN( 238) { HXLINE( 238) color = (color & 16777215); HXDLIN( 238) int color4; HXDLIN( 238) if ((a > 255)) { HXLINE( 238) color4 = 255; } else { HXLINE( 238) if ((a < 0)) { HXLINE( 238) color4 = 0; } else { HXLINE( 238) color4 = a; } } HXDLIN( 238) color = (color | (color4 << 24)); } HXDLIN( 238) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC3(FlxColor_Impl__obj,interpolate,return ) ::Array< int > FlxColor_Impl__obj::gradient(int Color1,int Color2,int Steps, ::Dynamic Ease){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_251_gradient) HXLINE( 252) ::Array< int > output = ::Array_obj< int >::__new(); HXLINE( 254) if (::hx::IsNull( Ease )) { HX_BEGIN_LOCAL_FUNC_S0(::hx::LocalFunc,_hx_Closure_0) HXARGC(1) Float _hx_run(Float t){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_258_gradient) HXLINE( 258) return t; } HX_END_LOCAL_FUNC1(return) HXLINE( 256) Ease = ::Dynamic(new _hx_Closure_0()); } HXLINE( 262) { HXLINE( 262) int _g = 0; HXDLIN( 262) int _g1 = Steps; HXDLIN( 262) while((_g < _g1)){ HXLINE( 262) _g = (_g + 1); HXDLIN( 262) int step = (_g - 1); HXLINE( 264) Float Factor = ( (Float)(Ease((( (Float)(step) ) / ( (Float)((Steps - 1)) )))) ); HXDLIN( 264) int r = ::Std_obj::_hx_int(((( (Float)((((Color2 >> 16) & 255) - ((Color1 >> 16) & 255))) ) * Factor) + ((Color1 >> 16) & 255))); HXDLIN( 264) int g = ::Std_obj::_hx_int(((( (Float)((((Color2 >> 8) & 255) - ((Color1 >> 8) & 255))) ) * Factor) + ((Color1 >> 8) & 255))); HXDLIN( 264) int b = ::Std_obj::_hx_int(((( (Float)(((Color2 & 255) - (Color1 & 255))) ) * Factor) + (Color1 & 255))); HXDLIN( 264) int a = ::Std_obj::_hx_int(((( (Float)((((Color2 >> 24) & 255) - ((Color1 >> 24) & 255))) ) * Factor) + ((Color1 >> 24) & 255))); HXDLIN( 264) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXDLIN( 264) { HXLINE( 264) color = (color & -16711681); HXDLIN( 264) int color1; HXDLIN( 264) if ((r > 255)) { HXLINE( 264) color1 = 255; } else { HXLINE( 264) if ((r < 0)) { HXLINE( 264) color1 = 0; } else { HXLINE( 264) color1 = r; } } HXDLIN( 264) color = (color | (color1 << 16)); } HXDLIN( 264) { HXLINE( 264) color = (color & -65281); HXDLIN( 264) int color2; HXDLIN( 264) if ((g > 255)) { HXLINE( 264) color2 = 255; } else { HXLINE( 264) if ((g < 0)) { HXLINE( 264) color2 = 0; } else { HXLINE( 264) color2 = g; } } HXDLIN( 264) color = (color | (color2 << 8)); } HXDLIN( 264) { HXLINE( 264) color = (color & -256); HXDLIN( 264) int color3; HXDLIN( 264) if ((b > 255)) { HXLINE( 264) color3 = 255; } else { HXLINE( 264) if ((b < 0)) { HXLINE( 264) color3 = 0; } else { HXLINE( 264) color3 = b; } } HXDLIN( 264) color = (color | color3); } HXDLIN( 264) { HXLINE( 264) color = (color & 16777215); HXDLIN( 264) int color4; HXDLIN( 264) if ((a > 255)) { HXLINE( 264) color4 = 255; } else { HXLINE( 264) if ((a < 0)) { HXLINE( 264) color4 = 0; } else { HXLINE( 264) color4 = a; } } HXDLIN( 264) color = (color | (color4 << 24)); } HXDLIN( 264) output[step] = color; } } HXLINE( 267) return output; } STATIC_HX_DEFINE_DYNAMIC_FUNC4(FlxColor_Impl__obj,gradient,return ) int FlxColor_Impl__obj::multiply(int lhs,int rhs){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_276_multiply) HXDLIN( 276) Float Red = ((( (Float)(((lhs >> 16) & 255)) ) / ( (Float)(255) )) * (( (Float)(((rhs >> 16) & 255)) ) / ( (Float)(255) ))); HXDLIN( 276) Float Green = ((( (Float)(((lhs >> 8) & 255)) ) / ( (Float)(255) )) * (( (Float)(((rhs >> 8) & 255)) ) / ( (Float)(255) ))); HXDLIN( 276) Float Blue = ((( (Float)((lhs & 255)) ) / ( (Float)(255) )) * (( (Float)((rhs & 255)) ) / ( (Float)(255) ))); HXDLIN( 276) Float Alpha = ( (Float)(1) ); HXDLIN( 276) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXDLIN( 276) { HXDLIN( 276) int Value = ::Math_obj::round((Red * ( (Float)(255) ))); HXDLIN( 276) color = (color & -16711681); HXDLIN( 276) int color1; HXDLIN( 276) if ((Value > 255)) { HXDLIN( 276) color1 = 255; } else { HXDLIN( 276) if ((Value < 0)) { HXDLIN( 276) color1 = 0; } else { HXDLIN( 276) color1 = Value; } } HXDLIN( 276) color = (color | (color1 << 16)); } HXDLIN( 276) { HXDLIN( 276) int Value1 = ::Math_obj::round((Green * ( (Float)(255) ))); HXDLIN( 276) color = (color & -65281); HXDLIN( 276) int color2; HXDLIN( 276) if ((Value1 > 255)) { HXDLIN( 276) color2 = 255; } else { HXDLIN( 276) if ((Value1 < 0)) { HXDLIN( 276) color2 = 0; } else { HXDLIN( 276) color2 = Value1; } } HXDLIN( 276) color = (color | (color2 << 8)); } HXDLIN( 276) { HXDLIN( 276) int Value2 = ::Math_obj::round((Blue * ( (Float)(255) ))); HXDLIN( 276) color = (color & -256); HXDLIN( 276) int color3; HXDLIN( 276) if ((Value2 > 255)) { HXDLIN( 276) color3 = 255; } else { HXDLIN( 276) if ((Value2 < 0)) { HXDLIN( 276) color3 = 0; } else { HXDLIN( 276) color3 = Value2; } } HXDLIN( 276) color = (color | color3); } HXDLIN( 276) { HXDLIN( 276) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 276) color = (color & 16777215); HXDLIN( 276) int color4; HXDLIN( 276) if ((Value3 > 255)) { HXDLIN( 276) color4 = 255; } else { HXDLIN( 276) if ((Value3 < 0)) { HXDLIN( 276) color4 = 0; } else { HXDLIN( 276) color4 = Value3; } } HXDLIN( 276) color = (color | (color4 << 24)); } HXDLIN( 276) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,multiply,return ) int FlxColor_Impl__obj::add(int lhs,int rhs){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_285_add) HXDLIN( 285) int Red = (((lhs >> 16) & 255) + ((rhs >> 16) & 255)); HXDLIN( 285) int Green = (((lhs >> 8) & 255) + ((rhs >> 8) & 255)); HXDLIN( 285) int Blue = ((lhs & 255) + (rhs & 255)); HXDLIN( 285) int Alpha = 255; HXDLIN( 285) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXDLIN( 285) { HXDLIN( 285) color = (color & -16711681); HXDLIN( 285) int color1; HXDLIN( 285) if ((Red > 255)) { HXDLIN( 285) color1 = 255; } else { HXDLIN( 285) if ((Red < 0)) { HXDLIN( 285) color1 = 0; } else { HXDLIN( 285) color1 = Red; } } HXDLIN( 285) color = (color | (color1 << 16)); } HXDLIN( 285) { HXDLIN( 285) color = (color & -65281); HXDLIN( 285) int color2; HXDLIN( 285) if ((Green > 255)) { HXDLIN( 285) color2 = 255; } else { HXDLIN( 285) if ((Green < 0)) { HXDLIN( 285) color2 = 0; } else { HXDLIN( 285) color2 = Green; } } HXDLIN( 285) color = (color | (color2 << 8)); } HXDLIN( 285) { HXDLIN( 285) color = (color & -256); HXDLIN( 285) int color3; HXDLIN( 285) if ((Blue > 255)) { HXDLIN( 285) color3 = 255; } else { HXDLIN( 285) if ((Blue < 0)) { HXDLIN( 285) color3 = 0; } else { HXDLIN( 285) color3 = Blue; } } HXDLIN( 285) color = (color | color3); } HXDLIN( 285) { HXDLIN( 285) color = (color & 16777215); HXDLIN( 285) int color4; HXDLIN( 285) if ((Alpha > 255)) { HXDLIN( 285) color4 = 255; } else { HXDLIN( 285) if ((Alpha < 0)) { HXDLIN( 285) color4 = 0; } else { HXDLIN( 285) color4 = Alpha; } } HXDLIN( 285) color = (color | (color4 << 24)); } HXDLIN( 285) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,add,return ) int FlxColor_Impl__obj::subtract(int lhs,int rhs){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_294_subtract) HXDLIN( 294) int Red = (((lhs >> 16) & 255) - ((rhs >> 16) & 255)); HXDLIN( 294) int Green = (((lhs >> 8) & 255) - ((rhs >> 8) & 255)); HXDLIN( 294) int Blue = ((lhs & 255) - (rhs & 255)); HXDLIN( 294) int Alpha = 255; HXDLIN( 294) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXDLIN( 294) { HXDLIN( 294) color = (color & -16711681); HXDLIN( 294) int color1; HXDLIN( 294) if ((Red > 255)) { HXDLIN( 294) color1 = 255; } else { HXDLIN( 294) if ((Red < 0)) { HXDLIN( 294) color1 = 0; } else { HXDLIN( 294) color1 = Red; } } HXDLIN( 294) color = (color | (color1 << 16)); } HXDLIN( 294) { HXDLIN( 294) color = (color & -65281); HXDLIN( 294) int color2; HXDLIN( 294) if ((Green > 255)) { HXDLIN( 294) color2 = 255; } else { HXDLIN( 294) if ((Green < 0)) { HXDLIN( 294) color2 = 0; } else { HXDLIN( 294) color2 = Green; } } HXDLIN( 294) color = (color | (color2 << 8)); } HXDLIN( 294) { HXDLIN( 294) color = (color & -256); HXDLIN( 294) int color3; HXDLIN( 294) if ((Blue > 255)) { HXDLIN( 294) color3 = 255; } else { HXDLIN( 294) if ((Blue < 0)) { HXDLIN( 294) color3 = 0; } else { HXDLIN( 294) color3 = Blue; } } HXDLIN( 294) color = (color | color3); } HXDLIN( 294) { HXDLIN( 294) color = (color & 16777215); HXDLIN( 294) int color4; HXDLIN( 294) if ((Alpha > 255)) { HXDLIN( 294) color4 = 255; } else { HXDLIN( 294) if ((Alpha < 0)) { HXDLIN( 294) color4 = 0; } else { HXDLIN( 294) color4 = Alpha; } } HXDLIN( 294) color = (color | (color4 << 24)); } HXDLIN( 294) return color; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,subtract,return ) int FlxColor_Impl__obj::getComplementHarmony(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_305_getComplementHarmony) HXDLIN( 305) int _hx_tmp = ::flixel::math::FlxMath_obj::wrap((::Std_obj::_hx_int(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1)) + 180),0,350); HXDLIN( 305) return ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(_hx_tmp) ),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,getComplementHarmony,return ) ::Dynamic FlxColor_Impl__obj::getAnalogousHarmony(int this1,::hx::Null< int > __o_Threshold){ int Threshold = __o_Threshold.Default(30); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_316_getAnalogousHarmony) HXLINE( 317) int warmer = ::flixel::math::FlxMath_obj::wrap((::Std_obj::_hx_int(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1)) - Threshold),0,350); HXDLIN( 317) int warmer1 = ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(warmer) ),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); HXLINE( 318) int colder = ::flixel::math::FlxMath_obj::wrap((::Std_obj::_hx_int(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1)) + Threshold),0,350); HXDLIN( 318) int colder1 = ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(colder) ),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); HXLINE( 320) return ::Dynamic(::hx::Anon_obj::Create(3) ->setFixed(0,HX_("warmer",f2,95,03,ba),warmer1) ->setFixed(1,HX_("colder",91,61,7e,c6),colder1) ->setFixed(2,HX_("original",51,34,e8,e0),this1)); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,getAnalogousHarmony,return ) ::Dynamic FlxColor_Impl__obj::getSplitComplementHarmony(int this1,::hx::Null< int > __o_Threshold){ int Threshold = __o_Threshold.Default(30); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_331_getSplitComplementHarmony) HXLINE( 332) int oppositeHue = ::flixel::math::FlxMath_obj::wrap((::Std_obj::_hx_int(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1)) + 180),0,350); HXLINE( 333) int warmer = ::flixel::math::FlxMath_obj::wrap((oppositeHue - Threshold),0,350); HXDLIN( 333) int warmer1 = ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(warmer) ),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); HXLINE( 334) int colder = ::flixel::math::FlxMath_obj::wrap((oppositeHue + Threshold),0,350); HXDLIN( 334) int colder1 = ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(colder) ),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); HXLINE( 336) return ::Dynamic(::hx::Anon_obj::Create(3) ->setFixed(0,HX_("warmer",f2,95,03,ba),warmer1) ->setFixed(1,HX_("colder",91,61,7e,c6),colder1) ->setFixed(2,HX_("original",51,34,e8,e0),this1)); } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,getSplitComplementHarmony,return ) ::Dynamic FlxColor_Impl__obj::getTriadicHarmony(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_346_getTriadicHarmony) HXLINE( 347) int triadic1 = ::flixel::math::FlxMath_obj::wrap((::Std_obj::_hx_int(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1)) + 120),0,359); HXDLIN( 347) int triadic11 = ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(triadic1) ),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); HXLINE( 348) int triadic2 = ::flixel::math::FlxMath_obj::wrap((::Std_obj::_hx_int(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(triadic11)) + 120),0,359); HXDLIN( 348) int triadic21 = ::flixel::util::_FlxColor::FlxColor_Impl__obj::fromHSB(( (Float)(triadic2) ),((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) ))); HXLINE( 350) return ::Dynamic(::hx::Anon_obj::Create(3) ->setFixed(0,HX_("color1",6e,c5,86,c6),this1) ->setFixed(1,HX_("color2",6f,c5,86,c6),triadic11) ->setFixed(2,HX_("color3",70,c5,86,c6),triadic21)); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,getTriadicHarmony,return ) int FlxColor_Impl__obj::to24Bit(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_360_to24Bit) HXDLIN( 360) return (this1 & 16777215); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,to24Bit,return ) ::String FlxColor_Impl__obj::toHexString(int this1,::hx::Null< bool > __o_Alpha,::hx::Null< bool > __o_Prefix){ bool Alpha = __o_Alpha.Default(true); bool Prefix = __o_Prefix.Default(true); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_372_toHexString) HXDLIN( 372) ::String _hx_tmp; HXDLIN( 372) if (Prefix) { HXDLIN( 372) _hx_tmp = HX_("0x",48,2a,00,00); } else { HXDLIN( 372) _hx_tmp = HX_("",00,00,00,00); } HXDLIN( 372) ::String _hx_tmp1; HXDLIN( 372) if (Alpha) { HXDLIN( 372) _hx_tmp1 = ::StringTools_obj::hex(((this1 >> 24) & 255),2); } else { HXDLIN( 372) _hx_tmp1 = HX_("",00,00,00,00); } HXDLIN( 372) ::String _hx_tmp2 = ((_hx_tmp + _hx_tmp1) + ::StringTools_obj::hex(((this1 >> 16) & 255),2)); HXDLIN( 372) ::String _hx_tmp3 = (_hx_tmp2 + ::StringTools_obj::hex(((this1 >> 8) & 255),2)); HXDLIN( 372) return (_hx_tmp3 + ::StringTools_obj::hex((this1 & 255),2)); } STATIC_HX_DEFINE_DYNAMIC_FUNC3(FlxColor_Impl__obj,toHexString,return ) ::String FlxColor_Impl__obj::toWebString(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_383_toWebString) HXDLIN( 383) ::String _hx_tmp = (HX_("",00,00,00,00) + ::StringTools_obj::hex(((this1 >> 16) & 255),2)); HXDLIN( 383) ::String _hx_tmp1 = (_hx_tmp + ::StringTools_obj::hex(((this1 >> 8) & 255),2)); HXDLIN( 383) return (HX_("#",23,00,00,00) + (_hx_tmp1 + ::StringTools_obj::hex((this1 & 255),2))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,toWebString,return ) ::String FlxColor_Impl__obj::getColorInfo(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_392_getColorInfo) HXLINE( 394) ::String result = HX_("0x",48,2a,00,00); HXDLIN( 394) ::String result1 = ::StringTools_obj::hex(((this1 >> 24) & 255),2); HXDLIN( 394) ::String result2 = ((result + result1) + ::StringTools_obj::hex(((this1 >> 16) & 255),2)); HXDLIN( 394) ::String result3 = (result2 + ::StringTools_obj::hex(((this1 >> 8) & 255),2)); HXDLIN( 394) ::String result4 = ((result3 + ::StringTools_obj::hex((this1 & 255),2)) + HX_("\n",0a,00,00,00)); HXLINE( 396) result4 = (result4 + ((((((((HX_("Alpha: ",64,15,67,7f) + ((this1 >> 24) & 255)) + HX_(" Red: ",f7,bd,55,45)) + ((this1 >> 16) & 255)) + HX_(" Green: ",e9,23,00,ae)) + ((this1 >> 8) & 255)) + HX_(" Blue: ",00,1c,26,13)) + (this1 & 255)) + HX_("\n",0a,00,00,00))); HXLINE( 398) ::String result5 = ((HX_("Hue: ",3e,91,7c,c2) + ::flixel::math::FlxMath_obj::roundDecimal(::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1),2)) + HX_(" Saturation: ",38,1b,be,c1)); HXDLIN( 398) ::String result6 = ((result5 + ::flixel::math::FlxMath_obj::roundDecimal(((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))),2)) + HX_(" Brightness: ",f7,92,6f,4f)); HXDLIN( 398) ::String result7 = ((result6 + ::flixel::math::FlxMath_obj::roundDecimal(::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))),2)) + HX_(" Lightness: ",13,68,ef,ba)); HXDLIN( 398) result4 = (result4 + (result7 + ::flixel::math::FlxMath_obj::roundDecimal(((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) + ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ( (Float)(2) )),2))); HXLINE( 401) return result4; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,getColorInfo,return ) int FlxColor_Impl__obj::getDarkened(int this1,::hx::Null< Float > __o_Factor){ Float Factor = __o_Factor.Default(((Float)0.2)); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_411_getDarkened) HXLINE( 412) Float lowerBound; HXDLIN( 412) if ((Factor < 0)) { HXLINE( 412) lowerBound = ( (Float)(0) ); } else { HXLINE( 412) lowerBound = Factor; } HXDLIN( 412) if ((lowerBound > 1)) { HXLINE( 412) Factor = ( (Float)(1) ); } else { HXLINE( 412) Factor = lowerBound; } HXLINE( 413) int output = this1; HXLINE( 414) { HXLINE( 414) Float Value = (((::Math_obj::max((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) )))) + ::Math_obj::min((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) ))))) / ( (Float)(2) )) * (( (Float)(1) ) - Factor)); HXDLIN( 414) { HXLINE( 414) Float Hue = ::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(output); HXDLIN( 414) Float Alpha = (( (Float)(((output >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 414) Float chroma = ((( (Float)(1) ) - ::Math_obj::abs(((( (Float)(2) ) * Value) - ( (Float)(1) )))) * ((::Math_obj::max((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) )))))); HXDLIN( 414) Float match = (Value - (chroma / ( (Float)(2) ))); HXDLIN( 414) { HXLINE( 414) Float Hue1 = Hue; HXDLIN( 414) Float Chroma = chroma; HXDLIN( 414) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 414) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 414) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 414) Chroma = (Chroma + match); HXDLIN( 414) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 414) { HXLINE( 414) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 414) output = (output & -16711681); HXDLIN( 414) int output1; HXDLIN( 414) if ((Value > 255)) { HXLINE( 414) output1 = 255; } else { HXLINE( 414) if ((Value < 0)) { HXLINE( 414) output1 = 0; } else { HXLINE( 414) output1 = Value; } } HXDLIN( 414) output = (output | (output1 << 16)); } HXDLIN( 414) { HXLINE( 414) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 414) output = (output & -65281); HXDLIN( 414) int output2; HXDLIN( 414) if ((Value1 > 255)) { HXLINE( 414) output2 = 255; } else { HXLINE( 414) if ((Value1 < 0)) { HXLINE( 414) output2 = 0; } else { HXLINE( 414) output2 = Value1; } } HXDLIN( 414) output = (output | (output2 << 8)); } HXDLIN( 414) { HXLINE( 414) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 414) output = (output & -256); HXDLIN( 414) int output3; HXDLIN( 414) if ((Value2 > 255)) { HXLINE( 414) output3 = 255; } else { HXLINE( 414) if ((Value2 < 0)) { HXLINE( 414) output3 = 0; } else { HXLINE( 414) output3 = Value2; } } HXDLIN( 414) output = (output | output3); } HXDLIN( 414) { HXLINE( 414) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 414) output = (output & 16777215); HXDLIN( 414) int output4; HXDLIN( 414) if ((Value3 > 255)) { HXLINE( 414) output4 = 255; } else { HXLINE( 414) if ((Value3 < 0)) { HXLINE( 414) output4 = 0; } else { HXLINE( 414) output4 = Value3; } } HXDLIN( 414) output = (output | (output4 << 24)); } } break; case (int)1: { HXLINE( 414) { HXLINE( 414) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 414) output = (output & -16711681); HXDLIN( 414) int output1; HXDLIN( 414) if ((Value > 255)) { HXLINE( 414) output1 = 255; } else { HXLINE( 414) if ((Value < 0)) { HXLINE( 414) output1 = 0; } else { HXLINE( 414) output1 = Value; } } HXDLIN( 414) output = (output | (output1 << 16)); } HXDLIN( 414) { HXLINE( 414) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 414) output = (output & -65281); HXDLIN( 414) int output2; HXDLIN( 414) if ((Value1 > 255)) { HXLINE( 414) output2 = 255; } else { HXLINE( 414) if ((Value1 < 0)) { HXLINE( 414) output2 = 0; } else { HXLINE( 414) output2 = Value1; } } HXDLIN( 414) output = (output | (output2 << 8)); } HXDLIN( 414) { HXLINE( 414) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 414) output = (output & -256); HXDLIN( 414) int output3; HXDLIN( 414) if ((Value2 > 255)) { HXLINE( 414) output3 = 255; } else { HXLINE( 414) if ((Value2 < 0)) { HXLINE( 414) output3 = 0; } else { HXLINE( 414) output3 = Value2; } } HXDLIN( 414) output = (output | output3); } HXDLIN( 414) { HXLINE( 414) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 414) output = (output & 16777215); HXDLIN( 414) int output4; HXDLIN( 414) if ((Value3 > 255)) { HXLINE( 414) output4 = 255; } else { HXLINE( 414) if ((Value3 < 0)) { HXLINE( 414) output4 = 0; } else { HXLINE( 414) output4 = Value3; } } HXDLIN( 414) output = (output | (output4 << 24)); } } break; case (int)2: { HXLINE( 414) { HXLINE( 414) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 414) output = (output & -16711681); HXDLIN( 414) int output1; HXDLIN( 414) if ((Value > 255)) { HXLINE( 414) output1 = 255; } else { HXLINE( 414) if ((Value < 0)) { HXLINE( 414) output1 = 0; } else { HXLINE( 414) output1 = Value; } } HXDLIN( 414) output = (output | (output1 << 16)); } HXDLIN( 414) { HXLINE( 414) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 414) output = (output & -65281); HXDLIN( 414) int output2; HXDLIN( 414) if ((Value1 > 255)) { HXLINE( 414) output2 = 255; } else { HXLINE( 414) if ((Value1 < 0)) { HXLINE( 414) output2 = 0; } else { HXLINE( 414) output2 = Value1; } } HXDLIN( 414) output = (output | (output2 << 8)); } HXDLIN( 414) { HXLINE( 414) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 414) output = (output & -256); HXDLIN( 414) int output3; HXDLIN( 414) if ((Value2 > 255)) { HXLINE( 414) output3 = 255; } else { HXLINE( 414) if ((Value2 < 0)) { HXLINE( 414) output3 = 0; } else { HXLINE( 414) output3 = Value2; } } HXDLIN( 414) output = (output | output3); } HXDLIN( 414) { HXLINE( 414) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 414) output = (output & 16777215); HXDLIN( 414) int output4; HXDLIN( 414) if ((Value3 > 255)) { HXLINE( 414) output4 = 255; } else { HXLINE( 414) if ((Value3 < 0)) { HXLINE( 414) output4 = 0; } else { HXLINE( 414) output4 = Value3; } } HXDLIN( 414) output = (output | (output4 << 24)); } } break; case (int)3: { HXLINE( 414) { HXLINE( 414) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 414) output = (output & -16711681); HXDLIN( 414) int output1; HXDLIN( 414) if ((Value > 255)) { HXLINE( 414) output1 = 255; } else { HXLINE( 414) if ((Value < 0)) { HXLINE( 414) output1 = 0; } else { HXLINE( 414) output1 = Value; } } HXDLIN( 414) output = (output | (output1 << 16)); } HXDLIN( 414) { HXLINE( 414) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 414) output = (output & -65281); HXDLIN( 414) int output2; HXDLIN( 414) if ((Value1 > 255)) { HXLINE( 414) output2 = 255; } else { HXLINE( 414) if ((Value1 < 0)) { HXLINE( 414) output2 = 0; } else { HXLINE( 414) output2 = Value1; } } HXDLIN( 414) output = (output | (output2 << 8)); } HXDLIN( 414) { HXLINE( 414) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 414) output = (output & -256); HXDLIN( 414) int output3; HXDLIN( 414) if ((Value2 > 255)) { HXLINE( 414) output3 = 255; } else { HXLINE( 414) if ((Value2 < 0)) { HXLINE( 414) output3 = 0; } else { HXLINE( 414) output3 = Value2; } } HXDLIN( 414) output = (output | output3); } HXDLIN( 414) { HXLINE( 414) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 414) output = (output & 16777215); HXDLIN( 414) int output4; HXDLIN( 414) if ((Value3 > 255)) { HXLINE( 414) output4 = 255; } else { HXLINE( 414) if ((Value3 < 0)) { HXLINE( 414) output4 = 0; } else { HXLINE( 414) output4 = Value3; } } HXDLIN( 414) output = (output | (output4 << 24)); } } break; case (int)4: { HXLINE( 414) { HXLINE( 414) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 414) output = (output & -16711681); HXDLIN( 414) int output1; HXDLIN( 414) if ((Value > 255)) { HXLINE( 414) output1 = 255; } else { HXLINE( 414) if ((Value < 0)) { HXLINE( 414) output1 = 0; } else { HXLINE( 414) output1 = Value; } } HXDLIN( 414) output = (output | (output1 << 16)); } HXDLIN( 414) { HXLINE( 414) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 414) output = (output & -65281); HXDLIN( 414) int output2; HXDLIN( 414) if ((Value1 > 255)) { HXLINE( 414) output2 = 255; } else { HXLINE( 414) if ((Value1 < 0)) { HXLINE( 414) output2 = 0; } else { HXLINE( 414) output2 = Value1; } } HXDLIN( 414) output = (output | (output2 << 8)); } HXDLIN( 414) { HXLINE( 414) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 414) output = (output & -256); HXDLIN( 414) int output3; HXDLIN( 414) if ((Value2 > 255)) { HXLINE( 414) output3 = 255; } else { HXLINE( 414) if ((Value2 < 0)) { HXLINE( 414) output3 = 0; } else { HXLINE( 414) output3 = Value2; } } HXDLIN( 414) output = (output | output3); } HXDLIN( 414) { HXLINE( 414) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 414) output = (output & 16777215); HXDLIN( 414) int output4; HXDLIN( 414) if ((Value3 > 255)) { HXLINE( 414) output4 = 255; } else { HXLINE( 414) if ((Value3 < 0)) { HXLINE( 414) output4 = 0; } else { HXLINE( 414) output4 = Value3; } } HXDLIN( 414) output = (output | (output4 << 24)); } } break; case (int)5: { HXLINE( 414) { HXLINE( 414) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 414) output = (output & -16711681); HXDLIN( 414) int output1; HXDLIN( 414) if ((Value > 255)) { HXLINE( 414) output1 = 255; } else { HXLINE( 414) if ((Value < 0)) { HXLINE( 414) output1 = 0; } else { HXLINE( 414) output1 = Value; } } HXDLIN( 414) output = (output | (output1 << 16)); } HXDLIN( 414) { HXLINE( 414) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 414) output = (output & -65281); HXDLIN( 414) int output2; HXDLIN( 414) if ((Value1 > 255)) { HXLINE( 414) output2 = 255; } else { HXLINE( 414) if ((Value1 < 0)) { HXLINE( 414) output2 = 0; } else { HXLINE( 414) output2 = Value1; } } HXDLIN( 414) output = (output | (output2 << 8)); } HXDLIN( 414) { HXLINE( 414) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 414) output = (output & -256); HXDLIN( 414) int output3; HXDLIN( 414) if ((Value2 > 255)) { HXLINE( 414) output3 = 255; } else { HXLINE( 414) if ((Value2 < 0)) { HXLINE( 414) output3 = 0; } else { HXLINE( 414) output3 = Value2; } } HXDLIN( 414) output = (output | output3); } HXDLIN( 414) { HXLINE( 414) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 414) output = (output & 16777215); HXDLIN( 414) int output4; HXDLIN( 414) if ((Value3 > 255)) { HXLINE( 414) output4 = 255; } else { HXLINE( 414) if ((Value3 < 0)) { HXLINE( 414) output4 = 0; } else { HXLINE( 414) output4 = Value3; } } HXDLIN( 414) output = (output | (output4 << 24)); } } break; } } } } HXLINE( 415) return output; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,getDarkened,return ) int FlxColor_Impl__obj::getLightened(int this1,::hx::Null< Float > __o_Factor){ Float Factor = __o_Factor.Default(((Float)0.2)); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_425_getLightened) HXLINE( 426) Float lowerBound; HXDLIN( 426) if ((Factor < 0)) { HXLINE( 426) lowerBound = ( (Float)(0) ); } else { HXLINE( 426) lowerBound = Factor; } HXDLIN( 426) if ((lowerBound > 1)) { HXLINE( 426) Factor = ( (Float)(1) ); } else { HXLINE( 426) Factor = lowerBound; } HXLINE( 427) int output = this1; HXLINE( 428) { HXLINE( 428) Float Value = (((::Math_obj::max((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) )))) + ::Math_obj::min((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) ))))) / ( (Float)(2) )) + ((( (Float)(1) ) - ((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) + ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ( (Float)(2) ))) * Factor)); HXDLIN( 428) { HXLINE( 428) Float Hue = ::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(output); HXDLIN( 428) Float Alpha = (( (Float)(((output >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 428) Float chroma = ((( (Float)(1) ) - ::Math_obj::abs(((( (Float)(2) ) * Value) - ( (Float)(1) )))) * ((::Math_obj::max((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((output >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((output >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((output & 255)) ) / ( (Float)(255) )))))); HXDLIN( 428) Float match = (Value - (chroma / ( (Float)(2) ))); HXDLIN( 428) { HXLINE( 428) Float Hue1 = Hue; HXDLIN( 428) Float Chroma = chroma; HXDLIN( 428) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 428) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 428) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 428) Chroma = (Chroma + match); HXDLIN( 428) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 428) { HXLINE( 428) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 428) output = (output & -16711681); HXDLIN( 428) int output1; HXDLIN( 428) if ((Value > 255)) { HXLINE( 428) output1 = 255; } else { HXLINE( 428) if ((Value < 0)) { HXLINE( 428) output1 = 0; } else { HXLINE( 428) output1 = Value; } } HXDLIN( 428) output = (output | (output1 << 16)); } HXDLIN( 428) { HXLINE( 428) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 428) output = (output & -65281); HXDLIN( 428) int output2; HXDLIN( 428) if ((Value1 > 255)) { HXLINE( 428) output2 = 255; } else { HXLINE( 428) if ((Value1 < 0)) { HXLINE( 428) output2 = 0; } else { HXLINE( 428) output2 = Value1; } } HXDLIN( 428) output = (output | (output2 << 8)); } HXDLIN( 428) { HXLINE( 428) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 428) output = (output & -256); HXDLIN( 428) int output3; HXDLIN( 428) if ((Value2 > 255)) { HXLINE( 428) output3 = 255; } else { HXLINE( 428) if ((Value2 < 0)) { HXLINE( 428) output3 = 0; } else { HXLINE( 428) output3 = Value2; } } HXDLIN( 428) output = (output | output3); } HXDLIN( 428) { HXLINE( 428) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 428) output = (output & 16777215); HXDLIN( 428) int output4; HXDLIN( 428) if ((Value3 > 255)) { HXLINE( 428) output4 = 255; } else { HXLINE( 428) if ((Value3 < 0)) { HXLINE( 428) output4 = 0; } else { HXLINE( 428) output4 = Value3; } } HXDLIN( 428) output = (output | (output4 << 24)); } } break; case (int)1: { HXLINE( 428) { HXLINE( 428) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 428) output = (output & -16711681); HXDLIN( 428) int output1; HXDLIN( 428) if ((Value > 255)) { HXLINE( 428) output1 = 255; } else { HXLINE( 428) if ((Value < 0)) { HXLINE( 428) output1 = 0; } else { HXLINE( 428) output1 = Value; } } HXDLIN( 428) output = (output | (output1 << 16)); } HXDLIN( 428) { HXLINE( 428) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 428) output = (output & -65281); HXDLIN( 428) int output2; HXDLIN( 428) if ((Value1 > 255)) { HXLINE( 428) output2 = 255; } else { HXLINE( 428) if ((Value1 < 0)) { HXLINE( 428) output2 = 0; } else { HXLINE( 428) output2 = Value1; } } HXDLIN( 428) output = (output | (output2 << 8)); } HXDLIN( 428) { HXLINE( 428) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 428) output = (output & -256); HXDLIN( 428) int output3; HXDLIN( 428) if ((Value2 > 255)) { HXLINE( 428) output3 = 255; } else { HXLINE( 428) if ((Value2 < 0)) { HXLINE( 428) output3 = 0; } else { HXLINE( 428) output3 = Value2; } } HXDLIN( 428) output = (output | output3); } HXDLIN( 428) { HXLINE( 428) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 428) output = (output & 16777215); HXDLIN( 428) int output4; HXDLIN( 428) if ((Value3 > 255)) { HXLINE( 428) output4 = 255; } else { HXLINE( 428) if ((Value3 < 0)) { HXLINE( 428) output4 = 0; } else { HXLINE( 428) output4 = Value3; } } HXDLIN( 428) output = (output | (output4 << 24)); } } break; case (int)2: { HXLINE( 428) { HXLINE( 428) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 428) output = (output & -16711681); HXDLIN( 428) int output1; HXDLIN( 428) if ((Value > 255)) { HXLINE( 428) output1 = 255; } else { HXLINE( 428) if ((Value < 0)) { HXLINE( 428) output1 = 0; } else { HXLINE( 428) output1 = Value; } } HXDLIN( 428) output = (output | (output1 << 16)); } HXDLIN( 428) { HXLINE( 428) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 428) output = (output & -65281); HXDLIN( 428) int output2; HXDLIN( 428) if ((Value1 > 255)) { HXLINE( 428) output2 = 255; } else { HXLINE( 428) if ((Value1 < 0)) { HXLINE( 428) output2 = 0; } else { HXLINE( 428) output2 = Value1; } } HXDLIN( 428) output = (output | (output2 << 8)); } HXDLIN( 428) { HXLINE( 428) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 428) output = (output & -256); HXDLIN( 428) int output3; HXDLIN( 428) if ((Value2 > 255)) { HXLINE( 428) output3 = 255; } else { HXLINE( 428) if ((Value2 < 0)) { HXLINE( 428) output3 = 0; } else { HXLINE( 428) output3 = Value2; } } HXDLIN( 428) output = (output | output3); } HXDLIN( 428) { HXLINE( 428) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 428) output = (output & 16777215); HXDLIN( 428) int output4; HXDLIN( 428) if ((Value3 > 255)) { HXLINE( 428) output4 = 255; } else { HXLINE( 428) if ((Value3 < 0)) { HXLINE( 428) output4 = 0; } else { HXLINE( 428) output4 = Value3; } } HXDLIN( 428) output = (output | (output4 << 24)); } } break; case (int)3: { HXLINE( 428) { HXLINE( 428) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 428) output = (output & -16711681); HXDLIN( 428) int output1; HXDLIN( 428) if ((Value > 255)) { HXLINE( 428) output1 = 255; } else { HXLINE( 428) if ((Value < 0)) { HXLINE( 428) output1 = 0; } else { HXLINE( 428) output1 = Value; } } HXDLIN( 428) output = (output | (output1 << 16)); } HXDLIN( 428) { HXLINE( 428) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 428) output = (output & -65281); HXDLIN( 428) int output2; HXDLIN( 428) if ((Value1 > 255)) { HXLINE( 428) output2 = 255; } else { HXLINE( 428) if ((Value1 < 0)) { HXLINE( 428) output2 = 0; } else { HXLINE( 428) output2 = Value1; } } HXDLIN( 428) output = (output | (output2 << 8)); } HXDLIN( 428) { HXLINE( 428) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 428) output = (output & -256); HXDLIN( 428) int output3; HXDLIN( 428) if ((Value2 > 255)) { HXLINE( 428) output3 = 255; } else { HXLINE( 428) if ((Value2 < 0)) { HXLINE( 428) output3 = 0; } else { HXLINE( 428) output3 = Value2; } } HXDLIN( 428) output = (output | output3); } HXDLIN( 428) { HXLINE( 428) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 428) output = (output & 16777215); HXDLIN( 428) int output4; HXDLIN( 428) if ((Value3 > 255)) { HXLINE( 428) output4 = 255; } else { HXLINE( 428) if ((Value3 < 0)) { HXLINE( 428) output4 = 0; } else { HXLINE( 428) output4 = Value3; } } HXDLIN( 428) output = (output | (output4 << 24)); } } break; case (int)4: { HXLINE( 428) { HXLINE( 428) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 428) output = (output & -16711681); HXDLIN( 428) int output1; HXDLIN( 428) if ((Value > 255)) { HXLINE( 428) output1 = 255; } else { HXLINE( 428) if ((Value < 0)) { HXLINE( 428) output1 = 0; } else { HXLINE( 428) output1 = Value; } } HXDLIN( 428) output = (output | (output1 << 16)); } HXDLIN( 428) { HXLINE( 428) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 428) output = (output & -65281); HXDLIN( 428) int output2; HXDLIN( 428) if ((Value1 > 255)) { HXLINE( 428) output2 = 255; } else { HXLINE( 428) if ((Value1 < 0)) { HXLINE( 428) output2 = 0; } else { HXLINE( 428) output2 = Value1; } } HXDLIN( 428) output = (output | (output2 << 8)); } HXDLIN( 428) { HXLINE( 428) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 428) output = (output & -256); HXDLIN( 428) int output3; HXDLIN( 428) if ((Value2 > 255)) { HXLINE( 428) output3 = 255; } else { HXLINE( 428) if ((Value2 < 0)) { HXLINE( 428) output3 = 0; } else { HXLINE( 428) output3 = Value2; } } HXDLIN( 428) output = (output | output3); } HXDLIN( 428) { HXLINE( 428) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 428) output = (output & 16777215); HXDLIN( 428) int output4; HXDLIN( 428) if ((Value3 > 255)) { HXLINE( 428) output4 = 255; } else { HXLINE( 428) if ((Value3 < 0)) { HXLINE( 428) output4 = 0; } else { HXLINE( 428) output4 = Value3; } } HXDLIN( 428) output = (output | (output4 << 24)); } } break; case (int)5: { HXLINE( 428) { HXLINE( 428) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 428) output = (output & -16711681); HXDLIN( 428) int output1; HXDLIN( 428) if ((Value > 255)) { HXLINE( 428) output1 = 255; } else { HXLINE( 428) if ((Value < 0)) { HXLINE( 428) output1 = 0; } else { HXLINE( 428) output1 = Value; } } HXDLIN( 428) output = (output | (output1 << 16)); } HXDLIN( 428) { HXLINE( 428) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 428) output = (output & -65281); HXDLIN( 428) int output2; HXDLIN( 428) if ((Value1 > 255)) { HXLINE( 428) output2 = 255; } else { HXLINE( 428) if ((Value1 < 0)) { HXLINE( 428) output2 = 0; } else { HXLINE( 428) output2 = Value1; } } HXDLIN( 428) output = (output | (output2 << 8)); } HXDLIN( 428) { HXLINE( 428) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 428) output = (output & -256); HXDLIN( 428) int output3; HXDLIN( 428) if ((Value2 > 255)) { HXLINE( 428) output3 = 255; } else { HXLINE( 428) if ((Value2 < 0)) { HXLINE( 428) output3 = 0; } else { HXLINE( 428) output3 = Value2; } } HXDLIN( 428) output = (output | output3); } HXDLIN( 428) { HXLINE( 428) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 428) output = (output & 16777215); HXDLIN( 428) int output4; HXDLIN( 428) if ((Value3 > 255)) { HXLINE( 428) output4 = 255; } else { HXLINE( 428) if ((Value3 < 0)) { HXLINE( 428) output4 = 0; } else { HXLINE( 428) output4 = Value3; } } HXDLIN( 428) output = (output | (output4 << 24)); } } break; } } } } HXLINE( 429) return output; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,getLightened,return ) int FlxColor_Impl__obj::getInverted(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_438_getInverted) HXLINE( 439) int oldAlpha = ((this1 >> 24) & 255); HXLINE( 440) int lhs = -1; HXDLIN( 440) int Red = (((lhs >> 16) & 255) - ((this1 >> 16) & 255)); HXDLIN( 440) int Green = (((lhs >> 8) & 255) - ((this1 >> 8) & 255)); HXDLIN( 440) int Blue = ((lhs & 255) - (this1 & 255)); HXDLIN( 440) int Alpha = 255; HXDLIN( 440) int color = ::flixel::util::_FlxColor::FlxColor_Impl__obj::_new(null()); HXDLIN( 440) { HXLINE( 440) color = (color & -16711681); HXDLIN( 440) int color1; HXDLIN( 440) if ((Red > 255)) { HXLINE( 440) color1 = 255; } else { HXLINE( 440) if ((Red < 0)) { HXLINE( 440) color1 = 0; } else { HXLINE( 440) color1 = Red; } } HXDLIN( 440) color = (color | (color1 << 16)); } HXDLIN( 440) { HXLINE( 440) color = (color & -65281); HXDLIN( 440) int color2; HXDLIN( 440) if ((Green > 255)) { HXLINE( 440) color2 = 255; } else { HXLINE( 440) if ((Green < 0)) { HXLINE( 440) color2 = 0; } else { HXLINE( 440) color2 = Green; } } HXDLIN( 440) color = (color | (color2 << 8)); } HXDLIN( 440) { HXLINE( 440) color = (color & -256); HXDLIN( 440) int color3; HXDLIN( 440) if ((Blue > 255)) { HXLINE( 440) color3 = 255; } else { HXLINE( 440) if ((Blue < 0)) { HXLINE( 440) color3 = 0; } else { HXLINE( 440) color3 = Blue; } } HXDLIN( 440) color = (color | color3); } HXDLIN( 440) { HXLINE( 440) color = (color & 16777215); HXDLIN( 440) int color4; HXDLIN( 440) if ((Alpha > 255)) { HXLINE( 440) color4 = 255; } else { HXLINE( 440) if ((Alpha < 0)) { HXLINE( 440) color4 = 0; } else { HXLINE( 440) color4 = Alpha; } } HXDLIN( 440) color = (color | (color4 << 24)); } HXDLIN( 440) int output = color; HXLINE( 441) { HXLINE( 441) output = (output & 16777215); HXDLIN( 441) int output1; HXDLIN( 441) if ((oldAlpha > 255)) { HXLINE( 441) output1 = 255; } else { HXLINE( 441) if ((oldAlpha < 0)) { HXLINE( 441) output1 = 0; } else { HXLINE( 441) output1 = oldAlpha; } } HXDLIN( 441) output = (output | (output1 << 24)); } HXLINE( 442) return output; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,getInverted,return ) int FlxColor_Impl__obj::setRGB(int this1,int Red,int Green,int Blue,::hx::Null< int > __o_Alpha){ int Alpha = __o_Alpha.Default(255); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_455_setRGB) HXLINE( 456) { HXLINE( 456) this1 = (this1 & -16711681); HXDLIN( 456) int this2; HXDLIN( 456) if ((Red > 255)) { HXLINE( 456) this2 = 255; } else { HXLINE( 456) if ((Red < 0)) { HXLINE( 456) this2 = 0; } else { HXLINE( 456) this2 = Red; } } HXDLIN( 456) this1 = (this1 | (this2 << 16)); } HXLINE( 457) { HXLINE( 457) this1 = (this1 & -65281); HXDLIN( 457) int this3; HXDLIN( 457) if ((Green > 255)) { HXLINE( 457) this3 = 255; } else { HXLINE( 457) if ((Green < 0)) { HXLINE( 457) this3 = 0; } else { HXLINE( 457) this3 = Green; } } HXDLIN( 457) this1 = (this1 | (this3 << 8)); } HXLINE( 458) { HXLINE( 458) this1 = (this1 & -256); HXDLIN( 458) int this4; HXDLIN( 458) if ((Blue > 255)) { HXLINE( 458) this4 = 255; } else { HXLINE( 458) if ((Blue < 0)) { HXLINE( 458) this4 = 0; } else { HXLINE( 458) this4 = Blue; } } HXDLIN( 458) this1 = (this1 | this4); } HXLINE( 459) { HXLINE( 459) this1 = (this1 & 16777215); HXDLIN( 459) int this5; HXDLIN( 459) if ((Alpha > 255)) { HXLINE( 459) this5 = 255; } else { HXLINE( 459) if ((Alpha < 0)) { HXLINE( 459) this5 = 0; } else { HXLINE( 459) this5 = Alpha; } } HXDLIN( 459) this1 = (this1 | (this5 << 24)); } HXLINE( 460) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC5(FlxColor_Impl__obj,setRGB,return ) int FlxColor_Impl__obj::setRGBFloat(int this1,Float Red,Float Green,Float Blue,::hx::Null< Float > __o_Alpha){ Float Alpha = __o_Alpha.Default(1); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_473_setRGBFloat) HXLINE( 474) { HXLINE( 474) int Value = ::Math_obj::round((Red * ( (Float)(255) ))); HXDLIN( 474) this1 = (this1 & -16711681); HXDLIN( 474) int this2; HXDLIN( 474) if ((Value > 255)) { HXLINE( 474) this2 = 255; } else { HXLINE( 474) if ((Value < 0)) { HXLINE( 474) this2 = 0; } else { HXLINE( 474) this2 = Value; } } HXDLIN( 474) this1 = (this1 | (this2 << 16)); } HXLINE( 475) { HXLINE( 475) int Value1 = ::Math_obj::round((Green * ( (Float)(255) ))); HXDLIN( 475) this1 = (this1 & -65281); HXDLIN( 475) int this3; HXDLIN( 475) if ((Value1 > 255)) { HXLINE( 475) this3 = 255; } else { HXLINE( 475) if ((Value1 < 0)) { HXLINE( 475) this3 = 0; } else { HXLINE( 475) this3 = Value1; } } HXDLIN( 475) this1 = (this1 | (this3 << 8)); } HXLINE( 476) { HXLINE( 476) int Value2 = ::Math_obj::round((Blue * ( (Float)(255) ))); HXDLIN( 476) this1 = (this1 & -256); HXDLIN( 476) int this4; HXDLIN( 476) if ((Value2 > 255)) { HXLINE( 476) this4 = 255; } else { HXLINE( 476) if ((Value2 < 0)) { HXLINE( 476) this4 = 0; } else { HXLINE( 476) this4 = Value2; } } HXDLIN( 476) this1 = (this1 | this4); } HXLINE( 477) { HXLINE( 477) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 477) this1 = (this1 & 16777215); HXDLIN( 477) int this5; HXDLIN( 477) if ((Value3 > 255)) { HXLINE( 477) this5 = 255; } else { HXLINE( 477) if ((Value3 < 0)) { HXLINE( 477) this5 = 0; } else { HXLINE( 477) this5 = Value3; } } HXDLIN( 477) this1 = (this1 | (this5 << 24)); } HXLINE( 478) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC5(FlxColor_Impl__obj,setRGBFloat,return ) int FlxColor_Impl__obj::setCMYK(int this1,Float Cyan,Float Magenta,Float Yellow,Float Black,::hx::Null< Float > __o_Alpha){ Float Alpha = __o_Alpha.Default(1); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_492_setCMYK) HXLINE( 493) { HXLINE( 493) Float Value = ((( (Float)(1) ) - Cyan) * (( (Float)(1) ) - Black)); HXDLIN( 493) { HXLINE( 493) int Value1 = ::Math_obj::round((Value * ( (Float)(255) ))); HXDLIN( 493) this1 = (this1 & -16711681); HXDLIN( 493) int this2; HXDLIN( 493) if ((Value1 > 255)) { HXLINE( 493) this2 = 255; } else { HXLINE( 493) if ((Value1 < 0)) { HXLINE( 493) this2 = 0; } else { HXLINE( 493) this2 = Value1; } } HXDLIN( 493) this1 = (this1 | (this2 << 16)); } } HXLINE( 494) { HXLINE( 494) Float Value2 = ((( (Float)(1) ) - Magenta) * (( (Float)(1) ) - Black)); HXDLIN( 494) { HXLINE( 494) int Value3 = ::Math_obj::round((Value2 * ( (Float)(255) ))); HXDLIN( 494) this1 = (this1 & -65281); HXDLIN( 494) int this3; HXDLIN( 494) if ((Value3 > 255)) { HXLINE( 494) this3 = 255; } else { HXLINE( 494) if ((Value3 < 0)) { HXLINE( 494) this3 = 0; } else { HXLINE( 494) this3 = Value3; } } HXDLIN( 494) this1 = (this1 | (this3 << 8)); } } HXLINE( 495) { HXLINE( 495) Float Value4 = ((( (Float)(1) ) - Yellow) * (( (Float)(1) ) - Black)); HXDLIN( 495) { HXLINE( 495) int Value5 = ::Math_obj::round((Value4 * ( (Float)(255) ))); HXDLIN( 495) this1 = (this1 & -256); HXDLIN( 495) int this4; HXDLIN( 495) if ((Value5 > 255)) { HXLINE( 495) this4 = 255; } else { HXLINE( 495) if ((Value5 < 0)) { HXLINE( 495) this4 = 0; } else { HXLINE( 495) this4 = Value5; } } HXDLIN( 495) this1 = (this1 | this4); } } HXLINE( 496) { HXLINE( 496) int Value6 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 496) this1 = (this1 & 16777215); HXDLIN( 496) int this5; HXDLIN( 496) if ((Value6 > 255)) { HXLINE( 496) this5 = 255; } else { HXLINE( 496) if ((Value6 < 0)) { HXLINE( 496) this5 = 0; } else { HXLINE( 496) this5 = Value6; } } HXDLIN( 496) this1 = (this1 | (this5 << 24)); } HXLINE( 497) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC6(FlxColor_Impl__obj,setCMYK,return ) int FlxColor_Impl__obj::setHSB(int this1,Float Hue,Float Saturation,Float Brightness,Float Alpha){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_510_setHSB) HXLINE( 511) Float chroma = (Brightness * Saturation); HXLINE( 512) Float match = (Brightness - chroma); HXLINE( 513) Float Hue1 = Hue; HXDLIN( 513) Float Chroma = chroma; HXDLIN( 513) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 513) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 513) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 513) Chroma = (Chroma + match); HXDLIN( 513) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 513) { HXLINE( 513) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -16711681); HXDLIN( 513) int this2; HXDLIN( 513) if ((Value > 255)) { HXLINE( 513) this2 = 255; } else { HXLINE( 513) if ((Value < 0)) { HXLINE( 513) this2 = 0; } else { HXLINE( 513) this2 = Value; } } HXDLIN( 513) this1 = (this1 | (this2 << 16)); } HXDLIN( 513) { HXLINE( 513) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -65281); HXDLIN( 513) int this3; HXDLIN( 513) if ((Value1 > 255)) { HXLINE( 513) this3 = 255; } else { HXLINE( 513) if ((Value1 < 0)) { HXLINE( 513) this3 = 0; } else { HXLINE( 513) this3 = Value1; } } HXDLIN( 513) this1 = (this1 | (this3 << 8)); } HXDLIN( 513) { HXLINE( 513) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -256); HXDLIN( 513) int this4; HXDLIN( 513) if ((Value2 > 255)) { HXLINE( 513) this4 = 255; } else { HXLINE( 513) if ((Value2 < 0)) { HXLINE( 513) this4 = 0; } else { HXLINE( 513) this4 = Value2; } } HXDLIN( 513) this1 = (this1 | this4); } HXDLIN( 513) { HXLINE( 513) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & 16777215); HXDLIN( 513) int this5; HXDLIN( 513) if ((Value3 > 255)) { HXLINE( 513) this5 = 255; } else { HXLINE( 513) if ((Value3 < 0)) { HXLINE( 513) this5 = 0; } else { HXLINE( 513) this5 = Value3; } } HXDLIN( 513) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 513) { HXLINE( 513) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -16711681); HXDLIN( 513) int this2; HXDLIN( 513) if ((Value > 255)) { HXLINE( 513) this2 = 255; } else { HXLINE( 513) if ((Value < 0)) { HXLINE( 513) this2 = 0; } else { HXLINE( 513) this2 = Value; } } HXDLIN( 513) this1 = (this1 | (this2 << 16)); } HXDLIN( 513) { HXLINE( 513) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -65281); HXDLIN( 513) int this3; HXDLIN( 513) if ((Value1 > 255)) { HXLINE( 513) this3 = 255; } else { HXLINE( 513) if ((Value1 < 0)) { HXLINE( 513) this3 = 0; } else { HXLINE( 513) this3 = Value1; } } HXDLIN( 513) this1 = (this1 | (this3 << 8)); } HXDLIN( 513) { HXLINE( 513) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -256); HXDLIN( 513) int this4; HXDLIN( 513) if ((Value2 > 255)) { HXLINE( 513) this4 = 255; } else { HXLINE( 513) if ((Value2 < 0)) { HXLINE( 513) this4 = 0; } else { HXLINE( 513) this4 = Value2; } } HXDLIN( 513) this1 = (this1 | this4); } HXDLIN( 513) { HXLINE( 513) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & 16777215); HXDLIN( 513) int this5; HXDLIN( 513) if ((Value3 > 255)) { HXLINE( 513) this5 = 255; } else { HXLINE( 513) if ((Value3 < 0)) { HXLINE( 513) this5 = 0; } else { HXLINE( 513) this5 = Value3; } } HXDLIN( 513) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 513) { HXLINE( 513) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -16711681); HXDLIN( 513) int this2; HXDLIN( 513) if ((Value > 255)) { HXLINE( 513) this2 = 255; } else { HXLINE( 513) if ((Value < 0)) { HXLINE( 513) this2 = 0; } else { HXLINE( 513) this2 = Value; } } HXDLIN( 513) this1 = (this1 | (this2 << 16)); } HXDLIN( 513) { HXLINE( 513) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -65281); HXDLIN( 513) int this3; HXDLIN( 513) if ((Value1 > 255)) { HXLINE( 513) this3 = 255; } else { HXLINE( 513) if ((Value1 < 0)) { HXLINE( 513) this3 = 0; } else { HXLINE( 513) this3 = Value1; } } HXDLIN( 513) this1 = (this1 | (this3 << 8)); } HXDLIN( 513) { HXLINE( 513) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -256); HXDLIN( 513) int this4; HXDLIN( 513) if ((Value2 > 255)) { HXLINE( 513) this4 = 255; } else { HXLINE( 513) if ((Value2 < 0)) { HXLINE( 513) this4 = 0; } else { HXLINE( 513) this4 = Value2; } } HXDLIN( 513) this1 = (this1 | this4); } HXDLIN( 513) { HXLINE( 513) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & 16777215); HXDLIN( 513) int this5; HXDLIN( 513) if ((Value3 > 255)) { HXLINE( 513) this5 = 255; } else { HXLINE( 513) if ((Value3 < 0)) { HXLINE( 513) this5 = 0; } else { HXLINE( 513) this5 = Value3; } } HXDLIN( 513) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 513) { HXLINE( 513) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -16711681); HXDLIN( 513) int this2; HXDLIN( 513) if ((Value > 255)) { HXLINE( 513) this2 = 255; } else { HXLINE( 513) if ((Value < 0)) { HXLINE( 513) this2 = 0; } else { HXLINE( 513) this2 = Value; } } HXDLIN( 513) this1 = (this1 | (this2 << 16)); } HXDLIN( 513) { HXLINE( 513) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -65281); HXDLIN( 513) int this3; HXDLIN( 513) if ((Value1 > 255)) { HXLINE( 513) this3 = 255; } else { HXLINE( 513) if ((Value1 < 0)) { HXLINE( 513) this3 = 0; } else { HXLINE( 513) this3 = Value1; } } HXDLIN( 513) this1 = (this1 | (this3 << 8)); } HXDLIN( 513) { HXLINE( 513) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -256); HXDLIN( 513) int this4; HXDLIN( 513) if ((Value2 > 255)) { HXLINE( 513) this4 = 255; } else { HXLINE( 513) if ((Value2 < 0)) { HXLINE( 513) this4 = 0; } else { HXLINE( 513) this4 = Value2; } } HXDLIN( 513) this1 = (this1 | this4); } HXDLIN( 513) { HXLINE( 513) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & 16777215); HXDLIN( 513) int this5; HXDLIN( 513) if ((Value3 > 255)) { HXLINE( 513) this5 = 255; } else { HXLINE( 513) if ((Value3 < 0)) { HXLINE( 513) this5 = 0; } else { HXLINE( 513) this5 = Value3; } } HXDLIN( 513) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 513) { HXLINE( 513) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -16711681); HXDLIN( 513) int this2; HXDLIN( 513) if ((Value > 255)) { HXLINE( 513) this2 = 255; } else { HXLINE( 513) if ((Value < 0)) { HXLINE( 513) this2 = 0; } else { HXLINE( 513) this2 = Value; } } HXDLIN( 513) this1 = (this1 | (this2 << 16)); } HXDLIN( 513) { HXLINE( 513) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -65281); HXDLIN( 513) int this3; HXDLIN( 513) if ((Value1 > 255)) { HXLINE( 513) this3 = 255; } else { HXLINE( 513) if ((Value1 < 0)) { HXLINE( 513) this3 = 0; } else { HXLINE( 513) this3 = Value1; } } HXDLIN( 513) this1 = (this1 | (this3 << 8)); } HXDLIN( 513) { HXLINE( 513) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -256); HXDLIN( 513) int this4; HXDLIN( 513) if ((Value2 > 255)) { HXLINE( 513) this4 = 255; } else { HXLINE( 513) if ((Value2 < 0)) { HXLINE( 513) this4 = 0; } else { HXLINE( 513) this4 = Value2; } } HXDLIN( 513) this1 = (this1 | this4); } HXDLIN( 513) { HXLINE( 513) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & 16777215); HXDLIN( 513) int this5; HXDLIN( 513) if ((Value3 > 255)) { HXLINE( 513) this5 = 255; } else { HXLINE( 513) if ((Value3 < 0)) { HXLINE( 513) this5 = 0; } else { HXLINE( 513) this5 = Value3; } } HXDLIN( 513) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 513) { HXLINE( 513) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -16711681); HXDLIN( 513) int this2; HXDLIN( 513) if ((Value > 255)) { HXLINE( 513) this2 = 255; } else { HXLINE( 513) if ((Value < 0)) { HXLINE( 513) this2 = 0; } else { HXLINE( 513) this2 = Value; } } HXDLIN( 513) this1 = (this1 | (this2 << 16)); } HXDLIN( 513) { HXLINE( 513) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -65281); HXDLIN( 513) int this3; HXDLIN( 513) if ((Value1 > 255)) { HXLINE( 513) this3 = 255; } else { HXLINE( 513) if ((Value1 < 0)) { HXLINE( 513) this3 = 0; } else { HXLINE( 513) this3 = Value1; } } HXDLIN( 513) this1 = (this1 | (this3 << 8)); } HXDLIN( 513) { HXLINE( 513) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & -256); HXDLIN( 513) int this4; HXDLIN( 513) if ((Value2 > 255)) { HXLINE( 513) this4 = 255; } else { HXLINE( 513) if ((Value2 < 0)) { HXLINE( 513) this4 = 0; } else { HXLINE( 513) this4 = Value2; } } HXDLIN( 513) this1 = (this1 | this4); } HXDLIN( 513) { HXLINE( 513) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 513) this1 = (this1 & 16777215); HXDLIN( 513) int this5; HXDLIN( 513) if ((Value3 > 255)) { HXLINE( 513) this5 = 255; } else { HXLINE( 513) if ((Value3 < 0)) { HXLINE( 513) this5 = 0; } else { HXLINE( 513) this5 = Value3; } } HXDLIN( 513) this1 = (this1 | (this5 << 24)); } } break; } HXDLIN( 513) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC5(FlxColor_Impl__obj,setHSB,return ) int FlxColor_Impl__obj::setHSL(int this1,Float Hue,Float Saturation,Float Lightness,Float Alpha){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_526_setHSL) HXLINE( 527) Float chroma = ((( (Float)(1) ) - ::Math_obj::abs(((( (Float)(2) ) * Lightness) - ( (Float)(1) )))) * Saturation); HXLINE( 528) Float match = (Lightness - (chroma / ( (Float)(2) ))); HXLINE( 529) Float Hue1 = Hue; HXDLIN( 529) Float Chroma = chroma; HXDLIN( 529) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 529) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 529) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 529) Chroma = (Chroma + match); HXDLIN( 529) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 529) { HXLINE( 529) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -16711681); HXDLIN( 529) int this2; HXDLIN( 529) if ((Value > 255)) { HXLINE( 529) this2 = 255; } else { HXLINE( 529) if ((Value < 0)) { HXLINE( 529) this2 = 0; } else { HXLINE( 529) this2 = Value; } } HXDLIN( 529) this1 = (this1 | (this2 << 16)); } HXDLIN( 529) { HXLINE( 529) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -65281); HXDLIN( 529) int this3; HXDLIN( 529) if ((Value1 > 255)) { HXLINE( 529) this3 = 255; } else { HXLINE( 529) if ((Value1 < 0)) { HXLINE( 529) this3 = 0; } else { HXLINE( 529) this3 = Value1; } } HXDLIN( 529) this1 = (this1 | (this3 << 8)); } HXDLIN( 529) { HXLINE( 529) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -256); HXDLIN( 529) int this4; HXDLIN( 529) if ((Value2 > 255)) { HXLINE( 529) this4 = 255; } else { HXLINE( 529) if ((Value2 < 0)) { HXLINE( 529) this4 = 0; } else { HXLINE( 529) this4 = Value2; } } HXDLIN( 529) this1 = (this1 | this4); } HXDLIN( 529) { HXLINE( 529) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & 16777215); HXDLIN( 529) int this5; HXDLIN( 529) if ((Value3 > 255)) { HXLINE( 529) this5 = 255; } else { HXLINE( 529) if ((Value3 < 0)) { HXLINE( 529) this5 = 0; } else { HXLINE( 529) this5 = Value3; } } HXDLIN( 529) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 529) { HXLINE( 529) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -16711681); HXDLIN( 529) int this2; HXDLIN( 529) if ((Value > 255)) { HXLINE( 529) this2 = 255; } else { HXLINE( 529) if ((Value < 0)) { HXLINE( 529) this2 = 0; } else { HXLINE( 529) this2 = Value; } } HXDLIN( 529) this1 = (this1 | (this2 << 16)); } HXDLIN( 529) { HXLINE( 529) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -65281); HXDLIN( 529) int this3; HXDLIN( 529) if ((Value1 > 255)) { HXLINE( 529) this3 = 255; } else { HXLINE( 529) if ((Value1 < 0)) { HXLINE( 529) this3 = 0; } else { HXLINE( 529) this3 = Value1; } } HXDLIN( 529) this1 = (this1 | (this3 << 8)); } HXDLIN( 529) { HXLINE( 529) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -256); HXDLIN( 529) int this4; HXDLIN( 529) if ((Value2 > 255)) { HXLINE( 529) this4 = 255; } else { HXLINE( 529) if ((Value2 < 0)) { HXLINE( 529) this4 = 0; } else { HXLINE( 529) this4 = Value2; } } HXDLIN( 529) this1 = (this1 | this4); } HXDLIN( 529) { HXLINE( 529) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & 16777215); HXDLIN( 529) int this5; HXDLIN( 529) if ((Value3 > 255)) { HXLINE( 529) this5 = 255; } else { HXLINE( 529) if ((Value3 < 0)) { HXLINE( 529) this5 = 0; } else { HXLINE( 529) this5 = Value3; } } HXDLIN( 529) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 529) { HXLINE( 529) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -16711681); HXDLIN( 529) int this2; HXDLIN( 529) if ((Value > 255)) { HXLINE( 529) this2 = 255; } else { HXLINE( 529) if ((Value < 0)) { HXLINE( 529) this2 = 0; } else { HXLINE( 529) this2 = Value; } } HXDLIN( 529) this1 = (this1 | (this2 << 16)); } HXDLIN( 529) { HXLINE( 529) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -65281); HXDLIN( 529) int this3; HXDLIN( 529) if ((Value1 > 255)) { HXLINE( 529) this3 = 255; } else { HXLINE( 529) if ((Value1 < 0)) { HXLINE( 529) this3 = 0; } else { HXLINE( 529) this3 = Value1; } } HXDLIN( 529) this1 = (this1 | (this3 << 8)); } HXDLIN( 529) { HXLINE( 529) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -256); HXDLIN( 529) int this4; HXDLIN( 529) if ((Value2 > 255)) { HXLINE( 529) this4 = 255; } else { HXLINE( 529) if ((Value2 < 0)) { HXLINE( 529) this4 = 0; } else { HXLINE( 529) this4 = Value2; } } HXDLIN( 529) this1 = (this1 | this4); } HXDLIN( 529) { HXLINE( 529) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & 16777215); HXDLIN( 529) int this5; HXDLIN( 529) if ((Value3 > 255)) { HXLINE( 529) this5 = 255; } else { HXLINE( 529) if ((Value3 < 0)) { HXLINE( 529) this5 = 0; } else { HXLINE( 529) this5 = Value3; } } HXDLIN( 529) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 529) { HXLINE( 529) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -16711681); HXDLIN( 529) int this2; HXDLIN( 529) if ((Value > 255)) { HXLINE( 529) this2 = 255; } else { HXLINE( 529) if ((Value < 0)) { HXLINE( 529) this2 = 0; } else { HXLINE( 529) this2 = Value; } } HXDLIN( 529) this1 = (this1 | (this2 << 16)); } HXDLIN( 529) { HXLINE( 529) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -65281); HXDLIN( 529) int this3; HXDLIN( 529) if ((Value1 > 255)) { HXLINE( 529) this3 = 255; } else { HXLINE( 529) if ((Value1 < 0)) { HXLINE( 529) this3 = 0; } else { HXLINE( 529) this3 = Value1; } } HXDLIN( 529) this1 = (this1 | (this3 << 8)); } HXDLIN( 529) { HXLINE( 529) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -256); HXDLIN( 529) int this4; HXDLIN( 529) if ((Value2 > 255)) { HXLINE( 529) this4 = 255; } else { HXLINE( 529) if ((Value2 < 0)) { HXLINE( 529) this4 = 0; } else { HXLINE( 529) this4 = Value2; } } HXDLIN( 529) this1 = (this1 | this4); } HXDLIN( 529) { HXLINE( 529) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & 16777215); HXDLIN( 529) int this5; HXDLIN( 529) if ((Value3 > 255)) { HXLINE( 529) this5 = 255; } else { HXLINE( 529) if ((Value3 < 0)) { HXLINE( 529) this5 = 0; } else { HXLINE( 529) this5 = Value3; } } HXDLIN( 529) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 529) { HXLINE( 529) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -16711681); HXDLIN( 529) int this2; HXDLIN( 529) if ((Value > 255)) { HXLINE( 529) this2 = 255; } else { HXLINE( 529) if ((Value < 0)) { HXLINE( 529) this2 = 0; } else { HXLINE( 529) this2 = Value; } } HXDLIN( 529) this1 = (this1 | (this2 << 16)); } HXDLIN( 529) { HXLINE( 529) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -65281); HXDLIN( 529) int this3; HXDLIN( 529) if ((Value1 > 255)) { HXLINE( 529) this3 = 255; } else { HXLINE( 529) if ((Value1 < 0)) { HXLINE( 529) this3 = 0; } else { HXLINE( 529) this3 = Value1; } } HXDLIN( 529) this1 = (this1 | (this3 << 8)); } HXDLIN( 529) { HXLINE( 529) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -256); HXDLIN( 529) int this4; HXDLIN( 529) if ((Value2 > 255)) { HXLINE( 529) this4 = 255; } else { HXLINE( 529) if ((Value2 < 0)) { HXLINE( 529) this4 = 0; } else { HXLINE( 529) this4 = Value2; } } HXDLIN( 529) this1 = (this1 | this4); } HXDLIN( 529) { HXLINE( 529) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & 16777215); HXDLIN( 529) int this5; HXDLIN( 529) if ((Value3 > 255)) { HXLINE( 529) this5 = 255; } else { HXLINE( 529) if ((Value3 < 0)) { HXLINE( 529) this5 = 0; } else { HXLINE( 529) this5 = Value3; } } HXDLIN( 529) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 529) { HXLINE( 529) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -16711681); HXDLIN( 529) int this2; HXDLIN( 529) if ((Value > 255)) { HXLINE( 529) this2 = 255; } else { HXLINE( 529) if ((Value < 0)) { HXLINE( 529) this2 = 0; } else { HXLINE( 529) this2 = Value; } } HXDLIN( 529) this1 = (this1 | (this2 << 16)); } HXDLIN( 529) { HXLINE( 529) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -65281); HXDLIN( 529) int this3; HXDLIN( 529) if ((Value1 > 255)) { HXLINE( 529) this3 = 255; } else { HXLINE( 529) if ((Value1 < 0)) { HXLINE( 529) this3 = 0; } else { HXLINE( 529) this3 = Value1; } } HXDLIN( 529) this1 = (this1 | (this3 << 8)); } HXDLIN( 529) { HXLINE( 529) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & -256); HXDLIN( 529) int this4; HXDLIN( 529) if ((Value2 > 255)) { HXLINE( 529) this4 = 255; } else { HXLINE( 529) if ((Value2 < 0)) { HXLINE( 529) this4 = 0; } else { HXLINE( 529) this4 = Value2; } } HXDLIN( 529) this1 = (this1 | this4); } HXDLIN( 529) { HXLINE( 529) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 529) this1 = (this1 & 16777215); HXDLIN( 529) int this5; HXDLIN( 529) if ((Value3 > 255)) { HXLINE( 529) this5 = 255; } else { HXLINE( 529) if ((Value3 < 0)) { HXLINE( 529) this5 = 0; } else { HXLINE( 529) this5 = Value3; } } HXDLIN( 529) this1 = (this1 | (this5 << 24)); } } break; } HXDLIN( 529) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC5(FlxColor_Impl__obj,setHSL,return ) int FlxColor_Impl__obj::setHSChromaMatch(int this1,Float Hue,Float Saturation,Float Chroma,Float Match,Float Alpha){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_536_setHSChromaMatch) HXLINE( 537) Hue = ::hx::Mod(Hue,360); HXLINE( 538) Float hueD = (Hue / ( (Float)(60) )); HXLINE( 539) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + Match); HXLINE( 540) Chroma = (Chroma + Match); HXLINE( 542) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 545) { HXLINE( 545) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 545) this1 = (this1 & -16711681); HXDLIN( 545) int this2; HXDLIN( 545) if ((Value > 255)) { HXLINE( 545) this2 = 255; } else { HXLINE( 545) if ((Value < 0)) { HXLINE( 545) this2 = 0; } else { HXLINE( 545) this2 = Value; } } HXDLIN( 545) this1 = (this1 | (this2 << 16)); } HXDLIN( 545) { HXLINE( 545) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 545) this1 = (this1 & -65281); HXDLIN( 545) int this3; HXDLIN( 545) if ((Value1 > 255)) { HXLINE( 545) this3 = 255; } else { HXLINE( 545) if ((Value1 < 0)) { HXLINE( 545) this3 = 0; } else { HXLINE( 545) this3 = Value1; } } HXDLIN( 545) this1 = (this1 | (this3 << 8)); } HXDLIN( 545) { HXLINE( 545) int Value2 = ::Math_obj::round((Match * ( (Float)(255) ))); HXDLIN( 545) this1 = (this1 & -256); HXDLIN( 545) int this4; HXDLIN( 545) if ((Value2 > 255)) { HXLINE( 545) this4 = 255; } else { HXLINE( 545) if ((Value2 < 0)) { HXLINE( 545) this4 = 0; } else { HXLINE( 545) this4 = Value2; } } HXDLIN( 545) this1 = (this1 | this4); } HXDLIN( 545) { HXLINE( 545) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 545) this1 = (this1 & 16777215); HXDLIN( 545) int this5; HXDLIN( 545) if ((Value3 > 255)) { HXLINE( 545) this5 = 255; } else { HXLINE( 545) if ((Value3 < 0)) { HXLINE( 545) this5 = 0; } else { HXLINE( 545) this5 = Value3; } } HXDLIN( 545) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 547) { HXLINE( 547) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 547) this1 = (this1 & -16711681); HXDLIN( 547) int this2; HXDLIN( 547) if ((Value > 255)) { HXLINE( 547) this2 = 255; } else { HXLINE( 547) if ((Value < 0)) { HXLINE( 547) this2 = 0; } else { HXLINE( 547) this2 = Value; } } HXDLIN( 547) this1 = (this1 | (this2 << 16)); } HXDLIN( 547) { HXLINE( 547) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 547) this1 = (this1 & -65281); HXDLIN( 547) int this3; HXDLIN( 547) if ((Value1 > 255)) { HXLINE( 547) this3 = 255; } else { HXLINE( 547) if ((Value1 < 0)) { HXLINE( 547) this3 = 0; } else { HXLINE( 547) this3 = Value1; } } HXDLIN( 547) this1 = (this1 | (this3 << 8)); } HXDLIN( 547) { HXLINE( 547) int Value2 = ::Math_obj::round((Match * ( (Float)(255) ))); HXDLIN( 547) this1 = (this1 & -256); HXDLIN( 547) int this4; HXDLIN( 547) if ((Value2 > 255)) { HXLINE( 547) this4 = 255; } else { HXLINE( 547) if ((Value2 < 0)) { HXLINE( 547) this4 = 0; } else { HXLINE( 547) this4 = Value2; } } HXDLIN( 547) this1 = (this1 | this4); } HXDLIN( 547) { HXLINE( 547) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 547) this1 = (this1 & 16777215); HXDLIN( 547) int this5; HXDLIN( 547) if ((Value3 > 255)) { HXLINE( 547) this5 = 255; } else { HXLINE( 547) if ((Value3 < 0)) { HXLINE( 547) this5 = 0; } else { HXLINE( 547) this5 = Value3; } } HXDLIN( 547) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 549) { HXLINE( 549) int Value = ::Math_obj::round((Match * ( (Float)(255) ))); HXDLIN( 549) this1 = (this1 & -16711681); HXDLIN( 549) int this2; HXDLIN( 549) if ((Value > 255)) { HXLINE( 549) this2 = 255; } else { HXLINE( 549) if ((Value < 0)) { HXLINE( 549) this2 = 0; } else { HXLINE( 549) this2 = Value; } } HXDLIN( 549) this1 = (this1 | (this2 << 16)); } HXDLIN( 549) { HXLINE( 549) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 549) this1 = (this1 & -65281); HXDLIN( 549) int this3; HXDLIN( 549) if ((Value1 > 255)) { HXLINE( 549) this3 = 255; } else { HXLINE( 549) if ((Value1 < 0)) { HXLINE( 549) this3 = 0; } else { HXLINE( 549) this3 = Value1; } } HXDLIN( 549) this1 = (this1 | (this3 << 8)); } HXDLIN( 549) { HXLINE( 549) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 549) this1 = (this1 & -256); HXDLIN( 549) int this4; HXDLIN( 549) if ((Value2 > 255)) { HXLINE( 549) this4 = 255; } else { HXLINE( 549) if ((Value2 < 0)) { HXLINE( 549) this4 = 0; } else { HXLINE( 549) this4 = Value2; } } HXDLIN( 549) this1 = (this1 | this4); } HXDLIN( 549) { HXLINE( 549) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 549) this1 = (this1 & 16777215); HXDLIN( 549) int this5; HXDLIN( 549) if ((Value3 > 255)) { HXLINE( 549) this5 = 255; } else { HXLINE( 549) if ((Value3 < 0)) { HXLINE( 549) this5 = 0; } else { HXLINE( 549) this5 = Value3; } } HXDLIN( 549) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 551) { HXLINE( 551) int Value = ::Math_obj::round((Match * ( (Float)(255) ))); HXDLIN( 551) this1 = (this1 & -16711681); HXDLIN( 551) int this2; HXDLIN( 551) if ((Value > 255)) { HXLINE( 551) this2 = 255; } else { HXLINE( 551) if ((Value < 0)) { HXLINE( 551) this2 = 0; } else { HXLINE( 551) this2 = Value; } } HXDLIN( 551) this1 = (this1 | (this2 << 16)); } HXDLIN( 551) { HXLINE( 551) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 551) this1 = (this1 & -65281); HXDLIN( 551) int this3; HXDLIN( 551) if ((Value1 > 255)) { HXLINE( 551) this3 = 255; } else { HXLINE( 551) if ((Value1 < 0)) { HXLINE( 551) this3 = 0; } else { HXLINE( 551) this3 = Value1; } } HXDLIN( 551) this1 = (this1 | (this3 << 8)); } HXDLIN( 551) { HXLINE( 551) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 551) this1 = (this1 & -256); HXDLIN( 551) int this4; HXDLIN( 551) if ((Value2 > 255)) { HXLINE( 551) this4 = 255; } else { HXLINE( 551) if ((Value2 < 0)) { HXLINE( 551) this4 = 0; } else { HXLINE( 551) this4 = Value2; } } HXDLIN( 551) this1 = (this1 | this4); } HXDLIN( 551) { HXLINE( 551) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 551) this1 = (this1 & 16777215); HXDLIN( 551) int this5; HXDLIN( 551) if ((Value3 > 255)) { HXLINE( 551) this5 = 255; } else { HXLINE( 551) if ((Value3 < 0)) { HXLINE( 551) this5 = 0; } else { HXLINE( 551) this5 = Value3; } } HXDLIN( 551) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 553) { HXLINE( 553) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 553) this1 = (this1 & -16711681); HXDLIN( 553) int this2; HXDLIN( 553) if ((Value > 255)) { HXLINE( 553) this2 = 255; } else { HXLINE( 553) if ((Value < 0)) { HXLINE( 553) this2 = 0; } else { HXLINE( 553) this2 = Value; } } HXDLIN( 553) this1 = (this1 | (this2 << 16)); } HXDLIN( 553) { HXLINE( 553) int Value1 = ::Math_obj::round((Match * ( (Float)(255) ))); HXDLIN( 553) this1 = (this1 & -65281); HXDLIN( 553) int this3; HXDLIN( 553) if ((Value1 > 255)) { HXLINE( 553) this3 = 255; } else { HXLINE( 553) if ((Value1 < 0)) { HXLINE( 553) this3 = 0; } else { HXLINE( 553) this3 = Value1; } } HXDLIN( 553) this1 = (this1 | (this3 << 8)); } HXDLIN( 553) { HXLINE( 553) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 553) this1 = (this1 & -256); HXDLIN( 553) int this4; HXDLIN( 553) if ((Value2 > 255)) { HXLINE( 553) this4 = 255; } else { HXLINE( 553) if ((Value2 < 0)) { HXLINE( 553) this4 = 0; } else { HXLINE( 553) this4 = Value2; } } HXDLIN( 553) this1 = (this1 | this4); } HXDLIN( 553) { HXLINE( 553) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 553) this1 = (this1 & 16777215); HXDLIN( 553) int this5; HXDLIN( 553) if ((Value3 > 255)) { HXLINE( 553) this5 = 255; } else { HXLINE( 553) if ((Value3 < 0)) { HXLINE( 553) this5 = 0; } else { HXLINE( 553) this5 = Value3; } } HXDLIN( 553) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 555) { HXLINE( 555) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 555) this1 = (this1 & -16711681); HXDLIN( 555) int this2; HXDLIN( 555) if ((Value > 255)) { HXLINE( 555) this2 = 255; } else { HXLINE( 555) if ((Value < 0)) { HXLINE( 555) this2 = 0; } else { HXLINE( 555) this2 = Value; } } HXDLIN( 555) this1 = (this1 | (this2 << 16)); } HXDLIN( 555) { HXLINE( 555) int Value1 = ::Math_obj::round((Match * ( (Float)(255) ))); HXDLIN( 555) this1 = (this1 & -65281); HXDLIN( 555) int this3; HXDLIN( 555) if ((Value1 > 255)) { HXLINE( 555) this3 = 255; } else { HXLINE( 555) if ((Value1 < 0)) { HXLINE( 555) this3 = 0; } else { HXLINE( 555) this3 = Value1; } } HXDLIN( 555) this1 = (this1 | (this3 << 8)); } HXDLIN( 555) { HXLINE( 555) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 555) this1 = (this1 & -256); HXDLIN( 555) int this4; HXDLIN( 555) if ((Value2 > 255)) { HXLINE( 555) this4 = 255; } else { HXLINE( 555) if ((Value2 < 0)) { HXLINE( 555) this4 = 0; } else { HXLINE( 555) this4 = Value2; } } HXDLIN( 555) this1 = (this1 | this4); } HXDLIN( 555) { HXLINE( 555) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 555) this1 = (this1 & 16777215); HXDLIN( 555) int this5; HXDLIN( 555) if ((Value3 > 255)) { HXLINE( 555) this5 = 255; } else { HXLINE( 555) if ((Value3 < 0)) { HXLINE( 555) this5 = 0; } else { HXLINE( 555) this5 = Value3; } } HXDLIN( 555) this1 = (this1 | (this5 << 24)); } } break; } HXLINE( 558) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC6(FlxColor_Impl__obj,setHSChromaMatch,return ) int FlxColor_Impl__obj::_new(::hx::Null< int > __o_Value){ int Value = __o_Value.Default(0); HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_561__new) HXDLIN( 561) int this1 = Value; HXDLIN( 561) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,_new,return ) int FlxColor_Impl__obj::getThis(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_571_getThis) HXDLIN( 571) return this1; } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,getThis,return ) void FlxColor_Impl__obj::validate(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_576_validate) } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,validate,(void)) int FlxColor_Impl__obj::get_red(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_584_get_red) HXDLIN( 584) return ((this1 >> 16) & 255); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_red,return ) int FlxColor_Impl__obj::get_green(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_589_get_green) HXDLIN( 589) return ((this1 >> 8) & 255); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_green,return ) int FlxColor_Impl__obj::get_blue(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_594_get_blue) HXDLIN( 594) return (this1 & 255); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_blue,return ) int FlxColor_Impl__obj::get_alpha(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_599_get_alpha) HXDLIN( 599) return ((this1 >> 24) & 255); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_alpha,return ) Float FlxColor_Impl__obj::get_redFloat(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_604_get_redFloat) HXDLIN( 604) return (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_redFloat,return ) Float FlxColor_Impl__obj::get_greenFloat(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_609_get_greenFloat) HXDLIN( 609) return (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_greenFloat,return ) Float FlxColor_Impl__obj::get_blueFloat(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_614_get_blueFloat) HXDLIN( 614) return (( (Float)((this1 & 255)) ) / ( (Float)(255) )); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_blueFloat,return ) Float FlxColor_Impl__obj::get_alphaFloat(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_619_get_alphaFloat) HXDLIN( 619) return (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_alphaFloat,return ) int FlxColor_Impl__obj::set_red(int this1,int Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_623_set_red) HXLINE( 625) this1 = (this1 & -16711681); HXLINE( 626) int this2; HXDLIN( 626) if ((Value > 255)) { HXLINE( 626) this2 = 255; } else { HXLINE( 626) if ((Value < 0)) { HXLINE( 626) this2 = 0; } else { HXLINE( 626) this2 = Value; } } HXDLIN( 626) this1 = (this1 | (this2 << 16)); HXLINE( 627) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_red,return ) int FlxColor_Impl__obj::set_green(int this1,int Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_631_set_green) HXLINE( 633) this1 = (this1 & -65281); HXLINE( 634) int this2; HXDLIN( 634) if ((Value > 255)) { HXLINE( 634) this2 = 255; } else { HXLINE( 634) if ((Value < 0)) { HXLINE( 634) this2 = 0; } else { HXLINE( 634) this2 = Value; } } HXDLIN( 634) this1 = (this1 | (this2 << 8)); HXLINE( 635) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_green,return ) int FlxColor_Impl__obj::set_blue(int this1,int Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_639_set_blue) HXLINE( 641) this1 = (this1 & -256); HXLINE( 642) int this2; HXDLIN( 642) if ((Value > 255)) { HXLINE( 642) this2 = 255; } else { HXLINE( 642) if ((Value < 0)) { HXLINE( 642) this2 = 0; } else { HXLINE( 642) this2 = Value; } } HXDLIN( 642) this1 = (this1 | this2); HXLINE( 643) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_blue,return ) int FlxColor_Impl__obj::set_alpha(int this1,int Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_647_set_alpha) HXLINE( 649) this1 = (this1 & 16777215); HXLINE( 650) int this2; HXDLIN( 650) if ((Value > 255)) { HXLINE( 650) this2 = 255; } else { HXLINE( 650) if ((Value < 0)) { HXLINE( 650) this2 = 0; } else { HXLINE( 650) this2 = Value; } } HXDLIN( 650) this1 = (this1 | (this2 << 24)); HXLINE( 651) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_alpha,return ) Float FlxColor_Impl__obj::set_redFloat(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_655_set_redFloat) HXLINE( 656) { HXLINE( 656) int Value1 = ::Math_obj::round((Value * ( (Float)(255) ))); HXDLIN( 656) this1 = (this1 & -16711681); HXDLIN( 656) int this2; HXDLIN( 656) if ((Value1 > 255)) { HXLINE( 656) this2 = 255; } else { HXLINE( 656) if ((Value1 < 0)) { HXLINE( 656) this2 = 0; } else { HXLINE( 656) this2 = Value1; } } HXDLIN( 656) this1 = (this1 | (this2 << 16)); } HXLINE( 657) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_redFloat,return ) Float FlxColor_Impl__obj::set_greenFloat(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_661_set_greenFloat) HXLINE( 662) { HXLINE( 662) int Value1 = ::Math_obj::round((Value * ( (Float)(255) ))); HXDLIN( 662) this1 = (this1 & -65281); HXDLIN( 662) int this2; HXDLIN( 662) if ((Value1 > 255)) { HXLINE( 662) this2 = 255; } else { HXLINE( 662) if ((Value1 < 0)) { HXLINE( 662) this2 = 0; } else { HXLINE( 662) this2 = Value1; } } HXDLIN( 662) this1 = (this1 | (this2 << 8)); } HXLINE( 663) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_greenFloat,return ) Float FlxColor_Impl__obj::set_blueFloat(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_667_set_blueFloat) HXLINE( 668) { HXLINE( 668) int Value1 = ::Math_obj::round((Value * ( (Float)(255) ))); HXDLIN( 668) this1 = (this1 & -256); HXDLIN( 668) int this2; HXDLIN( 668) if ((Value1 > 255)) { HXLINE( 668) this2 = 255; } else { HXLINE( 668) if ((Value1 < 0)) { HXLINE( 668) this2 = 0; } else { HXLINE( 668) this2 = Value1; } } HXDLIN( 668) this1 = (this1 | this2); } HXLINE( 669) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_blueFloat,return ) Float FlxColor_Impl__obj::set_alphaFloat(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_673_set_alphaFloat) HXLINE( 674) { HXLINE( 674) int Value1 = ::Math_obj::round((Value * ( (Float)(255) ))); HXDLIN( 674) this1 = (this1 & 16777215); HXDLIN( 674) int this2; HXDLIN( 674) if ((Value1 > 255)) { HXLINE( 674) this2 = 255; } else { HXLINE( 674) if ((Value1 < 0)) { HXLINE( 674) this2 = 0; } else { HXLINE( 674) this2 = Value1; } } HXDLIN( 674) this1 = (this1 | (this2 << 24)); } HXLINE( 675) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_alphaFloat,return ) Float FlxColor_Impl__obj::get_cyan(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_680_get_cyan) HXDLIN( 680) return (((( (Float)(1) ) - (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_cyan,return ) Float FlxColor_Impl__obj::get_magenta(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_685_get_magenta) HXDLIN( 685) return (((( (Float)(1) ) - (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_magenta,return ) Float FlxColor_Impl__obj::get_yellow(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_690_get_yellow) HXDLIN( 690) return (((( (Float)(1) ) - (( (Float)((this1 & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_yellow,return ) Float FlxColor_Impl__obj::get_black(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_695_get_black) HXDLIN( 695) return (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_black,return ) Float FlxColor_Impl__obj::set_cyan(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_699_set_cyan) HXLINE( 700) { HXLINE( 700) Float Magenta = (((( (Float)(1) ) - (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 700) Float Yellow = (((( (Float)(1) ) - (( (Float)((this1 & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 700) Float Black = (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 700) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 700) { HXLINE( 700) Float Value1 = ((( (Float)(1) ) - Value) * (( (Float)(1) ) - Black)); HXDLIN( 700) { HXLINE( 700) int Value2 = ::Math_obj::round((Value1 * ( (Float)(255) ))); HXDLIN( 700) this1 = (this1 & -16711681); HXDLIN( 700) int this2; HXDLIN( 700) if ((Value2 > 255)) { HXLINE( 700) this2 = 255; } else { HXLINE( 700) if ((Value2 < 0)) { HXLINE( 700) this2 = 0; } else { HXLINE( 700) this2 = Value2; } } HXDLIN( 700) this1 = (this1 | (this2 << 16)); } } HXDLIN( 700) { HXLINE( 700) Float Value3 = ((( (Float)(1) ) - Magenta) * (( (Float)(1) ) - Black)); HXDLIN( 700) { HXLINE( 700) int Value4 = ::Math_obj::round((Value3 * ( (Float)(255) ))); HXDLIN( 700) this1 = (this1 & -65281); HXDLIN( 700) int this3; HXDLIN( 700) if ((Value4 > 255)) { HXLINE( 700) this3 = 255; } else { HXLINE( 700) if ((Value4 < 0)) { HXLINE( 700) this3 = 0; } else { HXLINE( 700) this3 = Value4; } } HXDLIN( 700) this1 = (this1 | (this3 << 8)); } } HXDLIN( 700) { HXLINE( 700) Float Value5 = ((( (Float)(1) ) - Yellow) * (( (Float)(1) ) - Black)); HXDLIN( 700) { HXLINE( 700) int Value6 = ::Math_obj::round((Value5 * ( (Float)(255) ))); HXDLIN( 700) this1 = (this1 & -256); HXDLIN( 700) int this4; HXDLIN( 700) if ((Value6 > 255)) { HXLINE( 700) this4 = 255; } else { HXLINE( 700) if ((Value6 < 0)) { HXLINE( 700) this4 = 0; } else { HXLINE( 700) this4 = Value6; } } HXDLIN( 700) this1 = (this1 | this4); } } HXDLIN( 700) { HXLINE( 700) int Value7 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 700) this1 = (this1 & 16777215); HXDLIN( 700) int this5; HXDLIN( 700) if ((Value7 > 255)) { HXLINE( 700) this5 = 255; } else { HXLINE( 700) if ((Value7 < 0)) { HXLINE( 700) this5 = 0; } else { HXLINE( 700) this5 = Value7; } } HXDLIN( 700) this1 = (this1 | (this5 << 24)); } } HXLINE( 701) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_cyan,return ) Float FlxColor_Impl__obj::set_magenta(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_705_set_magenta) HXLINE( 706) { HXLINE( 706) Float Yellow = (((( (Float)(1) ) - (( (Float)((this1 & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 706) Float Black = (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 706) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 706) { HXLINE( 706) Float Value1 = ((( (Float)(1) ) - (((( (Float)(1) ) - (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) * (( (Float)(1) ) - Black)); HXDLIN( 706) { HXLINE( 706) int Value2 = ::Math_obj::round((Value1 * ( (Float)(255) ))); HXDLIN( 706) this1 = (this1 & -16711681); HXDLIN( 706) int this2; HXDLIN( 706) if ((Value2 > 255)) { HXLINE( 706) this2 = 255; } else { HXLINE( 706) if ((Value2 < 0)) { HXLINE( 706) this2 = 0; } else { HXLINE( 706) this2 = Value2; } } HXDLIN( 706) this1 = (this1 | (this2 << 16)); } } HXDLIN( 706) { HXLINE( 706) Float Value3 = ((( (Float)(1) ) - Value) * (( (Float)(1) ) - Black)); HXDLIN( 706) { HXLINE( 706) int Value4 = ::Math_obj::round((Value3 * ( (Float)(255) ))); HXDLIN( 706) this1 = (this1 & -65281); HXDLIN( 706) int this3; HXDLIN( 706) if ((Value4 > 255)) { HXLINE( 706) this3 = 255; } else { HXLINE( 706) if ((Value4 < 0)) { HXLINE( 706) this3 = 0; } else { HXLINE( 706) this3 = Value4; } } HXDLIN( 706) this1 = (this1 | (this3 << 8)); } } HXDLIN( 706) { HXLINE( 706) Float Value5 = ((( (Float)(1) ) - Yellow) * (( (Float)(1) ) - Black)); HXDLIN( 706) { HXLINE( 706) int Value6 = ::Math_obj::round((Value5 * ( (Float)(255) ))); HXDLIN( 706) this1 = (this1 & -256); HXDLIN( 706) int this4; HXDLIN( 706) if ((Value6 > 255)) { HXLINE( 706) this4 = 255; } else { HXLINE( 706) if ((Value6 < 0)) { HXLINE( 706) this4 = 0; } else { HXLINE( 706) this4 = Value6; } } HXDLIN( 706) this1 = (this1 | this4); } } HXDLIN( 706) { HXLINE( 706) int Value7 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 706) this1 = (this1 & 16777215); HXDLIN( 706) int this5; HXDLIN( 706) if ((Value7 > 255)) { HXLINE( 706) this5 = 255; } else { HXLINE( 706) if ((Value7 < 0)) { HXLINE( 706) this5 = 0; } else { HXLINE( 706) this5 = Value7; } } HXDLIN( 706) this1 = (this1 | (this5 << 24)); } } HXLINE( 707) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_magenta,return ) Float FlxColor_Impl__obj::set_yellow(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_711_set_yellow) HXLINE( 712) { HXLINE( 712) Float Magenta = (((( (Float)(1) ) - (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 712) Float Black = (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 712) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 712) { HXLINE( 712) Float Value1 = ((( (Float)(1) ) - (((( (Float)(1) ) - (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) * (( (Float)(1) ) - Black)); HXDLIN( 712) { HXLINE( 712) int Value2 = ::Math_obj::round((Value1 * ( (Float)(255) ))); HXDLIN( 712) this1 = (this1 & -16711681); HXDLIN( 712) int this2; HXDLIN( 712) if ((Value2 > 255)) { HXLINE( 712) this2 = 255; } else { HXLINE( 712) if ((Value2 < 0)) { HXLINE( 712) this2 = 0; } else { HXLINE( 712) this2 = Value2; } } HXDLIN( 712) this1 = (this1 | (this2 << 16)); } } HXDLIN( 712) { HXLINE( 712) Float Value3 = ((( (Float)(1) ) - Magenta) * (( (Float)(1) ) - Black)); HXDLIN( 712) { HXLINE( 712) int Value4 = ::Math_obj::round((Value3 * ( (Float)(255) ))); HXDLIN( 712) this1 = (this1 & -65281); HXDLIN( 712) int this3; HXDLIN( 712) if ((Value4 > 255)) { HXLINE( 712) this3 = 255; } else { HXLINE( 712) if ((Value4 < 0)) { HXLINE( 712) this3 = 0; } else { HXLINE( 712) this3 = Value4; } } HXDLIN( 712) this1 = (this1 | (this3 << 8)); } } HXDLIN( 712) { HXLINE( 712) Float Value5 = ((( (Float)(1) ) - Value) * (( (Float)(1) ) - Black)); HXDLIN( 712) { HXLINE( 712) int Value6 = ::Math_obj::round((Value5 * ( (Float)(255) ))); HXDLIN( 712) this1 = (this1 & -256); HXDLIN( 712) int this4; HXDLIN( 712) if ((Value6 > 255)) { HXLINE( 712) this4 = 255; } else { HXLINE( 712) if ((Value6 < 0)) { HXLINE( 712) this4 = 0; } else { HXLINE( 712) this4 = Value6; } } HXDLIN( 712) this1 = (this1 | this4); } } HXDLIN( 712) { HXLINE( 712) int Value7 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 712) this1 = (this1 & 16777215); HXDLIN( 712) int this5; HXDLIN( 712) if ((Value7 > 255)) { HXLINE( 712) this5 = 255; } else { HXLINE( 712) if ((Value7 < 0)) { HXLINE( 712) this5 = 0; } else { HXLINE( 712) this5 = Value7; } } HXDLIN( 712) this1 = (this1 | (this5 << 24)); } } HXLINE( 713) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_yellow,return ) Float FlxColor_Impl__obj::set_black(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_717_set_black) HXLINE( 718) { HXLINE( 718) Float Magenta = (((( (Float)(1) ) - (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 718) Float Yellow = (((( (Float)(1) ) - (( (Float)((this1 & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); HXDLIN( 718) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 718) { HXLINE( 718) Float Value1 = ((( (Float)(1) ) - (((( (Float)(1) ) - (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) ))) - (( (Float)(1) ) - ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))) * (( (Float)(1) ) - Value)); HXDLIN( 718) { HXLINE( 718) int Value2 = ::Math_obj::round((Value1 * ( (Float)(255) ))); HXDLIN( 718) this1 = (this1 & -16711681); HXDLIN( 718) int this2; HXDLIN( 718) if ((Value2 > 255)) { HXLINE( 718) this2 = 255; } else { HXLINE( 718) if ((Value2 < 0)) { HXLINE( 718) this2 = 0; } else { HXLINE( 718) this2 = Value2; } } HXDLIN( 718) this1 = (this1 | (this2 << 16)); } } HXDLIN( 718) { HXLINE( 718) Float Value3 = ((( (Float)(1) ) - Magenta) * (( (Float)(1) ) - Value)); HXDLIN( 718) { HXLINE( 718) int Value4 = ::Math_obj::round((Value3 * ( (Float)(255) ))); HXDLIN( 718) this1 = (this1 & -65281); HXDLIN( 718) int this3; HXDLIN( 718) if ((Value4 > 255)) { HXLINE( 718) this3 = 255; } else { HXLINE( 718) if ((Value4 < 0)) { HXLINE( 718) this3 = 0; } else { HXLINE( 718) this3 = Value4; } } HXDLIN( 718) this1 = (this1 | (this3 << 8)); } } HXDLIN( 718) { HXLINE( 718) Float Value5 = ((( (Float)(1) ) - Yellow) * (( (Float)(1) ) - Value)); HXDLIN( 718) { HXLINE( 718) int Value6 = ::Math_obj::round((Value5 * ( (Float)(255) ))); HXDLIN( 718) this1 = (this1 & -256); HXDLIN( 718) int this4; HXDLIN( 718) if ((Value6 > 255)) { HXLINE( 718) this4 = 255; } else { HXLINE( 718) if ((Value6 < 0)) { HXLINE( 718) this4 = 0; } else { HXLINE( 718) this4 = Value6; } } HXDLIN( 718) this1 = (this1 | this4); } } HXDLIN( 718) { HXLINE( 718) int Value7 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 718) this1 = (this1 & 16777215); HXDLIN( 718) int this5; HXDLIN( 718) if ((Value7 > 255)) { HXLINE( 718) this5 = 255; } else { HXLINE( 718) if ((Value7 < 0)) { HXLINE( 718) this5 = 0; } else { HXLINE( 718) this5 = Value7; } } HXDLIN( 718) this1 = (this1 | (this5 << 24)); } } HXLINE( 719) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_black,return ) Float FlxColor_Impl__obj::get_hue(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_723_get_hue) HXLINE( 724) Float hueRad = ::Math_obj::atan2((::Math_obj::sqrt(( (Float)(3) )) * ((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )) - (( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(((( (Float)(2) ) * (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) ))) - (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) ))) - (( (Float)((this1 & 255)) ) / ( (Float)(255) )))); HXLINE( 725) Float hue = ( (Float)(0) ); HXLINE( 726) if ((hueRad != 0)) { HXLINE( 728) hue = ((( (Float)(180) ) / ::Math_obj::PI) * ::Math_obj::atan2((::Math_obj::sqrt(( (Float)(3) )) * ((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )) - (( (Float)((this1 & 255)) ) / ( (Float)(255) )))),(((( (Float)(2) ) * (( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) ))) - (( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) ))) - (( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); } HXLINE( 731) if ((hue < 0)) { HXLINE( 731) return (hue + 360); } else { HXLINE( 731) return hue; } HXDLIN( 731) return ((Float)0.); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_hue,return ) Float FlxColor_Impl__obj::get_brightness(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_736_get_brightness) HXDLIN( 736) return ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_brightness,return ) Float FlxColor_Impl__obj::get_saturation(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_741_get_saturation) HXDLIN( 741) return ((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_saturation,return ) Float FlxColor_Impl__obj::get_lightness(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_746_get_lightness) HXDLIN( 746) return ((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) + ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ( (Float)(2) )); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,get_lightness,return ) Float FlxColor_Impl__obj::set_hue(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_750_set_hue) HXLINE( 751) { HXLINE( 751) Float Brightness = ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))); HXDLIN( 751) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 751) Float chroma = (Brightness * ((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))); HXDLIN( 751) Float match = (Brightness - chroma); HXDLIN( 751) { HXLINE( 751) Float Hue = Value; HXDLIN( 751) Float Chroma = chroma; HXDLIN( 751) Hue = ::hx::Mod(Hue,360); HXDLIN( 751) Float hueD = (Hue / ( (Float)(60) )); HXDLIN( 751) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 751) Chroma = (Chroma + match); HXDLIN( 751) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 751) { HXLINE( 751) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -16711681); HXDLIN( 751) int this2; HXDLIN( 751) if ((Value > 255)) { HXLINE( 751) this2 = 255; } else { HXLINE( 751) if ((Value < 0)) { HXLINE( 751) this2 = 0; } else { HXLINE( 751) this2 = Value; } } HXDLIN( 751) this1 = (this1 | (this2 << 16)); } HXDLIN( 751) { HXLINE( 751) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -65281); HXDLIN( 751) int this3; HXDLIN( 751) if ((Value1 > 255)) { HXLINE( 751) this3 = 255; } else { HXLINE( 751) if ((Value1 < 0)) { HXLINE( 751) this3 = 0; } else { HXLINE( 751) this3 = Value1; } } HXDLIN( 751) this1 = (this1 | (this3 << 8)); } HXDLIN( 751) { HXLINE( 751) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -256); HXDLIN( 751) int this4; HXDLIN( 751) if ((Value2 > 255)) { HXLINE( 751) this4 = 255; } else { HXLINE( 751) if ((Value2 < 0)) { HXLINE( 751) this4 = 0; } else { HXLINE( 751) this4 = Value2; } } HXDLIN( 751) this1 = (this1 | this4); } HXDLIN( 751) { HXLINE( 751) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & 16777215); HXDLIN( 751) int this5; HXDLIN( 751) if ((Value3 > 255)) { HXLINE( 751) this5 = 255; } else { HXLINE( 751) if ((Value3 < 0)) { HXLINE( 751) this5 = 0; } else { HXLINE( 751) this5 = Value3; } } HXDLIN( 751) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 751) { HXLINE( 751) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -16711681); HXDLIN( 751) int this2; HXDLIN( 751) if ((Value > 255)) { HXLINE( 751) this2 = 255; } else { HXLINE( 751) if ((Value < 0)) { HXLINE( 751) this2 = 0; } else { HXLINE( 751) this2 = Value; } } HXDLIN( 751) this1 = (this1 | (this2 << 16)); } HXDLIN( 751) { HXLINE( 751) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -65281); HXDLIN( 751) int this3; HXDLIN( 751) if ((Value1 > 255)) { HXLINE( 751) this3 = 255; } else { HXLINE( 751) if ((Value1 < 0)) { HXLINE( 751) this3 = 0; } else { HXLINE( 751) this3 = Value1; } } HXDLIN( 751) this1 = (this1 | (this3 << 8)); } HXDLIN( 751) { HXLINE( 751) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -256); HXDLIN( 751) int this4; HXDLIN( 751) if ((Value2 > 255)) { HXLINE( 751) this4 = 255; } else { HXLINE( 751) if ((Value2 < 0)) { HXLINE( 751) this4 = 0; } else { HXLINE( 751) this4 = Value2; } } HXDLIN( 751) this1 = (this1 | this4); } HXDLIN( 751) { HXLINE( 751) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & 16777215); HXDLIN( 751) int this5; HXDLIN( 751) if ((Value3 > 255)) { HXLINE( 751) this5 = 255; } else { HXLINE( 751) if ((Value3 < 0)) { HXLINE( 751) this5 = 0; } else { HXLINE( 751) this5 = Value3; } } HXDLIN( 751) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 751) { HXLINE( 751) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -16711681); HXDLIN( 751) int this2; HXDLIN( 751) if ((Value > 255)) { HXLINE( 751) this2 = 255; } else { HXLINE( 751) if ((Value < 0)) { HXLINE( 751) this2 = 0; } else { HXLINE( 751) this2 = Value; } } HXDLIN( 751) this1 = (this1 | (this2 << 16)); } HXDLIN( 751) { HXLINE( 751) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -65281); HXDLIN( 751) int this3; HXDLIN( 751) if ((Value1 > 255)) { HXLINE( 751) this3 = 255; } else { HXLINE( 751) if ((Value1 < 0)) { HXLINE( 751) this3 = 0; } else { HXLINE( 751) this3 = Value1; } } HXDLIN( 751) this1 = (this1 | (this3 << 8)); } HXDLIN( 751) { HXLINE( 751) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -256); HXDLIN( 751) int this4; HXDLIN( 751) if ((Value2 > 255)) { HXLINE( 751) this4 = 255; } else { HXLINE( 751) if ((Value2 < 0)) { HXLINE( 751) this4 = 0; } else { HXLINE( 751) this4 = Value2; } } HXDLIN( 751) this1 = (this1 | this4); } HXDLIN( 751) { HXLINE( 751) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & 16777215); HXDLIN( 751) int this5; HXDLIN( 751) if ((Value3 > 255)) { HXLINE( 751) this5 = 255; } else { HXLINE( 751) if ((Value3 < 0)) { HXLINE( 751) this5 = 0; } else { HXLINE( 751) this5 = Value3; } } HXDLIN( 751) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 751) { HXLINE( 751) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -16711681); HXDLIN( 751) int this2; HXDLIN( 751) if ((Value > 255)) { HXLINE( 751) this2 = 255; } else { HXLINE( 751) if ((Value < 0)) { HXLINE( 751) this2 = 0; } else { HXLINE( 751) this2 = Value; } } HXDLIN( 751) this1 = (this1 | (this2 << 16)); } HXDLIN( 751) { HXLINE( 751) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -65281); HXDLIN( 751) int this3; HXDLIN( 751) if ((Value1 > 255)) { HXLINE( 751) this3 = 255; } else { HXLINE( 751) if ((Value1 < 0)) { HXLINE( 751) this3 = 0; } else { HXLINE( 751) this3 = Value1; } } HXDLIN( 751) this1 = (this1 | (this3 << 8)); } HXDLIN( 751) { HXLINE( 751) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -256); HXDLIN( 751) int this4; HXDLIN( 751) if ((Value2 > 255)) { HXLINE( 751) this4 = 255; } else { HXLINE( 751) if ((Value2 < 0)) { HXLINE( 751) this4 = 0; } else { HXLINE( 751) this4 = Value2; } } HXDLIN( 751) this1 = (this1 | this4); } HXDLIN( 751) { HXLINE( 751) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & 16777215); HXDLIN( 751) int this5; HXDLIN( 751) if ((Value3 > 255)) { HXLINE( 751) this5 = 255; } else { HXLINE( 751) if ((Value3 < 0)) { HXLINE( 751) this5 = 0; } else { HXLINE( 751) this5 = Value3; } } HXDLIN( 751) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 751) { HXLINE( 751) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -16711681); HXDLIN( 751) int this2; HXDLIN( 751) if ((Value > 255)) { HXLINE( 751) this2 = 255; } else { HXLINE( 751) if ((Value < 0)) { HXLINE( 751) this2 = 0; } else { HXLINE( 751) this2 = Value; } } HXDLIN( 751) this1 = (this1 | (this2 << 16)); } HXDLIN( 751) { HXLINE( 751) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -65281); HXDLIN( 751) int this3; HXDLIN( 751) if ((Value1 > 255)) { HXLINE( 751) this3 = 255; } else { HXLINE( 751) if ((Value1 < 0)) { HXLINE( 751) this3 = 0; } else { HXLINE( 751) this3 = Value1; } } HXDLIN( 751) this1 = (this1 | (this3 << 8)); } HXDLIN( 751) { HXLINE( 751) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -256); HXDLIN( 751) int this4; HXDLIN( 751) if ((Value2 > 255)) { HXLINE( 751) this4 = 255; } else { HXLINE( 751) if ((Value2 < 0)) { HXLINE( 751) this4 = 0; } else { HXLINE( 751) this4 = Value2; } } HXDLIN( 751) this1 = (this1 | this4); } HXDLIN( 751) { HXLINE( 751) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & 16777215); HXDLIN( 751) int this5; HXDLIN( 751) if ((Value3 > 255)) { HXLINE( 751) this5 = 255; } else { HXLINE( 751) if ((Value3 < 0)) { HXLINE( 751) this5 = 0; } else { HXLINE( 751) this5 = Value3; } } HXDLIN( 751) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 751) { HXLINE( 751) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -16711681); HXDLIN( 751) int this2; HXDLIN( 751) if ((Value > 255)) { HXLINE( 751) this2 = 255; } else { HXLINE( 751) if ((Value < 0)) { HXLINE( 751) this2 = 0; } else { HXLINE( 751) this2 = Value; } } HXDLIN( 751) this1 = (this1 | (this2 << 16)); } HXDLIN( 751) { HXLINE( 751) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -65281); HXDLIN( 751) int this3; HXDLIN( 751) if ((Value1 > 255)) { HXLINE( 751) this3 = 255; } else { HXLINE( 751) if ((Value1 < 0)) { HXLINE( 751) this3 = 0; } else { HXLINE( 751) this3 = Value1; } } HXDLIN( 751) this1 = (this1 | (this3 << 8)); } HXDLIN( 751) { HXLINE( 751) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & -256); HXDLIN( 751) int this4; HXDLIN( 751) if ((Value2 > 255)) { HXLINE( 751) this4 = 255; } else { HXLINE( 751) if ((Value2 < 0)) { HXLINE( 751) this4 = 0; } else { HXLINE( 751) this4 = Value2; } } HXDLIN( 751) this1 = (this1 | this4); } HXDLIN( 751) { HXLINE( 751) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 751) this1 = (this1 & 16777215); HXDLIN( 751) int this5; HXDLIN( 751) if ((Value3 > 255)) { HXLINE( 751) this5 = 255; } else { HXLINE( 751) if ((Value3 < 0)) { HXLINE( 751) this5 = 0; } else { HXLINE( 751) this5 = Value3; } } HXDLIN( 751) this1 = (this1 | (this5 << 24)); } } break; } } } HXLINE( 752) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_hue,return ) Float FlxColor_Impl__obj::set_saturation(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_756_set_saturation) HXLINE( 757) { HXLINE( 757) Float Hue = ::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1); HXDLIN( 757) Float Brightness = ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))); HXDLIN( 757) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 757) Float chroma = (Brightness * Value); HXDLIN( 757) Float match = (Brightness - chroma); HXDLIN( 757) { HXLINE( 757) Float Hue1 = Hue; HXDLIN( 757) Float Chroma = chroma; HXDLIN( 757) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 757) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 757) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 757) Chroma = (Chroma + match); HXDLIN( 757) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 757) { HXLINE( 757) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -16711681); HXDLIN( 757) int this2; HXDLIN( 757) if ((Value > 255)) { HXLINE( 757) this2 = 255; } else { HXLINE( 757) if ((Value < 0)) { HXLINE( 757) this2 = 0; } else { HXLINE( 757) this2 = Value; } } HXDLIN( 757) this1 = (this1 | (this2 << 16)); } HXDLIN( 757) { HXLINE( 757) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -65281); HXDLIN( 757) int this3; HXDLIN( 757) if ((Value1 > 255)) { HXLINE( 757) this3 = 255; } else { HXLINE( 757) if ((Value1 < 0)) { HXLINE( 757) this3 = 0; } else { HXLINE( 757) this3 = Value1; } } HXDLIN( 757) this1 = (this1 | (this3 << 8)); } HXDLIN( 757) { HXLINE( 757) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -256); HXDLIN( 757) int this4; HXDLIN( 757) if ((Value2 > 255)) { HXLINE( 757) this4 = 255; } else { HXLINE( 757) if ((Value2 < 0)) { HXLINE( 757) this4 = 0; } else { HXLINE( 757) this4 = Value2; } } HXDLIN( 757) this1 = (this1 | this4); } HXDLIN( 757) { HXLINE( 757) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & 16777215); HXDLIN( 757) int this5; HXDLIN( 757) if ((Value3 > 255)) { HXLINE( 757) this5 = 255; } else { HXLINE( 757) if ((Value3 < 0)) { HXLINE( 757) this5 = 0; } else { HXLINE( 757) this5 = Value3; } } HXDLIN( 757) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 757) { HXLINE( 757) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -16711681); HXDLIN( 757) int this2; HXDLIN( 757) if ((Value > 255)) { HXLINE( 757) this2 = 255; } else { HXLINE( 757) if ((Value < 0)) { HXLINE( 757) this2 = 0; } else { HXLINE( 757) this2 = Value; } } HXDLIN( 757) this1 = (this1 | (this2 << 16)); } HXDLIN( 757) { HXLINE( 757) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -65281); HXDLIN( 757) int this3; HXDLIN( 757) if ((Value1 > 255)) { HXLINE( 757) this3 = 255; } else { HXLINE( 757) if ((Value1 < 0)) { HXLINE( 757) this3 = 0; } else { HXLINE( 757) this3 = Value1; } } HXDLIN( 757) this1 = (this1 | (this3 << 8)); } HXDLIN( 757) { HXLINE( 757) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -256); HXDLIN( 757) int this4; HXDLIN( 757) if ((Value2 > 255)) { HXLINE( 757) this4 = 255; } else { HXLINE( 757) if ((Value2 < 0)) { HXLINE( 757) this4 = 0; } else { HXLINE( 757) this4 = Value2; } } HXDLIN( 757) this1 = (this1 | this4); } HXDLIN( 757) { HXLINE( 757) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & 16777215); HXDLIN( 757) int this5; HXDLIN( 757) if ((Value3 > 255)) { HXLINE( 757) this5 = 255; } else { HXLINE( 757) if ((Value3 < 0)) { HXLINE( 757) this5 = 0; } else { HXLINE( 757) this5 = Value3; } } HXDLIN( 757) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 757) { HXLINE( 757) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -16711681); HXDLIN( 757) int this2; HXDLIN( 757) if ((Value > 255)) { HXLINE( 757) this2 = 255; } else { HXLINE( 757) if ((Value < 0)) { HXLINE( 757) this2 = 0; } else { HXLINE( 757) this2 = Value; } } HXDLIN( 757) this1 = (this1 | (this2 << 16)); } HXDLIN( 757) { HXLINE( 757) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -65281); HXDLIN( 757) int this3; HXDLIN( 757) if ((Value1 > 255)) { HXLINE( 757) this3 = 255; } else { HXLINE( 757) if ((Value1 < 0)) { HXLINE( 757) this3 = 0; } else { HXLINE( 757) this3 = Value1; } } HXDLIN( 757) this1 = (this1 | (this3 << 8)); } HXDLIN( 757) { HXLINE( 757) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -256); HXDLIN( 757) int this4; HXDLIN( 757) if ((Value2 > 255)) { HXLINE( 757) this4 = 255; } else { HXLINE( 757) if ((Value2 < 0)) { HXLINE( 757) this4 = 0; } else { HXLINE( 757) this4 = Value2; } } HXDLIN( 757) this1 = (this1 | this4); } HXDLIN( 757) { HXLINE( 757) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & 16777215); HXDLIN( 757) int this5; HXDLIN( 757) if ((Value3 > 255)) { HXLINE( 757) this5 = 255; } else { HXLINE( 757) if ((Value3 < 0)) { HXLINE( 757) this5 = 0; } else { HXLINE( 757) this5 = Value3; } } HXDLIN( 757) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 757) { HXLINE( 757) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -16711681); HXDLIN( 757) int this2; HXDLIN( 757) if ((Value > 255)) { HXLINE( 757) this2 = 255; } else { HXLINE( 757) if ((Value < 0)) { HXLINE( 757) this2 = 0; } else { HXLINE( 757) this2 = Value; } } HXDLIN( 757) this1 = (this1 | (this2 << 16)); } HXDLIN( 757) { HXLINE( 757) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -65281); HXDLIN( 757) int this3; HXDLIN( 757) if ((Value1 > 255)) { HXLINE( 757) this3 = 255; } else { HXLINE( 757) if ((Value1 < 0)) { HXLINE( 757) this3 = 0; } else { HXLINE( 757) this3 = Value1; } } HXDLIN( 757) this1 = (this1 | (this3 << 8)); } HXDLIN( 757) { HXLINE( 757) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -256); HXDLIN( 757) int this4; HXDLIN( 757) if ((Value2 > 255)) { HXLINE( 757) this4 = 255; } else { HXLINE( 757) if ((Value2 < 0)) { HXLINE( 757) this4 = 0; } else { HXLINE( 757) this4 = Value2; } } HXDLIN( 757) this1 = (this1 | this4); } HXDLIN( 757) { HXLINE( 757) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & 16777215); HXDLIN( 757) int this5; HXDLIN( 757) if ((Value3 > 255)) { HXLINE( 757) this5 = 255; } else { HXLINE( 757) if ((Value3 < 0)) { HXLINE( 757) this5 = 0; } else { HXLINE( 757) this5 = Value3; } } HXDLIN( 757) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 757) { HXLINE( 757) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -16711681); HXDLIN( 757) int this2; HXDLIN( 757) if ((Value > 255)) { HXLINE( 757) this2 = 255; } else { HXLINE( 757) if ((Value < 0)) { HXLINE( 757) this2 = 0; } else { HXLINE( 757) this2 = Value; } } HXDLIN( 757) this1 = (this1 | (this2 << 16)); } HXDLIN( 757) { HXLINE( 757) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -65281); HXDLIN( 757) int this3; HXDLIN( 757) if ((Value1 > 255)) { HXLINE( 757) this3 = 255; } else { HXLINE( 757) if ((Value1 < 0)) { HXLINE( 757) this3 = 0; } else { HXLINE( 757) this3 = Value1; } } HXDLIN( 757) this1 = (this1 | (this3 << 8)); } HXDLIN( 757) { HXLINE( 757) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -256); HXDLIN( 757) int this4; HXDLIN( 757) if ((Value2 > 255)) { HXLINE( 757) this4 = 255; } else { HXLINE( 757) if ((Value2 < 0)) { HXLINE( 757) this4 = 0; } else { HXLINE( 757) this4 = Value2; } } HXDLIN( 757) this1 = (this1 | this4); } HXDLIN( 757) { HXLINE( 757) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & 16777215); HXDLIN( 757) int this5; HXDLIN( 757) if ((Value3 > 255)) { HXLINE( 757) this5 = 255; } else { HXLINE( 757) if ((Value3 < 0)) { HXLINE( 757) this5 = 0; } else { HXLINE( 757) this5 = Value3; } } HXDLIN( 757) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 757) { HXLINE( 757) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -16711681); HXDLIN( 757) int this2; HXDLIN( 757) if ((Value > 255)) { HXLINE( 757) this2 = 255; } else { HXLINE( 757) if ((Value < 0)) { HXLINE( 757) this2 = 0; } else { HXLINE( 757) this2 = Value; } } HXDLIN( 757) this1 = (this1 | (this2 << 16)); } HXDLIN( 757) { HXLINE( 757) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -65281); HXDLIN( 757) int this3; HXDLIN( 757) if ((Value1 > 255)) { HXLINE( 757) this3 = 255; } else { HXLINE( 757) if ((Value1 < 0)) { HXLINE( 757) this3 = 0; } else { HXLINE( 757) this3 = Value1; } } HXDLIN( 757) this1 = (this1 | (this3 << 8)); } HXDLIN( 757) { HXLINE( 757) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & -256); HXDLIN( 757) int this4; HXDLIN( 757) if ((Value2 > 255)) { HXLINE( 757) this4 = 255; } else { HXLINE( 757) if ((Value2 < 0)) { HXLINE( 757) this4 = 0; } else { HXLINE( 757) this4 = Value2; } } HXDLIN( 757) this1 = (this1 | this4); } HXDLIN( 757) { HXLINE( 757) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 757) this1 = (this1 & 16777215); HXDLIN( 757) int this5; HXDLIN( 757) if ((Value3 > 255)) { HXLINE( 757) this5 = 255; } else { HXLINE( 757) if ((Value3 < 0)) { HXLINE( 757) this5 = 0; } else { HXLINE( 757) this5 = Value3; } } HXDLIN( 757) this1 = (this1 | (this5 << 24)); } } break; } } } HXLINE( 758) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_saturation,return ) Float FlxColor_Impl__obj::set_brightness(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_762_set_brightness) HXLINE( 763) { HXLINE( 763) Float Hue = ::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1); HXDLIN( 763) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 763) Float chroma = (Value * ((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))); HXDLIN( 763) Float match = (Value - chroma); HXDLIN( 763) { HXLINE( 763) Float Hue1 = Hue; HXDLIN( 763) Float Chroma = chroma; HXDLIN( 763) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 763) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 763) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 763) Chroma = (Chroma + match); HXDLIN( 763) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 763) { HXLINE( 763) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -16711681); HXDLIN( 763) int this2; HXDLIN( 763) if ((Value > 255)) { HXLINE( 763) this2 = 255; } else { HXLINE( 763) if ((Value < 0)) { HXLINE( 763) this2 = 0; } else { HXLINE( 763) this2 = Value; } } HXDLIN( 763) this1 = (this1 | (this2 << 16)); } HXDLIN( 763) { HXLINE( 763) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -65281); HXDLIN( 763) int this3; HXDLIN( 763) if ((Value1 > 255)) { HXLINE( 763) this3 = 255; } else { HXLINE( 763) if ((Value1 < 0)) { HXLINE( 763) this3 = 0; } else { HXLINE( 763) this3 = Value1; } } HXDLIN( 763) this1 = (this1 | (this3 << 8)); } HXDLIN( 763) { HXLINE( 763) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -256); HXDLIN( 763) int this4; HXDLIN( 763) if ((Value2 > 255)) { HXLINE( 763) this4 = 255; } else { HXLINE( 763) if ((Value2 < 0)) { HXLINE( 763) this4 = 0; } else { HXLINE( 763) this4 = Value2; } } HXDLIN( 763) this1 = (this1 | this4); } HXDLIN( 763) { HXLINE( 763) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & 16777215); HXDLIN( 763) int this5; HXDLIN( 763) if ((Value3 > 255)) { HXLINE( 763) this5 = 255; } else { HXLINE( 763) if ((Value3 < 0)) { HXLINE( 763) this5 = 0; } else { HXLINE( 763) this5 = Value3; } } HXDLIN( 763) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 763) { HXLINE( 763) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -16711681); HXDLIN( 763) int this2; HXDLIN( 763) if ((Value > 255)) { HXLINE( 763) this2 = 255; } else { HXLINE( 763) if ((Value < 0)) { HXLINE( 763) this2 = 0; } else { HXLINE( 763) this2 = Value; } } HXDLIN( 763) this1 = (this1 | (this2 << 16)); } HXDLIN( 763) { HXLINE( 763) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -65281); HXDLIN( 763) int this3; HXDLIN( 763) if ((Value1 > 255)) { HXLINE( 763) this3 = 255; } else { HXLINE( 763) if ((Value1 < 0)) { HXLINE( 763) this3 = 0; } else { HXLINE( 763) this3 = Value1; } } HXDLIN( 763) this1 = (this1 | (this3 << 8)); } HXDLIN( 763) { HXLINE( 763) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -256); HXDLIN( 763) int this4; HXDLIN( 763) if ((Value2 > 255)) { HXLINE( 763) this4 = 255; } else { HXLINE( 763) if ((Value2 < 0)) { HXLINE( 763) this4 = 0; } else { HXLINE( 763) this4 = Value2; } } HXDLIN( 763) this1 = (this1 | this4); } HXDLIN( 763) { HXLINE( 763) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & 16777215); HXDLIN( 763) int this5; HXDLIN( 763) if ((Value3 > 255)) { HXLINE( 763) this5 = 255; } else { HXLINE( 763) if ((Value3 < 0)) { HXLINE( 763) this5 = 0; } else { HXLINE( 763) this5 = Value3; } } HXDLIN( 763) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 763) { HXLINE( 763) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -16711681); HXDLIN( 763) int this2; HXDLIN( 763) if ((Value > 255)) { HXLINE( 763) this2 = 255; } else { HXLINE( 763) if ((Value < 0)) { HXLINE( 763) this2 = 0; } else { HXLINE( 763) this2 = Value; } } HXDLIN( 763) this1 = (this1 | (this2 << 16)); } HXDLIN( 763) { HXLINE( 763) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -65281); HXDLIN( 763) int this3; HXDLIN( 763) if ((Value1 > 255)) { HXLINE( 763) this3 = 255; } else { HXLINE( 763) if ((Value1 < 0)) { HXLINE( 763) this3 = 0; } else { HXLINE( 763) this3 = Value1; } } HXDLIN( 763) this1 = (this1 | (this3 << 8)); } HXDLIN( 763) { HXLINE( 763) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -256); HXDLIN( 763) int this4; HXDLIN( 763) if ((Value2 > 255)) { HXLINE( 763) this4 = 255; } else { HXLINE( 763) if ((Value2 < 0)) { HXLINE( 763) this4 = 0; } else { HXLINE( 763) this4 = Value2; } } HXDLIN( 763) this1 = (this1 | this4); } HXDLIN( 763) { HXLINE( 763) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & 16777215); HXDLIN( 763) int this5; HXDLIN( 763) if ((Value3 > 255)) { HXLINE( 763) this5 = 255; } else { HXLINE( 763) if ((Value3 < 0)) { HXLINE( 763) this5 = 0; } else { HXLINE( 763) this5 = Value3; } } HXDLIN( 763) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 763) { HXLINE( 763) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -16711681); HXDLIN( 763) int this2; HXDLIN( 763) if ((Value > 255)) { HXLINE( 763) this2 = 255; } else { HXLINE( 763) if ((Value < 0)) { HXLINE( 763) this2 = 0; } else { HXLINE( 763) this2 = Value; } } HXDLIN( 763) this1 = (this1 | (this2 << 16)); } HXDLIN( 763) { HXLINE( 763) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -65281); HXDLIN( 763) int this3; HXDLIN( 763) if ((Value1 > 255)) { HXLINE( 763) this3 = 255; } else { HXLINE( 763) if ((Value1 < 0)) { HXLINE( 763) this3 = 0; } else { HXLINE( 763) this3 = Value1; } } HXDLIN( 763) this1 = (this1 | (this3 << 8)); } HXDLIN( 763) { HXLINE( 763) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -256); HXDLIN( 763) int this4; HXDLIN( 763) if ((Value2 > 255)) { HXLINE( 763) this4 = 255; } else { HXLINE( 763) if ((Value2 < 0)) { HXLINE( 763) this4 = 0; } else { HXLINE( 763) this4 = Value2; } } HXDLIN( 763) this1 = (this1 | this4); } HXDLIN( 763) { HXLINE( 763) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & 16777215); HXDLIN( 763) int this5; HXDLIN( 763) if ((Value3 > 255)) { HXLINE( 763) this5 = 255; } else { HXLINE( 763) if ((Value3 < 0)) { HXLINE( 763) this5 = 0; } else { HXLINE( 763) this5 = Value3; } } HXDLIN( 763) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 763) { HXLINE( 763) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -16711681); HXDLIN( 763) int this2; HXDLIN( 763) if ((Value > 255)) { HXLINE( 763) this2 = 255; } else { HXLINE( 763) if ((Value < 0)) { HXLINE( 763) this2 = 0; } else { HXLINE( 763) this2 = Value; } } HXDLIN( 763) this1 = (this1 | (this2 << 16)); } HXDLIN( 763) { HXLINE( 763) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -65281); HXDLIN( 763) int this3; HXDLIN( 763) if ((Value1 > 255)) { HXLINE( 763) this3 = 255; } else { HXLINE( 763) if ((Value1 < 0)) { HXLINE( 763) this3 = 0; } else { HXLINE( 763) this3 = Value1; } } HXDLIN( 763) this1 = (this1 | (this3 << 8)); } HXDLIN( 763) { HXLINE( 763) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -256); HXDLIN( 763) int this4; HXDLIN( 763) if ((Value2 > 255)) { HXLINE( 763) this4 = 255; } else { HXLINE( 763) if ((Value2 < 0)) { HXLINE( 763) this4 = 0; } else { HXLINE( 763) this4 = Value2; } } HXDLIN( 763) this1 = (this1 | this4); } HXDLIN( 763) { HXLINE( 763) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & 16777215); HXDLIN( 763) int this5; HXDLIN( 763) if ((Value3 > 255)) { HXLINE( 763) this5 = 255; } else { HXLINE( 763) if ((Value3 < 0)) { HXLINE( 763) this5 = 0; } else { HXLINE( 763) this5 = Value3; } } HXDLIN( 763) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 763) { HXLINE( 763) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -16711681); HXDLIN( 763) int this2; HXDLIN( 763) if ((Value > 255)) { HXLINE( 763) this2 = 255; } else { HXLINE( 763) if ((Value < 0)) { HXLINE( 763) this2 = 0; } else { HXLINE( 763) this2 = Value; } } HXDLIN( 763) this1 = (this1 | (this2 << 16)); } HXDLIN( 763) { HXLINE( 763) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -65281); HXDLIN( 763) int this3; HXDLIN( 763) if ((Value1 > 255)) { HXLINE( 763) this3 = 255; } else { HXLINE( 763) if ((Value1 < 0)) { HXLINE( 763) this3 = 0; } else { HXLINE( 763) this3 = Value1; } } HXDLIN( 763) this1 = (this1 | (this3 << 8)); } HXDLIN( 763) { HXLINE( 763) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & -256); HXDLIN( 763) int this4; HXDLIN( 763) if ((Value2 > 255)) { HXLINE( 763) this4 = 255; } else { HXLINE( 763) if ((Value2 < 0)) { HXLINE( 763) this4 = 0; } else { HXLINE( 763) this4 = Value2; } } HXDLIN( 763) this1 = (this1 | this4); } HXDLIN( 763) { HXLINE( 763) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 763) this1 = (this1 & 16777215); HXDLIN( 763) int this5; HXDLIN( 763) if ((Value3 > 255)) { HXLINE( 763) this5 = 255; } else { HXLINE( 763) if ((Value3 < 0)) { HXLINE( 763) this5 = 0; } else { HXLINE( 763) this5 = Value3; } } HXDLIN( 763) this1 = (this1 | (this5 << 24)); } } break; } } } HXLINE( 764) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_brightness,return ) Float FlxColor_Impl__obj::set_lightness(int this1,Float Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_768_set_lightness) HXLINE( 769) { HXLINE( 769) Float Hue = ::flixel::util::_FlxColor::FlxColor_Impl__obj::get_hue(this1); HXDLIN( 769) Float Alpha = (( (Float)(((this1 >> 24) & 255)) ) / ( (Float)(255) )); HXDLIN( 769) Float chroma = ((( (Float)(1) ) - ::Math_obj::abs(((( (Float)(2) ) * Value) - ( (Float)(1) )))) * ((::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))) - ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) ))))) / ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))))); HXDLIN( 769) Float match = (Value - (chroma / ( (Float)(2) ))); HXDLIN( 769) { HXLINE( 769) Float Hue1 = Hue; HXDLIN( 769) Float Chroma = chroma; HXDLIN( 769) Hue1 = ::hx::Mod(Hue1,360); HXDLIN( 769) Float hueD = (Hue1 / ( (Float)(60) )); HXDLIN( 769) Float mid = ((Chroma * (( (Float)(1) ) - ::Math_obj::abs((::hx::Mod(hueD,2) - ( (Float)(1) ))))) + match); HXDLIN( 769) Chroma = (Chroma + match); HXDLIN( 769) switch((int)(::Std_obj::_hx_int(hueD))){ case (int)0: { HXLINE( 769) { HXLINE( 769) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -16711681); HXDLIN( 769) int this2; HXDLIN( 769) if ((Value > 255)) { HXLINE( 769) this2 = 255; } else { HXLINE( 769) if ((Value < 0)) { HXLINE( 769) this2 = 0; } else { HXLINE( 769) this2 = Value; } } HXDLIN( 769) this1 = (this1 | (this2 << 16)); } HXDLIN( 769) { HXLINE( 769) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -65281); HXDLIN( 769) int this3; HXDLIN( 769) if ((Value1 > 255)) { HXLINE( 769) this3 = 255; } else { HXLINE( 769) if ((Value1 < 0)) { HXLINE( 769) this3 = 0; } else { HXLINE( 769) this3 = Value1; } } HXDLIN( 769) this1 = (this1 | (this3 << 8)); } HXDLIN( 769) { HXLINE( 769) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -256); HXDLIN( 769) int this4; HXDLIN( 769) if ((Value2 > 255)) { HXLINE( 769) this4 = 255; } else { HXLINE( 769) if ((Value2 < 0)) { HXLINE( 769) this4 = 0; } else { HXLINE( 769) this4 = Value2; } } HXDLIN( 769) this1 = (this1 | this4); } HXDLIN( 769) { HXLINE( 769) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & 16777215); HXDLIN( 769) int this5; HXDLIN( 769) if ((Value3 > 255)) { HXLINE( 769) this5 = 255; } else { HXLINE( 769) if ((Value3 < 0)) { HXLINE( 769) this5 = 0; } else { HXLINE( 769) this5 = Value3; } } HXDLIN( 769) this1 = (this1 | (this5 << 24)); } } break; case (int)1: { HXLINE( 769) { HXLINE( 769) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -16711681); HXDLIN( 769) int this2; HXDLIN( 769) if ((Value > 255)) { HXLINE( 769) this2 = 255; } else { HXLINE( 769) if ((Value < 0)) { HXLINE( 769) this2 = 0; } else { HXLINE( 769) this2 = Value; } } HXDLIN( 769) this1 = (this1 | (this2 << 16)); } HXDLIN( 769) { HXLINE( 769) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -65281); HXDLIN( 769) int this3; HXDLIN( 769) if ((Value1 > 255)) { HXLINE( 769) this3 = 255; } else { HXLINE( 769) if ((Value1 < 0)) { HXLINE( 769) this3 = 0; } else { HXLINE( 769) this3 = Value1; } } HXDLIN( 769) this1 = (this1 | (this3 << 8)); } HXDLIN( 769) { HXLINE( 769) int Value2 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -256); HXDLIN( 769) int this4; HXDLIN( 769) if ((Value2 > 255)) { HXLINE( 769) this4 = 255; } else { HXLINE( 769) if ((Value2 < 0)) { HXLINE( 769) this4 = 0; } else { HXLINE( 769) this4 = Value2; } } HXDLIN( 769) this1 = (this1 | this4); } HXDLIN( 769) { HXLINE( 769) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & 16777215); HXDLIN( 769) int this5; HXDLIN( 769) if ((Value3 > 255)) { HXLINE( 769) this5 = 255; } else { HXLINE( 769) if ((Value3 < 0)) { HXLINE( 769) this5 = 0; } else { HXLINE( 769) this5 = Value3; } } HXDLIN( 769) this1 = (this1 | (this5 << 24)); } } break; case (int)2: { HXLINE( 769) { HXLINE( 769) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -16711681); HXDLIN( 769) int this2; HXDLIN( 769) if ((Value > 255)) { HXLINE( 769) this2 = 255; } else { HXLINE( 769) if ((Value < 0)) { HXLINE( 769) this2 = 0; } else { HXLINE( 769) this2 = Value; } } HXDLIN( 769) this1 = (this1 | (this2 << 16)); } HXDLIN( 769) { HXLINE( 769) int Value1 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -65281); HXDLIN( 769) int this3; HXDLIN( 769) if ((Value1 > 255)) { HXLINE( 769) this3 = 255; } else { HXLINE( 769) if ((Value1 < 0)) { HXLINE( 769) this3 = 0; } else { HXLINE( 769) this3 = Value1; } } HXDLIN( 769) this1 = (this1 | (this3 << 8)); } HXDLIN( 769) { HXLINE( 769) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -256); HXDLIN( 769) int this4; HXDLIN( 769) if ((Value2 > 255)) { HXLINE( 769) this4 = 255; } else { HXLINE( 769) if ((Value2 < 0)) { HXLINE( 769) this4 = 0; } else { HXLINE( 769) this4 = Value2; } } HXDLIN( 769) this1 = (this1 | this4); } HXDLIN( 769) { HXLINE( 769) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & 16777215); HXDLIN( 769) int this5; HXDLIN( 769) if ((Value3 > 255)) { HXLINE( 769) this5 = 255; } else { HXLINE( 769) if ((Value3 < 0)) { HXLINE( 769) this5 = 0; } else { HXLINE( 769) this5 = Value3; } } HXDLIN( 769) this1 = (this1 | (this5 << 24)); } } break; case (int)3: { HXLINE( 769) { HXLINE( 769) int Value = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -16711681); HXDLIN( 769) int this2; HXDLIN( 769) if ((Value > 255)) { HXLINE( 769) this2 = 255; } else { HXLINE( 769) if ((Value < 0)) { HXLINE( 769) this2 = 0; } else { HXLINE( 769) this2 = Value; } } HXDLIN( 769) this1 = (this1 | (this2 << 16)); } HXDLIN( 769) { HXLINE( 769) int Value1 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -65281); HXDLIN( 769) int this3; HXDLIN( 769) if ((Value1 > 255)) { HXLINE( 769) this3 = 255; } else { HXLINE( 769) if ((Value1 < 0)) { HXLINE( 769) this3 = 0; } else { HXLINE( 769) this3 = Value1; } } HXDLIN( 769) this1 = (this1 | (this3 << 8)); } HXDLIN( 769) { HXLINE( 769) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -256); HXDLIN( 769) int this4; HXDLIN( 769) if ((Value2 > 255)) { HXLINE( 769) this4 = 255; } else { HXLINE( 769) if ((Value2 < 0)) { HXLINE( 769) this4 = 0; } else { HXLINE( 769) this4 = Value2; } } HXDLIN( 769) this1 = (this1 | this4); } HXDLIN( 769) { HXLINE( 769) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & 16777215); HXDLIN( 769) int this5; HXDLIN( 769) if ((Value3 > 255)) { HXLINE( 769) this5 = 255; } else { HXLINE( 769) if ((Value3 < 0)) { HXLINE( 769) this5 = 0; } else { HXLINE( 769) this5 = Value3; } } HXDLIN( 769) this1 = (this1 | (this5 << 24)); } } break; case (int)4: { HXLINE( 769) { HXLINE( 769) int Value = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -16711681); HXDLIN( 769) int this2; HXDLIN( 769) if ((Value > 255)) { HXLINE( 769) this2 = 255; } else { HXLINE( 769) if ((Value < 0)) { HXLINE( 769) this2 = 0; } else { HXLINE( 769) this2 = Value; } } HXDLIN( 769) this1 = (this1 | (this2 << 16)); } HXDLIN( 769) { HXLINE( 769) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -65281); HXDLIN( 769) int this3; HXDLIN( 769) if ((Value1 > 255)) { HXLINE( 769) this3 = 255; } else { HXLINE( 769) if ((Value1 < 0)) { HXLINE( 769) this3 = 0; } else { HXLINE( 769) this3 = Value1; } } HXDLIN( 769) this1 = (this1 | (this3 << 8)); } HXDLIN( 769) { HXLINE( 769) int Value2 = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -256); HXDLIN( 769) int this4; HXDLIN( 769) if ((Value2 > 255)) { HXLINE( 769) this4 = 255; } else { HXLINE( 769) if ((Value2 < 0)) { HXLINE( 769) this4 = 0; } else { HXLINE( 769) this4 = Value2; } } HXDLIN( 769) this1 = (this1 | this4); } HXDLIN( 769) { HXLINE( 769) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & 16777215); HXDLIN( 769) int this5; HXDLIN( 769) if ((Value3 > 255)) { HXLINE( 769) this5 = 255; } else { HXLINE( 769) if ((Value3 < 0)) { HXLINE( 769) this5 = 0; } else { HXLINE( 769) this5 = Value3; } } HXDLIN( 769) this1 = (this1 | (this5 << 24)); } } break; case (int)5: { HXLINE( 769) { HXLINE( 769) int Value = ::Math_obj::round((Chroma * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -16711681); HXDLIN( 769) int this2; HXDLIN( 769) if ((Value > 255)) { HXLINE( 769) this2 = 255; } else { HXLINE( 769) if ((Value < 0)) { HXLINE( 769) this2 = 0; } else { HXLINE( 769) this2 = Value; } } HXDLIN( 769) this1 = (this1 | (this2 << 16)); } HXDLIN( 769) { HXLINE( 769) int Value1 = ::Math_obj::round((match * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -65281); HXDLIN( 769) int this3; HXDLIN( 769) if ((Value1 > 255)) { HXLINE( 769) this3 = 255; } else { HXLINE( 769) if ((Value1 < 0)) { HXLINE( 769) this3 = 0; } else { HXLINE( 769) this3 = Value1; } } HXDLIN( 769) this1 = (this1 | (this3 << 8)); } HXDLIN( 769) { HXLINE( 769) int Value2 = ::Math_obj::round((mid * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & -256); HXDLIN( 769) int this4; HXDLIN( 769) if ((Value2 > 255)) { HXLINE( 769) this4 = 255; } else { HXLINE( 769) if ((Value2 < 0)) { HXLINE( 769) this4 = 0; } else { HXLINE( 769) this4 = Value2; } } HXDLIN( 769) this1 = (this1 | this4); } HXDLIN( 769) { HXLINE( 769) int Value3 = ::Math_obj::round((Alpha * ( (Float)(255) ))); HXDLIN( 769) this1 = (this1 & 16777215); HXDLIN( 769) int this5; HXDLIN( 769) if ((Value3 > 255)) { HXLINE( 769) this5 = 255; } else { HXLINE( 769) if ((Value3 < 0)) { HXLINE( 769) this5 = 0; } else { HXLINE( 769) this5 = Value3; } } HXDLIN( 769) this1 = (this1 | (this5 << 24)); } } break; } } } HXLINE( 770) return Value; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,set_lightness,return ) Float FlxColor_Impl__obj::maxColor(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_775_maxColor) HXDLIN( 775) return ::Math_obj::max((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::max((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,maxColor,return ) Float FlxColor_Impl__obj::minColor(int this1){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_780_minColor) HXDLIN( 780) return ::Math_obj::min((( (Float)(((this1 >> 16) & 255)) ) / ( (Float)(255) )),::Math_obj::min((( (Float)(((this1 >> 8) & 255)) ) / ( (Float)(255) )),(( (Float)((this1 & 255)) ) / ( (Float)(255) )))); } STATIC_HX_DEFINE_DYNAMIC_FUNC1(FlxColor_Impl__obj,minColor,return ) int FlxColor_Impl__obj::boundChannel(int this1,int Value){ HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_785_boundChannel) HXDLIN( 785) if ((Value > 255)) { HXDLIN( 785) return 255; } else { HXDLIN( 785) if ((Value < 0)) { HXDLIN( 785) return 0; } else { HXDLIN( 785) return Value; } } HXDLIN( 785) return 0; } STATIC_HX_DEFINE_DYNAMIC_FUNC2(FlxColor_Impl__obj,boundChannel,return ) FlxColor_Impl__obj::FlxColor_Impl__obj() { } bool FlxColor_Impl__obj::__GetStatic(const ::String &inName, Dynamic &outValue, ::hx::PropertyAccess inCallProp) { switch(inName.length) { case 3: if (HX_FIELD_EQ(inName,"add") ) { outValue = add_dyn(); return true; } break; case 4: if (HX_FIELD_EQ(inName,"_new") ) { outValue = _new_dyn(); return true; } break; case 6: if (HX_FIELD_EQ(inName,"setRGB") ) { outValue = setRGB_dyn(); return true; } if (HX_FIELD_EQ(inName,"setHSB") ) { outValue = setHSB_dyn(); return true; } if (HX_FIELD_EQ(inName,"setHSL") ) { outValue = setHSL_dyn(); return true; } break; case 7: if (HX_FIELD_EQ(inName,"fromInt") ) { outValue = fromInt_dyn(); return true; } if (HX_FIELD_EQ(inName,"fromRGB") ) { outValue = fromRGB_dyn(); return true; } if (HX_FIELD_EQ(inName,"fromHSB") ) { outValue = fromHSB_dyn(); return true; } if (HX_FIELD_EQ(inName,"fromHSL") ) { outValue = fromHSL_dyn(); return true; } if (HX_FIELD_EQ(inName,"to24Bit") ) { outValue = to24Bit_dyn(); return true; } if (HX_FIELD_EQ(inName,"setCMYK") ) { outValue = setCMYK_dyn(); return true; } if (HX_FIELD_EQ(inName,"getThis") ) { outValue = getThis_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_red") ) { outValue = get_red_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_red") ) { outValue = set_red_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_hue") ) { outValue = get_hue_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_hue") ) { outValue = set_hue_dyn(); return true; } break; case 8: if (HX_FIELD_EQ(inName,"fromCMYK") ) { outValue = fromCMYK_dyn(); return true; } if (HX_FIELD_EQ(inName,"gradient") ) { outValue = gradient_dyn(); return true; } if (HX_FIELD_EQ(inName,"multiply") ) { outValue = multiply_dyn(); return true; } if (HX_FIELD_EQ(inName,"subtract") ) { outValue = subtract_dyn(); return true; } if (HX_FIELD_EQ(inName,"validate") ) { outValue = validate_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_blue") ) { outValue = get_blue_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_blue") ) { outValue = set_blue_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_cyan") ) { outValue = get_cyan_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_cyan") ) { outValue = set_cyan_dyn(); return true; } if (HX_FIELD_EQ(inName,"maxColor") ) { outValue = maxColor_dyn(); return true; } if (HX_FIELD_EQ(inName,"minColor") ) { outValue = minColor_dyn(); return true; } break; case 9: if (HX_FIELD_EQ(inName,"get_green") ) { outValue = get_green_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_alpha") ) { outValue = get_alpha_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_green") ) { outValue = set_green_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_alpha") ) { outValue = set_alpha_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_black") ) { outValue = get_black_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_black") ) { outValue = set_black_dyn(); return true; } break; case 10: if (HX_FIELD_EQ(inName,"fromString") ) { outValue = fromString_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_yellow") ) { outValue = get_yellow_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_yellow") ) { outValue = set_yellow_dyn(); return true; } break; case 11: if (HX_FIELD_EQ(inName,"interpolate") ) { outValue = interpolate_dyn(); return true; } if (HX_FIELD_EQ(inName,"toHexString") ) { outValue = toHexString_dyn(); return true; } if (HX_FIELD_EQ(inName,"toWebString") ) { outValue = toWebString_dyn(); return true; } if (HX_FIELD_EQ(inName,"getDarkened") ) { outValue = getDarkened_dyn(); return true; } if (HX_FIELD_EQ(inName,"getInverted") ) { outValue = getInverted_dyn(); return true; } if (HX_FIELD_EQ(inName,"setRGBFloat") ) { outValue = setRGBFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_magenta") ) { outValue = get_magenta_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_magenta") ) { outValue = set_magenta_dyn(); return true; } break; case 12: if (HX_FIELD_EQ(inName,"fromRGBFloat") ) { outValue = fromRGBFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"getColorInfo") ) { outValue = getColorInfo_dyn(); return true; } if (HX_FIELD_EQ(inName,"getLightened") ) { outValue = getLightened_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_redFloat") ) { outValue = get_redFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_redFloat") ) { outValue = set_redFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"boundChannel") ) { outValue = boundChannel_dyn(); return true; } break; case 13: if (HX_FIELD_EQ(inName,"get_blueFloat") ) { outValue = get_blueFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_blueFloat") ) { outValue = set_blueFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_lightness") ) { outValue = get_lightness_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_lightness") ) { outValue = set_lightness_dyn(); return true; } break; case 14: if (HX_FIELD_EQ(inName,"get_greenFloat") ) { outValue = get_greenFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_alphaFloat") ) { outValue = get_alphaFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_greenFloat") ) { outValue = set_greenFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_alphaFloat") ) { outValue = set_alphaFloat_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_brightness") ) { outValue = get_brightness_dyn(); return true; } if (HX_FIELD_EQ(inName,"get_saturation") ) { outValue = get_saturation_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_saturation") ) { outValue = set_saturation_dyn(); return true; } if (HX_FIELD_EQ(inName,"set_brightness") ) { outValue = set_brightness_dyn(); return true; } break; case 16: if (HX_FIELD_EQ(inName,"getHSBColorWheel") ) { outValue = getHSBColorWheel_dyn(); return true; } if (HX_FIELD_EQ(inName,"setHSChromaMatch") ) { outValue = setHSChromaMatch_dyn(); return true; } break; case 17: if (HX_FIELD_EQ(inName,"getTriadicHarmony") ) { outValue = getTriadicHarmony_dyn(); return true; } break; case 19: if (HX_FIELD_EQ(inName,"getAnalogousHarmony") ) { outValue = getAnalogousHarmony_dyn(); return true; } break; case 20: if (HX_FIELD_EQ(inName,"getComplementHarmony") ) { outValue = getComplementHarmony_dyn(); return true; } break; case 25: if (HX_FIELD_EQ(inName,"getSplitComplementHarmony") ) { outValue = getSplitComplementHarmony_dyn(); return true; } } return false; } #ifdef HXCPP_SCRIPTABLE static ::hx::StorageInfo *FlxColor_Impl__obj_sMemberStorageInfo = 0; static ::hx::StaticInfo FlxColor_Impl__obj_sStaticStorageInfo[] = { {::hx::fsInt,(void *) &FlxColor_Impl__obj::TRANSPARENT,HX_("TRANSPARENT",32,37,f6,f8)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::WHITE,HX_("WHITE",89,82,ab,47)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::GRAY,HX_("GRAY",e3,97,2c,2f)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::BLACK,HX_("BLACK",9f,0d,e0,32)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::GREEN,HX_("GREEN",a3,46,db,17)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::LIME,HX_("LIME",15,df,73,32)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::YELLOW,HX_("YELLOW",74,4b,df,82)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::ORANGE,HX_("ORANGE",ee,5e,3f,f8)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::RED,HX_("RED",31,75,3e,00)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::PURPLE,HX_("PURPLE",3c,a2,0c,24)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::BLUE,HX_("BLUE",9a,0a,da,2b)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::BROWN,HX_("BROWN",56,06,e2,36)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::PINK,HX_("PINK",76,ba,18,35)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::MAGENTA,HX_("MAGENTA",09,8e,71,8e)}, {::hx::fsInt,(void *) &FlxColor_Impl__obj::CYAN,HX_("CYAN",23,0d,8d,2c)}, {::hx::fsObject /* ::haxe::ds::StringMap */ ,(void *) &FlxColor_Impl__obj::colorLookup,HX_("colorLookup",3d,34,de,1b)}, {::hx::fsObject /* ::EReg */ ,(void *) &FlxColor_Impl__obj::COLOR_REGEX,HX_("COLOR_REGEX",6b,2b,e2,09)}, { ::hx::fsUnknown, 0, null()} }; #endif static void FlxColor_Impl__obj_sMarkStatics(HX_MARK_PARAMS) { HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::TRANSPARENT,"TRANSPARENT"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::WHITE,"WHITE"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::GRAY,"GRAY"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::BLACK,"BLACK"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::GREEN,"GREEN"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::LIME,"LIME"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::YELLOW,"YELLOW"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::ORANGE,"ORANGE"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::RED,"RED"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::PURPLE,"PURPLE"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::BLUE,"BLUE"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::BROWN,"BROWN"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::PINK,"PINK"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::MAGENTA,"MAGENTA"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::CYAN,"CYAN"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::colorLookup,"colorLookup"); HX_MARK_MEMBER_NAME(FlxColor_Impl__obj::COLOR_REGEX,"COLOR_REGEX"); }; #ifdef HXCPP_VISIT_ALLOCS static void FlxColor_Impl__obj_sVisitStatics(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::TRANSPARENT,"TRANSPARENT"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::WHITE,"WHITE"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::GRAY,"GRAY"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::BLACK,"BLACK"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::GREEN,"GREEN"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::LIME,"LIME"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::YELLOW,"YELLOW"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::ORANGE,"ORANGE"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::RED,"RED"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::PURPLE,"PURPLE"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::BLUE,"BLUE"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::BROWN,"BROWN"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::PINK,"PINK"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::MAGENTA,"MAGENTA"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::CYAN,"CYAN"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::colorLookup,"colorLookup"); HX_VISIT_MEMBER_NAME(FlxColor_Impl__obj::COLOR_REGEX,"COLOR_REGEX"); }; #endif ::hx::Class FlxColor_Impl__obj::__mClass; static ::String FlxColor_Impl__obj_sStaticFields[] = { HX_("TRANSPARENT",32,37,f6,f8), HX_("WHITE",89,82,ab,47), HX_("GRAY",e3,97,2c,2f), HX_("BLACK",9f,0d,e0,32), HX_("GREEN",a3,46,db,17), HX_("LIME",15,df,73,32), HX_("YELLOW",74,4b,df,82), HX_("ORANGE",ee,5e,3f,f8), HX_("RED",31,75,3e,00), HX_("PURPLE",3c,a2,0c,24), HX_("BLUE",9a,0a,da,2b), HX_("BROWN",56,06,e2,36), HX_("PINK",76,ba,18,35), HX_("MAGENTA",09,8e,71,8e), HX_("CYAN",23,0d,8d,2c), HX_("colorLookup",3d,34,de,1b), HX_("COLOR_REGEX",6b,2b,e2,09), HX_("fromInt",a5,dd,fa,57), HX_("fromRGB",c3,8f,01,58), HX_("fromRGBFloat",d9,a2,53,9a), HX_("fromCMYK",66,a9,76,9f), HX_("fromHSB",ad,03,fa,57), HX_("fromHSL",b7,03,fa,57), HX_("fromString",db,2d,74,54), HX_("getHSBColorWheel",99,27,93,2f), HX_("interpolate",c1,d4,32,1f), HX_("gradient",f0,39,3f,2a), HX_("multiply",24,e2,8c,9a), HX_("add",21,f2,49,00), HX_("subtract",14,75,11,f8), HX_("getComplementHarmony",4a,20,b6,d3), HX_("getAnalogousHarmony",df,79,e2,a4), HX_("getSplitComplementHarmony",bc,be,30,75), HX_("getTriadicHarmony",f4,5d,d3,ab), HX_("to24Bit",d0,66,f1,25), HX_("toHexString",11,69,b3,6d), HX_("toWebString",8a,5b,00,37), HX_("getColorInfo",fb,5f,7f,30), HX_("getDarkened",34,e7,ef,b2), HX_("getLightened",68,ad,b1,e0), HX_("getInverted",ab,73,25,1b), HX_("setRGB",8b,4c,6e,6f), HX_("setRGBFloat",11,91,9d,2a), HX_("setCMYK",9e,1b,2f,07), HX_("setHSB",75,c0,66,6f), HX_("setHSL",7f,c0,66,6f), HX_("setHSChromaMatch",c2,69,0f,10), HX_("_new",61,15,1f,3f), HX_("getThis",14,b6,7e,1f), HX_("validate",96,d0,e3,04), HX_("get_red",e8,a1,cb,26), HX_("get_green",1a,6b,96,dd), HX_("get_blue",23,fe,d3,c0), HX_("get_alpha",b5,03,40,65), HX_("get_redFloat",94,aa,fc,26), HX_("get_greenFloat",22,4c,51,4d), HX_("get_blueFloat",79,18,35,9c), HX_("get_alphaFloat",a7,a1,31,99), HX_("set_red",f4,32,cd,19), HX_("set_green",26,57,e7,c0), HX_("set_blue",97,57,31,6f), HX_("set_alpha",c1,ef,90,48), HX_("set_redFloat",08,ce,f5,3b), HX_("set_greenFloat",96,34,71,6d), HX_("set_blueFloat",85,fa,3a,e1), HX_("set_alphaFloat",1b,8a,51,b9), HX_("get_cyan",ac,00,87,c1), HX_("get_magenta",40,1a,98,94), HX_("get_yellow",3d,0f,e4,c0), HX_("get_black",16,32,9b,f8), HX_("set_cyan",20,5a,e4,6f), HX_("set_magenta",4c,21,05,9f), HX_("set_yellow",b1,ad,61,c4), HX_("set_black",22,1e,ec,db), HX_("get_hue",4f,19,c4,26), HX_("get_brightness",1a,16,67,db), HX_("get_saturation",1b,5c,97,6c), HX_("get_lightness",44,08,ab,98), HX_("set_hue",5b,aa,c5,19), HX_("set_saturation",8f,44,b7,8c), HX_("set_brightness",8e,fe,86,fb), HX_("set_lightness",50,ea,b0,dd), HX_("maxColor",1f,c4,79,f4), HX_("minColor",71,de,93,41), HX_("boundChannel",25,1c,54,83), ::String(null()) }; void FlxColor_Impl__obj::__register() { FlxColor_Impl__obj _hx_dummy; FlxColor_Impl__obj::_hx_vtable = *(void **)&_hx_dummy; ::hx::Static(__mClass) = new ::hx::Class_obj(); __mClass->mName = HX_("flixel.util._FlxColor.FlxColor_Impl_",09,b7,a9,ef); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &FlxColor_Impl__obj::__GetStatic; __mClass->mSetStaticField = &::hx::Class_obj::SetNoStaticField; __mClass->mMarkFunc = FlxColor_Impl__obj_sMarkStatics; __mClass->mStatics = ::hx::Class_obj::dupFunctions(FlxColor_Impl__obj_sStaticFields); __mClass->mMembers = ::hx::Class_obj::dupFunctions(0 /* sMemberFields */); __mClass->mCanCast = ::hx::TCanCast< FlxColor_Impl__obj >; #ifdef HXCPP_VISIT_ALLOCS __mClass->mVisitFunc = FlxColor_Impl__obj_sVisitStatics; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = FlxColor_Impl__obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = FlxColor_Impl__obj_sStaticStorageInfo; #endif ::hx::_hx_RegisterClass(__mClass->mName, __mClass); } void FlxColor_Impl__obj::__boot() { { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_20_boot) HXDLIN( 20) TRANSPARENT = 0; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_21_boot) HXDLIN( 21) WHITE = -1; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_22_boot) HXDLIN( 22) GRAY = -8355712; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_23_boot) HXDLIN( 23) BLACK = -16777216; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_25_boot) HXDLIN( 25) GREEN = -16744448; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_26_boot) HXDLIN( 26) LIME = -16711936; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_27_boot) HXDLIN( 27) YELLOW = -256; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_28_boot) HXDLIN( 28) ORANGE = -23296; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_29_boot) HXDLIN( 29) RED = -65536; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_30_boot) HXDLIN( 30) PURPLE = -8388480; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_31_boot) HXDLIN( 31) BLUE = -16776961; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_32_boot) HXDLIN( 32) BROWN = -7650029; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_33_boot) HXDLIN( 33) PINK = -16181; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_34_boot) HXDLIN( 34) MAGENTA = -65281; } { HX_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_35_boot) HXDLIN( 35) CYAN = -16711681; } { HX_BEGIN_LOCAL_FUNC_S0(::hx::LocalFunc,_hx_Closure_0) HXARGC(0) ::haxe::ds::StringMap _hx_run(){ HX_GC_STACKFRAME(&_hx_pos_0c1a490149f50aaa_54_boot) HXDLIN( 54) ::haxe::ds::StringMap _g = ::haxe::ds::StringMap_obj::__alloc( HX_CTX ); HXDLIN( 54) _g->set(HX_("TRANSPARENT",32,37,f6,f8),0); HXDLIN( 54) _g->set(HX_("WHITE",89,82,ab,47),-1); HXDLIN( 54) _g->set(HX_("GRAY",e3,97,2c,2f),-8355712); HXDLIN( 54) _g->set(HX_("BLACK",9f,0d,e0,32),-16777216); HXDLIN( 54) _g->set(HX_("GREEN",a3,46,db,17),-16744448); HXDLIN( 54) _g->set(HX_("LIME",15,df,73,32),-16711936); HXDLIN( 54) _g->set(HX_("YELLOW",74,4b,df,82),-256); HXDLIN( 54) _g->set(HX_("ORANGE",ee,5e,3f,f8),-23296); HXDLIN( 54) _g->set(HX_("RED",31,75,3e,00),-65536); HXDLIN( 54) _g->set(HX_("PURPLE",3c,a2,0c,24),-8388480); HXDLIN( 54) _g->set(HX_("BLUE",9a,0a,da,2b),-16776961); HXDLIN( 54) _g->set(HX_("BROWN",56,06,e2,36),-7650029); HXDLIN( 54) _g->set(HX_("PINK",76,ba,18,35),-16181); HXDLIN( 54) _g->set(HX_("MAGENTA",09,8e,71,8e),-65281); HXDLIN( 54) _g->set(HX_("CYAN",23,0d,8d,2c),-16711681); HXDLIN( 54) return _g; } HX_END_LOCAL_FUNC0(return) HX_STACKFRAME(&_hx_pos_0c1a490149f50aaa_54_boot) HXDLIN( 54) colorLookup = ( ( ::haxe::ds::StringMap)( ::Dynamic(new _hx_Closure_0())()) ); } { HX_GC_STACKFRAME(&_hx_pos_fda63b7a1987bfd7_78_boot) HXDLIN( 78) COLOR_REGEX = ::EReg_obj::__alloc( HX_CTX ,HX_("^(0x|#)(([A-F0-9]{2}){3,4})$",25,93,28,2c),HX_("i",69,00,00,00)); } } } // end namespace flixel } // end namespace util } // end namespace _FlxColor
[ "72734817+khiodev@users.noreply.github.com" ]
72734817+khiodev@users.noreply.github.com
29e89c97e39a8be6d036366fab099a72984de38c
bce8cdd81d8180ed18b770be9c328f561f43bb63
/Source/AW/Player/ZHitbox.h
318f0fdc823ca80614a13ffbe849e268b7fe1980
[]
no_license
Vjorn/AeroWalkZ
da2c26c1ca1df3e3d7e729e01d08d432a2663ed3
65f4cc3f41241400c428e80acc83c5adcfcef0cd
refs/heads/master
2022-12-03T02:39:04.982536
2020-08-08T18:18:48
2020-08-08T18:18:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
639
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "ZHitbox.generated.h" UCLASS() class AW_API AZHitbox : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties AZHitbox(); UPROPERTY(EditAnywhere, BlueprintReadWrite) FVector PreviousLocation; UPROPERTY(EditAnywhere, BlueprintReadWrite) bool Active; protected: // Called when the game starts or when spawned virtual void BeginPlay() override; public: // Called every frame virtual void Tick(float DeltaTime) override; };
[ "mechdmc@gmail.com" ]
mechdmc@gmail.com
92a2a784e6dbe58bc854f6eeb4d40f4c17883065
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/curl/gumtree/curl_repos_function_205_last_repos.cpp
1657f6af9580e1fa95db7b3cc18c84c2268f8b23
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
390
cpp
static void setsock(SockInfo *f, curl_socket_t s, CURL *e, int act, GlobalInfo *g) { int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0)|EV_PERSIST; f->sockfd = s; f->action = act; f->easy = e; if(f->evset) event_free(f->ev); f->ev = event_new(g->evbase, f->sockfd, kind, event_cb, g); f->evset = 1; event_add(f->ev, NULL); }
[ "993273596@qq.com" ]
993273596@qq.com
2785a75c63ce43ecf174b7f1b2e00f24e96ef1d7
3220c2863bbc78f6d7bcf51aa773afca032e3485
/external/loki-mq/oxenmq/variant.h
fb4c9fe6e874cf0f10b5c67ca779ee5e48057c69
[ "BSD-3-Clause" ]
permissive
Beldex-Coin/beldex-core-custom
6713d7c14561456023417fbaecdd6999fb8dcc6a
ed805b9b6d11294f16c0e3edfde1b82c35857154
refs/heads/master
2023-06-28T02:34:41.500008
2023-06-08T08:09:35
2023-06-08T08:09:35
202,894,271
1
1
null
2019-08-19T08:08:41
2019-08-17T14:58:49
C++
UTF-8
C++
false
false
4,527
h
#pragma once // Workarounds for macos compatibility. On macOS we aren't allowed to touch anything in // std::variant that could throw if compiling with a target <10.14 because Apple fails hard at // properly updating their STL. Thus, if compiling in such a mode, we have to introduce // workarounds. // // This header defines a `var` namespace with `var::get` and `var::visit` implementations. On // everything except broken backwards macos, this is just an alias to `std`. On broken backwards // macos, we provide implementations that throw std::runtime_error in failure cases since the // std::bad_variant_access exception can't be touched. // // You also get a BROKEN_APPLE_VARIANT macro defined if targetting a problematic mac architecture. #include <variant> #ifdef __APPLE__ # include <AvailabilityVersions.h> # if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14 # define BROKEN_APPLE_VARIANT # endif #endif #ifndef BROKEN_APPLE_VARIANT namespace var = std; // Oh look, actual C++17 support #else // Oh look, apple. namespace var { // Apple won't let us use std::visit or std::get if targetting some version of macos earlier than // 10.14 because Apple is awful about not updating their STL. So we have to provide our own, and // then call these without `std::` -- on crappy macos we'll come here, on everything else we'll ADL // to the std:: implementation. template <typename T, typename... Types> constexpr T& get(std::variant<Types...>& var) { if (auto* v = std::get_if<T>(&var)) return *v; throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <typename T, typename... Types> constexpr const T& get(const std::variant<Types...>& var) { if (auto* v = std::get_if<T>(&var)) return *v; throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <typename T, typename... Types> constexpr const T&& get(const std::variant<Types...>&& var) { if (auto* v = std::get_if<T>(&var)) return std::move(*v); throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <typename T, typename... Types> constexpr T&& get(std::variant<Types...>&& var) { if (auto* v = std::get_if<T>(&var)) return std::move(*v); throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <size_t I, typename... Types> constexpr auto& get(std::variant<Types...>& var) { if (auto* v = std::get_if<I>(&var)) return *v; throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <size_t I, typename... Types> constexpr const auto& get(const std::variant<Types...>& var) { if (auto* v = std::get_if<I>(&var)) return *v; throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <size_t I, typename... Types> constexpr const auto&& get(const std::variant<Types...>&& var) { if (auto* v = std::get_if<I>(&var)) return std::move(*v); throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <size_t I, typename... Types> constexpr auto&& get(std::variant<Types...>&& var) { if (auto* v = std::get_if<I>(&var)) return std::move(*v); throw std::runtime_error{"Bad variant access -- variant does not contain the requested type"}; } template <size_t I, size_t... More, class Visitor, class Variant> constexpr auto visit_helper(Visitor&& vis, Variant&& var) { if (var.index() == I) return vis(var::get<I>(std::forward<Variant>(var))); else if constexpr (sizeof...(More) > 0) return visit_helper<More...>(std::forward<Visitor>(vis), std::forward<Variant>(var)); else throw std::runtime_error{"Bad visit -- variant is valueless"}; } template <size_t... Is, class Visitor, class Variant> constexpr auto visit_helper(Visitor&& vis, Variant&& var, std::index_sequence<Is...>) { return visit_helper<Is...>(std::forward<Visitor>(vis), std::forward<Variant>(var)); } // Only handle a single variant here because multi-variant invocation is notably harder (and we // don't need it). template <class Visitor, class Variant> constexpr auto visit(Visitor&& vis, Variant&& var) { return visit_helper(std::forward<Visitor>(vis), std::forward<Variant>(var), std::make_index_sequence<std::variant_size_v<std::remove_reference_t<Variant>>>{}); } } // namespace var #endif
[ "victor.tucci@beldex.io" ]
victor.tucci@beldex.io