blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
247
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
4
111
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
58
visit_date
timestamp[ns]date
2015-07-25 18:16:41
2023-09-06 10:45:08
revision_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
committer_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
github_id
int64
3.89k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
25 values
gha_event_created_at
timestamp[ns]date
2012-06-07 00:51:45
2023-09-14 21:58:52
gha_created_at
timestamp[ns]date
2008-03-27 23:40:48
2023-08-24 19:49:39
gha_language
stringclasses
159 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
10.5M
extension
stringclasses
111 values
filename
stringlengths
1
195
text
stringlengths
7
10.5M
fc65dd0a43df8a2927f7ce503270d07dbefa3c41
601d32dc0b268486e0f480a155971547f62ed567
/particleCOOLNESS/src/Simulate_Particles.cpp
e9a57465e64d398f147d8c6c330cf7125ba48fd0
[]
no_license
davidutt36/CC-Lab-HW
db3a5aba1f5137440fd20612852f293bf41b0aba
bd2b0c8102eee9e6c2557d145e94415d0dd09e7c
refs/heads/master
2021-01-02T08:47:30.232824
2015-12-15T00:50:10
2015-12-15T00:50:10
42,841,256
0
0
null
null
null
null
UTF-8
C++
false
false
2,307
cpp
Simulate_Particles.cpp
// // Simulate_Particles.cpp // // // Created by David Utt on 11/29/15. // // #include "Simulate_Particles.h" Particle *particles; bool saving = false; float mag(ofPoint in){ float retf = sqrt(in.x * in.x + in.y * in.y); return retf; } //-------------------------------------------------------------- void testApp::setup(){ ofSetFrameRate(60); ofEnableSmoothing(); ofEnableAlphaBlending(); particles = new Particle[1000]; for(int i = 0; i < 1000; i++){ particles[i] = Particle(ofPoint(100, ofGetHeight()-100)); } } //-------------------------------------------------------------- void testApp::draw(){ ofBackground(255, 255, 255); ofSetColor(0, 0, 0); for(int i = 0; i < 1000; i++){ particles[i].update(); particles[i].draw(); } } Particle::Particle(ofPoint l){ counter = 0; float randmin = -HALF_PI; float randmax = 0; float r = ofRandom(0, TWO_PI); float x = cos(r); float y = sin(r); acc = ofPoint(x / 250, y / 250); float q = ofRandom(0, 1); r = ofRandom(randmin, randmax); x = cos(r) * q; y = sin(r) * q; vel = ofPoint(x, y); loc = l; hist = new ofPoint[1000]; } void Particle::update(){ vel += acc; loc += vel; if(ofGetFrameNum() % 10 == 0 && counter < 1000){ hist[counter].x = loc.x; hist[counter].y = loc.y; counter++; } } void Particle::draw(){ ofFill(); ofSetColor(100, 100, 100, 100); drawArrowHead(vel, loc, 10); ofNoFill(); ofSetColor(0, 0, 0, 100); ofBeginShape(); for(int i = 0; i < counter; i++){ ofVertex(hist[i].x, hist[i].y); } if(counter > 0) ofVertex(loc.x, loc.y); ofEndShape(false); } void Particle::drawArrowHead(ofPoint v, ofPoint loc, float scale){ ofPushMatrix(); float arrowsize = 5.0f; ofTranslate(loc.x, loc.y, 0); float rotate = atan2(v.y, v.x); ofRotate(ofRadToDeg(rotate), 0, 0, 1); float len = mag(v) * scale; arrowsize = ofMap(len, 0.f, 10.f, 0.f, 1.f, false) * arrowsize; ofLine(0, 0, len-arrowsize, 0); ofBeginShape(); ofVertex(len, 0); ofVertex(len-arrowsize, arrowsize/2); ofVertex(len-arrowsize, -arrowsize/2); ofEndShape(true); ofPopMatrix(); }
151d362d9c5aa72ae4af6aaf4abd0c662f6be1d1
6a6f0b692b76dc62954e24b311503f6185810454
/Redeployer/Code/Client.cpp
0f7ce0362f4c2234697f2eadbd86ac5a92b27aaf
[]
no_license
spencerparkin/Junk
0c5572086d9ebbbedd2a24f87911002ffe6839a9
917ba7435de19091a9d6dd2c8419fed573400833
refs/heads/master
2021-01-10T03:40:22.389159
2020-08-08T10:16:48
2020-08-08T10:16:48
44,126,134
0
0
null
null
null
null
UTF-8
C++
false
false
3,347
cpp
Client.cpp
// Client.cpp #include "Client.h" #include "App.h" #include "Frame.h" #include <wx/sstream.h> #include <wx/protocol/http.h> #include <rapidjson/writer.h> #include <rapidjson/reader.h> Client::Client( wxSocketBase* connectedSocket ) { this->connectedSocket = connectedSocket; socketInputStream = new wxSocketInputStream( *connectedSocket ); socketOutputStream = new wxSocketOutputStream( *connectedSocket ); } /*virtual*/ Client::~Client( void ) { delete socketInputStream; delete socketOutputStream; delete connectedSocket; } bool Client::IsConnected( void ) { return connectedSocket->IsConnected(); } bool Client::Run( void ) { Frame* frame = wxGetApp().GetFrame(); if( !connectedSocket->WaitForRead(0) ) return true; if( !IsConnected() ) { frame->AddLogMessage( wxString::Format( "Client 0x%016x no longer connected.", this ) ); return false; } wxStringOutputStream stringOutputStream; socketInputStream->Read( stringOutputStream ); wxString stringPacket = stringOutputStream.GetString(); rapidjson::Document inputDoc; inputDoc.Parse( ( const char* )stringPacket.c_str() ); if( !inputDoc.IsObject() ) return false; if( !inputDoc.HasMember( "packetType" ) ) { frame->AddLogMessage( "No packet type given." ); return false; } wxString packetType = inputDoc[ "packetType" ].GetString(); Handler* handler = nullptr; if( packetType == "Query" ) handler = new QueryPackageHandler(); else if( packetType == "Redeploy" ) handler = new RedeployPackageHandler(); if( !handler ) { frame->AddLogMessage( "Can't handle packet type: " + packetType ); return false; } rapidjson::Document outputDoc; if( !handler->Handle( inputDoc, outputDoc ) ) { frame->AddLogMessage( "Failed to handle packet." ); return false; } rapidjson::StringBuffer buffer; rapidjson::Writer< rapidjson::StringBuffer > writer( buffer ); if( !outputDoc.Accept( writer ) ) { frame->AddLogMessage( "Failed to write json packet string." ); return false; } stringPacket = writer.GetString(); wxStringInputStream stringInputStream( stringPacket ); socketOutputStream->Write( stringInputStream ); return true; } /*virtual*/ bool Client::QueryPackageHandler::Handle( const rapidjson::Document& inputDoc, rapidjson::Document& outputDoc ) { Frame* frame = wxGetApp().GetFrame(); if( !inputDoc.HasMember( "packageName" ) ) { frame->AddLogMessage( "No package name given." ); return false; } if( !inputDoc.HasMember( "currentVersion" ) ) { frame->AddLogMessage( "No current version given." ); return false; } wxString packageName = inputDoc[ "packageName" ].GetString(); int currentVersion = inputDoc[ "version" ].GetInt(); wxString packageServerHost = "http://utwarhammer:9000/"; wxHTTP http; http.SetHeader( "content-type", "blah" ); if( !http.Connect( packageServerHost ) ) { frame->AddLogMessage( "Failed to connect to package server." ); return false; } wxInputStream* httpInputStream = http.GetInputStream( "packageVersion?package=" + packageName + wxString::Format( "&version=%d", currentVersion ) ); wxDELETE( httpInputStream ); http.Close(); return true; } /*virtual*/ bool Client::RedeployPackageHandler::Handle( const rapidjson::Document& inputDoc, rapidjson::Document& outputDoc ) { Frame* frame = wxGetApp().GetFrame(); return false; } // Client.cpp
1b08d4c5528075dd837191c27981fe135a18395b
36b9decf14d266d6babaf1c44085c2ba869c03ce
/Remnant-main/Remnant/SDK/OnlineSubsystemUtils_classes.h
8c3c00e283e15e5fcef4c4a8d63c2f83ed608999
[]
no_license
RoryGlenn/RemnantLootSwitcher
6e309a7b2b7bac88a166b552b640c830b863eb2d
85c4cb6839b7c0f60cf8143c571d64ca12439a63
refs/heads/master
2022-12-29T08:47:15.713546
2020-10-23T22:01:45
2020-10-23T22:01:45
305,910,400
0
0
null
null
null
null
UTF-8
C++
false
false
42,062
h
OnlineSubsystemUtils_classes.h
#pragma once // Name: Remnant, Version: 6 #ifdef _MSC_VER #pragma pack(push, 0x01) #endif /*!!HELPER_DEF!!*/ /*!!DEFINE!!*/ namespace UFT { //--------------------------------------------------------------------------- // Classes //--------------------------------------------------------------------------- // Class OnlineSubsystemUtils.IpConnection // 0x0060 (FullSize[0x18E8] - InheritedSize[0x1888]) class UIpConnection : public UNetConnection { public: unsigned char UnknownData_XUDR[0x60]; // 0x1888(0x0060) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.IpConnection"); return ptr; } }; // Class OnlineSubsystemUtils.ShowLoginUICallbackProxy // 0x0030 (FullSize[0x0060] - InheritedSize[0x0030]) class UShowLoginUICallbackProxy : public UBlueprintAsyncActionBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0030(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0040(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_86LD[0x10]; // 0x0050(0x0010) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.ShowLoginUICallbackProxy"); return ptr; } static class UShowLoginUICallbackProxy* STATIC_ShowExternalLoginUI(class UObject* WorldContextObject, class APlayerController* InPlayerController); }; // Class OnlineSubsystemUtils.OnlineBeacon // 0x0030 (FullSize[0x0360] - InheritedSize[0x0330]) class AOnlineBeacon : public AActor { public: unsigned char UnknownData_45AT[0x8]; // 0x0330(0x0008) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) float BeaconConnectionInitialTimeout; // 0x0338(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float BeaconConnectionTimeout; // 0x033C(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UNetDriver* NetDriver; // 0x0340(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_C4LV[0x18]; // 0x0348(0x0018) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlineBeacon"); return ptr; } }; // Class OnlineSubsystemUtils.IpNetDriver // 0x0048 (FullSize[0x0768] - InheritedSize[0x0720]) class UIpNetDriver : public UNetDriver { public: unsigned char LogPortUnreach : 1; // 0x0720(0x0001) BIT_FIELD (Config, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char AllowPlayerPortUnreach : 1; // 0x0720(0x0001) BIT_FIELD (Config, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_UVQ1[0x3]; // 0x0721(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) uint32_t MaxPortCountToTry; // 0x0724(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_GEEF[0x1C]; // 0x0728(0x001C) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) uint32_t ServerDesiredSocketReceiveBufferBytes; // 0x0744(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) uint32_t ServerDesiredSocketSendBufferBytes; // 0x0748(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) uint32_t ClientDesiredSocketReceiveBufferBytes; // 0x074C(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) uint32_t ClientDesiredSocketSendBufferBytes; // 0x0750(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_TW87[0x14]; // 0x0754(0x0014) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.IpNetDriver"); return ptr; } }; // Class OnlineSubsystemUtils.AchievementBlueprintLibrary // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UAchievementBlueprintLibrary : public UBlueprintFunctionLibrary { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.AchievementBlueprintLibrary"); return ptr; } static void STATIC_GetCachedAchievementProgress(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FName& AchievementId, bool* bFoundID, float* Progress); static void STATIC_GetCachedAchievementDescription(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FName& AchievementId, bool* bFoundID, struct FText* Title, struct FText* LockedDescription, struct FText* UnlockedDescription, bool* bHidden); }; // Class OnlineSubsystemUtils.AchievementQueryCallbackProxy // 0x0038 (FullSize[0x0060] - InheritedSize[0x0028]) class UAchievementQueryCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_5DW0[0x18]; // 0x0048(0x0018) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.AchievementQueryCallbackProxy"); return ptr; } static class UAchievementQueryCallbackProxy* STATIC_CacheAchievements(class UObject* WorldContextObject, class APlayerController* PlayerController); static class UAchievementQueryCallbackProxy* STATIC_CacheAchievementDescriptions(class UObject* WorldContextObject, class APlayerController* PlayerController); }; // Class OnlineSubsystemUtils.AchievementWriteCallbackProxy // 0x0050 (FullSize[0x0078] - InheritedSize[0x0028]) class UAchievementWriteCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_WOLH[0x30]; // 0x0048(0x0030) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.AchievementWriteCallbackProxy"); return ptr; } static class UAchievementWriteCallbackProxy* STATIC_WriteAchievementProgress(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FName& AchievementName, float Progress, int UserTag); }; // Class OnlineSubsystemUtils.ConnectionCallbackProxy // 0x0048 (FullSize[0x0070] - InheritedSize[0x0028]) class UConnectionCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_W9EI[0x28]; // 0x0048(0x0028) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.ConnectionCallbackProxy"); return ptr; } static class UConnectionCallbackProxy* STATIC_ConnectToService(class UObject* WorldContextObject, class APlayerController* PlayerController); }; // Class OnlineSubsystemUtils.CreateSessionCallbackProxy // 0x0068 (FullSize[0x0090] - InheritedSize[0x0028]) class UCreateSessionCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_Z5VQ[0x48]; // 0x0048(0x0048) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.CreateSessionCallbackProxy"); return ptr; } static class UCreateSessionCallbackProxy* STATIC_CreateSession(class UObject* WorldContextObject, class APlayerController* PlayerController, int PublicConnections, bool bUseLAN); }; // Class OnlineSubsystemUtils.DestroySessionCallbackProxy // 0x0048 (FullSize[0x0070] - InheritedSize[0x0028]) class UDestroySessionCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_QM0H[0x28]; // 0x0048(0x0028) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.DestroySessionCallbackProxy"); return ptr; } static class UDestroySessionCallbackProxy* STATIC_DestroySession(class UObject* WorldContextObject, class APlayerController* PlayerController); }; // Class OnlineSubsystemUtils.OnlineBeaconClient // 0x0050 (FullSize[0x03B0] - InheritedSize[0x0360]) class AOnlineBeaconClient : public AOnlineBeacon { public: class AOnlineBeaconHostObject* BeaconOwner; // 0x0360(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UNetConnection* BeaconConnection; // 0x0368(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) EBeaconConnectionState ConnectionState; // 0x0370(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_6Y5S[0x3F]; // 0x0371(0x003F) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlineBeaconClient"); return ptr; } void ClientOnConnected(); }; // Class OnlineSubsystemUtils.EndMatchCallbackProxy // 0x0050 (FullSize[0x0078] - InheritedSize[0x0028]) class UEndMatchCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_5EOG[0x30]; // 0x0048(0x0030) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.EndMatchCallbackProxy"); return ptr; } static class UEndMatchCallbackProxy* STATIC_EndMatch(class UObject* WorldContextObject, class APlayerController* PlayerController, const TScriptInterface<class UTurnBasedMatchInterface>& MatchActor, const struct FString& MatchID, TEnumAsByte<EMPMatchOutcome> LocalPlayerOutcome, TEnumAsByte<EMPMatchOutcome> OtherPlayersOutcome); }; // Class OnlineSubsystemUtils.TestBeaconClient // 0x0000 (FullSize[0x03B0] - InheritedSize[0x03B0]) class ATestBeaconClient : public AOnlineBeaconClient { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.TestBeaconClient"); return ptr; } void ServerPong(); void ClientPing(); }; // Class OnlineSubsystemUtils.EndTurnCallbackProxy // 0x0048 (FullSize[0x0070] - InheritedSize[0x0028]) class UEndTurnCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_Q88M[0x28]; // 0x0048(0x0028) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.EndTurnCallbackProxy"); return ptr; } static class UEndTurnCallbackProxy* STATIC_EndTurn(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FString& MatchID, const TScriptInterface<class UTurnBasedMatchInterface>& TurnBasedMatchInterface); }; // Class OnlineSubsystemUtils.OnlineBeaconHostObject // 0x0028 (FullSize[0x0358] - InheritedSize[0x0330]) class AOnlineBeaconHostObject : public AActor { public: struct FString BeaconTypeName; // 0x0330(0x0010) (ZeroConstructor, Transient, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) class UClass* ClientBeaconActorClass; // 0x0340(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierProtected) TArray<class AOnlineBeaconClient*> ClientActors; // 0x0348(0x0010) (ZeroConstructor, Protected, NativeAccessSpecifierProtected) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlineBeaconHostObject"); return ptr; } }; // Class OnlineSubsystemUtils.TestBeaconHost // 0x0000 (FullSize[0x0358] - InheritedSize[0x0358]) class ATestBeaconHost : public AOnlineBeaconHostObject { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.TestBeaconHost"); return ptr; } }; // Class OnlineSubsystemUtils.TurnBasedBlueprintLibrary // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class UTurnBasedBlueprintLibrary : public UBlueprintFunctionLibrary { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.TurnBasedBlueprintLibrary"); return ptr; } static void STATIC_RegisterTurnBasedMatchInterfaceObject(class UObject* WorldContextObject, class APlayerController* PlayerController, class UObject* Object); static void STATIC_GetPlayerDisplayName(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FString& MatchID, int PlayerIndex, struct FString* PlayerDisplayName); static void STATIC_GetMyPlayerIndex(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FString& MatchID, int* PlayerIndex); static void STATIC_GetIsMyTurn(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FString& MatchID, bool* bIsMyTurn); }; // Class OnlineSubsystemUtils.VoipListenerSynthComponent // 0x0010 (FullSize[0x0690] - InheritedSize[0x0680]) class UVoipListenerSynthComponent : public USynthComponent { public: unsigned char UnknownData_JJ6Y[0x10]; // 0x0680(0x0010) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.VoipListenerSynthComponent"); return ptr; } bool IsIdling(); }; // Class OnlineSubsystemUtils.FindSessionsCallbackProxy // 0x0060 (FullSize[0x0088] - InheritedSize[0x0028]) class UFindSessionsCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_TE9V[0x40]; // 0x0048(0x0040) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.FindSessionsCallbackProxy"); return ptr; } static struct FString STATIC_GetServerName(const struct FBlueprintSessionResult& Result); static int STATIC_GetPingInMs(const struct FBlueprintSessionResult& Result); static int STATIC_GetMaxPlayers(const struct FBlueprintSessionResult& Result); static int STATIC_GetCurrentPlayers(const struct FBlueprintSessionResult& Result); static class UFindSessionsCallbackProxy* STATIC_FindSessions(class UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN); }; // Class OnlineSubsystemUtils.FindTurnBasedMatchCallbackProxy // 0x0058 (FullSize[0x0080] - InheritedSize[0x0028]) class UFindTurnBasedMatchCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_51C1[0x38]; // 0x0048(0x0038) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.FindTurnBasedMatchCallbackProxy"); return ptr; } static class UFindTurnBasedMatchCallbackProxy* STATIC_FindTurnBasedMatch(class UObject* WorldContextObject, class APlayerController* PlayerController, const TScriptInterface<class UTurnBasedMatchInterface>& MatchActor, int MinPlayers, int MaxPlayers, int PlayerGroup, bool ShowExistingMatches); }; // Class OnlineSubsystemUtils.InAppPurchaseCallbackProxy // 0x0058 (FullSize[0x0080] - InheritedSize[0x0028]) class UInAppPurchaseCallbackProxy : public UObject { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_YP47[0x38]; // 0x0048(0x0038) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.InAppPurchaseCallbackProxy"); return ptr; } static class UInAppPurchaseCallbackProxy* STATIC_CreateProxyObjectForInAppPurchase(class APlayerController* PlayerController, const struct FInAppPurchaseProductRequest& ProductRequest); }; // Class OnlineSubsystemUtils.InAppPurchaseQueryCallbackProxy // 0x0068 (FullSize[0x0090] - InheritedSize[0x0028]) class UInAppPurchaseQueryCallbackProxy : public UObject { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_S20Y[0x48]; // 0x0048(0x0048) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.InAppPurchaseQueryCallbackProxy"); return ptr; } static class UInAppPurchaseQueryCallbackProxy* STATIC_CreateProxyObjectForInAppPurchaseQuery(class APlayerController* PlayerController, TArray<struct FString> ProductIdentifiers); }; // Class OnlineSubsystemUtils.InAppPurchaseRestoreCallbackProxy // 0x0068 (FullSize[0x0090] - InheritedSize[0x0028]) class UInAppPurchaseRestoreCallbackProxy : public UObject { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_B2KK[0x48]; // 0x0048(0x0048) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.InAppPurchaseRestoreCallbackProxy"); return ptr; } static class UInAppPurchaseRestoreCallbackProxy* STATIC_CreateProxyObjectForInAppPurchaseRestore(TArray<struct FInAppPurchaseProductRequest> ConsumableProductFlags, class APlayerController* PlayerController); }; // Class OnlineSubsystemUtils.JoinSessionCallbackProxy // 0x0100 (FullSize[0x0128] - InheritedSize[0x0028]) class UJoinSessionCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_Y4GG[0xE0]; // 0x0048(0x00E0) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.JoinSessionCallbackProxy"); return ptr; } static class UJoinSessionCallbackProxy* STATIC_JoinSession(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FBlueprintSessionResult& SearchResult); }; // Class OnlineSubsystemUtils.LeaderboardBlueprintLibrary // 0x0000 (FullSize[0x0028] - InheritedSize[0x0028]) class ULeaderboardBlueprintLibrary : public UBlueprintFunctionLibrary { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.LeaderboardBlueprintLibrary"); return ptr; } static bool STATIC_WriteLeaderboardInteger(class APlayerController* PlayerController, const struct FName& StatName, int StatValue); }; // Class OnlineSubsystemUtils.LeaderboardFlushCallbackProxy // 0x0040 (FullSize[0x0068] - InheritedSize[0x0028]) class ULeaderboardFlushCallbackProxy : public UObject { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_PCX0[0x20]; // 0x0048(0x0020) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.LeaderboardFlushCallbackProxy"); return ptr; } static class ULeaderboardFlushCallbackProxy* STATIC_CreateProxyObjectForFlush(class APlayerController* PlayerController, const struct FName& SessionName); }; // Class OnlineSubsystemUtils.LeaderboardQueryCallbackProxy // 0x0070 (FullSize[0x0098] - InheritedSize[0x0028]) class ULeaderboardQueryCallbackProxy : public UObject { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_F3ZY[0x50]; // 0x0048(0x0050) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.LeaderboardQueryCallbackProxy"); return ptr; } static class ULeaderboardQueryCallbackProxy* STATIC_CreateProxyObjectForIntQuery(class APlayerController* PlayerController, const struct FName& StatName); }; // Class OnlineSubsystemUtils.LogoutCallbackProxy // 0x0038 (FullSize[0x0068] - InheritedSize[0x0030]) class ULogoutCallbackProxy : public UBlueprintAsyncActionBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0030(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0040(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_WV92[0x18]; // 0x0050(0x0018) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.LogoutCallbackProxy"); return ptr; } static class ULogoutCallbackProxy* STATIC_Logout(class UObject* WorldContextObject, class APlayerController* PlayerController); }; // Class OnlineSubsystemUtils.OnlineBeaconHost // 0x00B8 (FullSize[0x0418] - InheritedSize[0x0360]) class AOnlineBeaconHost : public AOnlineBeacon { public: int ListenPort; // 0x0360(0x0004) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_I1QG[0x4]; // 0x0364(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<class AOnlineBeaconClient*> ClientActors; // 0x0368(0x0010) (ZeroConstructor, NativeAccessSpecifierPrivate) unsigned char UnknownData_MQD3[0xA0]; // 0x0378(0x00A0) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlineBeaconHost"); return ptr; } }; // Class OnlineSubsystemUtils.OnlineEngineInterfaceImpl // 0x0100 (FullSize[0x0128] - InheritedSize[0x0028]) class UOnlineEngineInterfaceImpl : public UOnlineEngineInterface { public: struct FName VoiceSubsystemNameOverride; // 0x0028(0x0008) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPrivate) unsigned char UnknownData_P9G0[0xF8]; // 0x0030(0x00F8) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlineEngineInterfaceImpl"); return ptr; } }; // Class OnlineSubsystemUtils.OnlinePIESettings // 0x0018 (FullSize[0x0050] - InheritedSize[0x0038]) class UOnlinePIESettings : public UDeveloperSettings { public: bool bOnlinePIEEnabled; // 0x0038(0x0001) (Edit, ZeroConstructor, Config, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) unsigned char UnknownData_NLTY[0x7]; // 0x0039(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<struct FPIELoginSettingsInternal> Logins; // 0x0040(0x0010) (Edit, ZeroConstructor, Config, NativeAccessSpecifierPublic) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlinePIESettings"); return ptr; } }; // Class OnlineSubsystemUtils.OnlineSessionClient // 0x0168 (FullSize[0x0190] - InheritedSize[0x0028]) class UOnlineSessionClient : public UOnlineSession { public: unsigned char UnknownData_71VZ[0x160]; // 0x0028(0x0160) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) bool bIsFromInvite; // 0x0188(0x0001) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) bool bHandlingDisconnect; // 0x0189(0x0001) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_RT23[0x6]; // 0x018A(0x0006) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.OnlineSessionClient"); return ptr; } }; // Class OnlineSubsystemUtils.PartyBeaconClient // 0x00B0 (FullSize[0x0460] - InheritedSize[0x03B0]) class APartyBeaconClient : public AOnlineBeaconClient { public: unsigned char UnknownData_DLV4[0x30]; // 0x03B0(0x0030) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) struct FString DestSessionId; // 0x03E0(0x0010) (ZeroConstructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FPartyReservation PendingReservation; // 0x03F0(0x0040) (Protected, NativeAccessSpecifierProtected) EClientRequestType RequestType; // 0x0430(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) bool bPendingReservationSent; // 0x0431(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) bool bCancelReservation; // 0x0432(0x0001) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_0FL6[0x2D]; // 0x0433(0x002D) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.PartyBeaconClient"); return ptr; } void ServerUpdateReservationRequest(const struct FString& SessionId, const struct FPartyReservation& ReservationUpdate); void ServerReservationRequest(const struct FString& SessionId, const struct FPartyReservation& Reservation); void ServerCancelReservationRequest(const struct FUniqueNetIdRepl& PartyLeader); void ClientSendReservationUpdates(int NumRemainingReservations); void ClientSendReservationFull(); void ClientReservationResponse(TEnumAsByte<EPartyReservationResult> ReservationResponse); void ClientCancelReservationResponse(TEnumAsByte<EPartyReservationResult> ReservationResponse); }; // Class OnlineSubsystemUtils.PartyBeaconHost // 0x0078 (FullSize[0x03D0] - InheritedSize[0x0358]) class APartyBeaconHost : public AOnlineBeaconHostObject { public: class UPartyBeaconState* State; // 0x0358(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_38PK[0x60]; // 0x0360(0x0060) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) bool bLogoutOnSessionTimeout; // 0x03C0(0x0001) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_MD8I[0x3]; // 0x03C1(0x0003) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) float SessionTimeoutSecs; // 0x03C4(0x0004) (ZeroConstructor, Transient, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) float TravelSessionTimeoutSecs; // 0x03C8(0x0004) (ZeroConstructor, Transient, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_0M0P[0x4]; // 0x03CC(0x0004) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.PartyBeaconHost"); return ptr; } }; // Class OnlineSubsystemUtils.PartyBeaconState // 0x0050 (FullSize[0x0078] - InheritedSize[0x0028]) class UPartyBeaconState : public UObject { public: struct FName SessionName; // 0x0028(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int NumConsumedReservations; // 0x0030(0x0004) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int MaxReservations; // 0x0034(0x0004) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int NumTeams; // 0x0038(0x0004) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int NumPlayersPerTeam; // 0x003C(0x0004) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) struct FName TeamAssignmentMethod; // 0x0040(0x0008) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int ReservedHostTeamNum; // 0x0048(0x0004) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) int ForceTeamNum; // 0x004C(0x0004) (ZeroConstructor, Transient, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) bool bRestrictCrossConsole; // 0x0050(0x0001) (ZeroConstructor, Config, IsPlainOldData, NoDestructor, Protected, HasGetValueTypeHash, NativeAccessSpecifierProtected) unsigned char UnknownData_57N4[0x7]; // 0x0051(0x0007) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY) TArray<struct FPartyReservation> Reservations; // 0x0058(0x0010) (ZeroConstructor, Transient, Protected, NativeAccessSpecifierProtected) unsigned char UnknownData_KB04[0x10]; // 0x0068(0x0010) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.PartyBeaconState"); return ptr; } }; // Class OnlineSubsystemUtils.QuitMatchCallbackProxy // 0x0048 (FullSize[0x0070] - InheritedSize[0x0028]) class UQuitMatchCallbackProxy : public UOnlineBlueprintCallProxyBase { public: struct FScriptMulticastDelegate OnSuccess; // 0x0028(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) struct FScriptMulticastDelegate OnFailure; // 0x0038(0x0010) (ZeroConstructor, InstancedReference, BlueprintAssignable, NativeAccessSpecifierPublic) unsigned char UnknownData_AKKZ[0x28]; // 0x0048(0x0028) MISSED OFFSET (PADDING) static UClass* StaticClass() { static auto ptr = UObject::FindClass("Class OnlineSubsystemUtils.QuitMatchCallbackProxy"); return ptr; } static class UQuitMatchCallbackProxy* STATIC_QuitMatch(class UObject* WorldContextObject, class APlayerController* PlayerController, const struct FString& MatchID, TEnumAsByte<EMPMatchOutcome> Outcome, int TurnTimeoutInSeconds); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
ae0152c8411ec3bc3b4b50c51484c1f226dd3b05
f83ef53177180ebfeb5a3e230aa29794f52ce1fc
/ACE/ACE_wrappers/TAO/tests/DII_AMI_Forward/server.cpp
9ba3fd91155dea1821da6631f627cfa2ba89ac63
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-sun-iiop", "Apache-2.0" ]
permissive
msrLi/portingSources
fe7528b3fd08eed4a1b41383c88ee5c09c2294ef
57d561730ab27804a3172b33807f2bffbc9e52ae
refs/heads/master
2021-07-08T01:22:29.604203
2019-07-10T13:07:06
2019-07-10T13:07:06
196,183,165
2
1
Apache-2.0
2020-10-13T14:30:53
2019-07-10T10:16:46
null
UTF-8
C++
false
false
3,171
cpp
server.cpp
// -*- C++ -*- #include "test_i.h" #include "ace/Get_Opt.h" #include "ace/Task.h" #include "server_interceptor.h" #include "orb_initializer.h" #include "tao/ORBInitializer_Registry.h" const ACE_TCHAR *ior_filename = ACE_TEXT("server.ior"); int parse_args (int argc, ACE_TCHAR *argv[]) { ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:m:n:t")); int c; while ((c = get_opts ()) != -1) { switch (c) { case 'o': ior_filename = get_opts.opt_arg (); break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-o <iorfile>" "\n", argv [0]), -1); } } // Indicates successful parsing of the command line return 0; } int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { try { // Create the ORB initializer. Server_ORBInitializer *temp_initializer = 0; ACE_NEW_RETURN (temp_initializer, Server_ORBInitializer, -1); PortableInterceptor::ORBInitializer_var initializer = temp_initializer; PortableInterceptor::register_orb_initializer (initializer.in ()); // Now initialize the ORB. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA"); if (CORBA::is_nil (poa_object.in ())) { ACE_ERROR_RETURN ((LM_ERROR, " (%P|%t) Unable to initialize the POA.\n"), 1); } PortableServer::POA_var root_poa = PortableServer::POA::_narrow (poa_object.in ()); PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); if (parse_args (argc, argv) != 0) { return 1; } // Create the interceptor. ForwardTest_Request_Interceptor * server_interceptor = temp_initializer->server_interceptor(); Forward_Test_i *final_impl = new Forward_Test_i(orb.in ()); PortableServer::ServantBase_var servant = final_impl; Forward::Test_var target = final_impl->_this (); server_interceptor->forward_reference (target.in()); Forward_Test_i *server_impl = new Forward_Test_i (orb.in()); servant = server_impl; Forward::Test_var server = server_impl->_this (); CORBA::String_var iorstr = orb->object_to_string (server.in ()); FILE *output_file= ACE_OS::fopen (ior_filename, "w"); if (output_file == 0) ACE_ERROR_RETURN ((LM_ERROR, "Cannot open output file for writing IOR: %s\n", ior_filename), 1); ACE_OS::fprintf (output_file, "%s", iorstr.in()); ACE_OS::fclose (output_file); poa_manager->activate (); orb->run (); ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("Server: exception caught - "); return 1; } return 0; }
9118d67fd07fb12c8c482cf26e813e81923cb1da
3ccf768d7354a3959c230cf148b82e4ffb3345e5
/SPOJ/Life, the Universe, and Everything (Interactive).cpp
9ec28ca4ab8df7515907048fd7e6645187c7390a
[]
no_license
AdityaRajSingh/CP
f954153d0f212729a12c00c13ac426b6dbf79a65
63a45f85a116c1ac6072b2ea82d6c3dc9f2fb910
refs/heads/master
2021-06-18T20:37:13.016307
2021-04-17T17:30:01
2021-04-17T17:30:01
204,256,046
1
0
null
null
null
null
UTF-8
C++
false
false
845
cpp
Life, the Universe, and Everything (Interactive).cpp
/****************************************** * AUTHOR : ADITYA RAJ SINGH * ******************************************/ #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) #define endl '\n' int main() { #ifndef ONLINE_JUDGE freopen("/home/aadi/Documents/input.txt", "r", stdin); freopen("/home/aadi/Documents/output.txt", "w", stdout); #endif fast; //////////////////////////////////////////////////////////////////////////////////////////// int t=0; do { scanf("%d",&t); printf("%d\n",t); fflush(stdout); } while(t!=42); //////////////////////////////////////////////////////////////////////////////////////////// #ifndef ONLINE_JUDGE cout<<endl<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec"<<endl; #endif return 0; }
849ad92006dd2cf10624ee8c8a65bd7131419b10
0fefd9e2f171cdfe4d8143577f285e8aa5e3c3cd
/src/Deck.cpp
1ae0601fdae8d670bff0a54c611c8f57e9fe2c9d
[]
no_license
blumenra/assignment1
f1d40e9daa2ff1affcbd618821e6ff3001658ddb
6a197f6765306c7439367ccfd1c9d02e3fe4b8f3
refs/heads/master
2020-01-23T21:43:57.783313
2016-12-08T04:36:32
2016-12-08T04:36:32
74,684,344
0
0
null
null
null
null
UTF-8
C++
false
false
1,925
cpp
Deck.cpp
#include <Deck.h> Deck::Deck(): deck() {} //Deck Constructor Deck::Deck(vector<Card*>& deck): deck(deck) {} Deck::Deck(const Deck& otherDeck): deck(copy(otherDeck)) {} bool Deck::isEmpty(){ return this->deck.empty(); } int Deck::getNumberOfCards(){ return deck.size(); } string Deck::toString(){ string strDeck = ""; for(vector<Card*>::iterator it = deck.begin() ; it != deck.end(); it++){ strDeck += (*it)->toString() + " "; } int strDeckLength = strDeck.length(); string strDeckNoLastSpace = strDeck.substr(0, strDeckLength-1); return strDeckNoLastSpace; } Deck::~Deck(){ for(vector<Card*>::iterator it = deck.begin() ; it != deck.end(); it++){ delete (*it); } } Card* Deck::fetchCard(){ if (!this->isEmpty()){ Card* topCard = this->deck.front(); this->deck.erase(deck.begin()); return topCard; } throw invalid_argument("Trying to fetch from empty deck!!!"); } vector<Card*> Deck::giveCards(int numberToGive){ vector<Card*> cardsToGive; if (numberToGive < 0){ throw invalid_argument("Can't fetch negative cards"); } else if (numberToGive == 0){ return cardsToGive; } for (int i=0; i<numberToGive && !this->isEmpty(); i++){ cardsToGive.push_back(this->fetchCard()); } return cardsToGive; } vector<Card*> Deck::getDeckVec() const { vector<Card*> newDeck = this->deck; return newDeck; } vector<Card*> Deck::copy(const Deck& otherDeck) { vector<Card*> copiedDeck; // this->deck = copiedDeck; Card* tempCard; vector<Card*> otherDeckVec = otherDeck.getDeckVec(); for(vector<Card*>::iterator it = otherDeckVec.begin() ; it != otherDeckVec.end(); it++){ if((*it)->isFigure()){ tempCard = new FigureCard(**it); } else { tempCard = new NumericCard(**it); } copiedDeck.push_back(tempCard); } this->deck = copiedDeck; return copiedDeck; } Deck& Deck::operator=(Deck& otherDeck) { if(this != &otherDeck) { this->copy(otherDeck); } return *this; }
b85eac63f1a10b20cbd8bd36ea6242e05faad50f
52f0fffcd4de0065856b2adf3fad9e5eb2bf515b
/DynModels/phaseportrait.cpp
6e4cfa3ccbb36c42e610e447a338064f6c9721bf
[]
no_license
DesmondFox/DynModels
dd407bb707b11ceeef699a2827451806d11c7e6f
0d5a161490ecfb94cbad16f1983c52267f76653c
refs/heads/master
2020-07-17T21:52:16.818019
2019-11-17T17:08:14
2019-11-17T17:08:14
119,556,300
0
0
null
2019-03-22T12:38:59
2018-01-30T15:37:53
C++
UTF-8
C++
false
false
5,536
cpp
phaseportrait.cpp
#include "phaseportrait.h" PhasePortrait::PhasePortrait(QWidget *parent) : CommonPlot(parent) { prepareItems(); setInteractions(QCP::iRangeDrag | QCP::iRangeZoom); } void PhasePortrait::prepareItems() { try { pEilersCurve = new QCPCurve(xAxis, yAxis); pModEilersCurve = new QCPCurve(xAxis, yAxis); pRungeKuttaCurve= new QCPCurve(xAxis, yAxis); pAdamsCurve = new QCPCurve(xAxis, yAxis); } catch(std::bad_alloc &ex) { qDebug() << "Alloc failed: " << ex.what(); QApplication::exit(-10); } /// /// Синий - метод Эйлера /// Красный - мод. метод Эйлера /// Зеленый - метод Р-Кутты /// Фиолетовый - метод Адамса /// pEilersCurve->setPen(QPen(QBrush(Qt::blue), LineWidth)); pModEilersCurve->setPen(QPen(QBrush(Qt::red), LineWidth)); pRungeKuttaCurve->setPen(QPen(QBrush(Qt::green), LineWidth)); pAdamsCurve->setPen(QPen(QBrush(Qt::magenta), LineWidth)); pEilersCurve->setVisible(false); pModEilersCurve->setVisible(false); pRungeKuttaCurve->setVisible(false); pAdamsCurve->setVisible(false); pointsGraph = nullptr; } QCPCurve *PhasePortrait::getCurve(const DiffMethod &method) { if (method == DiffMethod::Eilers) return pEilersCurve; if (method == DiffMethod::ModifiedEilers) return pModEilersCurve; if (method == DiffMethod::RungeKutta4thOrder) return pRungeKuttaCurve; if (method == DiffMethod::AdamsBashforth4rdOrder) return pAdamsCurve; return nullptr; } void PhasePortrait::drawArrows(const QList<Element> &data) { qDebug() << "Drawing arrows at phase portrait"; qDebug() << "Received" << data.size() << "items"; int size = data.size(); for (QCPAbstractItem *item : arrows) this->removeItem(item); arrows.clear(); int step = 2; if (size < 2) return; if (size > 2 && size < 50) step = 2; if (size > 50 && size < 100) step = 10; if (size > 100 && size < 400) step = 20; if (size > 400 && size < 1000) step = 60; if (size > 1000) step = 100; if (size > 5000) step = 400; // step = size / 10; for (int i = 0; i < data.size() - 5; i+= step) { QCPItemLine *arrow = new QCPItemLine(this); arrow->start->setCoords(data[i].second.at(0), data[i].second.at(1)); arrow->end->setCoords(data[i+2].second.at(0), data[i+2].second.at(1)); arrow->setHead(QCPLineEnding::esSpikeArrow); arrows << arrow; } } void PhasePortrait::setRoles(const QStringList &roleslist) { Q_ASSERT(roleslist.size() == 2); roles = roleslist; xAxis->setLabel(roleslist.at(0)); yAxis->setLabel(roleslist.at(1)); } void PhasePortrait::hide(const DiffMethod &method) { auto curve = getCurve(method); /// WARNING: Костыль curve->data().data()->clear(); curve->setVisible(false); replot(); } void PhasePortrait::clearPlot() { hide(DiffMethod::Eilers); hide(DiffMethod::ModifiedEilers); hide(DiffMethod::RungeKutta4thOrder); hide(DiffMethod::AdamsBashforth4rdOrder); pEilersCurve->data().data()->clear(); pModEilersCurve->data().data()->clear(); pRungeKuttaCurve->data().data()->clear(); pAdamsCurve->data().data()->clear(); for (QCPItemText *text : textItems) { this->removeItem(text); } textItems.clear(); } void PhasePortrait::setEquilibriumPoints(QList<StablePointForPhasePortrait> points) { if (points.size() == 0) return; Q_ASSERT(points.front().point.size() == 2); equilPoints = points; if (pointsGraph != nullptr) { pointsGraph->data().data()->clear(); for (QCPItemText *text : textItems) { this->removeItem(text); } textItems.clear(); } pointsGraph = this->addGraph(this->xAxis, this->yAxis); pointsGraph->setPen(QPen(QColor(Qt::black))); pointsGraph->setBrush(QBrush(QColor(Qt::black))); pointsGraph->setLineStyle(QCPGraph::lsNone); pointsGraph->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, QColor(Qt::black), QColor(Qt::black), 8)); for (StablePointForPhasePortrait p : points) { pointsGraph->addData(p.point.at(0), p.point.at(1)); QCPItemText *text = new QCPItemText(this); text->setClipToAxisRect(true); text->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter); text->position->setAxes(xAxis, yAxis); text->position->setCoords(p.point.at(0), p.point.at(1)); text->setFont(QFont(font().family(), 12)); text->setText(p.description); textItems << text; } } void PhasePortrait::draw(const DiffMethod &method, const QList<Element> &data) { Q_ASSERT(data.first().second.size() == 2); auto curve = getCurve(method); curve->setVisible(true); QVector<QCPCurveData> convertedData; for (const Element &el : data) { qreal x = el.second.at(0); qreal y = el.second.at(1); if (isCorrected(x) && isCorrected(y)) convertedData << QCPCurveData(el.first, x, y); } curve->data().data()->set(convertedData, true); drawArrows(data); axisRect()->setupFullAxesBox(); rescaleAxes(true); replot(); }
6081b2c24a7cd9b50a1448b4d40895a2a252556b
ac875b7b19dc40f0e5ba7131c71d5309935e03d4
/utils/conmenu.h
2d3bd72384a9f1892e93ecd26c480b48cf0c17d4
[]
no_license
Shad0w64bit/next
493bb1a102b3eeff5022299077b4c1ff679dc0e0
e6dfc8440a5b0825670d45f598624f57621c34fb
refs/heads/master
2023-03-17T07:38:36.039635
2021-03-08T08:58:29
2021-03-08T08:58:29
257,820,423
0
0
null
null
null
null
UTF-8
C++
false
false
1,587
h
conmenu.h
#include <iostream> #include <fstream> #include <windows.h> #include <conio.h> #define KB_UP 72 #define KB_DOWN 80 #define KB_ENTER 13 class ConMenu { public: ConMenu() { m_hOut = GetStdHandle(STD_OUTPUT_HANDLE); } ~ConMenu() { for (auto it=m_items.begin(); it!=m_items.end(); ++it) { free(*it); } } int show(unsigned int index = 0) { if (m_items.size() <= 0) return -1; unsigned int sel = (m_items.size() > index) ? index : 0; bool changed = true; while (true) { if (kbhit()) { int KB_code = getch(); int newSel; switch(KB_code) { case KB_UP: newSel = sel-1; if ((newSel >= 0) && (newSel < (int)m_items.size())) sel = newSel; break; case KB_DOWN: newSel = sel+1; if ((newSel >= 0) && (newSel < (int)m_items.size())) sel = newSel; break; case KB_ENTER: return sel; } changed = true; } if (changed) { system("cls"); unsigned int i=0; for (auto it=m_items.begin(); it!=m_items.end(); ++it) { if (i == sel) SetConsoleTextAttribute(m_hOut, BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED); std::cout << (*it) << std::endl; if (i == sel) SetConsoleTextAttribute(m_hOut, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED); i++; } changed = false; } } } void add(char* str) { int sz = strlen(str) + 1; if (sz <= 0) return; char* s = (char*)malloc(sz); strncpy(s,str,sz); m_items.push_back(s); } private: HANDLE m_hOut; std::vector<char*> m_items; };
3c176c569f48a65bb25607e4bf6bb79eb523d572
83e0b25992665df6283600d329b420799db0c0ef
/include/roswasm_examples.h
7b9ed415bf511393b37c6f8458a071d399b08884
[]
no_license
nilsbore/roswasm_webgui
2e72f1a948c5e723735d9c7e87ae6c73324bfbf4
c852f3301c25c4f6c0fa040fa0deff9893928973
refs/heads/master
2021-04-24T03:13:04.941712
2020-06-06T11:32:00
2020-06-06T11:32:00
250,066,633
0
1
null
2020-05-22T14:14:40
2020-03-25T19:03:39
C++
UTF-8
C++
false
false
2,249
h
roswasm_examples.h
#ifndef ROSWASM_EXAMPLES_H #define ROSWASM_EXAMPLES_H #include <roswasm_widget.h> #include <sensor_msgs/NavSatFix.h> #include <sensor_msgs/BatteryState.h> #include <nav_msgs/Odometry.h> namespace roswasm_webgui { class ExampleActuatorWidget { private: TopicPairWidget<geometry_msgs::Pose2D, std_msgs::Float64>* thruster_angles; TopicPairWidget<geometry_msgs::Pose2D, std_msgs::Float64>* thruster_rpms; roswasm::Publisher* rpm_pub; roswasm::Timer* pub_timer; bool rpm_pub_enabled; TopicWidget<std_msgs::Float32>* lcg_actuator; TopicWidget<std_msgs::Bool>* lcg_control_enable; TopicWidget<std_msgs::Float32>* lcg_control_setpoint; TopicWidget<std_msgs::Float32>* vbs_actuator; TopicWidget<std_msgs::Bool>* vbs_control_enable; TopicWidget<std_msgs::Float32>* vbs_control_setpoint; TopicWidget<std_msgs::Float32>* tcg_actuator; TopicWidget<std_msgs::Bool>* tcg_control_enable; TopicWidget<std_msgs::Float32>* tcg_control_setpoint; public: void pub_callback(const ros::TimerEvent& e); void show_window(bool& show_actuator_window); ExampleActuatorWidget(roswasm::NodeHandle* nh); }; class ExampleDashboardWidget { private: bool was_leak; TopicBuffer<std_msgs::Bool>* leak; TopicBuffer<sensor_msgs::NavSatFix>* gps; TopicBuffer<sensor_msgs::BatteryState>* battery; TopicBuffer<nav_msgs::Odometry>* odom; TopicBuffer<std_msgs::Float64>* vbs; TopicBuffer<std_msgs::Float64>* lcg; TopicBuffer<std_msgs::Float64>* depth; TopicBuffer<std_msgs::Float64>* pitch; TopicBuffer<std_msgs::Float64>* roll; TopicBuffer<std_msgs::Float64>* yaw; public: bool is_emergency() { return was_leak; } void show_window(bool& show_dashboard_window); ExampleDashboardWidget(roswasm::NodeHandle* nh); }; class ExampleTeleopWidget { private: bool enabled; geometry_msgs::Pose2D angles_msg; geometry_msgs::Pose2D rpm_msg; roswasm::Publisher* rpm_pub; roswasm::Publisher* angle_pub; roswasm::Timer* pub_timer; public: void pub_callback(const ros::TimerEvent& e); void show_window(bool& show_teleop_window); ExampleTeleopWidget(roswasm::NodeHandle* nh); }; } // namespace roswasm_webgui #endif // ROSWASM_EXAMPLES_H
7c3bc75973e4bfb402a57943408300f90ca457e8
293902682d7ee13be81ada6c28ef6b840983ac33
/CORAL_SERVER/CoralSockets/CoralSockets/GenericSocketException.h
83341596ca5575eba5a41139aa924a94aa65c913
[]
no_license
cms-externals/coral
d17cba45fff7f34d7a1ba13ab3bb371e0696c1af
a879b41c994fa956ff0ae78e3410bb409582ad20
refs/heads/cms/CORAL_2_3_21py3
2022-02-26T18:51:25.258362
2022-02-23T13:19:11
2022-02-23T13:19:11
91,173,895
0
4
null
2022-02-14T13:20:11
2017-05-13T12:47:54
C++
UTF-8
C++
false
false
558
h
GenericSocketException.h
#ifndef CORALSOCKETS_GENERICSOCKETEXCEPTION_H #define CORALSOCKETS_GENERICSOCKETEXCEPTION_H #include "CoralBase/Exception.h" namespace coral { namespace CoralSockets { class GenericSocketException : public Exception { public: /// Constructor GenericSocketException( const std::string& message, const std::string& methodName = "" ) : Exception( message, methodName, "coral::CoralSockets" ) {} /// Destructor virtual ~GenericSocketException() throw() {} }; } } #endif
ede49c28e8e4523c5a1df40f47cd111fb7b47d44
e3cd86387b1cbca05b5c78b428ec700a292623be
/src/Plotter.cpp
5cbe61fccf4d2936cc7d118734fc5be1b71fe372
[]
no_license
mkovac/KDs-plotter
5f23f7fa9bca6c77d7113a4183b3f1a4f467a645
020624376efbf70290c98d3a05c480dee40ced16
refs/heads/master
2021-01-01T15:30:00.019497
2014-06-09T14:09:33
2014-06-09T14:09:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
18,502
cpp
Plotter.cpp
#include "Plotter.hpp" // Constructor //============================================== Plotter::Plotter( TString energy, bool unblind ) { // ZXnorm = 1.0086 + 0.3826 + 0.4505 + 1.3097 + 0.8967 + 1.9897; ZXnorm = 0.462495 + 1.86816 + 0.297662 + 1.32318 + 0.211827 + 1.12853; // _applySuperKDcut = applySuperKDcut; _unblind = unblind; _energy = energy; plotsDir = "plots/properties_v3/"; inputDir = "/data_CMS/cms/mkovac/StatTrees/140519/"; can = new TCanvas( "can", "can", 550, 550 ); pt = new TPaveText( 0.14, 0.94, 0.89, 0.99, "brNDC" ); // Chains data = new TChain("SelectedTree"); qqZZ_8 = new TChain("SelectedTree"); qqZZ_7 = new TChain("SelectedTree"); ggZZ_8 = new TChain("SelectedTree"); ggZZ_7 = new TChain("SelectedTree"); SM_8 = new TChain("SelectedTree"); SM_7 = new TChain("SelectedTree"); // POWHEG_8 = new TChain("SelectedTree"); // POWHEG_7 = new TChain("SelectedTree"); PS_8 = new TChain("SelectedTree"); PS_7 = new TChain("SelectedTree"); } //============================================== // Destructor //================= Plotter::~Plotter() { delete can; } //================= //================== void Plotter::Plot() { if( applySuperKDcut ) { if ( _myProd == Utilities::GG || _myProd == Utilities::QQB ) { cutString = "ZZMass > 105.6 && ZZMass < 140.6 && p0plus_VAJHU*p0plus_m4l/(p0plus_VAJHU*p0plus_m4l+bkg_VAMCFM*bkg_m4l) > .5"; // SuperKD // cutStringR = "ZZMass > 105.6 && ZZMass < 140.6 && p0plus_VAJHU*p0plus_m4l_125p65/(p0plus_VAJHU*p0plus_m4l_125p65+bkg_VAMCFM*bkg_m4l_125p65) > .5"; // SuperKD } else { cutString = "ZZMass > 105.6 && ZZMass < 140.6 && p0plus_VAJHU*p0plus_m4l/(p0plus_VAJHU*p0plus_m4l+bkg_prodIndep_VAMCFM*bkg_m4l) > .5"; // Production indepedent SuperKD // cutStringR = "ZZMass > 105.6 && ZZMass < 140.6 && p0plus_VAJHU*p0plus_m4l_125p65/(p0plus_VAJHU*p0plus_m4l_125p65+bkg_prodIndep_VAMCFM*bkg_m4l_125p65) > .5"; // production indepedent SuperKD } } else { cutString = "ZZMass > 121.5 && ZZMass < 130.5"; // cutStringR = "ZZMass > 121.5 && ZZMass < 130.5"; // cutString = "ZZMass > 105.6 && ZZMass < 140.6"; } // Read the Trees if ( _energy == "7TeV" ) { data->Reset(); qqZZ_7->Reset(); ggZZ_7->Reset(); SM_7->Reset(); // POWHEG_7->Reset(); PS_7->Reset(); read7TeV_Data(); read7TeV_MC(); } else if ( _energy == "8TeV" ) { data->Reset(); qqZZ_8->Reset(); ggZZ_8->Reset(); SM_8->Reset(); // POWHEG_8->Reset(); PS_8->Reset(); read8TeV_Data(); read8TeV_MC(); } else { data->Reset(); qqZZ_7->Reset(); ggZZ_7->Reset(); SM_7->Reset(); // POWHEG_7->Reset(); PS_7->Reset(); qqZZ_8->Reset(); ggZZ_8->Reset(); SM_8->Reset(); // POWHEG_8->Reset(); PS_8->Reset(); read7TeV_Data(); read7TeV_MC(); read8TeV_Data(); read8TeV_MC(); } // Loop over the variables for ( int iVar = 0; iVar < Utilities::numOfVariables; iVar++ ) { // Set correct draw strings if ( iVar == Utilities::SuperKD && (_myProd == Utilities::GG || _myProd == Utilities::QQB) ) { drawString = variableString[7] + "bkg_VAMCFM*bkg_m4l)"; // drawStringR = variableStringR[7] + "bkg_VAMCFM*bkg_m4l_125p65)"; } else if ( iVar == Utilities::SuperKD && _myProd == Utilities::PID ) { drawString = variableString[7] + "bkg_prodIndep_VAMCFM*bkg_m4l)"; // drawStringR = variableStringR[7] + "bkg_prodIndep_VAMCFM*bkg_m4l_125p65)"; } else if ( iVar == Utilities::KD ) { if ( _myProd == Utilities::GG ) { drawString = variableString[8] + modelGG[_myModel] + "_VAJHU)"; // drawStringR = variableStringR[8] + model[myModel] + "_VAJHU)"; } else if ( _myProd == Utilities::QQB ) { drawString = variableString[8] + modelQQB[_myModel] + "_VAJHU)"; } else if ( _myProd == Utilities::PID ) { drawString = variableString[8] + modelPID[_myModel] + "_VAJHU)"; } } else { drawString = variableString[iVar]; // drawStringR = variableStringR[iVar]; } // Set correct cuts for KD and SuperKD if ( iVar >= 7 && !applySuperKDcut ) { cutString = "ZZMass > 105.6 && ZZMass < 140.6"; // cutStringR = "ZZMass > 105.6 && ZZMass < 140.6"; } // Set binning if ( iVar == Utilities::Z1Mass && !applySuperKDcut ) binsString[0] = "(40,40,120)"; // Make data histograms if ( _unblind ) { data->Draw( drawString + ">>datahisto" + binsString[iVar], cutString ); datahisto = (TH1F*) gDirectory->Get("datahisto"); datahisto->SetBinErrorOption(TH1::kPoisson); datahisto->SetMarkerStyle(20); datahisto->SetMarkerSize(.7); } // Make histograms if ( _energy == "7TeV" ) { makeHistos7TeV_MC( binsString[iVar] ); qqZZhisto = new TH1F(*qqZZ_7histo); ggZZhisto = new TH1F(*ggZZ_7histo); SMhisto = new TH1F(*SM_7histo); PShisto = new TH1F(*PS_7histo); } else if ( _energy == "8TeV" ) { makeHistos8TeV_MC( binsString[iVar] ); qqZZhisto = new TH1F(*qqZZ_8histo); ggZZhisto = new TH1F(*ggZZ_8histo); SMhisto = new TH1F(*SM_8histo); PShisto = new TH1F(*PS_8histo); } else { makeHistos8TeV_MC( binsString[iVar] ); makeHistos7TeV_MC( binsString[iVar] ); qqZZhisto = new TH1F(*qqZZ_7histo); qqZZhisto->Add(qqZZ_8histo); ggZZhisto = new TH1F(*ggZZ_7histo); ggZZhisto->Add(ggZZ_8histo); SMhisto = new TH1F(*SM_7histo); SMhisto->Add(SM_8histo); PShisto = new TH1F(*PS_7histo); PShisto->Add(PS_8histo); } // if ( !qqZZ_7histo || !qqZZ_8histo ) assert(0); qqZZhisto->SetLineColor(kAzure-9); qqZZhisto->SetLineWidth(2); qqZZhisto->SetFillColor(kAzure-9); ggZZhisto->SetLineColor(kAzure-9); ggZZhisto->SetLineWidth(0); ggZZhisto->SetFillColor(kAzure-9); SMhisto->SetLineColor(kOrange+10); SMhisto->SetLineWidth(2); SMhisto->SetFillColor(0); PShisto->SetLineColor(kRed); PShisto->SetLineWidth(2); PShisto->SetLineStyle(2); PShisto->SetFillColor(0); PShisto->Scale( SMhisto->Integral()/PShisto->Integral() ); double with = (double)qqZZ_8->Draw( "ZZMass", cutString ); double without = (double)qqZZ_8->Draw( "ZZMass", "ZZMass > 105.6 && ZZMass < 140.6" ); // double with = (double)qqZZhisto->Draw( "ZZMass", cutString ); // double without = (double)qqZZhisto->Draw( "ZZMass", "ZZMass > 105.6 && ZZMass < 140.6" ); ZXhisto = new TH1F(*qqZZhisto); ZXhisto->Scale( (ZXnorm*with/without)/ZXhisto->Integral() ); ZXhisto->SetLineColor(kGreen-5); ZXhisto->SetLineWidth(2); ZXhisto->SetFillColor(kGreen-5); stringstream ss; ss << SMhisto->GetBinWidth(5); ss >> binWidth; if ( _unblind ) { datahisto->GetXaxis()->SetTitle( axisLabel[iVar] ); datahisto->GetYaxis()->SetTitle( "Events / " + binWidth ); if ( iVar == Utilities::KD) { if ( _myProd == Utilities::GG ) datahisto->GetXaxis()->SetTitle(KDlabelGG[_myModel]); else if ( _myProd == Utilities::QQB ) datahisto->GetXaxis()->SetTitle(KDlabelQQB[_myModel]); else datahisto->GetXaxis()->SetTitle(KDlabelPID[_myModel]); } if( _myProd == Utilities::PID && iVar == Utilities::SuperKD ) datahisto->GetXaxis()->SetTitle( axisLabel[iVar] + "^{dec}" ); } THStack* stackSM = new THStack( "stackSM", "stackSM" ); stackSM->Add(ZXhisto); stackSM->Add(ggZZhisto); stackSM->Add(qqZZhisto); stackSM->Add(SMhisto); THStack* stackPS = new THStack( "stackPS", "stackPS" ); stackPS->Add(ZXhisto); stackPS->Add(ggZZhisto); stackPS->Add(qqZZhisto); stackPS->Add(PShisto); ////////// // Draw // ////////// if ( _unblind ) { datahisto->GetYaxis()->SetRangeUser(0,max(stackSM->GetMaximum(),datahisto->GetBinContent(datahisto->GetMaximumBin())+datahisto->GetBinError(datahisto->GetMaximumBin()))*1.5); datahisto->Draw("E1"); } else { stackSM->Draw(""); stackSM->GetXaxis()->SetTitle( axisLabel[iVar] ); stackSM->GetYaxis()->SetTitle( "Events / " + binWidth ); stackSM->SetMaximum( stackSM->GetMaximum()*2 ); if ( iVar == Utilities::KD) { if ( _myProd == Utilities::GG ) stackSM->GetXaxis()->SetTitle(KDlabelGG[_myModel]); else if ( _myProd == Utilities::QQB ) stackSM->GetXaxis()->SetTitle(KDlabelQQB[_myModel]); else stackSM->GetXaxis()->SetTitle(KDlabelPID[_myModel]); } if( _myProd == Utilities::PID && iVar == Utilities::SuperKD ) stackSM->GetXaxis()->SetTitle( axisLabel[iVar] + "^{dec}" ); } stackSM->Draw("SAME"); // if(myModel!=0) stackPS->Draw("SAME"); stackPS->Draw("SAME"); if ( _unblind ) { datahisto->Draw("E1same"); datahisto->Draw("SAMEp"); } // // Legend // TLegend *leg = new TLegend( .2, .68, .6, .9 ); leg->SetFillColor(0); leg->SetBorderSize(0); if ( _unblind ) { leg->AddEntry( datahisto, "Data", "p" ); } leg->AddEntry(SMhisto,"0^{+}","l"); //, m_{H}=126 GeV if ( _myProd == Utilities::GG ) leg->AddEntry( PShisto, legendTagGG[_myModel], "l" ); else if ( _myProd == Utilities::QQB ) leg->AddEntry( PShisto, legendTagQQB[_myModel], "l" ); else leg->AddEntry( PShisto, legendTagPID[_myModel], "l" ); leg->AddEntry( qqZZhisto, "ZZ/Z#gamma*", "f" ); leg->AddEntry( ZXhisto, "Z+X", "f" ); leg->Draw(); // datahisto->Draw( "E1same" ); gPad->RedrawAxis(); // // Plot header // pt->SetBorderSize(0); pt->SetTextAlign(12); pt->SetFillStyle(0); pt->SetTextFont(42); pt->SetTextSize(0.03); text = pt->AddText( 0.01, 0.3, "CMS (preliminary)" ); text = pt->AddText( 0.53, 0.3, "19.7 fb^{-1} (8 TeV) + 5.1 fb^{-1} (7 TeV)"); pt->Draw(); if ( _myProd == Utilities::PID && applySuperKDcut ) { SupeKDCut = new TLatex(0.7, 0.85, "D^{dec}_{bkg} > 0.5"); SupeKDCut->SetNDC(kTRUE); SupeKDCut->SetTextFont(42); SupeKDCut->Draw("same"); } else if ( (_myProd == Utilities::GG || _myProd == Utilities::QQB) && applySuperKDcut ) { SupeKDCut = new TLatex(0.7, 0.85, "D_{bkg} > 0.5"); SupeKDCut->SetNDC(kTRUE); SupeKDCut->SetTextFont(42); SupeKDCut->Draw("same"); } // // Save // if ( applySuperKDcut ) { can->SaveAs(plotsDir + saveTag[_myModel] + saveProductionTag[_myProd] + saveString[iVar] + "_superKDcut.png"); can->SaveAs(plotsDir + saveTag[_myModel] + saveProductionTag[_myProd] + saveString[iVar] + "_superKDcut.pdf"); // can->SaveAs(plotsDir + saveTag[_myModel] + "_" + saveString[iVar] + "_superKDcut.eps"); // can->SaveAs(plotsDir + saveTag[_myModel] + "_" + saveString[iVar] + "_superKDcut.root"); // can->SaveAs(plotsDir + saveTag[_myModel] + "_" + saveString[iVar] + "_superKDcut.C"); } else { can->SaveAs(plotsDir + saveTag[_myModel] + saveProductionTag[_myProd] + saveString[iVar] + ".png"); can->SaveAs(plotsDir + saveTag[_myModel] + saveProductionTag[_myProd] + saveString[iVar] + ".pdf"); // can->SaveAs(plotsDir + saveTag[_myModel] + "_" + saveString[iVar] + ".eps"); // can->SaveAs(plotsDir + saveTag[_myModel] + "_" + saveString[iVar] + ".root"); // can->SaveAs(plotsDir + saveTag[_myModel] + "_" + saveString[iVar] + ".C"); } // Cleaning cout << "[INFO]: Cleaning..." << endl; pt->Clear(); delete qqZZ_7histo; delete qqZZ_8histo; delete ggZZ_7histo; delete ggZZ_8histo; // delete POWHEG_7histo; // delete POWHEG_8histo; delete SM_7histo; delete SM_8histo; delete PS_7histo; delete PS_8histo; delete datahisto; delete qqZZhisto; delete ZXhisto; delete SMhisto; delete PShisto; } // End for var } // End plot function //================== //========================= void Plotter::read8TeV_MC() { cout << "[INFO]: Reading 8TeV MC..." << endl; qqZZ_8->Add(inputDir + "PRODFSR_8TeV/4mu/HZZ4lTree_ZZTo*.root"); qqZZ_8->Add(inputDir + "PRODFSR_8TeV/4e/HZZ4lTree_ZZTo*.root"); qqZZ_8->Add(inputDir + "PRODFSR_8TeV/2mu2e/HZZ4lTree_ZZTo*.root"); ggZZ_8->Add(inputDir + "PRODFSR_8TeV/4mu/HZZ4lTree_ggZZ*.root"); ggZZ_8->Add(inputDir + "PRODFSR_8TeV/4e/HZZ4lTree_ggZZ*.root"); ggZZ_8->Add(inputDir + "PRODFSR_8TeV/2mu2e/HZZ4lTree_ggZZ*.root"); SM_8->Add(inputDir + "PRODFSR_8TeV/4mu/HZZ4lTree_powheg15jhuGenV3-0PMH125.6.root"); SM_8->Add(inputDir + "PRODFSR_8TeV/4e/HZZ4lTree_powheg15jhuGenV3-0PMH125.6.root"); SM_8->Add(inputDir + "PRODFSR_8TeV/2mu2e/HZZ4lTree_powheg15jhuGenV3-0PMH125.6.root"); // POWHEG_8->Add(inputDir + "PRODFSR_8TeV/4mu/HZZ4lTree_powheg15jhuGenV3H126.root"); // Was HZZ4lTree_H126 // POWHEG_8->Add(inputDir + "PRODFSR_8TeV/4e/HZZ4lTree_powheg15jhuGenV3H126.root"); // Was HZZ4lTree_H126 // POWHEG_8->Add(inputDir + "PRODFSR_8TeV/2mu2e/HZZ4lTree_powheg15jhuGenV3H126.root"); // Was HZZ4lTree_H126 if ( _myProd == Utilities::QQB ) { PS_8->Add(inputDir + "PRODFSR_8TeV/4mu/HZZ4lTree_" + sampleNameQQB[_myModel] + ".root"); PS_8->Add(inputDir + "PRODFSR_8TeV/4e/HZZ4lTree_" + sampleNameQQB[_myModel] + ".root"); PS_8->Add(inputDir + "PRODFSR_8TeV/2mu2e/HZZ4lTree_" + sampleNameQQB[_myModel] + ".root"); cout << "[INFO] 8TeV ALT model tree is " << sampleNameQQB[_myModel] << endl; } else { PS_8->Add(inputDir + "PRODFSR_8TeV/4mu/HZZ4lTree_" + sampleNameGG[_myModel] + ".root"); PS_8->Add(inputDir + "PRODFSR_8TeV/4e/HZZ4lTree_" + sampleNameGG[_myModel] + ".root"); PS_8->Add(inputDir + "PRODFSR_8TeV/2mu2e/HZZ4lTree_" + sampleNameGG[_myModel] + ".root"); cout << "[INFO] 8TeV ALT model tree is " << sampleNameGG[_myModel] << endl; } // End if _myProd } // End read8TeV_MC() //========================= //========================= void Plotter::read7TeV_MC() { cout << "[INFO]: Reading 7TeV MC..." << endl; qqZZ_7->Add(inputDir + "PRODFSR/4mu/HZZ4lTree_ZZTo*.root"); qqZZ_7->Add(inputDir + "PRODFSR/4e/HZZ4lTree_ZZTo*.root"); qqZZ_7->Add(inputDir + "PRODFSR/2mu2e/HZZ4lTree_ZZTo*.root"); ggZZ_7->Add(inputDir + "PRODFSR/4mu/HZZ4lTree_ggZZ*.root"); ggZZ_7->Add(inputDir + "PRODFSR/4e/HZZ4lTree_ggZZ*.root"); ggZZ_7->Add(inputDir + "PRODFSR/2mu2e/HZZ4lTree_ggZZ*.root"); SM_7->Add(inputDir + "PRODFSR/4mu/HZZ4lTree_powheg15jhuGenV3-0PMH125.6.root"); SM_7->Add(inputDir + "PRODFSR/4e/HZZ4lTree_powheg15jhuGenV3-0PMH125.6.root"); SM_7->Add(inputDir + "PRODFSR/2mu2e/HZZ4lTree_powheg15jhuGenV3-0PMH125.6.root"); // POWHEG_7->Add(inputDir + "PRODFSR/4mu/HZZ4lTree_powheg15jhuGenV3H126.root"); // Was HZZ4lTree_H126 // POWHEG_7->Add(inputDir + "PRODFSR/4e/HZZ4lTree_powheg15jhuGenV3H126.root"); // Was HZZ4lTree_H126 // POWHEG_7->Add(inputDir + "PRODFSR/2mu2e/HZZ4lTree_powheg15jhuGenV3H126.root"); // Was HZZ4lTree_H126 if ( _myProd == Utilities::QQB ) { PS_7->Add(inputDir + "PRODFSR/4mu/HZZ4lTree_" + sampleNameQQB[_myModel] + ".root"); PS_7->Add(inputDir + "PRODFSR/4e/HZZ4lTree_" + sampleNameQQB[_myModel] + ".root"); PS_7->Add(inputDir + "PRODFSR/2mu2e/HZZ4lTree_" + sampleNameQQB[_myModel] + ".root"); cout << "[INFO] 7TeV ALT model tree is " << sampleNameQQB[_myModel] << endl; } else { PS_7->Add(inputDir + "PRODFSR/4mu/HZZ4lTree_" + sampleNameGG[_myModel] + ".root"); PS_7->Add(inputDir + "PRODFSR/4e/HZZ4lTree_" + sampleNameGG[_myModel] + ".root"); PS_7->Add(inputDir + "PRODFSR/2mu2e/HZZ4lTree_" + sampleNameGG[_myModel] + ".root"); cout << "[INFO] 7TeV ALT model tree is " << sampleNameGG[_myModel] << endl; } // End if _myProd } // End read7TeV_MC() //========================= //=========================== void Plotter::read8TeV_Data() { cout << "[INFO]: Reading 8TeV Data..." << endl; data->Add(inputDir + "PRODFSR_8TeV/data/HZZ4lTree_DoubleMu.root"); data->Add(inputDir + "PRODFSR_8TeV/data/HZZ4lTree_DoubleOr.root"); data->Add(inputDir + "PRODFSR_8TeV/data/HZZ4lTree_DoubleEle.root"); } //=========================== //=========================== void Plotter::read7TeV_Data() { cout << "[INFO]: Reading 7TeV Data..." << endl; data->Add(inputDir + "PRODFSR/data/HZZ4lTree_DoubleMu.root"); data->Add(inputDir + "PRODFSR/data/HZZ4lTree_DoubleOr.root"); data->Add(inputDir + "PRODFSR/data/HZZ4lTree_DoubleEle.root"); } //=========================== //================================================ void Plotter::makeHistos8TeV_MC( TString binning ) { cout << "[INFO]: Making 8TeV histos..." << endl; qqZZ_8->Draw( drawString + ">>qqZZ_8histo" + binning, "19.712*MC_weight*("+cutString+")" ); qqZZ_8histo = (TH1F*) gDirectory->Get("qqZZ_8histo"); ggZZ_8->Draw( drawString + ">>ggZZ_8histo" + binning, "19.712*MC_weight*("+cutString+")" ); ggZZ_8histo = (TH1F*) gDirectory->Get("ggZZ_8histo"); // POWHEG_8->Draw( drawString + ">>POWHEG_8histo" + binning, "19.712*MC_weight*("+cutString+")" ); // POWHEG_8histo = (TH1F*) gDirectory->Get("POWHEG_8histo"); SM_8->Draw( drawString + ">>SM_8histo" + binning, "19.712*MC_weight*("+cutString+")" ); SM_8histo = (TH1F*) gDirectory->Get("SM_8histo"); // SM_8histo->Scale(POWHEG_8histo->Integral()/SM_8histo->Integral()); PS_8->Draw( drawString + ">>PS_8histo" + binning, "19.712*MC_weight*("+cutString+")" ); PS_8histo = (TH1F*) gDirectory->Get("PS_8histo"); // PS_8histo->Scale(POWHEG_8histo->Integral()/PS_8histo->Integral()); } //================================================ //================================================ void Plotter::makeHistos7TeV_MC( TString binning ) { cout << "[INFO]: Making 7TeV histos..." << endl; qqZZ_7->Draw( drawString + ">>qqZZ_7histo" + binning, "5.051*MC_weight*("+cutString+")" ); qqZZ_7histo = (TH1F*) gDirectory->Get("qqZZ_7histo"); ggZZ_7->Draw( drawString + ">>ggZZ_7histo" + binning, "5.051*MC_weight*("+cutString+")" ); ggZZ_7histo = (TH1F*) gDirectory->Get("ggZZ_7histo"); // POWHEG_7->Draw( drawString + ">>POWHEG_7histo" + binning, "5.051*MC_weight*("+cutString+")" ); // POWHEG_7histo = (TH1F*) gDirectory->Get("POWHEG_7histo"); SM_7->Draw( drawString + ">>SM_7histo" + binning, "5.051*MC_weight*("+cutString+")" ); SM_7histo = (TH1F*) gDirectory->Get("SM_7histo"); // SM_7histo->Scale(POWHEG_7histo->Integral()/SM_7histo->Integral()); PS_7->Draw( drawString + ">>PS_7histo" + binning, "5.051*MC_weight*("+cutString+")" ); PS_7histo = (TH1F*) gDirectory->Get("PS_7histo"); // PS_7histo->Scale(POWHEG_7histo->Integral()/PS_7histo->Integral()); } //================================================ //====================================================== void Plotter::PlotKD( Utilities::hypothesis myModel, Utilities::production myProd ) { _myModel = myModel; _myProd = myProd; applySuperKDcut = true; Plot(); applySuperKDcut = false; Plot(); } //======================================================
78c6042931d4cd566812bd946edaf2445f4c4ad8
c9c680dfec2a7b35b025d4438fd464147f51ed6c
/src/Sound_Mixer.h
6ba5077ed577be3cc91fdd3a18c95c29c003dbbc
[]
no_license
birgersp/df-jobsounds
5064ff3f2d6b8b292e5e359d8f1e5ba59e7caa93
fb04e5de12b20d473fb2e269fa3d8017c40c934c
refs/heads/master
2020-12-22T16:09:11.272996
2020-06-01T19:09:30
2020-06-01T19:09:30
64,414,073
1
1
null
null
null
null
UTF-8
C++
false
false
353
h
Sound_Mixer.h
/** * @author birgersp * https://github.com/birgersp */ #pragma once #include "core.h" #include "Sound.h" #include <SDL2/SDL_mixer.h> class Sound_Mixer { public: void initialize(); Sound load_sound(String_ref filename); void play(const Sound& sound); private: Vector<Mix_Chunk *> mix_chunks; Mix_Chunk *get_mix_chunk(const Sound& sound); };
297106bb852593bf78e83ca5eae6ea6660d8ebe2
20737c1ea61539f214e95f4fc8cd9b3fc77925dc
/TurboSort.cpp
eb276f47bd618310b821bec805d12db9a48ff97e
[]
no_license
abhicse32/Codechef-Solutions
6b67eda8805eee077a1ff66ed57eeb34d9876866
8f0277db048bc08053a2ff55d00f5d6c5a17aa84
refs/heads/master
2021-01-20T17:32:58.839891
2016-06-08T13:32:05
2016-06-08T13:32:05
60,700,174
0
1
null
null
null
null
UTF-8
C++
false
false
366
cpp
TurboSort.cpp
#include<> #include<stdlib.h> int main() { int t,n,i,j,*arr,MAX = 1000000; scanf("%d",&t); arr = (int *)malloc(sizeof(int) * MAX); for(i = 0; i < t; i++) { scanf("%d",&n); arr[n-1]++; } for( i = 0; i < MAX; i++) { for(j = 0;j < arr[i]; j++) printf("%d\n",i + 1); } //getch(); return 0; }
239846a94efb8dca658524e1814cc941711c3723
ec6b16fc4c014258d3ea48626ae58b80290384c9
/Cyberbezpieczenstwo_w_administracji/Cyberbezpieczenstwo_w_administracji/PauseState.cpp
0339576a14de289014c76177c258dfb773dc46b8
[]
no_license
SwRafal/Cyberbezpieczenstwo_w_administracji
5336ec35ec6e4bb7d1751806c3b4ec2ebcdcd429
58289efb02ebf901e5b7fc2546e65ccdf94fd06b
refs/heads/master
2020-06-18T18:17:49.168974
2019-10-23T18:49:30
2019-10-23T18:49:30
196,395,303
0
2
null
null
null
null
WINDOWS-1250
C++
false
false
5,109
cpp
PauseState.cpp
#include "PauseState.h" PauseState::PauseState(gm::gameDataRef data) : data(data), resumeButton(*gm::Assets::getFont()), saveButton(*gm::Assets::getFont()), menuButton(*gm::Assets::getFont()) { } PauseState::~PauseState() { } void PauseState::init() { /* variables */ resuming = false; scale = 0.05; opacity = 0; /* scene background */ gm::Assets::LoadTexture("rounded rect shape", ROUNDED_RECT_SHAPE_FILEPATH); buttonsbackground.setTexture(*gm::Assets::getTexture("rounded rect shape")); buttonsbackground.setPosition(SCREEN_WIDTH / 2 - buttonsbackground.getGlobalBounds().width / 2, SCREEN_HEIGHT / 2 - buttonsbackground.getGlobalBounds().height / 2); background.setTexture(*gm::Assets::getTexture("pause bg")); background.setScale(SCREEN_WIDTH / background.getGlobalBounds().width, SCREEN_HEIGHT / background.getGlobalBounds().height); rect.setSize(sf::Vector2f(SCREEN_WIDTH,SCREEN_HEIGHT)); rect.setFillColor(sf::Color(82, 82, 82,opacity)); rect.setPosition(0,0); /* Resume button */ resumeButton.setTextIdleColor(sf::Color::White); resumeButton.setTextAimedColor(sf::Color(230, 120, 255,255)); resumeButton.setTextPressColor(sf::Color(216, 46, 255,255)); resumeButton.setIdleColor(sf::Color::Transparent); resumeButton.setAimedColor(sf::Color::Transparent); resumeButton.setPressColor(sf::Color::Transparent); resumeButton.setSize(200,55); resumeButton.setTextSize(250); resumeButton.setTextString(L"Wznów grę"); resumeButton.setPosition(SCREEN_WIDTH / 2 - resumeButton.getGlobalBounds().width / 2,SCREEN_HEIGHT / 2 - resumeButton.getGlobalBounds().height / 2 - 50); /* Save button */ saveButton.setTextIdleColor(sf::Color::White); saveButton.setTextAimedColor(sf::Color(230, 120, 255, 255)); saveButton.setTextPressColor(sf::Color(216, 46, 255, 255)); saveButton.setIdleColor(sf::Color::Transparent); saveButton.setAimedColor(sf::Color::Transparent); saveButton.setPressColor(sf::Color::Transparent); saveButton.setSize(200, 55); saveButton.setTextSize(80); saveButton.setTextString(L"Zapisz grę"); saveButton.setPosition(SCREEN_WIDTH / 2 - saveButton.getGlobalBounds().width / 2, SCREEN_HEIGHT / 2 - saveButton.getGlobalBounds().height / 2 + 4); /* Menu button */ menuButton.setTextIdleColor(sf::Color::White); menuButton.setTextAimedColor(sf::Color(230, 120, 255,255)); menuButton.setTextPressColor(sf::Color(216, 46, 255,255)); menuButton.setIdleColor(sf::Color::Transparent); menuButton.setAimedColor(sf::Color::Transparent); menuButton.setPressColor(sf::Color::Transparent); menuButton.setSize(300,60); menuButton.setTextSize(70); menuButton.setTextString(L"Wyjście do menu"); menuButton.setPosition(SCREEN_WIDTH / 2 - menuButton.getGlobalBounds().width / 2,SCREEN_HEIGHT / 2 - menuButton.getGlobalBounds().height / 2 + 60); /* click sound */ gm::Assets::LoadSound("click", CLICK_SOUND_FILEPATH); clickSound.setBuffer(*gm::Assets::getSound("click")); } void PauseState::handleInput() { /*Events*/ gm::Core::resetEvent(); gm::Core::setEnteredChar(NULL); while (gm::Core::getWindow().pollEvent(gm::Core::getEvent())) { switch (gm::Core::getEvent().type) { case sf::Event::Closed: gm::Core::getWindow().close(); break; case sf::Event::TextEntered: gm::Core::setEnteredChar(gm::Core::getEvent().text.unicode); break; case sf::Event::Resized: break; } } if(gm::Core::getEnteredChar() == 0x0000001B) { resuming = true; } if(resumeButton.clicked(gm::Core::getWindow())) { clickSound.play(); Sleep(100); resuming = true; } if (saveButton.clicked(gm::Core::getWindow())) { clickSound.play(); Sleep(100); resuming = true; data->moveToSave = true; } if(menuButton.clicked(gm::Core::getWindow())) { clickSound.play(); Sleep(100); resuming = true; data->returnToMenu = true; } } void PauseState::update(sf::RenderWindow &win) { /* animation */ if(resuming == true && opacity <= 0 && scale <= 0.05) data->machine.removeState(); if(resuming == false && (opacity < 170 || scale < 1.0)) { buttonsbackground.setScale(scale,scale); buttonsbackground.setPosition(SCREEN_WIDTH / 2 - buttonsbackground.getGlobalBounds().width / 2, SCREEN_HEIGHT / 2 - buttonsbackground.getGlobalBounds().height / 2); if(scale < 1.0) scale = scale + 0.05; rect.setFillColor(sf::Color(82, 82, 82,opacity)); if(opacity < 170) opacity = opacity + 10; } if(resuming == true && (opacity > 0 || scale > 0.05)) { buttonsbackground.setScale(scale,scale); buttonsbackground.setPosition(SCREEN_WIDTH / 2 - buttonsbackground.getGlobalBounds().width / 2, SCREEN_HEIGHT / 2 - buttonsbackground.getGlobalBounds().height / 2); if(scale > 0.05) scale = scale - 0.05; rect.setFillColor(sf::Color(82, 82, 82,opacity)); if(opacity > 0) opacity = opacity - 10; } } void PauseState::draw(sf::RenderWindow& win) { win.clear(); win.draw(background); win.draw(rect); win.draw(buttonsbackground); if(opacity >= 170 && scale >= 1.0) { win.draw(resumeButton); win.draw(saveButton); win.draw(menuButton); } win.display(); }
a20d39e2fe2562e0805cc386c0bfd741fad3b756
e35b0ed81d919b0a0dd446ef1f92a40fc3fbff0b
/test/data_handler_test.cpp
8f0ee9337addbddb516b077b34e6988590ebc5af
[]
no_license
DonghyunSung-MS/motion_filter
06d3907c52647c41f9444e43acbbd369860d6489
fb7a66a691b8e135593faa45e3d640e7533efce7
refs/heads/master
2023-06-24T10:35:31.241097
2021-07-23T09:00:28
2021-07-23T09:00:28
379,152,948
1
1
null
null
null
null
UTF-8
C++
false
false
810
cpp
data_handler_test.cpp
#include <motion_filter/data_handler.hpp> #include <std_msgs/Int32.h> #include <std_msgs/Float64.h> using namespace motion_filter; int main(int argc, char **argv) { ros::init(argc, argv, "dh_test"); ros::NodeHandle nh("~"); double dt = 1.0/100.0; DataHandler dh = DataHandler(nh); ros::Rate loop_rate(1.0/dt); int pub1_ind, pub2_ind; pub1_ind = dh.addPublisher<std_msgs::Int32>("/int_test", 100); pub2_ind = dh.addPublisher<std_msgs::Float64>("/double_test", 100); while(ros::ok()) { std_msgs::Int32 msg1; std_msgs::Float64 msg2; msg1.data = 1; msg2.data = 5.0; dh.publish(msg1, pub1_ind); dh.publish(msg2, pub2_ind); ros::spinOnce(); loop_rate.sleep(); } return 0; }
6c824eae8e982cef01b5210b1e7934f6ac3fed59
c564bc1a2b730b2ea27fb847e4be2a979fd28718
/cacm.cpp
d7705e8fec8ae3bcc96544a249763b63b3b77ac7
[]
no_license
codyemoffitt/2110_LinkedListsCPP
7aebf3642924b438cbff6b6c7aff4ecd91394358
ddbfd32f9abf944e167e881d75c92621ecc85c30
refs/heads/master
2021-01-09T21:48:31.672534
2016-01-15T08:41:40
2016-01-15T08:41:40
49,707,048
0
0
null
null
null
null
UTF-8
C++
false
false
8,190
cpp
cacm.cpp
//Program 2 cacm.cpp //Author: Cody Moffitt //Date: 3-7-13 //Purpose: This program loads articles from the CACM database files into a sorted linked list. // It opens the CACM database file given in the command line arguments. // If the filename and file are valid, it loads articles into a sorted linked list. // It then displays a menu and lets you make several choices to manipulate or show that list. // You can find an article, list all articles, add a new article, remove an article, or exit. // The program loops until the user chooses to exit. #include <iostream> #include <string> #include <fstream> #include "linkedlist.h" #include "article.h" using namespace std; char displayMenu() //Function to display the user menu and get user input. { cout << endl << endl << "What would you like to do?" << endl; cout << "(F)ind an article" << endl; cout << "(L)ist all articles" << endl; cout << "(A)dd a new article" << endl; cout << "(R)emove an existing article" << endl; cout << "(E)xit" << endl; cout << "Your choice>"; return cin.get(); } int main(int argc, char *argv[]) { ifstream inFile; //The stream for the file we will open, it will hold the database. string inFileName; //The name of the file to open. Article temp; //The article object we will temporarily use to load our database full of articles. string nKey, nAuthor, nTitle; //Temporarily used strings to load the article temp object's data members. LinkedList<Article> list; //The linked list we will load our database of articles into. char menuChoice; //The char variable which will hold the user's menu choice. bool found = false; //A bool to determine if an article was found or not. bool exit = false; //If the user wants to quit, this gets turned to true and breaks the program's main loop. if ( argc != 2 ) // We need atleast two arguments, the program name and the filename. { cout << endl << "Please enter a file name after the program. Example: "<< argv[0] <<" filename" << endl; cout << "Exiting..." << endl; return(0); } else inFileName = argv[1]; //If we have enough arguments, assign the 2nd argument to the file name. inFile.open(inFileName.c_str()); //Open the file with the database in it. if (!inFile) //Check to make sure our file is valid. { cout << "File not found. Exiting..." << endl; return(0); } cout << endl << "Loading library, please wait..." << endl; //Tell the user we are loading the database. If it was huge it could take a while. while(!inFile.eof()) //Load the linked list with the articles in the database. We use the temp article and strings to do it. { getline(inFile, nKey,'\n'); getline(inFile, nAuthor,'\n'); getline(inFile, nTitle,'\n'); temp.Init(nKey, nAuthor, nTitle); list.PutItem(temp); } inFile.close(); //Close the file. Please be kind, rewind. cout << endl << "Welcome to the CACM library!" << endl; //Display the menu, gather user input. while(!exit) //Keep running until user specifies to end it. { menuChoice = displayMenu(); //Display menu returns the user's input. switch(menuChoice) { case 'F':case 'f': //Find an article based on its key and display it. cin.ignore(10000,'\n'); //Ignores any weird extra input from cin, so we get good strings below. //We get the key, load it into a string, load that into our temp article. cout << endl << "Please enter a search key: "; getline(cin, nKey,'\n'); temp.setKey(nKey); temp = list.GetItem(temp, found); if(found) { cout << endl; cout << "------------------------------------------------------------" << endl; cout << "- Record FOUND:" << endl; cout << "-" << endl; cout << "- Key: " << temp.getKey() << endl; cout << "- Author: " << temp.getAuthor() << endl; cout << "- Title: " << temp.getTitle() << endl; cout << "------------------------------------------------------------" << endl; } else { cout << endl; cout << "-----------------------------------------------------------" << endl; cout << "- Sorry, but there are no records matching your query -" << endl; cout << "-----------------------------------------------------------" << endl; } found = false; //Reset found, as it is used elsewhere. break; //End the find case. case 'L': case 'l': //Display all articles in the database. cin.ignore(10000,'\n'); //Ignores any weird extra input from cin. list.DisplayList(); cout << list.GetSize() << " records shown." << endl; //Display number of records shown. break; //End the display list case. case 'A': case 'a': //Add an article cin.ignore(10000,'\n'); //Ignores any weird extra input from cin, so we get good strings below. //Load in temp variables, and temp article, so it can be inserted in the list. cout << endl; cout << "Please enter the key for your new article: "; getline(cin, nKey,'\n'); temp.setKey(nKey); //Put that key in our temp object. list.GetItem(temp, found); //Search for the key in the list. if(found) //Check and make sure the key is not already in use. { cout << endl << "This key already exists!" << endl; break; //End this case prematurely. } else //If it isn't in use, continue and add the object to the list. { cout << "Enter the author's name: "; getline(cin, nAuthor,'\n'); cout << "Enter the title of the article: "; getline(cin, nTitle,'\n'); temp.Init(nKey, nAuthor, nTitle); //Load the user's data into the temp object. list.PutItem(temp); //Put the new article in the list. cout << endl; cout << "------------------------------------------------------------" << endl; cout << "- The following record has been added: " << endl; cout << "-" << endl; cout << "- Key: " << temp.getKey() << endl; cout << "- Author: " << temp.getAuthor() << endl; cout << "- Title: " << temp.getTitle() << endl; cout << "------------------------------------------------------------" << endl; } found = false; //Reset our found variable as it is used elsewhere. break; //End the add an article case. case 'R': case 'r': //Remove an article from the list. cin.ignore(10000,'\n'); //Ignores any weird extra input from cin, so we get good strings below. //Load the key into the temp object, then search and destroy. cout << endl; cout << "Please enter the key of the item you wish to remove: "; getline(cin, nKey,'\n'); temp.setKey(nKey); //Put that key in our temp object. list.GetItem(temp, found); //Search for the key in the list. if(found) //Delete the item from the list if it is in there. { list.DeleteItem(temp); cout << "------------------------------------------------------------" << endl; cout << "- The following record has been REMOVED: " << endl; cout << "-" << endl; cout << "- Key: " << temp.getKey() << endl; cout << "------------------------------------------------------------"; break; //End this case. } else //If it isn't in the list, tell the user. { cout << endl << "Article with key " << temp.getKey() << " not found." << endl; } found = false; //Reset our found variable as it is used elsewhere. break; //End the remove an article case. case 'E': case 'e': //Exit the program, but display a nice message first to help the user's self esteem. exit = true; cout << endl << "Thank you for using the CACM Library!" << endl; break; //End the exit case. default: cin.ignore(10000,'\n'); //Ignores any weird extra input from cin. cout << endl << "Please make a valid menu choice." << endl; } //End switch statement } // End while statement return 0; //End program }
a49f01aedace593d5307d16c9314a4157130d5a7
761c4e71dcd882fbc815766bfe2dffa6a04f2ef4
/644 div3/E.cpp
21278a1301e0d96dc9fe2a26db25298c907c520e
[]
no_license
Adityasharma15/Codeforces
419838d8672c2106a8135b5bd495f2c3da259d7d
31e61d11db0e9ab749c5d97fbb14ae482655615d
refs/heads/master
2021-04-05T15:08:01.415459
2020-11-20T12:13:25
2020-11-20T12:13:25
248,570,193
3
3
null
2020-10-23T05:59:42
2020-03-19T17:56:09
C++
UTF-8
C++
false
false
1,011
cpp
E.cpp
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll t; cin >> t; while(t--) { ll n; cin >> n; ll arr[n][n]; string s; for(ll i = 0;i<n; i++) { cin >> s; for(ll j = 0; j<n; j++) { arr[i][j] = s[j] - '0' ; } } bool flag = true; bool flag1 = true; bool flag2 = true; for(ll i = 0;i<n; i++) { for(ll j = 0; j<n; j++) { if(arr[i][j] == 1) { flag1 = true; flag2 = true; if((i+1)<n && arr[i+1][j] == 0) { flag1 = false; } if((j+1)<n && arr[i][j+1] == 0) { flag2 = false; } } if(flag1==false && flag2 == false) flag = false; } } if(flag) cout << "YES\n"; else cout << "NO\n"; } return 0; }
865e6e91facc11db719bc7beac2f2d66fa5518fd
1cf7d8786d7ef678f0d6739bf97e1c440144262c
/mCanny.cpp
81368a96578e69c151e8159cd6c149888a5f0c6e
[]
no_license
JoeNero/Opencv_private
bcd0235304c6b26bb40004acb4b5a25d72047abd
c54f7dbfe36c950e6f57471a4c0455b9f5902c26
refs/heads/master
2020-12-28T03:38:24.500153
2020-04-09T05:45:56
2020-04-09T05:45:56
238,167,778
0
0
null
null
null
null
GB18030
C++
false
false
666
cpp
mCanny.cpp
/* 创建者 : XTT 功能 : OpenCV Canny算子边缘检测 时间 : 2020/01/08 */ #define _CRTSECURE_NO_WARINGS #include <iostream> #include <opencv2\highgui\highgui.hpp> #include <opencv2\core\core.hpp> #include <opencv2\imgproc\imgproc.hpp> #include "opencv2/imgproc/types_c.h" using namespace std; using namespace cv; int main() { Mat img, imgGray, imgEdge; img = imread("timg.jpg"); if (!img.data) { cout << "Please input image path" << endl; return 0; } imshow("原图", img); cvtColor(img, imgGray, CV_BGR2GRAY); imshow("灰度图", imgGray); Canny(imgGray, imgEdge, 3, 9, 3); imshow("Canny", imgEdge); waitKey(); return 0; }
1e6bf708e999b7e67a2880fef33778e0e85c788c
2d3679e04dc0144393417aed4d35bb60d5d14cb5
/src/Factory/Module/Monitor/Monitor.cpp
ba9ffcc7e8be4253e46887f80333432e80385861
[ "MIT" ]
permissive
praveenmunagapati/aff3ct
8d480d2012e0fe452187e57a362d07dc2d0ae745
a4ec63b36496275d5fdf4b3c75443d2a3af6c216
refs/heads/master
2021-07-21T15:42:45.047139
2017-10-31T08:51:34
2017-10-31T08:51:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
959
cpp
Monitor.cpp
#include "Tools/Exception/exception.hpp" #include "Module/Monitor/Monitor.hpp" #include "Monitor.hpp" using namespace aff3ct; using namespace aff3ct::factory; const std::string aff3ct::factory::Monitor::name = "Monitor"; const std::string aff3ct::factory::Monitor::prefix = "mnt"; Monitor::parameters ::parameters(const std::string prefix) : Factory::parameters(Monitor::name, Monitor::name, prefix) { } Monitor::parameters ::parameters(const std::string name, const std::string prefix) : Factory::parameters(name, Monitor::name, prefix) { } Monitor::parameters ::~parameters() { } Monitor::parameters* Monitor::parameters ::clone() const { return new Monitor::parameters(*this); } void Monitor::parameters ::get_description(arg_map &req_args, arg_map &opt_args) const { } void Monitor::parameters ::store(const arg_val_map &vals) { } void Monitor::parameters ::get_headers(std::map<std::string,header_list>& headers, const bool full) const { }
12909f956612c2ed2f10a602ac9052b6d3a0c651
73a0f661f1423d63e86489d4b2673f0103698aab
/oneflow/core/auto_parallel/auto_memory.h
5591a7be30545990e7f6f60a6e7cd0c6ee3cb1cc
[ "Apache-2.0" ]
permissive
Oneflow-Inc/oneflow
4fc3e081e45db0242a465c4330d8bcc8b21ee924
0aab78ea24d4b1c784c30c57d33ec69fe5605e4a
refs/heads/master
2023-08-25T16:58:30.576596
2023-08-22T14:15:46
2023-08-22T14:15:46
81,634,683
5,495
786
Apache-2.0
2023-09-14T09:44:31
2017-02-11T06:09:53
C++
UTF-8
C++
false
false
1,338
h
auto_memory.h
/* Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef ONEFLOW_CORE_AUTO_PARALLEL_AUTO_MEMORY_H_ #define ONEFLOW_CORE_AUTO_PARALLEL_AUTO_MEMORY_H_ #include "oneflow/core/auto_parallel/sbp_graph.h" #include "oneflow/core/graph/op_graph.h" namespace oneflow { namespace auto_parallel { void InitMemory(const OpGraph& op_graph, SbpGraph* sbp_graph, bool nccl_use_compute_stream); // Straighten a subset of the op graph void StraightenSubGraph(const std::vector<const OpNode*>& sub_graph, std::vector<const OpNode*>* ordered_op_nodes); // Straighten the whole op graph void StraightenOpGraph(const OpGraph& op_graph, std::vector<const OpNode*>* ordered_op_nodes); } // namespace auto_parallel } // namespace oneflow #endif // ONEFLOW_CORE_AUTO_PARALLEL_AUTO_MEMORY_H_
93c1427d3bd8bc45d61469e19b0fe418544ae46b
5cf1e908865c7836e51fe3da1feee3c66837a4f1
/Modules/Core/include/selxInterfaceAcceptor.hxx
ddcfac6bbb06a1712fc7b742efe68a75f9acc3da
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
deaspo/SuperElastix
b20630baf165e5d33b7334b7de8e39bea05a145c
4e917e974237342e0b761ab59cb11d3352e243fb
refs/heads/develop
2020-03-21T16:44:59.634268
2018-06-30T14:08:23
2018-06-30T14:08:23
138,791,142
0
0
Apache-2.0
2018-06-30T13:54:16
2018-06-26T20:42:47
C++
UTF-8
C++
false
false
3,420
hxx
selxInterfaceAcceptor.hxx
/*========================================================================= * * Copyright Leiden University Medical Center, Erasmus University Medical * Center and contributors * * 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.txt * * 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 InterfaceAcceptor_hxx #define InterfaceAcceptor_hxx #include "selxConnectionInfo.h" namespace selx { template< class InterfaceT > int InterfaceAcceptor< InterfaceT >::Connect( ComponentBase::Pointer providerComponent ) { // Here the core of the handshake mechanism takes place: One specific // interface of the Providing Component is taken (by dynamic_cast) and // passed to the accepting Component. // The function returns the number of successful connects (1 or 0) std::shared_ptr< InterfaceT > providerInterface = std::dynamic_pointer_cast< InterfaceT >( providerComponent ); if( !providerInterface ) { // casting failed: this Providing Component does not have the specific interface. return 0; } // connect value interfaces this->Accept( providerInterface ); // due to the input argument being uniquely defined in the multiple inheritance tree, all versions of Set() are accessible at component level // store the interface for access by the user defined component this->m_AcceptedInterface = providerInterface; // TODO: see if we can get rid of all (dynamic) casts below. Perhaps a "static_cast in release mode"? auto providerConnectionInfo = std::dynamic_pointer_cast<ConnectionInfo< InterfaceT >>( providerComponent); if (!providerConnectionInfo) { // By definition should not fail, since providerComponent always is a base // class pointer of an SuperElastixComponent object and // SuperElastixComponents that are derived from InterfaceT (checked // previously) also derive from ConnectionInfo< InterfaceT> throw std::runtime_error( "std::dynamic_pointer_cast<ConnectionInfo< InterfaceT > should not fail by definition " ); } ComponentBase* AcceptorBaseComponent = dynamic_cast<ComponentBase*>( this ); if (!AcceptorBaseComponent) { // By definition should not fail, since 'this', the AcceptorInterface, and // ComponentBase are both base classes from the SuperElastixComponent // object on which this functionality is called. throw std::runtime_error("dynamic_cast<ComponentBase*> should not fail by definition "); } providerConnectionInfo->SetProvidedTo(AcceptorBaseComponent->m_Name); return 1; } template< class InterfaceT > bool InterfaceAcceptor< InterfaceT >::CanAcceptConnectionFrom( ComponentBase::ConstPointer providerComponent ) { std::shared_ptr< const InterfaceT > providerInterface = std::dynamic_pointer_cast< const InterfaceT >( providerComponent ); return bool(providerInterface); } } //end namespace selx #endif // InterfaceAcceptor_hxx
5edc4faab87816aafcdfd1ff6b5764c5fc1d17ec
db02128059c2d16e47a89dab433d9aedd2d08720
/mycombobox.h
8502124ada1fe4e9725b4a8c29b98d548e272bc8
[]
no_license
baronzzl/QTreeWidget-NoteBook
1cf28b2da12f8e2607e46d2a5409fbdcf550e7ef
69407ad754e2a78f191501159b2a1eea6f5c31b3
refs/heads/master
2020-06-24T17:25:13.991836
2019-07-26T14:22:26
2019-07-26T14:22:26
199,029,956
0
1
null
null
null
null
UTF-8
C++
false
false
387
h
mycombobox.h
//测试控件是否会自动释放 #ifndef MYCOMBOBOX_H #define MYCOMBOBOX_H #include <QComboBox> #include <QDebug> class myComboBox : public QComboBox { public: myComboBox(QWidget *parent = 0) : QComboBox(parent){ //qDebug() << "combox construct"<<endl; } ~myComboBox() { //qDebug() << "combox disconstruct"<<endl; } }; #endif // MYCOMBOBOX_H
80885fbddfc8c24150b4dc4d2c4e4737cf5aa79b
efc0cbb907a05ee2c1f2a656f83eae07d390f64d
/AppleFileSystemDriver.cpp
f295ebd6d68888002a36568a6d1d49c3a789d9df
[]
no_license
apple-opensource-mirror/AppleFileSystemDriver
504989074864a5a7fd4617e676163388bc007745
4026f86535ddd3e43c5022140e6a3875e70fa56a
refs/heads/master
2020-06-23T03:52:34.551654
2017-09-28T17:59:11
2017-09-28T17:59:11
198,502,126
1
0
null
null
null
null
UTF-8
C++
false
false
14,314
cpp
AppleFileSystemDriver.cpp
/* * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #include "AppleFileSystemDriver.h" #include <IOKit/IOLib.h> #include <IOKit/IOBSD.h> #include <IOKit/IOBufferMemoryDescriptor.h> #include <libkern/OSByteOrder.h> #include <sys/param.h> #include <hfs/hfs_format.h> #include <libkern/crypto/md5.h> #include <uuid/uuid.h> #include <uuid/namespace.h> //------------------------------------------ //#define VERBOSE 1 //#define DEBUG 1 #if DEBUG #define VERBOSE 1 #define DEBUG_LOG(fmt, args...) IOLog(fmt, ## args) #else #define DEBUG_LOG(fmt, args...) #endif #if VERBOSE #define VERBOSE_LOG(fmt, args...) IOLog(fmt, ## args) #else #define VERBOSE_LOG(fmt, args...) #endif //------------------------------------------ #define kClassName "AppleFileSystemDriver" #define kMediaMatchKey "media-match" #define kBootUUIDKey "boot-uuid" #define kBootUUIDMediaKey "boot-uuid-media" #define super IOService OSDefineMetaClassAndStructors(AppleFileSystemDriver, IOService) //------------------------------------------ #if VERBOSE static OSString * createStringFromUUID(const uuid_t uu) { char buf[64]; uuid_unparse_upper(uu, buf); return OSString::withCString(buf); } #endif // VERBOSE //------------------------------------------ static IOReturn createUUIDFromName( const uuid_t uu_space, uint8_t *name_p, unsigned int name_len, uuid_t uu_result ) { /* * Creates a UUID from a unique "name" in the given "name space". See version 3 UUID. */ MD5_CTX md5c; assert( sizeof( uuid_t ) == MD5_DIGEST_LENGTH ); memcpy( uu_result, uu_space, sizeof( uuid_t ) ); MD5Init( &md5c ); MD5Update( &md5c, uu_result, sizeof( uuid_t ) ); MD5Update( &md5c, name_p, name_len ); MD5Final( uu_result, &md5c ); // this UUID has been made version 3 style (i.e. via namespace) // see "-uuid-urn-" IETF draft (which otherwise copies byte for byte) uu_result[6] = 0x30 | ( uu_result[6] & 0x0F ); uu_result[8] = 0x80 | ( uu_result[8] & 0x3F ); return kIOReturnSuccess; } //------------------------------------------ enum { kHFSBlockSize = 512, kVolumeUUIDValueLength = 8 }; typedef union VolumeUUID { uint8_t bytes[kVolumeUUIDValueLength]; struct { uint32_t high; uint32_t low; } v; } VolumeUUID; //------------------------------------------ IOReturn AppleFileSystemDriver::readHFSUUID(IOMedia *media, void **uuidPtr) { bool mediaIsOpen = false; UInt64 mediaBlockSize = 0; IOBufferMemoryDescriptor * buffer = 0; uint8_t * bytes = 0; UInt64 bytesAt = 0; UInt64 bufferReadAt = 0; vm_size_t bufferSize = 0; IOReturn status = kIOReturnError; HFSMasterDirectoryBlock * mdbPtr = 0; HFSPlusVolumeHeader * volHdrPtr = 0; VolumeUUID * volumeUUIDPtr = (VolumeUUID *)uuidPtr; DEBUG_LOG("%s::%s\n", kClassName, __func__); do { mediaBlockSize = media->getPreferredBlockSize(); bufferSize = IORound(sizeof(HFSMasterDirectoryBlock), mediaBlockSize); buffer = IOBufferMemoryDescriptor::withCapacity(bufferSize, kIODirectionIn); if ( buffer == 0 ) break; bytes = (uint8_t *) buffer->getBytesNoCopy(); // Open the media with read access. mediaIsOpen = media->open(media, 0, kIOStorageAccessReader); if ( mediaIsOpen == false ) break; bytesAt = 2 * kHFSBlockSize; bufferReadAt = IOTrunc( bytesAt, mediaBlockSize ); bytesAt -= bufferReadAt; mdbPtr = (HFSMasterDirectoryBlock *)&bytes[bytesAt]; volHdrPtr = (HFSPlusVolumeHeader *)&bytes[bytesAt]; status = media->read(media, bufferReadAt, buffer); if ( status != kIOReturnSuccess ) break; /* * If this is a wrapped HFS Plus volume, read the Volume Header from * sector 2 of the embedded volume. */ if ( OSSwapBigToHostInt16(mdbPtr->drSigWord) == kHFSSigWord && OSSwapBigToHostInt16(mdbPtr->drEmbedSigWord) == kHFSPlusSigWord) { u_int32_t allocationBlockSize, firstAllocationBlock, startBlock, blockCount; if (OSSwapBigToHostInt16(mdbPtr->drSigWord) != kHFSSigWord) { break; } allocationBlockSize = OSSwapBigToHostInt32(mdbPtr->drAlBlkSiz); firstAllocationBlock = OSSwapBigToHostInt16(mdbPtr->drAlBlSt); if (OSSwapBigToHostInt16(mdbPtr->drEmbedSigWord) != kHFSPlusSigWord) { break; } startBlock = OSSwapBigToHostInt16(mdbPtr->drEmbedExtent.startBlock); blockCount = OSSwapBigToHostInt16(mdbPtr->drEmbedExtent.blockCount); bytesAt = ((u_int64_t)startBlock * (u_int64_t)allocationBlockSize) + ((u_int64_t)firstAllocationBlock * (u_int64_t)kHFSBlockSize) + (u_int64_t)(2 * kHFSBlockSize); bufferReadAt = IOTrunc( bytesAt, mediaBlockSize ); bytesAt -= bufferReadAt; mdbPtr = (HFSMasterDirectoryBlock *)&bytes[bytesAt]; volHdrPtr = (HFSPlusVolumeHeader *)&bytes[bytesAt]; status = media->read(media, bufferReadAt, buffer); if ( status != kIOReturnSuccess ) break; } /* * At this point, we have the MDB for plain HFS, or VHB for HFS Plus and HFSX * volumes (including wrapped HFS Plus). Verify the signature and grab the * UUID from the Finder Info. */ if (OSSwapBigToHostInt16(mdbPtr->drSigWord) == kHFSSigWord) { bcopy((void *)&mdbPtr->drFndrInfo[6], volumeUUIDPtr->bytes, kVolumeUUIDValueLength); status = kIOReturnSuccess; } else if (OSSwapBigToHostInt16(volHdrPtr->signature) == kHFSPlusSigWord || OSSwapBigToHostInt16(volHdrPtr->signature) == kHFSXSigWord) { bcopy((void *)&volHdrPtr->finderInfo[24], volumeUUIDPtr->bytes, kVolumeUUIDValueLength); status = kIOReturnSuccess; } else { // status = 0 from earlier successful media->read() status = kIOReturnBadMedia; } } while (false); if ( mediaIsOpen ) media->close(media); if ( buffer ) buffer->release(); DEBUG_LOG("%s::%s finishes with status %d\n", kClassName, __func__, status); return status; } //------------------------------------------ bool AppleFileSystemDriver::mediaNotificationHandler( void * target, void * ref, IOService * service, IONotifier * notifier) { AppleFileSystemDriver * fs; IOMedia * media; IOReturn status = kIOReturnError; OSString * contentHint; const char * contentStr; VolumeUUID volumeUUID; OSString * uuidProperty; uuid_t uuid; bool matched = false; DEBUG_LOG("%s[%p]::%s -> '%s'\n", kClassName, target, __func__, service->getName()); do { fs = OSDynamicCast( AppleFileSystemDriver, (IOService *)target ); if (fs == 0) break; media = OSDynamicCast( IOMedia, service ); if (media == 0) break; // i.e. does it know how big it is / have a block size if ( media->isFormatted() == false ) break; // If the media already has a UUID property, try that first. uuidProperty = OSDynamicCast( OSString, media->getProperty("UUID") ); if (uuidProperty != NULL) { if (fs->_uuidString && uuidProperty->isEqualTo(fs->_uuidString)) { VERBOSE_LOG("existing UUID property matched\n"); matched = true; break; } } // only IOMedia's with content hints are interesting contentHint = OSDynamicCast( OSString, media->getProperty(kIOMediaContentHintKey) ); if (contentHint == NULL) break; contentStr = contentHint->getCStringNoCopy(); if (contentStr == NULL) break; // probe based on content hint if ( strcmp(contentStr, "Apple_HFS" ) == 0 || strcmp(contentStr, "Apple_HFSX" ) == 0 || strcmp(contentStr, "Apple_Boot" ) == 0 || strcmp(contentStr, "Apple_Recovery" ) == 0 || strcmp(contentStr, "48465300-0000-11AA-AA11-00306543ECAC" ) == 0 || /* APPLE_HFS_UUID */ strcmp(contentStr, "426F6F74-0000-11AA-AA11-00306543ECAC" ) == 0 || /* APPLE_BOOT_UUID */ strcmp(contentStr, "5265636F-7665-11AA-AA11-00306543ECAC" ) == 0 ) { /* APPLE_RECOVERY_UUID */ status = readHFSUUID( media, (void **)&volumeUUID ); } else { DEBUG_LOG("contentStr %s\n", contentStr); break; } if (status != kIOReturnSuccess) { break; } if (createUUIDFromName( kFSUUIDNamespaceSHA1, volumeUUID.bytes, kVolumeUUIDValueLength, uuid ) != kIOReturnSuccess) { break; } #if VERBOSE OSString *str = createStringFromUUID(uuid); OSString *bsdn = OSDynamicCast(OSString,media->getProperty("BSD Name")); if (str) { IOLog(" UUID %s found on volume '%s' (%s)\n", str->getCStringNoCopy(), media->getName(), bsdn ? bsdn->getCStringNoCopy():""); str->release(); } #endif if (fs->_uuid) { if ( uuid_compare(uuid, fs->_uuid) == 0 ) { VERBOSE_LOG(" UUID matched on volume %s\n", media->getName()); matched = true; } } } while (false); if (matched) { // prevent more notifications, if notifier is available if (fs->_notifier != NULL) { fs->_notifier->remove(); fs->_notifier = NULL; } DEBUG_LOG("%s::%s publishing boot-uuid-media '%s'\n", kClassName, __func__, media->getName()); IOService::publishResource( kBootUUIDMediaKey, media ); // Now that our job is done, get rid of the matching property // and kill the driver. fs->getResourceService()->removeProperty( kBootUUIDKey ); fs->terminate( kIOServiceRequired ); // Drop the retain for asynchronous notification fs->release( ); VERBOSE_LOG("%s[%p]::%s returning TRUE\n", kClassName, target, __func__); return true; } DEBUG_LOG("%s[%p]::%s returning false\n", kClassName, target, __func__); #if DEBUG //IOSleep(5000); #endif return false; } //------------------------------------------ bool AppleFileSystemDriver::start(IOService * provider) { OSDictionary * matching; OSString * uuidString; const char * uuidCString; IOService * resourceService; OSDictionary * dict; DEBUG_LOG("%s[%p]::%s\n", getName(), this, __func__); DEBUG_LOG("%s provider is '%s'\n", getName(), provider->getName()); do { resourceService = getResourceService(); if (resourceService == 0) break; uuidString = OSDynamicCast( OSString, resourceService->getProperty("boot-uuid") ); if (uuidString) { _uuidString = uuidString; _uuidString->retain(); uuidCString = uuidString->getCStringNoCopy(); DEBUG_LOG("%s: got UUID string '%s'\n", getName(), uuidCString); if (uuid_parse(uuidCString, _uuid) != 0) { IOLog("%s: Invalid UUID string '%s'\n", getName(), uuidCString); break; } } else { IOLog("%s: Error getting boot-uuid property\n", getName()); break; } // Match IOMedia objects matching our criteria (from kext .plist) dict = OSDynamicCast( OSDictionary, getProperty( kMediaMatchKey ) ); if (dict == 0) break; dict = OSDictionary::withDictionary(dict); if (dict == 0) break; matching = IOService::serviceMatching( "IOMedia", dict ); if ( matching == 0 ) return false; // Retain for asynchronous matching notification retain(); // Set up notification for newly-appearing devices. // This will also notify us about existing devices. _notifier = IOService::addMatchingNotification( gIOMatchedNotification, matching, &mediaNotificationHandler, this, 0 ); matching->release(); DEBUG_LOG("%s[%p]::%s finishes TRUE\n", getName(), this, __func__); return true; } while (false); DEBUG_LOG("%s[%p]::%s finishes false\n", getName(), this, __func__); return false; } //------------------------------------------ void AppleFileSystemDriver::free() { DEBUG_LOG("%s[%p]::%s\n", getName(), this, __func__); if (_notifier) _notifier->remove(); if (_uuidString) _uuidString->release(); super::free(); } //------------------------------------------
eedf7989f1d3c61eff9d1d896a08bbc4a49298fa
e8122796b3870a01dae0424716ee7a2b3c48ff2f
/Include/UserInterface/MenuElement.hpp
eac0ac2b5085832236e17fbba9ca5bfdbe43c1e1
[]
no_license
hadi-ilies/IndieStudio
ed72ff01c3447b4045dd931bb20ba332ff61e95f
b7eb2a0d65cdbc1f56bf90807d25773bc4faf821
refs/heads/master
2020-06-25T09:58:04.685150
2019-06-20T10:28:51
2019-06-20T10:28:51
199,277,437
1
0
null
null
null
null
UTF-8
C++
false
false
603
hpp
MenuElement.hpp
/** * @author Corentin Gautier (https://github.com/Adorr29) * @author Hadi Bereksi (https://github.com/hadi-ilies) * @author Camille Police (https://github.com/CamillePolice) * @copyright © 2019, OOP_indie_studio_2018, Zappy group * @package UI Package * @file MenuElement */ #pragma once #include <vector> #include <memory> #include "Window.hpp" class MenuElement { public: MenuElement(const vector3df &position, std::string type); virtual ~MenuElement(); vector3df getPosition() const; std::string getType() const; protected: const vector3df position; private: std::string type; };
27c59e8cd7e3010c026689f9dcd779b5eb2654c5
e25d67cb2effcd75fda50ec07210a48f9f8db0eb
/algorithms/STL Algorithms/non-modifing/identical.cpp
18dfb7aa47f01c6573172551fc6a7cceb5b3e1ef
[]
no_license
tahanebti/tnlib
db8072c754210e0a1e8d975a75282f6624dda044
9e18eddd1350f936a9dc4e61423a83b12f7d307f
refs/heads/master
2020-05-14T18:52:20.534733
2019-05-29T14:45:56
2019-05-29T14:45:56
181,917,423
0
0
null
null
null
null
UTF-8
C++
false
false
1,606
cpp
identical.cpp
/// identical /// /// Returns true if the two input ranges are equivalent. /// There is a subtle difference between this algorithm and /// the 'equal' algorithm. The equal algorithm assumes the /// two ranges are of equal length. This algorithm efficiently /// compares two ranges for both length equality and for /// element equality. There is no other standard algorithm /// that can do this. /// /// Returns: true if the sequence of elements defined by the range /// [first1, last1) is of the same length as the sequence of /// elements defined by the range of [first2, last2) and if /// the elements in these ranges are equal as per the /// equal algorithm. /// /// Complexity: At most 'min((last1 - first1), (last2 - first2))' applications /// of the corresponding comparison. /// template <typename InputIterator1, typename InputIterator2> bool identical(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) { while((first1 != last1) && (first2 != last2) && (*first1 == *first2)) { ++first1; ++first2; } return (first1 == last1) && (first2 == last2); } /// identical /// template <typename InputIterator1, typename InputIterator2, typename BinaryPredicate> bool identical(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, BinaryPredicate predicate) { while((first1 != last1) && (first2 != last2) && predicate(*first1, *first2)) { ++first1; ++first2; } return (first1 == last1) && (first2 == last2); }
d1a43fc3907adb77e67a1f8d52a561d043eba62c
4cc998877a0df5e766554af806f94a79419a0178
/Mathematical/Narcissistic number.cpp
f6c290725bbf54dac24525290b9c41437228160a
[]
no_license
greeshma0601/Arrays
521ecb189b0c0ce0b4fcb1244d62a02386620c54
6b69562519663bc07706410d8e4c4c73cbe606b5
refs/heads/master
2020-04-13T20:43:18.904015
2019-06-25T05:32:55
2019-06-25T05:32:55
163,437,158
0
0
null
null
null
null
UTF-8
C++
false
false
1,078
cpp
Narcissistic number.cpp
/* Narcissistic number Given N, check whether it is a Narcissistic number or not. Note:Narcissistic Number is a number that is the sum of its own digits each raised to the power of the number of digits Input: The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N. Output: Print 'Yes' if it is narcissistic,otherwise print 'No'. Constraints: 1<=T<=100 1<=N<=100000 Example: Input: 2 407 111 Output: Yes No Explanation: Testcase 1:- 4^3+0^3+7^3 = 64+0+343 = 407 equals to N. Testcase 2:- 1^3+1^3+1^3 = 3 is not equal to N. */ #include<bits/stdc++.h> #include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { //int n,i;cin>>n; //int a[n];for(i=0;i<n;i++)cin>>a[i]; string s; cin>>s;int len=s.length(); int n=stoi(s); int sum=0; for(int i=0;i<len;i++) { int a=s[i]-'0'; sum+=pow(a,len); } if(sum == n) { cout<<"Yes"; } else { cout<<"No"; } cout<<endl; } //code return 0; }
3559f4f5a984bfbc7152155d8b16d9c8e59f2900
91adb2b7718f15b916bc5db65c8e0bad081c7ae5
/TEST/main.cpp
32a0c4b36f4c3fa86de37031c943c1934d8a95e4
[ "Zlib" ]
permissive
MilchRatchet/PAL
e72e1ed64b14c8c2a2c82569ad5f26387f7e202e
75d1b1aaf467ff056a65d39de8ca234e1a1bb0c9
refs/heads/master
2023-06-28T06:30:06.484596
2021-07-18T12:17:37
2021-07-18T12:17:37
376,462,908
0
0
Zlib
2021-07-22T14:59:32
2021-06-13T06:46:13
C
UTF-8
C++
false
false
2,660
cpp
main.cpp
#include <iostream> #include <set> #include <string> #include "TEST_CONVEXHULL.h" #include "TEST_knapsack.h" #include "TEST_MAX_SAT.h" #include "TEST_metricTSP.h" #include "TEST_setcover.h" #include "TEST_UTILS.h" /* * select tests */ void select_tests(int argc, char** argv) { std::set<std::string> testset; for (int i = 1; i < argc; ++i) { testset.insert({std::string(argv[i])}); } if (testset.count("HELP") != 0 || argc == 1) { std::cout << "Helppage\n========\n"; std::cout << "Pass argument <FULL> to test all algorithms.\n"; std::cout << "Pass argument <AAL> to test all algorithms from the approximation algorithm library.\n"; std::cout << "Pass argument <CGL> to test all algorithms from the computational geometry library.\n"; std::cout << "Pass any abbreviation to select specific algorithms to test.\n"; std::cout << "You can combine several of these in any order to test several algorithms.\n"; std::cout << "Below you can find a list of available abbreviations:\n"; std::cout << "Abbreviation | Library | Algorithm\n"; std::cout << "-------------|---------|-------------------\n"; std::cout << " KSE | AAL | knapsack exact\n"; std::cout << " KSF | AAL | knapsack FPTAS\n"; std::cout << " KSM | AAL | minimum knapsack\n"; std::cout << " MSU | AAL | MAX SAT unbiased\n"; std::cout << " SCG | AAL | setcover greedy\n"; std::cout << " TSN | AAL | metric TSP nearest addition\n"; std::cout << " CHC | CGL | convex hull chan\n"; std::cout << " CHJ | CGL | convex hull jarvis\n"; } if ( testset.count("FULL") != 0 || testset.count("AAL") != 0 || testset.count("KSE") != 0 || testset.count("KSF") != 0 || testset.count("KSM") != 0) { TEST_KNAPSACK(testset); } if (testset.count("FULL") != 0 || testset.count("AAL") != 0 || testset.count("MSU") != 0) { TEST_MAX_SAT_unbiased(); } if (testset.count("FULL") != 0 || testset.count("AAL") != 0 || testset.count("SCG") != 0) { TEST_SETCOVER_GREEDY(); } if (testset.count("FULL") != 0 || testset.count("AAL") != 0 || testset.count("TSN") != 0) { TEST_METRIC_TSP_NEAREST_ADDITION(); } if (testset.count("FULL") != 0 || testset.count("CGL") != 0 || testset.count("CHC") != 0) { TEST_CONVEXHULL_CHAN(); } if (testset.count("FULL") != 0 || testset.count("CGL") != 0 || testset.count("CHJ") != 0) { TEST_CONVEXHULL_JARVIS(); } } /* * This is supposed to test the libraries */ int main(int argc, char** argv) { TEST_PRINT_START(); select_tests(argc, argv); return 0; }
d440830c1fcae7e2670b922103c0a8fb87d2f067
69bbbc4a9c25e03fb4a4ee4b6cd1d015ce6cfe23
/include/petshop.h
9c45afeab5292bf1efe31160efe4bbeb4f5b1c1d
[]
no_license
wellysongustavo/petshop-petfera
1c7cbe98a6742fee9cf43dab8b482cd111a1ee6b
b117813935eba85acc93f115c64056bf97fc874a
refs/heads/master
2020-05-19T02:53:39.686961
2019-07-02T15:49:27
2019-07-02T15:49:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,659
h
petshop.h
/** * @file petshop.h * @brief Estrutura de dados e assinaturas da classe controladora Petshop * @authors Fernanda Laís Pereira de Souza Pedro Hugo da Silva Freire Wellyson Gustavo Silva Oliveira * @since 03/05/2019 * @date 26/06/2019 */ #include <iostream> #include <string> #include <cstring> #include <sstream> #include <map> #include <iterator> #include <typeinfo> #include <fstream> #include <vector> #include "funcionario.h" #include "tratador.h" #include "veterinario.h" #include "animal.h" #include "animal_silvestre.h" #include "animal_nativo.h" #include "animal_exotico.h" #include "anfibio.h" #include "anfibio_nativo.h" #include "anfibio_exotico.h" #include "mamifero.h" #include "mamifero_nativo.h" #include "mamifero_exotico.h" #include "reptil.h" #include "reptil_nativo.h" #include "reptil_exotico.h" #include "ave.h" #include "ave_exotica.h" #include "ave_nativa.h" #include "date.h" #ifndef _PETSHOP_H_ #define _PETSHOP_H_ /** * Classe Petshop. Para controle do PetFera */ class Petshop{ private: /** * Map map_animais. Para guardar animais cadastrados e seus id's */ std::map<int, Animal*> map_animais; /** * Map map_funcionarios. Para guardar funcionários cadastrados e seus id's */ std::map<int, Funcionario*> map_funcionarios; public: std::string m_nome; /** * Construtor. Construtor da classe controladora que * recebe uma string que será seu nome. */ Petshop(std::string nome); /** * Destrutor. */ ~Petshop(); /** * Função para abertura de arquivo. Recebe uma string com * o nome do arquivo para abertura e retorna um objeto fstream. */ std::fstream abrirArquivo(std::string tipo_map); /** * Função para leitura do arquivo de controle de animais. Percorre * o csv controle_animais e faz leitura para o map_animais * da classe. */ void lerArquivoAnimal(); /** * Função para atualizar o arquivo de controle de animais. Escreve no arquivo * os atributos dos animais presentes no map_animais da classe. */ void atualizaArquivoAnimal(); /** * Função para atualizar o arquivo de controle de funcionários. Escreve no arquivo * os atributos dos funcionários presentes no map_funcionario da classe. */ void gravarArquivoFuncionario(); /** * Função para leitura do arquivo de controle de funcionários. Percorre * o csv controle_funcionários e faz leitura para o map_funcionarios * da classe. */ void lerArquivoFuncionario(); /** * Função para desalocar memória. Limpa a memória que * foi alocada para objetos anteriormente com o destrutor. */ void desalocarObjetos(); /** * Função para busca por id. Recebe uma string para identificar em qual * map fazer busca e em caso de encontrar, esse id é retornado. */ int buscarPorId(std::string tipo_map); /** * Função para verificar id. Recebe uma string para identificar em qual * map fazer verificação, retornando o id apenas se não houver sido * cadastrado anteriormente. */ int verificaId(std::string tipo_map); /** * Função para imprimir animal. Recebe um objeto de animal e imprime * seus atributos no prompt de comando. */ void imprimeAnimalEspecifico(Animal* animal); /** * Função para cadastrar animal. Coleta os atributos da classe animal * e envia para o cadastro da classe específica do animal. */ void cadastrarAnimal(); /** * Função para cadastrar animal da classe anfíbio. Recebe parâmetros da função de * cadastro de animal e coleta os atributos específicos da classe * anfíbio para criar objeto. */\ void cadastrarAnfibio(int id, std::string nome_cientifico, char sexo, double tamanho, std::string dieta, int id_veterinario, int id_tratador, std::string nome_batismo); /** * Função para cadastrar animal da classe réptil. Recebe parâmetros da função de * cadastro de animal e coleta os atributos específicos da classe * anfíbio para criar objeto. */ void cadastrarReptil(int id, std::string nome_cientifico, char sexo, double tamanho, std::string dieta, int id_veterinario, int id_tratador, std::string nome_batismo); /** * Função para cadastrar animal da classe ave. Recebe parâmetros da função de * cadastro de animal e coleta os atributos específicos da classe * anfíbio para criar objeto. */ void cadastrarAve(int id, std::string nome_cientifico, char sexo, double tamanho, std::string dieta, int id_veterinario, int id_tratador, std::string nome_batismo); /** * Função para cadastrar animal da classe mamífero. Recebe parâmetros da função de * cadastro de animal e coleta os atributos específicos da classe * anfíbio para criar objeto. */ void cadastrarMamifero(int id, std::string nome_cientifico, char sexo, double tamanho, std::string dieta, int id_veterinario, int id_tratador, std::string nome_batismo); /** * Função para listar animais. Imprime na tela o catálogo de animais * cadastrados no Petshop Petfera. */ void listarAnimais(); /** * Função para remover animal. Procura pelo id no map de controle de * animais e o remove ao encontrá-lo. */ void removerAnimal(); /** * Função para editar animais cadastrados. Com um iterador do map, percorre * até encontrar animal a ser editado e coleta os novos dados. */ void editarAnimal(); /** * Função para consultar animal. Pesquisa por id do animal, classe do animal, * por veterinário responsável e tratador. */ void consultarAnimal(); /** * Função para cadastrar funcionários. Coleta os atributos da classe funcionário * e envia para o cadastro da classe específica do funcionário. */ void cadastrarFuncionario(); /** * Função para listar funcionários. Lista os veterinários e tratadores cadastrados * no map de controle de funcionários. */ void listarFuncionarios(); /** * Função para remover funcionário. Procura pelo id no map de controle de * funcionário e o remove ao encontrá-lo. */ void removerFuncionario(); /** * Função para editar funcionários cadastrados. Com um iterador do map, percorre * até encontrar funcionários a ser editado e coleta os novos dados. */ void editarFuncionario(); /** * Função para consultar funcionários. Pesquisa por id do funcionários, * lista todos veterinários e lista todos tratadores cadastrados. */ void consultarFuncionario(); }; #endif
7bd075d2959fdc854a408576ff6d60908863b77d
b61ee126f8f9e4c85e9e387ce3491566915d8670
/third_task/stack.cpp
1f4c7e7284de2e227f3af711ef9d2c67766b28b4
[]
no_license
TheLostIn/database__2016-2017
9f0854501b67e2b237b10cf7920732a602050f91
f76d886598fd4cb0e0f298bb49cd3435849b6043
refs/heads/master
2021-01-11T09:57:47.638747
2017-01-11T12:28:38
2017-01-11T12:28:38
77,883,414
6
0
null
null
null
null
UTF-8
C++
false
false
1,890
cpp
stack.cpp
#include<iostream> using namespace std; typedef int Status; #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 typedef char SElemType; typedef struct{ SElemType * base; SElemType * top; int stacksize; }SqStack; #define STACK_INIT_SIZE 100 #define STACKINCREMENT 10 Status InitStack(SqStack &S); Status DestroyStack(SqStack &S); Status ClearStack(SqStack &S); Status StackEmpty(SqStack S); int StackLength(SqStack &S); Status GetTop(SqStack &S,SElemType &e); Status Push(SqStack &S,SElemType e); Status Pop(SqStack &S,SElemType &e); Status StackTraverse(SqStack &S,Status (*visit)()); //从栈底到栈顶依次对栈中的每个元素调用visit() //-------------------------------------------------- Status InitStack(SqStack &S) { S.base = (SElemType *)malloc(STACK_INIT_SIZE * sizeof(SElemType)); if(!S.base) exit(OVERFLOW); S.top = S.base; S.stacksize = STACK_INIT_SIZE; return OK; } // Status DestroyStack(SqStack &S){ // } // Status ClearStack(SqStack &S){ // } // Status StackEmpty(SqStack S){ // } // int StackLength(SqStack &S){ // } Status GetTop(SqStack &S,SElemType &e){ if(S.top == S.base) return ERROR; e = *(S.top-1); return OK; } Status Push(SqStack &S,SElemType e){ if(S.top - S.base >=S.stacksize){ S.base = (SElemType *) realloc (S.base,(S.stacksize+STACKINCREMENT)*sizeof(SElemType)); if(!S.base) exit (OVERFLOW); S.top = S.base + S.stacksize; S.stacksize += STACKINCREMENT; } *S.top++ =e; return OK; } Status Pop(SqStack &S,SElemType &e){ if(S.top==S.base) return ERROR; e = *--S.top; return OK; } // Status StackTraverse(SqStack &S,Status (*visit)()){ // } int main() { SqStack sq_origin,sq_operation,sq_data,sq_result; InitStack(sq_origin); InitStack(sq_operation); InitStack(sq_data); InitStack(sq_result); string ori="2+3+5*7*(6+7)-9"; S.top=ori; return 0; }
3fcc7b2896db2b4b357e5809fdecca6d10d3f695
92711931648bcb17fff8daaa27aef93387ec632d
/src/Config.hpp
9e7be2f7a3de3295e43c6f658352c974f8590d48
[ "MIT" ]
permissive
ulises-jeremias/cpp-conway-s-game-of-life
958222dabfe7949cf38e1ae95ab0381f68069a98
c3236b400ca176e948f42f0b56986b4a7935dc60
refs/heads/master
2021-05-04T13:50:52.148910
2018-02-19T23:05:48
2018-02-19T23:05:48
120,324,943
0
0
null
null
null
null
UTF-8
C++
false
false
217
hpp
Config.hpp
#ifndef CONFIG_H #define CONFIG_H struct Config { unsigned windowWidth, windowHeight, simWidth, simHeight, quadSize; }; #endif // CONFIG_H
29f7d46275c4c469525096b15b89bee594d96b00
2b1b459706bbac83dad951426927b5798e1786fc
/src/lib/storage/vfs/cpp/queue.h
63b521ce027546cdaf7f502810c02649bf7a9269
[ "BSD-2-Clause" ]
permissive
gnoliyil/fuchsia
bc205e4b77417acd4513fd35d7f83abd3f43eb8d
bc81409a0527580432923c30fbbb44aba677b57d
refs/heads/main
2022-12-12T11:53:01.714113
2022-01-08T17:01:14
2022-12-08T01:29:53
445,866,010
4
3
BSD-2-Clause
2022-10-11T05:44:30
2022-01-08T16:09:33
C++
UTF-8
C++
false
false
1,458
h
queue.h
// Copyright 2017 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SRC_LIB_STORAGE_VFS_CPP_QUEUE_H_ #define SRC_LIB_STORAGE_VFS_CPP_QUEUE_H_ #include <utility> #include <fbl/intrusive_single_list.h> #include <fbl/macros.h> namespace fs { // A wrapper around a singly linked list to make it appear as a queue. We pop from the front (moving // the head forward) and push onto the tail. template <typename PtrType> class Queue { public: using QueueType = fbl::SinglyLinkedList<PtrType>; Queue() : next_(queue_.end()) {} ~Queue() { ZX_DEBUG_ASSERT(is_empty()); } template <typename T> void push(T&& ptr) { if (queue_.is_empty()) { queue_.push_front(std::forward<T>(ptr)); next_ = queue_.begin(); } else { auto to_be_next = queue_.make_iterator(*ptr); queue_.insert_after(next_, std::forward<T>(ptr)); next_ = to_be_next; } } typename QueueType::PtrTraits::RefType front() { return queue_.front(); } typename QueueType::PtrTraits::ConstRefType front() const { return queue_.front(); } PtrType pop() { return queue_.pop_front(); } bool is_empty() const { return queue_.is_empty(); } private: // Add work to the front of the queue, remove work from the back QueueType queue_; typename QueueType::iterator next_; }; } // namespace fs #endif // SRC_LIB_STORAGE_VFS_CPP_QUEUE_H_
ced87bf019eeea43449aa0a5a0356e10b9bfc2ca
290273092ded4f168bc8980661ff5f865b59dcfa
/week06/main.cpp
5b8b793c76420a7b14776aaae1855d4cec2f5d3c
[]
no_license
seiya1817/2021graphics
963f609e73ae3a6ee737710de08943f024a8e716
e604933dacaf925b79095dfaa83e192ad014f4a0
refs/heads/main
2023-05-15T01:29:43.861402
2021-06-09T04:26:43
2021-06-09T04:26:43
346,205,073
0
0
null
null
null
null
BIG5
C++
false
false
1,662
cpp
main.cpp
#include <GL/glut.h> float angle=0; void hand() { glPushMatrix(); glScalef(0.5,0.1,0.1);///大小 glColor3f(0,0,1);///顏色 glutSolidCube(1);///方塊 glPopMatrix(); } void display() { glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glColor3f(1,1,1); glutSolidCube(0.5); ///右半邊 glPushMatrix();///備份矩陣 glTranslatef(0.25,0.25,0);///將東西整個移到右上 glRotatef(angle,0,0,1);///旋轉 glTranslatef(0.25,0,0);///將旋轉軸心移到底邊 hand();///呼叫hand(上手臂) glPushMatrix(); glTranslatef(0.25,0,0);///直直往右移動 glRotatef(angle,0,0,1); glTranslatef(0.25,0,0); hand();///hand(下手臂) glPopMatrix(); glPopMatrix();///釋放矩陣 ///左半邊 glPushMatrix();///備份矩陣 glTranslatef(-0.25,0.25,0);///將東西整個移到左上 glRotatef(-angle,0,0,1);///旋轉 glTranslatef(-0.25,0,0);///將旋轉軸心移到底邊 hand();///呼叫hand(上手臂) glPushMatrix(); glTranslatef(-0.25,0,0);///直直往左移動 glRotatef(-angle,0,0,1); glTranslatef(-0.25,0,0); hand();///hand(下手臂) glPopMatrix(); glPopMatrix();///釋放矩陣 glutSwapBuffers(); angle++; } int main(int argc,char**argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH); glutCreateWindow("Week04-mouse"); glutDisplayFunc(display); glutIdleFunc(display); glutMainLoop(); }
796f34f6f949a3719490f661bc6f7ad81f98d02d
3ba8d0f4c498e44204ec57c89a500ce1341a71bc
/Session3/Polynomial_1st.cpp
f0d1038d76830b2a76bef80ddf7ded37acfe2e98
[]
no_license
ShaoFuLiu/10902-Data-Structure
c37f531b311e5efbd5c5de7470ca8836d5fc45f8
96817b54cf6ad99365a44bffa567438e5398ff62
refs/heads/main
2023-06-24T13:01:37.425754
2021-07-29T23:42:22
2021-07-29T23:42:22
346,219,349
1
0
null
null
null
null
UTF-8
C++
false
false
457
cpp
Polynomial_1st.cpp
#include <iostream> #include <algorithm> #include <Polynomial.h> using namespace std; int main(void) { int degree = 3; Polynomial A, B, C; A.degree = degree; B.degree = degree; C.degree = degree; for (int i = 0; i <= degree; i++) { A.coef[i] = i; B.coef[i] = i; } C = A.Add(B); for (int i = 0; i <= degree; i++) { cout << A.coef[i] << "+" << B.coef[i] << "\t=\t" << C.coef[i] << endl; } }
db511622156d0b530dd703277f0123853bf8ec8c
adc86591cdae82d07e10f85c400938f764292de2
/src/fonction/fonction_conversion/fonction_selection_selon_dictionnaire.cpp
34d4a9cdf8270ae30f05e4f598186868080985cf
[]
no_license
sebangi/emgine
e88bbd9223ea978344d4e9be51abbaa1f124ed9e
9cd367f10f26c140bc02bab6a8257c46af66adce
refs/heads/master
2021-07-15T16:04:39.127717
2021-03-19T12:14:59
2021-03-19T12:14:59
78,368,305
0
0
null
null
null
null
UTF-8
C++
false
false
4,169
cpp
fonction_selection_selon_dictionnaire.cpp
/** \file fonction_selection_selon_dictionnaire.cpp * \brief Fichier d'implémentation de la classe fonction_selection_selon_dictionnaire. * \author Sébastien Angibaud */ #include "entete/fonction/fonction_conversion/fonction_selection_selon_dictionnaire.h" #include "entete/compilation/compilateur.h" #include "entete/compilation/log_compilation.h" #include "entete/compilation/log_widget_item.h" #include "entete/compilation/logs_compilation_widget.h" #include "entete/element/base_element.h" #include "entete/element/texte.h" #include "entete/element/type_element.h" /** -------------------------------------------------------------------------------------- \brief Constructeur de la classe fonction_selection_selon_dictionnaire. \param conteneur Pointeur sur le conteneur de la fonction. */ fonction_selection_selon_dictionnaire::fonction_selection_selon_dictionnaire( fonctions_conteneur * conteneur ) : base_fonction(conteneur) { set_id(f_conversion_selection_selon_dictionnaire); augmenter_max_niveau_visibilite(1); ajouter_parametre( PARAM_DICTIONNAIRE, new base_parametre( this, base_parametre::tr("Dictionnaire"), base_parametre::tr("Dictionnaire utilisé."), base_parametre::CONTENU_PARAM_VIDE_IMPOSSIBLE, base_parametre::CONFIGURATION_INVISIBLE, base_parametre::ALGO_AUCUN) ); } /** -------------------------------------------------------------------------------------- * \brief Initialisation par défaut de la fonction. */ void fonction_selection_selon_dictionnaire::initialisation_par_defaut() { m_parametres[PARAM_DICTIONNAIRE]->set_dictionnaire_par_defaut( "mes_projets/dico.txt" ); } /** -------------------------------------------------------------------------------------- \brief Teste si la fonction est valide. \param vue_logs Un pointeur sur le widget de vue des logs. \return \b True si la fonction est valide, \b False sinon. */ bool fonction_selection_selon_dictionnaire::est_valide(logs_compilation_widget * vue_logs) { return true; } /** -------------------------------------------------------------------------------------- * \brief Retourne la valeur de la fonction en version raccourci. * \return La valeur courte de la fonction. */ QString fonction_selection_selon_dictionnaire::get_valeur_courte() const { return base_fonction::tr("[Selection selon dictionnaire]"); } /** -------------------------------------------------------------------------------------- * \brief Execute la fonction. * \param compil Le compilateur utilisé. * \param textes_in Le texte source en entrée. * \param textes_out Le texte de sortie généré. */ void fonction_selection_selon_dictionnaire::executer( compilateur &compil, textes & textes_in, textes & textes_out ) { const textes & textes_dico = m_parametres[PARAM_DICTIONNAIRE]->get_textes_out(); if ( textes_dico.empty() ) return; const dictionnaire * dico = compil.get_dictionnaire( textes_dico[0].to_string() ); if ( dico == NULL ) return; for ( textes::const_iterator it_t = textes_in.begin(); it_t != textes_in.end(); ++it_t ) { int nb_mots = 0; int nb_mots_acceptes = 0; texte t( it_t->get_configuration(), it_t->get_separateur_ligne() ); for ( texte::const_iterator it_l = it_t->begin(); it_l != it_t->end(); ++it_l ) { ligne l; l.set_separateur_mot( it_l->get_separateur_mot() ); for ( ligne::const_iterator it_m = it_l->begin(); it_m != it_l->end(); ++it_m ) { QString s_m = it_m->to_string(); nb_mots++; if ( s_m.size() > 1 && dico->existe(s_m) ) nb_mots_acceptes++; l.ajouter_mot( mot(*it_m) ); } t.ajouter_ligne(l); } if ( nb_mots_acceptes * 2 >= nb_mots ) textes_out.ajouter_texte(compil.get_configuration(), t); } }
5a56009a7eeab89d1fc35722be9a50f4dad43941
cd0c34e5a887d56de032ebc1d9b473d676ea791e
/fileH.cpp
2753d42c1227834ae433be2fc8c6d990dac71e10
[]
no_license
riyel518/CS375-Assignment1-Working
486dd6f84b726e24ad00fb064def26b37919d163
e7e7c3b3f5be42953488e7d25d450050522fa85e
refs/heads/master
2021-01-10T05:14:40.318167
2015-12-23T05:59:56
2015-12-23T05:59:56
48,472,348
0
0
null
null
null
null
UTF-8
C++
false
false
267
cpp
fileH.cpp
#ifndef FILEH_H #define FILEH_H #include <string> struct inputData { char types; char secTypes; std::string licenses; int capacity; }; void fileInput (string fileName, startStack& auto, startStack& van ); #endif
029124b0fd13bf6d9761b9e462c527e0e6dc9644
61657efce98b72ee8d76e8be846edb74467d4d44
/sketch_nov13a.ino
37bf43c67cda722df7d315b0436f15cc9e3766d5
[]
no_license
FGalerne/arduino
43edb7f2a0b0942952476f7101767de85e2501ff
bf2bc43a1c594d75d205468023897f29d0827921
refs/heads/master
2021-01-22T00:51:01.639197
2016-11-13T00:32:50
2016-11-13T00:32:50
73,586,458
0
0
null
null
null
null
UTF-8
C++
false
false
617
ino
sketch_nov13a.ino
#include <LiquidCrystal.h> blablabla LiquidCrystal lcd(12,11,5,4,3,2); int capteur=0; char mot[20]; void setup() { Serial.begin(9600); lcd.begin(16,2);// put your setup code here, to run once: lcd.setCursor (0,0); } void loop() { int valcapt= analogRead (capteur); float voltage= valcapt*(5.0/1700.0); float temperature= (voltage*100); lcd.print("temp : "); lcd.print (temperature); lcd.println (" C "); delay(2000); lcd.clear(); if (temperature > 25) { lcd.print("Temp trop haute"); delay(3000); lcd.clear(); } else { lcd.print("Temp correcte"); delay(3000); lcd.clear(); } }
1dc0c1b0932ed45b5cf7de6ef1419fcb4c9a3b43
153f22995d60ed94e93f71c3c3cc7d363fa6f209
/recursion1b_/removeX.cpp
0e97aaab99a9010f7a88aaa1a236a0286b77d674
[]
no_license
md1894/c-ds
b269edaaf7ff31f562ee560c2b851bc8faa0b3a8
27077fc641bf504dc0f8dc5271db9f8e5e708b5f
refs/heads/master
2023-01-29T03:37:40.837892
2020-12-08T07:30:02
2020-12-08T07:30:02
218,822,640
1
1
null
null
null
null
UTF-8
C++
false
false
840
cpp
removeX.cpp
/* Remove X Send Feedback Given a string, compute recursively a new string where all 'x' chars have been removed. Sample Input 1 : xaxb Sample Output 1: ab Sample Input 2 : abc Sample Output 2: abc Sample Input 3 : xx Sample Output 3: */ #include <iostream> using namespace std; // Change in the given string itself. So no need to return or print anything int len(char a[]){ int i; for(i=0;a[i] != 0; i++){ } return i; } void rem(char a[]){ int i = len(a),j; for(j = 0; j < i; j++){ a[j] = a[j+1]; } a[j] = 0; } void removeX(char a[]) { // Write your code here if(a[0] != 0){ removeX(a+1); if(a[0] == 'x'){ rem(a); } } } int main() { char input[100]; cin.getline(input, 100); removeX(input); cout << input << endl; }
2d571b6f604f25f58afedd46afe82395a7dfb798
397f7eb1ea15ba0bb300ba1e99681164c0421a8d
/platform/posix/diagnostic_context_posix.cpp
c30efd754d61685dcd841cb2ab87dcb1e54665e8
[ "Apache-2.0" ]
permissive
mexicowilly/Chucho
38a19664a2296dbe128586281d3b2cc4fe8dc531
f4235420437eb2078ab592540c0d729b7b9a3c10
refs/heads/develop
2021-06-14T14:51:34.679209
2021-06-03T17:06:05
2021-06-03T17:06:05
67,319,394
4
4
null
2018-01-25T16:01:30
2016-09-04T01:20:42
C++
UTF-8
C++
false
false
2,213
cpp
diagnostic_context_posix.cpp
/* * Copyright 2013-2021 Will Mason * * 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 <chucho/diagnostic_context.hpp> #include <chucho/garbage_cleaner.hpp> #include <mutex> #include <pthread.h> namespace { void destructor(void* p) { delete reinterpret_cast<std::map<std::string, std::string>*>(p); } class key_manager { public: key_manager(); ~key_manager(); pthread_key_t get_key(); private: pthread_key_t key_; }; std::once_flag once; key_manager& kmgr() { // This will be cleaned at finalize time static key_manager* km; std::call_once(once, [&] () { km = new key_manager(); }); return *km; } key_manager::key_manager() { pthread_key_create(&key_, destructor); chucho::garbage_cleaner::get().add([this] () { delete this; }); } key_manager::~key_manager() { // Go ahead and delete manually here, because when the thread // that is running the garbage_cleaner is the same thread that // created the key, then the key will be deleted before the // destructor function gets a chance to be called, and the map // will leak. This has been observed. delete reinterpret_cast<std::map<std::string, std::string>*>(pthread_getspecific(key_)); pthread_key_delete(key_); } pthread_key_t key_manager::get_key() { return key_; } } namespace chucho { std::map<std::string, std::string>& diagnostic_context::get_map() { void* p = pthread_getspecific(kmgr().get_key()); if (p == nullptr) { p = new std::map<std::string, std::string>(); pthread_setspecific(kmgr().get_key(), p); } return *reinterpret_cast<std::map<std::string, std::string>*>(p); } }
75768413d23a659441090c1356b766c05609d738
598ae213f1855a5fb546eee37668e9489dcd0812
/pizzeriy/pizzeriy/onlineP.cpp
732514ce458651b2b8dc3b08291f270efb18d955
[]
no_license
stefandink1/Pizzeryi
f66d9bc523dd43deea620aeb3122e88335f4ab34
e072fe65a224cb55376e98116ab1010c4e407e05
refs/heads/master
2020-12-07T07:24:44.937451
2020-01-08T22:23:39
2020-01-08T22:23:39
232,671,722
0
0
null
null
null
null
UTF-8
C++
false
false
360
cpp
onlineP.cpp
#include "pch.h" #include "onlineP.h" void onlineP::askDistance() { cout << "Care este distanta pana la resedinta d-voastra? (km)" << endl; cin >> distance; } void onlineP::calcPrice() { float delivery = (0.05*this->pizzaValue)*(distance / 10); totalPrice = this->pizzaValue + delivery; } float onlineP::getPrice() { return totalPrice; }
accf0d1fae59af267ed72c18905bbca7b3c367b3
2d78b38d685cbba73dd5b1a84a006ae02e01464a
/Program2Folder/sources/inc/program2internals/input/InputPropagator.hpp
4488c21e7390000d4936febe40ea55a5bd58e72b
[]
no_license
stryku/LifeHelper
c14b4ccfe565c9914dbb74ee21f5035ab975db98
55317dd79053dfec9bd533b44a6a3e4d3aa46d43
refs/heads/master
2020-05-21T19:37:12.892478
2016-10-02T00:49:10
2016-10-02T00:49:10
63,280,543
0
0
null
null
null
null
UTF-8
C++
false
false
1,505
hpp
InputPropagator.hpp
#pragma once #include "utils/log.hpp" #include <memory> namespace P2 { namespace Input { template <typename InputHandler> class InputPropagator { public: InputPropagator() = default; InputPropagator(std::weak_ptr<InputHandler> handler) : inputHandler{ handler } {} InputPropagator(InputPropagator&&) = delete; InputPropagator& operator=(InputPropagator&&) = delete; InputPropagator(const InputPropagator&) = delete; InputPropagator& operator=(const InputPropagator&) = delete; void notifyDecrementSum() { LOG_FILE("InputPropagator::notifyDecrementSum"); if(auto ptr = inputHandler.lock()) ptr->decrementSum(); else LOG_FILE("InputPropagator::notifyDecrementSum inputHandler ptr expired!"); } void setInputHandler( std::weak_ptr<InputHandler> handler ) { LOG_FILE("InputPropagator::setInputHandler"); inputHandler = handler; } auto createDecrementSumCallback() { LOG_FILE("InputPropagator::createDecrementSumCallback"); auto callback = [this] { notifyDecrementSum(); }; return callback; } private: std::weak_ptr<InputHandler> inputHandler; }; } }
b924f1ddfc9b4bbf04b64d033aa1ad835fcc9d5f
ad3647454840c3ec767d1c2643c9ff6fc27ea18c
/week-04/day-03/Flyable/helicopter.cpp
6033ca33a171ec9ea9ad73cb9b64dc4311b03b99
[]
no_license
green-fox-academy/pVer297
15ec329d1efbf8a102c5a3b7214ab5e17217feb9
f0cf0fc9afe57a09043f379829df5144b02f9c71
refs/heads/master
2020-04-16T19:10:48.992084
2019-08-06T14:16:52
2019-08-06T14:16:52
165,849,635
0
0
null
null
null
null
UTF-8
C++
false
false
1,408
cpp
helicopter.cpp
// // Created by Egri Zoltán on 2019. 02. 06.. // #include "helicopter.h" Helicopter::Helicopter(int maxSpeed, int weight) { _maxSpeed = maxSpeed; _weight = weight; _speed = 0; _isInAir = false; } void Helicopter::takeOff() { if (!_isInAir) { std::cout << "The helicopter took off" << std::endl; _isInAir = true; } else { std::cout << "The helicopter is already in air" << std::endl; } } void Helicopter::fly() { if (!_isInAir) { std::cout << "The helicopter is not in the air" << std::endl; } else { if (_speed <= _maxSpeed - 20) { std::cout << "The helicopter is flying faster" << std::endl; _speed += 20; } else { std::cout << "The helicopter is already at its max speed" << std::endl; } } } void Helicopter::land() { if (!_isInAir) { std::cout << "The helicopter is already on the ground" << std::endl; } else { std::cout << "The helicopter landed on the ground" << std::endl; _isInAir = false; _speed = 0; } } void Helicopter::info() { std::string flyState = _isInAir ? " It's in the air." : " It's on the ground."; std::cout << "This is a " << _weight << " kg helicopter capable of reaching " << _maxSpeed << " km/h. It's current speed is " << _speed << ". " << flyState << std::endl; }
da98e11278fc682240574a1e18f9530edee64901
ac647f5ba39beb3b327f8f041f3215d227a2696f
/2018 tank drive (mach 2) Final Version/src/Commands/Autons/CenterToRightLine.cpp
890a5ad7513454a1069eea99fc6914e024f632fb
[]
no_license
RyanDraves/FRC-2018-Team-5162
656a4d570a98c5c3e126f5d8855b3f740874567f
423b3fc67060e0305292195c2c564fed87d7b62d
refs/heads/master
2021-04-18T19:33:14.068521
2019-01-05T17:13:03
2019-01-05T17:13:03
126,600,351
0
0
null
null
null
null
UTF-8
C++
false
false
1,468
cpp
CenterToRightLine.cpp
/* * CenterToRightLine.cpp * * Created on: Feb 8, 2018 * Author: brrobotics5162 */ #include "CenterToRightLine.h" CenterToRightLine::CenterToRightLine() { Requires(Robot::drivetrain.get()); // Use Requires() here to declare subsystem dependencies // eg. Requires(&Robot::chassis); } // Called just before this Command runs the first time void CenterToRightLine::Initialize() { counter = 0; } // Called repeatedly when this Command is scheduled to run void CenterToRightLine::Execute() { float angle = RobotMap::ahrs->GetAngle(); if (counter < 20) { Robot::drivetrain->AutonDrive(-0.5, -0.5, 0); } else if (counter == 20 && (angle < 88 || angle > 90)) { Robot::drivetrain->AutonDrive(-0.5, 0.5, angle); counter--; } else if (counter < 221) { Robot::drivetrain->AutonDrive(-0.5, -0.5, 90); } else if (counter == 221 && (angle < 0 || angle > 2)) { Robot::drivetrain->AutonDrive(0.5, -0.5, angle); counter--; } else if (counter < 322) { Robot::drivetrain->AutonDrive(-0.5, -0.5, 0); } counter++; Wait(0.005); } // Make this return true when this Command no longer needs to run execute() bool CenterToRightLine::IsFinished() { return false; } // Called once after isFinished returns true void CenterToRightLine::End() {} // Called when another command which requires one or more of the same // subsystems is scheduled to run void CenterToRightLine::Interrupted() {}
ab8d1fc066de52e9fbbe5790066800b14801e78e
9410fc7f3720c62256e3ddf88db33e3cc46f0eee
/Tuan 1/BaiTap5.cpp
d592991a897b66a9cb7ad9ad3931b43ecc48b23a
[]
no_license
21522604/OOP-UIT
8deb74ebf471dbfa1ba44ffc2bc1f5eec7296a96
922075f10386491ff089936e493cd56d88c1a530
refs/heads/main
2023-08-11T06:14:16.407817
2021-10-07T10:04:24
2021-10-07T10:04:24
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,159
cpp
BaiTap5.cpp
#include<iostream> #include<cmath> using namespace std; struct ToaDo { double HoanhDo; double TungDo; }; void NhapToaDo(ToaDo &X, int i) { cout << "Nhap lan luot toa do X va Y cua toa do thu " << i << ": "; cin >> X.HoanhDo >> X.TungDo; } void XuatToaDo(ToaDo X, ToaDo Y) { cout << "2 diem co khoang cach lon nhat la: " << endl; cout << "(" << X.HoanhDo << ";" << X.TungDo << ")" << endl; cout << "(" << Y.HoanhDo << ";" << Y.TungDo << ")"; } double KhoangCach(ToaDo X, ToaDo Y) { return sqrt(pow((X.HoanhDo - Y.HoanhDo), 2) + pow((X.TungDo - Y.TungDo), 2)); } void SetDiem(ToaDo &X, double HoanhDo = 0, double TungDo = 0) { X.HoanhDo = HoanhDo; X.TungDo = TungDo; } int main() { int SoPhanTu; cout << "Nhap so diem n: "; cin >> SoPhanTu; ToaDo *Mang = new ToaDo[SoPhanTu]; for (int i = 0; i < SoPhanTu; i++) { cout << "Nhap toa do diem thu " << i << endl; double HoanhDo, TungDo; if (i % 3 == 0) { cout << "Nhap Hoanh Do va Tung Do: "; cin >> HoanhDo >> TungDo; SetDiem(Mang[i], HoanhDo, TungDo); } else if (i % 3 == 1) { cout << "Chi nhap Hoanh Do: "; cin >> HoanhDo; SetDiem(Mang[i], HoanhDo); } else if (i % 3 == 2) { cout << "Hoanh Do bang 0 va Tung Do bang 0" << endl; SetDiem(Mang[i]); } } cout << "Cac diem duoc nhap vao la: " << endl; for (int i = 0; i < SoPhanTu; i++) { cout << "Diem thu " << i << " la: "; cout << "(" << Mang[i].HoanhDo << ";" << Mang[i].TungDo << ")" << endl; } int DiemThuNhat = 0; int DiemThuHai = 1; double Max = KhoangCach(Mang[0], Mang[1]); for (int i = 0; i < SoPhanTu; i++) { for (int j = i+1; j < SoPhanTu; j++) { if (Max < KhoangCach(Mang[i], Mang[j])) { Max = KhoangCach(Mang[i], Mang[j]); DiemThuNhat = i; DiemThuHai = j; } } } XuatToaDo(Mang[DiemThuNhat], Mang[DiemThuHai]); return 0; }
052d33341e8f07f4b1732b437ad11c2cd171be90
4e1b910430e933aa09b19160277ba6c461a1395b
/tensorflow/compiler/mlir/tf2xla/transforms/tf2xla_rewriter.cc
49d26fa36c6e7a48119a026b2ef1f0fb60094fdc
[ "LicenseRef-scancode-generic-cla", "Apache-2.0", "BSD-2-Clause" ]
permissive
jango-blockchained/tensorflow
a8fc4f057bb123aaa4974f9e937c4ddde112dd07
7d19de5804d9bd5fb46509bc072b5e542a14ad08
refs/heads/master
2023-08-18T00:38:15.308088
2023-03-29T15:50:36
2023-03-29T15:50:36
224,640,792
0
0
Apache-2.0
2022-10-12T11:39:04
2019-11-28T11:42:44
C++
UTF-8
C++
false
false
15,053
cc
tf2xla_rewriter.cc
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/compiler/mlir/tf2xla/transforms/tf2xla_rewriter.h" #include <cstdint> #include <memory> #include <string> #include <utility> #include <vector> #include "absl/container/inlined_vector.h" #include "absl/memory/memory.h" #include "absl/strings/string_view.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project #include "mlir/Dialect/SparseTensor/IR/SparseTensor.h" // from @llvm-project #include "mlir/Dialect/Tensor/IR/Tensor.h" // from @llvm-project #include "mlir/IR/Builders.h" // from @llvm-project #include "mlir/IR/BuiltinOps.h" // from @llvm-project #include "mlir/IR/BuiltinTypes.h" // from @llvm-project #include "mlir/IR/Diagnostics.h" // from @llvm-project #include "mlir/IR/IRMapping.h" // from @llvm-project #include "mlir/IR/Location.h" // from @llvm-project #include "mlir/IR/Operation.h" // from @llvm-project #include "mlir/IR/PatternMatch.h" // from @llvm-project #include "mlir/IR/Types.h" // from @llvm-project #include "mlir/IR/Value.h" // from @llvm-project #include "mlir/Pass/Pass.h" // from @llvm-project #include "mlir/Support/LogicalResult.h" // from @llvm-project #include "mlir/Transforms/DialectConversion.h" // from @llvm-project #include "tensorflow/compiler/mlir/op_or_arg_name_mapper.h" #include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h" #include "tensorflow/compiler/mlir/tensorflow/ir/tpu_embedding_ops_registry.h" #include "tensorflow/compiler/mlir/tensorflow/translate/export_tf_dialect_op.h" #include "tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.h" #include "tensorflow/compiler/mlir/tensorflow/utils/convert_type.h" #include "tensorflow/compiler/mlir/tensorflow/utils/translate_utils.h" #include "tensorflow/compiler/mlir/tf2xla/transforms/passes.h" #include "tensorflow/compiler/tf2xla/xla_compilation_device.h" #include "tensorflow/compiler/tf2xla/xla_context.h" #include "tensorflow/compiler/tf2xla/xla_expression.h" #include "tensorflow/compiler/tf2xla/xla_helpers.h" #include "tensorflow/compiler/tf2xla/xla_op_registry.h" #include "tensorflow/compiler/xla/client/xla_builder.h" #include "tensorflow/compiler/xla/mlir_hlo/mhlo/IR/hlo_ops.h" #include "tensorflow/compiler/xla/translate/hlo_to_mhlo/mlir_hlo_builder.h" #include "tensorflow/compiler/xla/xla_data.pb.h" #include "tensorflow/core/common_runtime/process_function_library_runtime.h" #include "tensorflow/core/framework/attr_value.pb.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/resource_mgr.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/framework/types.pb.h" #include "tensorflow/core/protobuf/config.pb.h" #include "tensorflow/core/public/session_options.h" #include "tensorflow/tsl/platform/env.h" #include "tensorflow/tsl/platform/status.h" #include "tensorflow/tsl/platform/statusor.h" namespace mlir { namespace mhlo { namespace { template <typename T, size_t N> using InlinedVector = tensorflow::gtl::InlinedVector<T, N>; // non-absl ok static std::unique_ptr<tensorflow::StaticDeviceMgr> CreateDeviceMgr( const std::string& device_type) { // Register compilation kernels for all registered XLA backends. tensorflow::XlaOpRegistry::RegisterCompilationKernels(); auto device = std::make_unique<tensorflow::XlaCompilationDevice>( tensorflow::SessionOptions(), tensorflow::DeviceType(device_type)); return std::make_unique<tensorflow::StaticDeviceMgr>(std::move(device)); } }; // namespace LogicalResult Tf2XlaRewriter::RewriteOp(Operation* op, PatternRewriter& rewriter, const std::string& device_type, bool is_module_pass, bool use_tf2xla_hlo_importer) { Tf2XlaRewriter tf2xla_rewriter(op, rewriter, device_type, is_module_pass, use_tf2xla_hlo_importer); return tf2xla_rewriter.LegalizeOp(); } Tf2XlaRewriter::Tf2XlaRewriter(Operation* op, PatternRewriter& rewriter, const std::string& device_type, bool is_module_pass, bool use_tf2xla_hlo_importer) : op_(op), device_type_(device_type), rewriter_(rewriter), hlo_builder_(op->getName().getStringRef().str(), rewriter_, op->getLoc(), /*build_functions=*/is_module_pass), context_(nullptr), use_tf2xla_hlo_importer_(use_tf2xla_hlo_importer) {} Tf2XlaRewriter::~Tf2XlaRewriter() { if (context_) context_->Unref(); } LogicalResult Tf2XlaRewriter::PrepareParams() { // XlaCompiler within the context is only used by the functional ops to // compile functions. We are not handling those at the moment so // XlaCompiler is not required. context_ = new tensorflow::XlaContext(/*compiler=*/nullptr, &hlo_builder_, /*graph=*/nullptr); context_->Ref(); device_mgr_ = CreateDeviceMgr(device_type_); if (!device_mgr_) return failure(); // Type of params_.device is DeviceBase* so store it as Device* to access // derived class method. device_ = device_mgr_->ListDevices().front(); params_.device = device_; params_.resource_manager = device_->resource_manager(); // Resources are cleared at the time of device manager destruction so pass // no-op cleanup function. auto cleanup = [](const std::string& name) {}; // Use step_id zero as we only have a single context concurrently and // concurrently running each of the MLIR functions create a new device. step_container_ = std::make_unique<tensorflow::ScopedStepContainer>( /*step_id=*/0, cleanup); tsl::Status status = step_container_->Create( device_->resource_manager(), tensorflow::XlaContext::kXlaContextResourceName, context_); if (!status.ok()) { return emitRemark(op_->getLoc()) << "failed to create XlaContext resource: " << status.ToString(); } params_.step_container = step_container_.get(); tsl::StatusOr<int64_t> version_or = tensorflow::GetTfGraphProducerVersion( op_->getParentOfType<mlir::ModuleOp>()); if (!version_or.ok()) { return emitError(op_->getLoc()) << version_or.status().ToString(); } flib_def_ = std::make_unique<tensorflow::FunctionLibraryDefinition>( tensorflow::OpRegistry::Global(), tensorflow::FunctionDefLibrary()); pflr_ = std::make_unique<tensorflow::ProcessFunctionLibraryRuntime>( device_mgr_.get(), tensorflow::Env::Default(), /*config=*/nullptr, version_or.value(), flib_def_.get(), tensorflow::OptimizerOptions()); params_.function_library = pflr_->GetFLR(device_->name()); return success(); } // Returns true if the given type is a ranked tensor type with static or // bounded dimensions. bool IsBounded(Type ty) { auto ranked_ty = ty.dyn_cast<RankedTensorType>(); if (!ranked_ty) return false; if (ranked_ty.hasStaticShape()) return true; auto encoding = ranked_ty.getEncoding().dyn_cast_or_null<TypeExtensionsAttr>(); if (!encoding) return false; for (int i = 0; i < ranked_ty.getRank(); ++i) { if (ranked_ty.isDynamicDim(i) && encoding.getBounds()[i] == ShapedType::kDynamic) { return false; } } return true; } bool HasSymbolRefAttr(Operation* op) { for (const auto& attr : op->getAttrs()) { Attribute attr_value = attr.getValue(); if (attr_value.isa<SymbolRefAttr>()) { return true; } else if (auto array_attr = attr_value.dyn_cast<ArrayAttr>()) { if (!array_attr.empty() && array_attr.begin()->isa<SymbolRefAttr>()) { return true; } } } return false; } LogicalResult Tf2XlaRewriter::LegalizeOp() { for (Type ty : op_->getOperandTypes()) { auto ranked_ty = ty.dyn_cast<ShapedType>(); // Only bounded operands are supported in the XLA builders. if (!IsBounded(ranked_ty)) { return op_->emitRemark() << "lowering requires bounded tensor operands " << ranked_ty; } } if (HasSymbolRefAttr(op_)) { return op_->emitRemark() << "ops with symbol references are not supported"; } auto nodedef_or = tensorflow::ConvertTFDialectOpToNodeDef( op_, name_mapper_.GetUniqueName(op_), /*ignore_unregistered_attrs=*/true); if (!nodedef_or.ok()) { return op_->emitRemark() << "failed to convert op to NodeDef: " << nodedef_or.status().ToString(); } if (failed(PrepareParams())) return failure(); std::shared_ptr<const tensorflow::NodeProperties> props; tsl::Status status = tensorflow::NodeProperties::CreateFromNodeDef( *nodedef_or.value(), params_.function_library->GetFunctionLibraryDefinition(), &props); if (!status.ok()) { return op_->emitRemark() << "failed to create NodeProperties: " << status.ToString(); } tensorflow::OpKernel* op_kernel_raw; status = params_.function_library->CreateKernel(props, &op_kernel_raw); if (!status.ok()) { return op_->emitRemark() << "failed to create tf2xla kernel: " << status.ToString(); } // Transfer ownership of the kernel to a local smart pointer. auto op_kernel = absl::WrapUnique(op_kernel_raw); std::vector<int> required_constants; status = tensorflow::XlaOpRegistry::CompileTimeConstantInputs( *op_kernel, &required_constants); if (!status.ok()) { return op_->emitRemark() << "failed to compute required constants: " << status.ToString(); } llvm::SmallDenseSet<int, 4> required_consts; required_consts.insert(required_constants.begin(), required_constants.end()); // TensorValue in inputs are backed by tensors which in turn depend on // expressions. So, pre-allocate them to the required size. InlinedVector<tensorflow::XlaExpression, 4> expressions; InlinedVector<tensorflow::Tensor, 4> tensors; InlinedVector<tensorflow::TensorValue, 4> inputs; expressions.reserve(op_->getNumOperands()); tensors.reserve(op_->getNumOperands()); inputs.reserve(op_->getNumOperands()); // Prepare the list of Tensor inputs for the kernel. for (auto it : llvm::enumerate(op_->getOperands())) { Value operand = it.value(); size_t idx = it.index(); tensorflow::XlaExpression expr = GetExprForOperand(operand, op_); tensorflow::XlaExpression::Kind kind = expr.kind(); if (kind == tensorflow::XlaExpression::Kind::kInvalid) return failure(); if (required_consts.count(idx) && kind != tensorflow::XlaExpression::Kind::kConstant) { return op_->emitRemark() << "lowering requires operand #" << idx << " to be a constant"; } expressions.push_back(expr); if (!tensorflow::DataTypeCanUseMemcpy(expr.dtype())) { return op_->emitRemark() << "skipping legalization due to unsupported type " << operand.getType(); } auto shape_or = expr.GetShape(); if (!shape_or.ok()) { return op_->emitRemark() << "failed to get shape for expression. " << expr.HumanString(); } tensors.emplace_back( device_->GetAllocator(tensorflow::AllocatorAttributes()), expr.dtype(), shape_or.value()); tensorflow::Tensor& tensor = tensors.back(); tensorflow::XlaExpression::AssignExpressionToTensor(expr, &tensor); inputs.emplace_back(&tensor); } params_.inputs = inputs; params_.op_kernel = op_kernel.get(); llvm::SmallVector<tensorflow::AllocatorAttributes, 4> output_attr( op_->getNumResults()); params_.output_attr_array = output_attr.data(); hlo_builder_.setInsertionPoint(op_); hlo_builder_.SetLocation(op_->getLoc()); // Execute the kernel. tensorflow::OpKernelContext op_context(&params_, op_->getNumResults()); device_->Compute(params_.op_kernel, &op_context); status = op_context.status(); status.Update(hlo_builder_.GetCurrentStatus()); if (!status.ok()) { return op_->emitRemark() << "compilation to HLO failed: " << status.ToString(); } // Replace uses of old results using the corresponding value after the // lowering. llvm::SmallVector<Value, 2> values; values.reserve(op_->getNumResults()); for (int i = 0, e = op_->getNumResults(); i < e; i++) { tensorflow::Tensor* output = op_context.mutable_output(i); const tensorflow::XlaExpression* expr = tensorflow::XlaExpression::CastExpressionFromTensor(*output); if (expr->kind() != tensorflow::XlaExpression::Kind::kXlaOp && expr->kind() != tensorflow::XlaExpression::Kind::kConstant) { return op_->emitRemark( "expects XlaExpression of kind kXlaOp or kConstant in compiled " "output"); } mlir::Value value = hlo_builder_.GetValue(expr->AsXlaOp(&hlo_builder_)); values.push_back(value); } rewriter_.replaceOp(op_, values); return success(); } tensorflow::XlaExpression Tf2XlaRewriter::GetExprForOperand(Value operand, Operation* op) { ElementsAttr const_attr; auto defining_op = operand.getDefiningOp(); if (defining_op && matchPattern(defining_op, m_Constant(&const_attr))) { tensorflow::Tensor tensor; auto status = tensorflow::ConvertToTensor(const_attr, &tensor); if (!status.ok()) { op->emitRemark() << "skipping legalization due to failed const conversion" << status.ToString(); return tensorflow::XlaExpression::Invalid(); } return tensorflow::XlaExpression::Constant(tensor); } // Skip this op if XLA doesn't support this operand type. auto xla_op_or = hlo_builder_.MakeXlaOp(operand); if (!xla_op_or.ok()) { op->emitRemark() << "skipping legalization due to " << xla_op_or.status().ToString(); return tensorflow::XlaExpression::Invalid(); } ::xla::XlaOp xla_op = xla_op_or.value(); tensorflow::DataType dtype; auto status = tensorflow::ConvertToDataType(operand.getType(), &dtype); if (!status.ok()) { op->emitRemark() << "skipping legalization due to " << status.ToString(); return tensorflow::XlaExpression::Invalid(); } return tensorflow::XlaExpression::XlaOp(xla_op, dtype); } } // namespace mhlo } // namespace mlir
f2b000ffbcb3e07891839db45e5bb14e97cfab34
ae7ec837eb954d7be7878f367aa7afb70d1a3897
/libs/lwwx/samples/generic_ui/stdwx.cpp
fda27c4bc2977731575ee417c72900f0200bc3e6
[ "MIT", "BSD-3-Clause" ]
permissive
hajokirchhoff/litwindow
0387bd1e59200eddb77784c665ba921089589026
7f574d4e80ee8339ac11c35f075857c20391c223
refs/heads/master
2022-06-18T20:15:21.475921
2016-12-28T18:16:58
2016-12-28T18:16:58
77,551,164
0
0
null
null
null
null
UTF-8
C++
false
false
649
cpp
stdwx.cpp
// stdafx.cpp : source file that includes just the standard includes // wxWindowsTemplate.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdwx.h" #ifndef __WIN95__ #error An error in wxWindows version 2.4.0 and 2.4.1 require that you set WINVER=0x400 in the project settings! // To set WINVER, open the project properties page, then // locate C++ | Preprocessor | Preprocessor Definitions // and add ;WINVER=0x400 to the line. #endif // TODO: reference any additional headers you need in STDAFX.H // and not in this file #include "litwindow/wx/wxwidgetimport.h"
824149d738016ab4219b64f7886410c94dc0d790
f60796674e5410ce733f8e7de704bce5e5a0a45b
/Source/Virtusonic/Audio/AudioController.cpp
35f1a2163c526a08e13864e6d35d853a5a177960
[ "Apache-2.0" ]
permissive
lkunic/Virtusonic
835303be940167606865041ebadc18f122a21f34
97b2cbf90ee707b7d609f0a739ebdf183a6f8c90
refs/heads/master
2022-09-05T05:19:01.719724
2022-09-01T21:03:02
2022-09-01T21:03:02
63,863,141
0
0
null
null
null
null
UTF-8
C++
false
false
822
cpp
AudioController.cpp
// Copyright (c) Luka Kunic, 2016. #include "Virtusonic.h" #include "AudioController.h" // Sets default values for this component's properties UAudioController::UAudioController() { PrimaryComponentTick.bCanEverTick = false; } /* * Adds an audio source to this component. */ void UAudioController::AddAudioSource(AAudioSource *audioSource) { mAudioSources.Add(audioSource); mAlternateIndex.Add(0); } /* * Returns the number of audio sources attached to this component. */ int32 UAudioController::GetAudioSourceCount() { return mAudioSources.Num(); } /* * Returns the audio source at the given index. */ AAudioSource* UAudioController::GetAudioSource(int32 index) { mAlternateIndex[index] = (mAlternateIndex[index] + 1) % 4; return mAudioSources[index + mAlternateIndex[index] * mAudioSources.Num() / 4]; }
b5ecf27d60aed59478ff65086a69fcdd7f76f567
3e5fb24eaeff3d237ad3cd10d53ead310ebdb5fa
/src/Observer.h
3fb3387eab13f28fe88c142d019c5a0ef653d8a1
[]
no_license
SamMaier/straights
21bafa95debca3f6c170b5787aa295e53d40429a
a292be89accf5ecd926a2382699c2c4173735d5b
refs/heads/master
2021-01-17T17:49:59.107003
2015-07-17T22:26:32
2015-07-17T22:26:32
37,215,298
0
0
null
null
null
null
UTF-8
C++
false
false
199
h
Observer.h
// // Created by Shiranka Miskin on 7/14/15. // #ifndef STRAIGHTS_OBSERVER_H #define STRAIGHTS_OBSERVER_H class Observer { public: virtual void update() = 0; }; #endif //STRAIGHTS_OBSERVER_H
60b4ec37179a700eaedbe00f532ee2aabd676370
247201411790407aca003556ae8867bd296f7723
/Source/FutureCity/FutureCity.cpp
04b1438633c56540471edcffdeb39d57d1d01afc
[ "MIT" ]
permissive
keleko34/FutureCity
a60fcdd0f7373d0a3633d2ae81871701f2692f87
9bf9ff65242fb92c8bb87c74d74b82ac13d23a65
refs/heads/master
2021-01-01T03:37:34.567528
2016-05-12T23:53:49
2016-05-12T23:53:49
58,478,134
0
0
null
null
null
null
UTF-8
C++
false
false
188
cpp
FutureCity.cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "FutureCity.h" IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, FutureCity, "FutureCity" );
074b27f398097861cbfa72cf859e3421065f8ead
f9282e5ccb911443c60bcd487c2dea83427f3c6e
/src/tensor.cpp
c8336998b1e0b8ba787d8e6a717600f99385132e
[ "MIT" ]
permissive
Lugatod/taco
19b0ba0035bca92b2c7904b647ce5a7d8572d9b2
787d2203436d8c2f8406664054bb64bc01e34ec2
refs/heads/master
2020-12-30T14:00:18.147864
2017-05-16T13:49:19
2017-05-16T13:49:19
91,270,918
0
0
null
2017-05-14T20:55:37
2017-05-14T20:55:37
null
UTF-8
C++
false
false
25,392
cpp
tensor.cpp
#include "taco/tensor.h" #include <cstring> #include <fstream> #include <sstream> #include <limits.h> #include "taco/tensor.h" #include "taco/expr.h" #include "taco/format.h" #include "ir/ir.h" #include "taco/expr_nodes/expr_nodes.h" #include "taco/expr_nodes/expr_visitor.h" #include "taco/storage/storage.h" #include "taco/storage/pack.h" #include "ir/ir.h" #include "lower/lower.h" #include "lower/iteration_schedule.h" #include "backends/module.h" #include "taco_tensor_t.h" #include "taco/io/tns_file_format.h" #include "taco/io/mtx_file_format.h" #include "taco/io/rb_file_format.h" #include "taco/util/strings.h" #include "taco/util/timers.h" #include "taco/util/name_generator.h" using namespace std; using namespace taco::ir; using namespace taco::storage; using namespace taco::expr_nodes; namespace taco { // class ComponentType size_t ComponentType::bytes() const { switch (this->kind) { case Bool: return sizeof(bool); case Int: return sizeof(int); case Float: return sizeof(float); case Double: return sizeof(double); case Unknown: break; } return UINT_MAX; } ComponentType::Kind ComponentType::getKind() const { return kind; } bool operator==(const ComponentType& a, const ComponentType& b) { return a.getKind() == b.getKind(); } bool operator!=(const ComponentType& a, const ComponentType& b) { return a.getKind() != b.getKind(); } std::ostream& operator<<(std::ostream& os, const ComponentType& type) { switch (type.getKind()) { case ComponentType::Bool: os << "bool"; break; case ComponentType::Int: os << "int"; break; case ComponentType::Float: os << "float"; break; case ComponentType::Double: os << "double"; break; case ComponentType::Unknown: break; } return os; } static const size_t DEFAULT_ALLOC_SIZE = (1 << 20); struct TensorBase::Content { string name; vector<int> dimensions; ComponentType ctype; storage::Storage storage; vector<taco::Var> indexVars; taco::Expr expr; vector<void*> arguments; size_t allocSize; size_t valuesSize; lower::IterationSchedule schedule; Stmt assembleFunc; Stmt computeFunc; shared_ptr<Module> module; }; TensorBase::TensorBase() : TensorBase(ComponentType::Double) { } TensorBase::TensorBase(ComponentType ctype) : TensorBase(util::uniqueName('A'), ctype) { } TensorBase::TensorBase(std::string name, ComponentType ctype) : TensorBase(name, ctype, {}, Format()) { } TensorBase::TensorBase(double val) : TensorBase(type<double>()) { this->insert({}, val); pack(); } TensorBase::TensorBase(ComponentType ctype, vector<int> dimensions, Format format) : TensorBase(util::uniqueName('A'), ctype, dimensions, format) { } TensorBase::TensorBase(string name, ComponentType ctype, vector<int> dimensions, Format format) : content(new Content) { taco_uassert(format.getOrder() == dimensions.size() || format.getOrder() == 1) << "The number of format levels (" << format.getOrder() << ") " << "must match the tensor order (" << dimensions.size() << "), " << "or there must be a single level."; taco_uassert(ctype == ComponentType::Double) << "Only double tensors currently supported"; if (dimensions.size() == 0) { format = Format(); } else if (dimensions.size() > 1 && format.getOrder() == 1) { DimensionType levelType = format.getLevels()[0].getType(); vector<DimensionType> levelTypes; for (size_t i = 0; i < dimensions.size(); i++) { levelTypes.push_back(levelType); } format = Format(levelTypes); } content->name = name; content->dimensions = dimensions; content->storage = Storage(format); content->ctype = ctype; this->setAllocSize(DEFAULT_ALLOC_SIZE); // Initialize dense storage dimensions vector<Level> levels = format.getLevels(); for (size_t i=0; i < levels.size(); ++i) { if (levels[i].getType() == DimensionType::Dense) { auto index = (int*)malloc(sizeof(int)); index[0] = dimensions[i]; content->storage.setDimensionIndex(i, {index}); } } content->module = make_shared<Module>(); this->coordinateBuffer = shared_ptr<vector<char>>(new vector<char>); this->coordinateBufferUsed = 0; this->coordinateSize = getOrder()*sizeof(int) + ctype.bytes(); } void TensorBase::setName(std::string name) const { content->name = name; } string TensorBase::getName() const { return content->name; } size_t TensorBase::getOrder() const { return content->dimensions.size(); } const vector<int>& TensorBase::getDimensions() const { return content->dimensions; } const Format& TensorBase::getFormat() const { return content->storage.getFormat(); } void TensorBase::reserve(size_t numCoordinates) { size_t newSize = this->coordinateBuffer->size() + numCoordinates*this->coordinateSize; this->coordinateBuffer->resize(newSize); } void TensorBase::insert(const initializer_list<int>& coordinate, double value) { taco_uassert(coordinate.size() == getOrder()) << "Wrong number of indices"; taco_uassert(getComponentType() == ComponentType::Double) << "Cannot insert a value of type '" << ComponentType::Double << "' " << "into a tensor with component type " << getComponentType(); if ((coordinateBuffer->size() - coordinateBufferUsed) < coordinateSize) { coordinateBuffer->resize(coordinateBuffer->size() + coordinateSize); } int* coordLoc = (int*)&coordinateBuffer->data()[coordinateBufferUsed]; for (int idx : coordinate) { *coordLoc = idx; coordLoc++; } *((double*)coordLoc) = value; coordinateBufferUsed += coordinateSize; } void TensorBase::insert(const std::vector<int>& coordinate, double value) { taco_uassert(coordinate.size() == getOrder()) << "Wrong number of indices"; taco_uassert(getComponentType() == ComponentType::Double) << "Cannot insert a value of type '" << ComponentType::Double << "' " << "into a tensor with component type " << getComponentType(); if ((coordinateBuffer->size() - coordinateBufferUsed) < coordinateSize) { coordinateBuffer->resize(coordinateBuffer->size() + coordinateSize); } int* coordLoc = (int*)&coordinateBuffer->data()[coordinateBufferUsed]; for (int idx : coordinate) { *coordLoc = idx; coordLoc++; } *((double*)coordLoc) = value; coordinateBufferUsed += coordinateSize; } const ComponentType& TensorBase::getComponentType() const { return content->ctype; } const vector<taco::Var>& TensorBase::getIndexVars() const { return content->indexVars; } const taco::Expr& TensorBase::getExpr() const { return content->expr; } const storage::Storage& TensorBase::getStorage() const { return content->storage; } storage::Storage& TensorBase::getStorage() { return content->storage; } void TensorBase::setAllocSize(size_t allocSize) const { taco_uassert(allocSize >= 2 && (allocSize & (allocSize - 1)) == 0) << "The index allocation size must be a power of two and at least two"; content->allocSize = allocSize; } size_t TensorBase::getAllocSize() const { return content->allocSize; } void TensorBase::setCSR(double* vals, int* rowPtr, int* colIdx) { taco_uassert(getFormat() == CSR) << "setCSR: the tensor " << getName() << " is not in the CSR format, " << "but instead " << getFormat(); auto storage = getStorage(); storage.setDimensionIndex(0, {util::copyToArray({getDimensions()[0]})}); storage.setDimensionIndex(1, {rowPtr, colIdx}); storage.setValues(vals); } void TensorBase::getCSR(double** vals, int** rowPtr, int** colIdx) { taco_uassert(getFormat() == CSR) << "getCSR: the tensor " << getName() << " is not defined in the CSR format"; auto storage = getStorage(); *vals = storage.getValues(); *rowPtr = storage.getDimensionIndex(1)[0]; *colIdx = storage.getDimensionIndex(1)[1]; } void TensorBase::setCSC(double* vals, int* colPtr, int* rowIdx) { taco_uassert(getFormat() == CSC) << "setCSC: the tensor " << getName() << " is not defined in the CSC format"; auto storage = getStorage(); std::vector<int> denseDim = {getDimensions()[1]}; storage.setDimensionIndex(0, {util::copyToArray(denseDim)}); storage.setDimensionIndex(1, {colPtr, rowIdx}); storage.setValues(vals); } void TensorBase::getCSC(double** vals, int** colPtr, int** rowIdx) { taco_uassert(getFormat() == CSC) << "getCSC: the tensor " << getName() << " is not defined in the CSC format"; auto storage = getStorage(); *vals = storage.getValues(); *colPtr = storage.getDimensionIndex(1)[0]; *rowIdx = storage.getDimensionIndex(1)[1]; } static int numIntegersToCompare = 0; static int lexicographicalCmp(const void* a, const void* b) { for (int i = 0; i < numIntegersToCompare; i++) { int diff = ((int*)a)[i] - ((int*)b)[i]; if (diff != 0) { return diff; } } return 0; } /// Pack coordinates into a data structure given by the tensor format. void TensorBase::pack() { taco_tassert(getComponentType() == ComponentType::Double) << "make the packing machinery work with other primitive types later. " << "Right now we're specializing to doubles so that we can use a " << "resizable vector, but eventually we should use a two pass pack " << "algorithm that figures out sizes first, and then packs the data"; // Nothing to pack if (coordinateBufferUsed == 0) { return; } const size_t order = getOrder(); // Pack scalars if (order == 0) { content->storage.setValues((double*)malloc(getComponentType().bytes())); char* coordLoc = this->coordinateBuffer->data(); content->storage.getValues()[0] = *(double*)&coordLoc[this->coordinateSize-getComponentType().bytes()]; this->coordinateBuffer->clear(); return; } /// Permute the coordinates according to the storage dimension ordering. /// This is a workaround since the current pack code only packs tensors in the /// order of the dimensions. const std::vector<Level>& levels = getFormat().getLevels(); const std::vector<int>& dimensions = getDimensions(); taco_iassert(levels.size() == order); std::vector<int> permutation; for (auto& level : levels) { permutation.push_back((int)level.getDimension()); } std::vector<int> permutedDimensions(order); for (size_t i = 0; i < order; ++i) { permutedDimensions[i] = dimensions[permutation[i]]; } taco_iassert((this->coordinateBufferUsed % this->coordinateSize) == 0); size_t numCoordinates = this->coordinateBufferUsed / this->coordinateSize; const size_t coordSize = this->coordinateSize; char* coordinatesPtr = coordinateBuffer->data(); vector<int> permuteBuffer(order); for (size_t i=0; i < numCoordinates; ++i) { int* coordinate = (int*)coordinatesPtr; for (size_t j = 0; j < order; j++) { permuteBuffer[j] = coordinate[permutation[j]]; } for (size_t j = 0; j < order; j++) { coordinate[j] = permuteBuffer[j]; } coordinatesPtr += this->coordinateSize; } coordinatesPtr = coordinateBuffer->data(); // The pack code expects the coordinates to be sorted numIntegersToCompare = order; qsort(coordinatesPtr, numCoordinates, coordSize, lexicographicalCmp); // Move coords into separate arrays std::vector<std::vector<int>> coordinates(order); for (size_t i=0; i < order; ++i) { coordinates[i] = std::vector<int>(numCoordinates); } std::vector<double> values(numCoordinates); for (size_t i=0; i < numCoordinates; ++i) { int* coordLoc = (int*)&coordinatesPtr[i*coordSize]; for (size_t d=0; d < order; ++d) { coordinates[d][i] = *coordLoc; coordLoc++; } values[i] = *((double*)coordLoc); } taco_iassert(coordinates.size() > 0); this->coordinateBuffer->clear(); this->coordinateBufferUsed = 0; // Pack indices and values content->storage = storage::pack(permutedDimensions, getFormat(), coordinates, values); // std::cout << storage::packCode(getFormat()) << std::endl; } void TensorBase::zero() { auto resultStorage = getStorage(); // Set values to 0.0 in case we are doing a += operation memset(resultStorage.getValues(), 0, content->valuesSize * sizeof(double)); } Access TensorBase::operator()(const std::vector<Var>& indices) { taco_uassert(indices.size() == getOrder()) << "A tensor of order " << getOrder() << " must be indexed with " << getOrder() << " variables, but is indexed with: " << util::join(indices); return Access(*this, indices); } void TensorBase::compile() { taco_iassert(getExpr().defined()) << "No expression defined for tensor"; content->assembleFunc = lower::lower(*this, "assemble", {lower::Assemble}); content->computeFunc = lower::lower(*this, "compute", {lower::Compute}); content->module->addFunction(content->assembleFunc); content->module->addFunction(content->computeFunc); content->module->compile(); } static taco_tensor_t* getTensorData(const TensorBase& tensor) { taco_tensor_t* tensorData = (taco_tensor_t*)malloc(sizeof(taco_tensor_t)); size_t order = tensor.getOrder(); Storage storage = tensor.getStorage(); Format format = storage.getFormat(); tensorData->order = order; tensorData->dims = (int32_t*)malloc(order * sizeof(int32_t)); tensorData->dim_types = (taco_dim_t*)malloc(order * sizeof(taco_dim_t)); tensorData->dim_order = (int32_t*)malloc(order * sizeof(int32_t)); tensorData->indices = (uint8_t***)malloc(order * sizeof(uint8_t***)); for (size_t i = 0; i < tensor.getOrder(); i++) { auto dimType = format.getLevels()[i]; auto dimIndex = storage.getDimensionIndex(i); tensorData->dims[i] = tensor.getDimensions()[i]; tensorData->dim_order[i] = dimType.getDimension(); switch (dimType.getType()) { case DimensionType::Dense: tensorData->dim_types[i] = taco_dim_dense; tensorData->indices[i] = (uint8_t**)malloc(1 * sizeof(uint8_t**)); tensorData->indices[i][0] = (uint8_t*)dimIndex[0]; // size break; case DimensionType::Sparse: tensorData->dim_types[i] = taco_dim_sparse; tensorData->indices[i] = (uint8_t**)malloc(2 * sizeof(uint8_t**)); tensorData->indices[i][0] = (uint8_t*)dimIndex[0]; // pos array tensorData->indices[i][1] = (uint8_t*)dimIndex[1]; // idx array break; case DimensionType::Fixed: taco_not_supported_yet; break; } } tensorData->csize = sizeof(double); tensorData->vals = (uint8_t*)storage.getValues(); return tensorData; } static inline vector<void*> packArguments(const TensorBase& tensor) { vector<void*> arguments; // Pack the result tensor arguments.push_back(getTensorData(tensor)); // Pack operand tensors vector<TensorBase> operands = expr_nodes::getOperands(tensor.getExpr()); for (auto& operand : operands) { arguments.push_back(getTensorData(operand)); } return arguments; } void TensorBase::assemble() { this->content->arguments = packArguments(*this); this->assembleInternal(); } void TensorBase::compute() { this->content->arguments = packArguments(*this); this->zero(); this->computeInternal(); } void TensorBase::evaluate() { this->compile(); this->content->arguments = packArguments(*this); this->assembleInternal(); this->zero(); this->computeInternal(); } void TensorBase::setExpr(const vector<taco::Var>& indexVars, taco::Expr expr) { // The following are index expressions we don't currently support, but that // are planned for the future. // We don't yet support distributing tensors. That is, every free variable // must be used on the right-hand-side. set<taco::Var> rhsVars; using namespace expr_nodes; expr_nodes::match(expr, function<void(const ReadNode*)>([&](const ReadNode* op) { for (auto& var : op->indexVars) { rhsVars.insert(var); } }) ); for (auto& lhsVar : indexVars) { taco_uassert(util::contains(rhsVars, lhsVar)) << "All variables must appear on the right-hand-side of an assignment. " "This restriction will be removed in the future.\n" << "Expression: " << getName() << "(" << util::join(indexVars,",") << ")"<< " = " << expr; } // Check that the dimensions indexed by the same variable are the same std::map<taco::Var,int> varSizes; for (size_t i = 0; i < indexVars.size(); i++) { taco::Var var = indexVars[i]; int dimension = getDimensions()[i]; if (util::contains(varSizes, var)) { taco_uassert(varSizes.at(var) == dimension) << "Index variable " << var << " is used to index dimensions of " << "different sizes (" << varSizes.at(var) << " and " << dimension << ")."; } else { varSizes.insert({var, dimension}); } } match(expr, std::function<void(const ReadNode*)>([&varSizes](const ReadNode* op) { for (size_t i = 0; i < op->indexVars.size(); i++) { taco::Var var = op->indexVars[i]; int dimension = op->tensor.getDimensions()[i]; if (util::contains(varSizes, var)) { taco_uassert(varSizes.at(var) == dimension) << "Index variable " << var << " is used to index dimensions of " << "different sizes (" << varSizes.at(var) << " and " << dimension << ")."; } else { varSizes.insert({var, dimension}); } } }) ); content->indexVars = indexVars; content->expr = expr; storage::Storage storage = getStorage(); Format format = storage.getFormat(); auto& levels = format.getLevels(); for (size_t i=0; i < levels.size(); ++i) { Level level = levels[i]; switch (level.getType()) { case DimensionType::Dense: break; case DimensionType::Sparse: { auto pos = (int*)malloc(getAllocSize() * sizeof(int)); auto idx = (int*)malloc(getAllocSize() * sizeof(int)); pos[0] = 0; storage.setDimensionIndex(i, {pos,idx}); break; } case DimensionType::Fixed: { auto pos = (int*)malloc(sizeof(int)); auto idx = (int*)malloc(getAllocSize() * sizeof(int)); storage.setDimensionIndex(i, {pos,idx}); break; } } } } void TensorBase::printComputeIR(ostream& os, bool color, bool simplify) const { IRPrinter printer(os, color, simplify); printer.print(content->computeFunc.as<Function>()->body); } void TensorBase::printAssembleIR(ostream& os, bool color, bool simplify) const { IRPrinter printer(os, color, simplify); printer.print(content->assembleFunc.as<Function>()->body); } string TensorBase::getSource() const { return content->module->getSource(); } void TensorBase::compileSource(std::string source) { taco_iassert(getExpr().defined()) << "No expression defined for tensor"; content->module->setSource(source); content->module->compile(); } bool equals(const TensorBase& a, const TensorBase& b) { // Component type must be the same if (a.getComponentType() != b.getComponentType()) { return false; } // Dimensions must be the same if (a.getOrder() != b.getOrder()) { return false; } for (auto dims : util::zip(a.getDimensions(), b.getDimensions())) { if (dims.first != dims.second) { return false; } } // Values must be the same auto at = iterate<double>(a); auto bt = iterate<double>(b); auto ait = at.begin(); auto bit = bt.begin(); for (; ait != at.end() && bit != bt.end(); ++ait, ++bit) { if (ait->first != bit->first) { return false; } if (abs((ait->second - bit->second)/ait->second) > 10e-6) { return false; } } return (ait == at.end() && bit == bt.end()); } bool operator==(const TensorBase& a, const TensorBase& b) { return a.content == b.content; } bool operator!=(const TensorBase& a, const TensorBase& b) { return a.content != b.content; } bool operator<(const TensorBase& a, const TensorBase& b) { return a.content < b.content; } bool operator>(const TensorBase& a, const TensorBase& b) { return a.content > b.content; } bool operator<=(const TensorBase& a, const TensorBase& b) { return a.content <= b.content; } bool operator>=(const TensorBase& a, const TensorBase& b) { return a.content >= b.content; } void TensorBase::assembleInternal() { content->module->callFuncPacked("assemble", content->arguments.data()); auto storage = getStorage(); auto format = storage.getFormat(); taco_tensor_t* tensorData = ((taco_tensor_t*)content->arguments[0]); for (size_t i = 0; i < getOrder(); i++) { auto dimType = format.getLevels()[i]; switch (dimType.getType()) { case DimensionType::Dense: break; case DimensionType::Sparse: storage.setDimensionIndex(i, {(int*)tensorData->indices[i][0], (int*)tensorData->indices[i][1]}); break; case DimensionType::Fixed: taco_not_supported_yet; break; } } content->valuesSize = storage.getSize().numValues(); storage.setValues((double*)malloc(content->valuesSize*sizeof(double))); tensorData->vals = (uint8_t*)storage.getValues(); } void TensorBase::computeInternal() { this->content->module->callFuncPacked("compute", content->arguments.data()); } ostream& operator<<(ostream& os, const TensorBase& tensor) { vector<string> dimStrings; for (int dim : tensor.getDimensions()) { dimStrings.push_back(to_string(dim)); } os << tensor.getName() << " (" << util::join(dimStrings, "x") << ") " << tensor.getFormat() << ":" << std::endl; // Print coordinates size_t numCoordinates = tensor.coordinateBufferUsed / tensor.coordinateSize; for (size_t i = 0; i < numCoordinates; i++) { int* ptr = (int*)&tensor.coordinateBuffer->data()[i*tensor.coordinateSize]; os << "(" << util::join(ptr, ptr+tensor.getOrder()) << "): " << ((double*)(ptr+tensor.getOrder()))[0] << std::endl; } // Print packed data os << tensor.getStorage(); return os; } static string getExtension(string filename) { return filename.substr(filename.find_last_of(".") + 1); } template <typename T> TensorBase dispatchRead(T& file, FileType filetype, Format format, bool pack) { TensorBase tensor; switch (filetype) { case FileType::ttx: case FileType::mtx: tensor = io::mtx::read(file, format, pack); break; case FileType::tns: tensor = io::tns::read(file, format, pack); break; case FileType::rb: tensor = io::rb::read(file, format, pack); break; } return tensor; } TensorBase read(std::string filename, Format format, bool pack) { string extension = getExtension(filename); TensorBase tensor; if (extension == "ttx") { tensor = dispatchRead(filename, FileType::ttx, format, pack); } else if (extension == "tns") { tensor = dispatchRead(filename, FileType::tns, format, pack); } else if (extension == "mtx") { tensor = dispatchRead(filename, FileType::mtx, format, pack); } else if (extension == "rb") { tensor = dispatchRead(filename, FileType::rb, format, pack); } else { taco_uerror << "File extension not recognized: " << filename << std::endl; } string name = filename.substr(filename.find_last_of("/") + 1); name = name.substr(0, name.find_first_of(".")); tensor.setName(name); return tensor; } TensorBase read(string filename, FileType filetype, Format format, bool pack) { return dispatchRead(filename, filetype, format, pack); } TensorBase read(istream& stream, FileType filetype, Format format, bool pack) { return dispatchRead(stream, filetype, format, pack); } template <typename T> void dispatchWrite(T& file, const TensorBase& tensor, FileType filetype) { switch (filetype) { case FileType::ttx: case FileType::mtx: io::mtx::write(file, tensor); break; case FileType::tns: io::tns::write(file, tensor); break; case FileType::rb: io::rb::write(file, tensor); break; } } void write(string filename, const TensorBase& tensor) { string extension = getExtension(filename); if (extension == "ttx") { dispatchWrite(filename, tensor, FileType::ttx); } else if (extension == "tns") { dispatchWrite(filename, tensor, FileType::tns); } else if (extension == "mtx") { taco_iassert(tensor.getOrder() == 2) << "The .mtx format only supports matrices. Consider using the .ttx format " "instead"; dispatchWrite(filename, tensor, FileType::mtx); } else if (extension == "rb") { dispatchWrite(filename, tensor, FileType::rb); } else { taco_uerror << "File extension not recognized: " << filename << std::endl; } } void write(string filename, FileType filetype, const TensorBase& tensor) { dispatchWrite(filename, tensor, filetype); } void write(ofstream& stream, FileType filetype, const TensorBase& tensor) { dispatchWrite(stream, tensor, filetype); } void packOperands(const TensorBase& tensor) { for (TensorBase operand : expr_nodes::getOperands(tensor.getExpr())) { operand.pack(); } } }
4432fd3d4c14075563be6e28278ec7b8fb76c810
2864ed81d44058fb867e15866026e382908608ef
/cplus/lang/CPlusString.h
cbb8454fde4fe73defe68d5d8c86a7bd0e25f0a5
[]
no_license
tursom/cplus
45f3b26eb3fb26b0340e4852b6c81d4534a91910
03a4b1a8a586bde2c38feeadb2db0e319cf8d925
refs/heads/master
2021-07-14T06:33:44.055445
2020-05-23T12:45:50
2020-05-23T12:45:50
134,021,179
5
0
null
null
null
null
UTF-8
C++
false
false
1,433
h
CPlusString.h
// // Created by Tursom Ulefits on 2018/6/16. // #ifndef CPLUS_CPLUSSTRING_H #define CPLUS_CPLUSSTRING_H #include <cstring> #include "../tools/class.h" #include "../thread/ThreadMutex.h" namespace cplus { namespace lang { class ByteArray; /** * String */ CPlusClass(CPlusString) { public: CPlusString(); explicit CPlusString(const char *str); explicit CPlusString(const char *str, size_t len); explicit CPlusString(const std::string &str); CPlusString(const CPlusString &str); explicit CPlusString(const ByteArray &str); ~CPlusString(); friend std::ostream &operator<<(std::ostream &os, const CPlusString &string); void setToNull(); void setStr(char *str, size_t bufferSize); size_t getBufferSize() const; size_t getSize() const; bool operator==(const CPlusString &rhs) const; bool operator!=(const CPlusString &rhs) const; bool operator<(const CPlusString &rhs) const; bool operator>(const CPlusString &rhs) const; bool operator<=(const CPlusString &rhs) const; bool operator>=(const CPlusString &rhs) const; char *getStr() const; int16_t getCount() const; int16_t &getCount(); void lock(); void unlock(); private: char *str{}; size_t bufferSize{}; int16_t count{0}; thread::ThreadMutex mutex{}; }; } } #endif //CPLUS_CPLUSSTRING_H
f81c6f10f7918323f72b3f211b6d31884e718752
b7444912fb9ecd331929d3587b4c96e8ecc76c4a
/Plugins/VRExpansionPlugin/VRExpansionPlugin/Intermediate/Build/Win64/UE4/Inc/VRExpansionPlugin/GrippableSphereComponent.gen.cpp
9879177cfa8e32a2c74e85c427d8c6608d01f002
[ "MIT" ]
permissive
Kilowattrl/LTX
d3150b3183d88ce2dc62529eb3f1a4ad09bb4519
b3c463588bb9d1123a624fc87c4c3f41d5413363
refs/heads/master
2023-07-10T21:51:14.328779
2021-08-12T00:14:44
2021-08-12T00:14:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
149,475
cpp
GrippableSphereComponent.gen.cpp
// Copyright 1998-2019 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 "VRExpansionPlugin/Public/Grippables/GrippableSphereComponent.h" #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable : 4883) #endif PRAGMA_DISABLE_DEPRECATION_WARNINGS void EmptyLinkFunctionForGeneratedCodeGrippableSphereComponent() {} // Cross Module References VREXPANSIONPLUGIN_API UClass* Z_Construct_UClass_UGrippableSphereComponent_NoRegister(); VREXPANSIONPLUGIN_API UClass* Z_Construct_UClass_UGrippableSphereComponent(); ENGINE_API UClass* Z_Construct_UClass_USphereComponent(); UPackage* Z_Construct_UPackage__Script_VRExpansionPlugin(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings(); VREXPANSIONPLUGIN_API UScriptStruct* Z_Construct_UScriptStruct_FBPAdvGripSettings(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange(); VREXPANSIONPLUGIN_API UClass* Z_Construct_UClass_UGripMotionControllerComponent_NoRegister(); COREUOBJECT_API UScriptStruct* Z_Construct_UScriptStruct_FTransform(); COREUOBJECT_API UScriptStruct* Z_Construct_UScriptStruct_FVector(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts(); VREXPANSIONPLUGIN_API UClass* Z_Construct_UClass_UVRGripScriptBase_NoRegister(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType(); VREXPANSIONPLUGIN_API UEnum* Z_Construct_UEnum_VRExpansionPlugin_EGripCollisionType(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting(); VREXPANSIONPLUGIN_API UEnum* Z_Construct_UEnum_VRExpansionPlugin_EGripLateUpdateSettings(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType(); VREXPANSIONPLUGIN_API UEnum* Z_Construct_UEnum_VRExpansionPlugin_EGripMovementReplicationSettings(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_IsHeld(); VREXPANSIONPLUGIN_API UScriptStruct* Z_Construct_UScriptStruct_FBPGripPair(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip(); VREXPANSIONPLUGIN_API UScriptStruct* Z_Construct_UScriptStruct_FBPActorGripInformation(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnGrip(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnInput(); ENGINE_API UEnum* Z_Construct_UEnum_Engine_EInputEvent(); INPUTCORE_API UScriptStruct* Z_Construct_UScriptStruct_FKey(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip(); ENGINE_API UClass* Z_Construct_UClass_USceneComponent_NoRegister(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnUsed(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing(); VREXPANSIONPLUGIN_API UScriptStruct* Z_Construct_UScriptStruct_FTransform_NetQuantize(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType(); VREXPANSIONPLUGIN_API UEnum* Z_Construct_UEnum_VRExpansionPlugin_ESecondaryGripType(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SetHeld(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior(); VREXPANSIONPLUGIN_API UEnum* Z_Construct_UEnum_VRExpansionPlugin_EGripInterfaceTeleportBehavior(); VREXPANSIONPLUGIN_API UFunction* Z_Construct_UFunction_UGrippableSphereComponent_TickGrip(); VREXPANSIONPLUGIN_API UScriptStruct* Z_Construct_UScriptStruct_FBPInterfaceProperties(); GAMEPLAYTAGS_API UScriptStruct* Z_Construct_UScriptStruct_FGameplayTagContainer(); VREXPANSIONPLUGIN_API UClass* Z_Construct_UClass_UVRGripInterface_NoRegister(); GAMEPLAYTAGS_API UClass* Z_Construct_UClass_UGameplayTagAssetInterface_NoRegister(); // End Cross Module References static FName NAME_UGrippableSphereComponent_AdvancedGripSettings = FName(TEXT("AdvancedGripSettings")); FBPAdvGripSettings UGrippableSphereComponent::AdvancedGripSettings() { GrippableSphereComponent_eventAdvancedGripSettings_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_AdvancedGripSettings),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_AllowsMultipleGrips = FName(TEXT("AllowsMultipleGrips")); bool UGrippableSphereComponent::AllowsMultipleGrips() { GrippableSphereComponent_eventAllowsMultipleGrips_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_AllowsMultipleGrips),&Parms); return !!Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_ClosestGripSlotInRange = FName(TEXT("ClosestGripSlotInRange")); void UGrippableSphereComponent::ClosestGripSlotInRange(FVector WorldLocation, bool bSecondarySlot, bool& bHadSlotInRange, FTransform& SlotWorldTransform, UGripMotionControllerComponent* CallingController, FName OverridePrefix) { GrippableSphereComponent_eventClosestGripSlotInRange_Parms Parms; Parms.WorldLocation=WorldLocation; Parms.bSecondarySlot=bSecondarySlot ? true : false; Parms.bHadSlotInRange=bHadSlotInRange ? true : false; Parms.SlotWorldTransform=SlotWorldTransform; Parms.CallingController=CallingController; Parms.OverridePrefix=OverridePrefix; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_ClosestGripSlotInRange),&Parms); bHadSlotInRange=Parms.bHadSlotInRange; SlotWorldTransform=Parms.SlotWorldTransform; } static FName NAME_UGrippableSphereComponent_DenyGripping = FName(TEXT("DenyGripping")); bool UGrippableSphereComponent::DenyGripping() { GrippableSphereComponent_eventDenyGripping_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_DenyGripping),&Parms); return !!Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_GetGripScripts = FName(TEXT("GetGripScripts")); bool UGrippableSphereComponent::GetGripScripts(TArray<UVRGripScriptBase*>& ArrayReference) { GrippableSphereComponent_eventGetGripScripts_Parms Parms; Parms.ArrayReference=ArrayReference; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_GetGripScripts),&Parms); ArrayReference=Parms.ArrayReference; return !!Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_GetGripStiffnessAndDamping = FName(TEXT("GetGripStiffnessAndDamping")); void UGrippableSphereComponent::GetGripStiffnessAndDamping(float& GripStiffnessOut, float& GripDampingOut) { GrippableSphereComponent_eventGetGripStiffnessAndDamping_Parms Parms; Parms.GripStiffnessOut=GripStiffnessOut; Parms.GripDampingOut=GripDampingOut; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_GetGripStiffnessAndDamping),&Parms); GripStiffnessOut=Parms.GripStiffnessOut; GripDampingOut=Parms.GripDampingOut; } static FName NAME_UGrippableSphereComponent_GetPrimaryGripType = FName(TEXT("GetPrimaryGripType")); EGripCollisionType UGrippableSphereComponent::GetPrimaryGripType(bool bIsSlot) { GrippableSphereComponent_eventGetPrimaryGripType_Parms Parms; Parms.bIsSlot=bIsSlot ? true : false; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_GetPrimaryGripType),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_GripBreakDistance = FName(TEXT("GripBreakDistance")); float UGrippableSphereComponent::GripBreakDistance() { GrippableSphereComponent_eventGripBreakDistance_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_GripBreakDistance),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_GripLateUpdateSetting = FName(TEXT("GripLateUpdateSetting")); EGripLateUpdateSettings UGrippableSphereComponent::GripLateUpdateSetting() { GrippableSphereComponent_eventGripLateUpdateSetting_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_GripLateUpdateSetting),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_GripMovementReplicationType = FName(TEXT("GripMovementReplicationType")); EGripMovementReplicationSettings UGrippableSphereComponent::GripMovementReplicationType() { GrippableSphereComponent_eventGripMovementReplicationType_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_GripMovementReplicationType),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_IsHeld = FName(TEXT("IsHeld")); void UGrippableSphereComponent::IsHeld(TArray<FBPGripPair>& HoldingControllers, bool& bIsHeld) { GrippableSphereComponent_eventIsHeld_Parms Parms; Parms.HoldingControllers=HoldingControllers; Parms.bIsHeld=bIsHeld ? true : false; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_IsHeld),&Parms); HoldingControllers=Parms.HoldingControllers; bIsHeld=Parms.bIsHeld; } static FName NAME_UGrippableSphereComponent_OnChildGrip = FName(TEXT("OnChildGrip")); void UGrippableSphereComponent::OnChildGrip(UGripMotionControllerComponent* GrippingController, FBPActorGripInformation const& GripInformation) { GrippableSphereComponent_eventOnChildGrip_Parms Parms; Parms.GrippingController=GrippingController; Parms.GripInformation=GripInformation; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnChildGrip),&Parms); } static FName NAME_UGrippableSphereComponent_OnChildGripRelease = FName(TEXT("OnChildGripRelease")); void UGrippableSphereComponent::OnChildGripRelease(UGripMotionControllerComponent* ReleasingController, FBPActorGripInformation const& GripInformation, bool bWasSocketed) { GrippableSphereComponent_eventOnChildGripRelease_Parms Parms; Parms.ReleasingController=ReleasingController; Parms.GripInformation=GripInformation; Parms.bWasSocketed=bWasSocketed ? true : false; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnChildGripRelease),&Parms); } static FName NAME_UGrippableSphereComponent_OnEndSecondaryUsed = FName(TEXT("OnEndSecondaryUsed")); void UGrippableSphereComponent::OnEndSecondaryUsed() { ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnEndSecondaryUsed),NULL); } static FName NAME_UGrippableSphereComponent_OnEndUsed = FName(TEXT("OnEndUsed")); void UGrippableSphereComponent::OnEndUsed() { ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnEndUsed),NULL); } static FName NAME_UGrippableSphereComponent_OnGrip = FName(TEXT("OnGrip")); void UGrippableSphereComponent::OnGrip(UGripMotionControllerComponent* GrippingController, FBPActorGripInformation const& GripInformation) { GrippableSphereComponent_eventOnGrip_Parms Parms; Parms.GrippingController=GrippingController; Parms.GripInformation=GripInformation; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnGrip),&Parms); } static FName NAME_UGrippableSphereComponent_OnGripRelease = FName(TEXT("OnGripRelease")); void UGrippableSphereComponent::OnGripRelease(UGripMotionControllerComponent* ReleasingController, FBPActorGripInformation const& GripInformation, bool bWasSocketed) { GrippableSphereComponent_eventOnGripRelease_Parms Parms; Parms.ReleasingController=ReleasingController; Parms.GripInformation=GripInformation; Parms.bWasSocketed=bWasSocketed ? true : false; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnGripRelease),&Parms); } static FName NAME_UGrippableSphereComponent_OnInput = FName(TEXT("OnInput")); void UGrippableSphereComponent::OnInput(FKey Key, EInputEvent KeyEvent) { GrippableSphereComponent_eventOnInput_Parms Parms; Parms.Key=Key; Parms.KeyEvent=KeyEvent; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnInput),&Parms); } static FName NAME_UGrippableSphereComponent_OnSecondaryGrip = FName(TEXT("OnSecondaryGrip")); void UGrippableSphereComponent::OnSecondaryGrip(UGripMotionControllerComponent* GripOwningController, USceneComponent* SecondaryGripComponent, FBPActorGripInformation const& GripInformation) { GrippableSphereComponent_eventOnSecondaryGrip_Parms Parms; Parms.GripOwningController=GripOwningController; Parms.SecondaryGripComponent=SecondaryGripComponent; Parms.GripInformation=GripInformation; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnSecondaryGrip),&Parms); } static FName NAME_UGrippableSphereComponent_OnSecondaryGripRelease = FName(TEXT("OnSecondaryGripRelease")); void UGrippableSphereComponent::OnSecondaryGripRelease(UGripMotionControllerComponent* GripOwningController, USceneComponent* ReleasingSecondaryGripComponent, FBPActorGripInformation const& GripInformation) { GrippableSphereComponent_eventOnSecondaryGripRelease_Parms Parms; Parms.GripOwningController=GripOwningController; Parms.ReleasingSecondaryGripComponent=ReleasingSecondaryGripComponent; Parms.GripInformation=GripInformation; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnSecondaryGripRelease),&Parms); } static FName NAME_UGrippableSphereComponent_OnSecondaryUsed = FName(TEXT("OnSecondaryUsed")); void UGrippableSphereComponent::OnSecondaryUsed() { ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnSecondaryUsed),NULL); } static FName NAME_UGrippableSphereComponent_OnUsed = FName(TEXT("OnUsed")); void UGrippableSphereComponent::OnUsed() { ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_OnUsed),NULL); } static FName NAME_UGrippableSphereComponent_RequestsSocketing = FName(TEXT("RequestsSocketing")); bool UGrippableSphereComponent::RequestsSocketing(USceneComponent*& ParentToSocketTo, FName& OptionalSocketName, FTransform_NetQuantize& RelativeTransform) { GrippableSphereComponent_eventRequestsSocketing_Parms Parms; Parms.ParentToSocketTo=ParentToSocketTo; Parms.OptionalSocketName=OptionalSocketName; Parms.RelativeTransform=RelativeTransform; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_RequestsSocketing),&Parms); ParentToSocketTo=Parms.ParentToSocketTo; OptionalSocketName=Parms.OptionalSocketName; RelativeTransform=Parms.RelativeTransform; return !!Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_SecondaryGripType = FName(TEXT("SecondaryGripType")); ESecondaryGripType UGrippableSphereComponent::SecondaryGripType() { GrippableSphereComponent_eventSecondaryGripType_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_SecondaryGripType),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_SetHeld = FName(TEXT("SetHeld")); void UGrippableSphereComponent::SetHeld(UGripMotionControllerComponent* HoldingController, uint8 GripID, bool bIsHeld) { GrippableSphereComponent_eventSetHeld_Parms Parms; Parms.HoldingController=HoldingController; Parms.GripID=GripID; Parms.bIsHeld=bIsHeld ? true : false; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_SetHeld),&Parms); } static FName NAME_UGrippableSphereComponent_SimulateOnDrop = FName(TEXT("SimulateOnDrop")); bool UGrippableSphereComponent::SimulateOnDrop() { GrippableSphereComponent_eventSimulateOnDrop_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_SimulateOnDrop),&Parms); return !!Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_TeleportBehavior = FName(TEXT("TeleportBehavior")); EGripInterfaceTeleportBehavior UGrippableSphereComponent::TeleportBehavior() { GrippableSphereComponent_eventTeleportBehavior_Parms Parms; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_TeleportBehavior),&Parms); return Parms.ReturnValue; } static FName NAME_UGrippableSphereComponent_TickGrip = FName(TEXT("TickGrip")); void UGrippableSphereComponent::TickGrip(UGripMotionControllerComponent* GrippingController, FBPActorGripInformation const& GripInformation, float DeltaTime) { GrippableSphereComponent_eventTickGrip_Parms Parms; Parms.GrippingController=GrippingController; Parms.GripInformation=GripInformation; Parms.DeltaTime=DeltaTime; ProcessEvent(FindFunctionChecked(NAME_UGrippableSphereComponent_TickGrip),&Parms); } void UGrippableSphereComponent::StaticRegisterNativesUGrippableSphereComponent() { UClass* Class = UGrippableSphereComponent::StaticClass(); static const FNameNativePtrPair Funcs[] = { { "AdvancedGripSettings", &UGrippableSphereComponent::execAdvancedGripSettings }, { "AllowsMultipleGrips", &UGrippableSphereComponent::execAllowsMultipleGrips }, { "ClosestGripSlotInRange", &UGrippableSphereComponent::execClosestGripSlotInRange }, { "DenyGripping", &UGrippableSphereComponent::execDenyGripping }, { "GetGripScripts", &UGrippableSphereComponent::execGetGripScripts }, { "GetGripStiffnessAndDamping", &UGrippableSphereComponent::execGetGripStiffnessAndDamping }, { "GetPrimaryGripType", &UGrippableSphereComponent::execGetPrimaryGripType }, { "GripBreakDistance", &UGrippableSphereComponent::execGripBreakDistance }, { "GripLateUpdateSetting", &UGrippableSphereComponent::execGripLateUpdateSetting }, { "GripMovementReplicationType", &UGrippableSphereComponent::execGripMovementReplicationType }, { "IsHeld", &UGrippableSphereComponent::execIsHeld }, { "OnChildGrip", &UGrippableSphereComponent::execOnChildGrip }, { "OnChildGripRelease", &UGrippableSphereComponent::execOnChildGripRelease }, { "OnEndSecondaryUsed", &UGrippableSphereComponent::execOnEndSecondaryUsed }, { "OnEndUsed", &UGrippableSphereComponent::execOnEndUsed }, { "OnGrip", &UGrippableSphereComponent::execOnGrip }, { "OnGripRelease", &UGrippableSphereComponent::execOnGripRelease }, { "OnInput", &UGrippableSphereComponent::execOnInput }, { "OnSecondaryGrip", &UGrippableSphereComponent::execOnSecondaryGrip }, { "OnSecondaryGripRelease", &UGrippableSphereComponent::execOnSecondaryGripRelease }, { "OnSecondaryUsed", &UGrippableSphereComponent::execOnSecondaryUsed }, { "OnUsed", &UGrippableSphereComponent::execOnUsed }, { "RequestsSocketing", &UGrippableSphereComponent::execRequestsSocketing }, { "SecondaryGripType", &UGrippableSphereComponent::execSecondaryGripType }, { "SetDenyGripping", &UGrippableSphereComponent::execSetDenyGripping }, { "SetHeld", &UGrippableSphereComponent::execSetHeld }, { "SimulateOnDrop", &UGrippableSphereComponent::execSimulateOnDrop }, { "TeleportBehavior", &UGrippableSphereComponent::execTeleportBehavior }, { "TickGrip", &UGrippableSphereComponent::execTickGrip }, }; FNativeFunctionRegistrar::RegisterFunctions(Class, Funcs, UE_ARRAY_COUNT(Funcs)); } struct Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics { static const UE4CodeGen_Private::FStructPropertyParams NewProp_ReturnValue; 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::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventAdvancedGripSettings_Parms, ReturnValue), Z_Construct_UScriptStruct_FBPAdvGripSettings, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::NewProp_ReturnValue, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Get the advanced physics settings for this grip\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Get the advanced physics settings for this grip" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "AdvancedGripSettings", nullptr, nullptr, sizeof(GrippableSphereComponent_eventAdvancedGripSettings_Parms), Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics { static void NewProp_ReturnValue_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::NewProp_ReturnValue_SetBit(void* Obj) { ((GrippableSphereComponent_eventAllowsMultipleGrips_Parms*)Obj)->ReturnValue = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventAllowsMultipleGrips_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::NewProp_ReturnValue_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::NewProp_ReturnValue, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Check if an object allows multiple grips at one time\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Check if an object allows multiple grips at one time" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "AllowsMultipleGrips", nullptr, nullptr, sizeof(GrippableSphereComponent_eventAllowsMultipleGrips_Parms), Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics { static const UE4CodeGen_Private::FNamePropertyParams NewProp_OverridePrefix; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_CallingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_CallingController; static const UE4CodeGen_Private::FStructPropertyParams NewProp_SlotWorldTransform; static void NewProp_bHadSlotInRange_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bHadSlotInRange; static void NewProp_bSecondarySlot_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bSecondarySlot; static const UE4CodeGen_Private::FStructPropertyParams NewProp_WorldLocation; 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::FNamePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_OverridePrefix = { "OverridePrefix", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Name, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventClosestGripSlotInRange_Parms, OverridePrefix), METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_CallingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_CallingController = { "CallingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventClosestGripSlotInRange_Parms, CallingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_CallingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_CallingController_MetaData)) }; const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_SlotWorldTransform = { "SlotWorldTransform", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventClosestGripSlotInRange_Parms, SlotWorldTransform), Z_Construct_UScriptStruct_FTransform, METADATA_PARAMS(nullptr, 0) }; void Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bHadSlotInRange_SetBit(void* Obj) { ((GrippableSphereComponent_eventClosestGripSlotInRange_Parms*)Obj)->bHadSlotInRange = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bHadSlotInRange = { "bHadSlotInRange", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventClosestGripSlotInRange_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bHadSlotInRange_SetBit, METADATA_PARAMS(nullptr, 0) }; void Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bSecondarySlot_SetBit(void* Obj) { ((GrippableSphereComponent_eventClosestGripSlotInRange_Parms*)Obj)->bSecondarySlot = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bSecondarySlot = { "bSecondarySlot", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventClosestGripSlotInRange_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bSecondarySlot_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_WorldLocation = { "WorldLocation", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventClosestGripSlotInRange_Parms, WorldLocation), Z_Construct_UScriptStruct_FVector, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_OverridePrefix, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_CallingController, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_SlotWorldTransform, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bHadSlotInRange, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_bSecondarySlot, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::NewProp_WorldLocation, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Get closest primary slot in range\n" }, { "CPP_Default_CallingController", "None" }, { "CPP_Default_OverridePrefix", "None" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Get closest primary slot in range" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "ClosestGripSlotInRange", nullptr, nullptr, sizeof(GrippableSphereComponent_eventClosestGripSlotInRange_Parms), Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0CC20C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics { static void NewProp_ReturnValue_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::NewProp_ReturnValue_SetBit(void* Obj) { ((GrippableSphereComponent_eventDenyGripping_Parms*)Obj)->ReturnValue = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventDenyGripping_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::NewProp_ReturnValue_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::NewProp_ReturnValue, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Set up as deny instead of allow so that default allows for gripping\n" }, { "DisplayName", "IsDenyingGrips" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Set up as deny instead of allow so that default allows for gripping" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "DenyGripping", nullptr, nullptr, sizeof(GrippableSphereComponent_eventDenyGripping_Parms), Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics { static void NewProp_ReturnValue_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_ReturnValue; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_ArrayReference_MetaData[]; #endif static const UE4CodeGen_Private::FArrayPropertyParams NewProp_ArrayReference; static const UE4CodeGen_Private::FObjectPropertyParams NewProp_ArrayReference_Inner; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ReturnValue_SetBit(void* Obj) { ((GrippableSphereComponent_eventGetGripScripts_Parms*)Obj)->ReturnValue = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventGetGripScripts_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ReturnValue_SetBit, METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FArrayPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference = { "ArrayReference", nullptr, (EPropertyFlags)0x0010008000000180, UE4CodeGen_Private::EPropertyGenFlags::Array, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGetGripScripts_Parms, ArrayReference), METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference_MetaData)) }; const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference_Inner = { "ArrayReference", nullptr, (EPropertyFlags)0x0000000000080000, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, Z_Construct_UClass_UVRGripScriptBase_NoRegister, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::NewProp_ArrayReference_Inner, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Get grip scripts\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Get grip scripts" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "GetGripScripts", nullptr, nullptr, sizeof(GrippableSphereComponent_eventGetGripScripts_Parms), Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics { static const UE4CodeGen_Private::FFloatPropertyParams NewProp_GripDampingOut; static const UE4CodeGen_Private::FFloatPropertyParams NewProp_GripStiffnessOut; 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_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::NewProp_GripDampingOut = { "GripDampingOut", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Float, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGetGripStiffnessAndDamping_Parms, GripDampingOut), METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FFloatPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::NewProp_GripStiffnessOut = { "GripStiffnessOut", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Float, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGetGripStiffnessAndDamping_Parms, GripStiffnessOut), METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::NewProp_GripDampingOut, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::NewProp_GripStiffnessOut, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// What grip stiffness and damping to use if using a physics constraint\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "What grip stiffness and damping to use if using a physics constraint" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "GetGripStiffnessAndDamping", nullptr, nullptr, sizeof(GrippableSphereComponent_eventGetGripStiffnessAndDamping_Parms), Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics { static const UE4CodeGen_Private::FEnumPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FBytePropertyParams NewProp_ReturnValue_Underlying; static void NewProp_bIsSlot_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bIsSlot; 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::FEnumPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Enum, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGetPrimaryGripType_Parms, ReturnValue), Z_Construct_UEnum_VRExpansionPlugin_EGripCollisionType, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_ReturnValue_Underlying = { "UnderlyingType", nullptr, (EPropertyFlags)0x0000000000000000, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, nullptr, METADATA_PARAMS(nullptr, 0) }; void Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_bIsSlot_SetBit(void* Obj) { ((GrippableSphereComponent_eventGetPrimaryGripType_Parms*)Obj)->bIsSlot = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_bIsSlot = { "bIsSlot", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventGetPrimaryGripType_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_bIsSlot_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_ReturnValue_Underlying, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::NewProp_bIsSlot, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Grip type to use\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Grip type to use" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "GetPrimaryGripType", nullptr, nullptr, sizeof(GrippableSphereComponent_eventGetPrimaryGripType_Parms), Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics { static const UE4CodeGen_Private::FFloatPropertyParams NewProp_ReturnValue; 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_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Float, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGripBreakDistance_Parms, ReturnValue), METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::NewProp_ReturnValue, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// What distance to break a grip at (only relevent with physics enabled grips\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "What distance to break a grip at (only relevent with physics enabled grips" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "GripBreakDistance", nullptr, nullptr, sizeof(GrippableSphereComponent_eventGripBreakDistance_Parms), Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics { static const UE4CodeGen_Private::FEnumPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FBytePropertyParams NewProp_ReturnValue_Underlying; 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::FEnumPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Enum, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGripLateUpdateSetting_Parms, ReturnValue), Z_Construct_UEnum_VRExpansionPlugin_EGripLateUpdateSettings, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::NewProp_ReturnValue_Underlying = { "UnderlyingType", nullptr, (EPropertyFlags)0x0000000000000000, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, nullptr, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::NewProp_ReturnValue_Underlying, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Define the late update setting\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Define the late update setting" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "GripLateUpdateSetting", nullptr, nullptr, sizeof(GrippableSphereComponent_eventGripLateUpdateSetting_Parms), Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics { static const UE4CodeGen_Private::FEnumPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FBytePropertyParams NewProp_ReturnValue_Underlying; 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::FEnumPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Enum, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventGripMovementReplicationType_Parms, ReturnValue), Z_Construct_UEnum_VRExpansionPlugin_EGripMovementReplicationSettings, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::NewProp_ReturnValue_Underlying = { "UnderlyingType", nullptr, (EPropertyFlags)0x0000000000000000, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, nullptr, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::NewProp_ReturnValue_Underlying, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Define which movement repliation setting to use\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Define which movement repliation setting to use" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "GripMovementReplicationType", nullptr, nullptr, sizeof(GrippableSphereComponent_eventGripMovementReplicationType_Parms), Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics { static void NewProp_bIsHeld_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bIsHeld; static const UE4CodeGen_Private::FArrayPropertyParams NewProp_HoldingControllers; static const UE4CodeGen_Private::FStructPropertyParams NewProp_HoldingControllers_Inner; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_bIsHeld_SetBit(void* Obj) { ((GrippableSphereComponent_eventIsHeld_Parms*)Obj)->bIsHeld = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_bIsHeld = { "bIsHeld", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventIsHeld_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_bIsHeld_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FArrayPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_HoldingControllers = { "HoldingControllers", nullptr, (EPropertyFlags)0x0010008000000180, UE4CodeGen_Private::EPropertyGenFlags::Array, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventIsHeld_Parms, HoldingControllers), METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_HoldingControllers_Inner = { "HoldingControllers", nullptr, (EPropertyFlags)0x0000008000000000, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, Z_Construct_UScriptStruct_FBPGripPair, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_bIsHeld, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_HoldingControllers, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::NewProp_HoldingControllers_Inner, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Returns if the object is held and if so, which controllers are holding it\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Returns if the object is held and if so, which controllers are holding it" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "IsHeld", nullptr, nullptr, sizeof(GrippableSphereComponent_eventIsHeld_Parms), Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_IsHeld() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_IsHeld_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GrippingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_GrippingController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnChildGrip_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GrippingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GrippingController = { "GrippingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnChildGrip_Parms, GrippingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GrippingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GrippingController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::NewProp_GrippingController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered on the interfaced object when child component is gripped\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered on the interfaced object when child component is gripped" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnChildGrip", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnChildGrip_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics { static void NewProp_bWasSocketed_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bWasSocketed; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_ReleasingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_ReleasingController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_bWasSocketed_SetBit(void* Obj) { ((GrippableSphereComponent_eventOnChildGripRelease_Parms*)Obj)->bWasSocketed = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_bWasSocketed = { "bWasSocketed", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventOnChildGripRelease_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_bWasSocketed_SetBit, METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnChildGripRelease_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_ReleasingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_ReleasingController = { "ReleasingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnChildGripRelease_Parms, ReleasingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_ReleasingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_ReleasingController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_bWasSocketed, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::NewProp_ReleasingController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered on the interfaced object when child component is released\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered on the interfaced object when child component is released" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnChildGripRelease", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnChildGripRelease_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Call to stop using an object\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Call to stop using an object" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnEndSecondaryUsed", nullptr, nullptr, 0, nullptr, 0, RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Call to stop using an object\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Call to stop using an object" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnEndUsed", nullptr, nullptr, 0, nullptr, 0, RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GrippingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_GrippingController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnGrip_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GrippingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GrippingController = { "GrippingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnGrip_Parms, GrippingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GrippingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GrippingController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::NewProp_GrippingController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered on the interfaced object when gripped\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered on the interfaced object when gripped" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnGrip", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnGrip_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnGrip() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnGrip_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics { static void NewProp_bWasSocketed_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bWasSocketed; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_ReleasingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_ReleasingController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_bWasSocketed_SetBit(void* Obj) { ((GrippableSphereComponent_eventOnGripRelease_Parms*)Obj)->bWasSocketed = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_bWasSocketed = { "bWasSocketed", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventOnGripRelease_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_bWasSocketed_SetBit, METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnGripRelease_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_ReleasingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_ReleasingController = { "ReleasingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnGripRelease_Parms, ReleasingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_ReleasingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_ReleasingController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_bWasSocketed, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::NewProp_ReleasingController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered on the interfaced object when grip is released\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered on the interfaced object when grip is released" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnGripRelease", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnGripRelease_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics { static const UE4CodeGen_Private::FBytePropertyParams NewProp_KeyEvent; static const UE4CodeGen_Private::FStructPropertyParams NewProp_Key; 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::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::NewProp_KeyEvent = { "KeyEvent", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnInput_Parms, KeyEvent), Z_Construct_UEnum_Engine_EInputEvent, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::NewProp_Key = { "Key", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnInput_Parms, Key), Z_Construct_UScriptStruct_FKey, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::NewProp_KeyEvent, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::NewProp_Key, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Call to send an action event to the object\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Call to send an action event to the object" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnInput", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnInput_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnInput() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnInput_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_SecondaryGripComponent_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_SecondaryGripComponent; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripOwningController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_GripOwningController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnSecondaryGrip_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_SecondaryGripComponent_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_SecondaryGripComponent = { "SecondaryGripComponent", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnSecondaryGrip_Parms, SecondaryGripComponent), Z_Construct_UClass_USceneComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_SecondaryGripComponent_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_SecondaryGripComponent_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripOwningController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripOwningController = { "GripOwningController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnSecondaryGrip_Parms, GripOwningController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripOwningController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripOwningController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_SecondaryGripComponent, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::NewProp_GripOwningController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered on the interfaced object when secondary gripped\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered on the interfaced object when secondary gripped" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnSecondaryGrip", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnSecondaryGrip_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_ReleasingSecondaryGripComponent_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_ReleasingSecondaryGripComponent; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripOwningController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_GripOwningController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnSecondaryGripRelease_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_ReleasingSecondaryGripComponent_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_ReleasingSecondaryGripComponent = { "ReleasingSecondaryGripComponent", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnSecondaryGripRelease_Parms, ReleasingSecondaryGripComponent), Z_Construct_UClass_USceneComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_ReleasingSecondaryGripComponent_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_ReleasingSecondaryGripComponent_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripOwningController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripOwningController = { "GripOwningController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventOnSecondaryGripRelease_Parms, GripOwningController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripOwningController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripOwningController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_ReleasingSecondaryGripComponent, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::NewProp_GripOwningController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered on the interfaced object when secondary grip is released\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered on the interfaced object when secondary grip is released" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnSecondaryGripRelease", nullptr, nullptr, sizeof(GrippableSphereComponent_eventOnSecondaryGripRelease_Parms), Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Call to use an object\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Call to use an object" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnSecondaryUsed", nullptr, nullptr, 0, nullptr, 0, RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_OnUsed_Statics { #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_OnUsed_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Call to use an object\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Call to use an object" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_OnUsed_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "OnUsed", nullptr, nullptr, 0, nullptr, 0, RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_OnUsed_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_OnUsed_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_OnUsed() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_OnUsed_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics { static void NewProp_ReturnValue_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FStructPropertyParams NewProp_RelativeTransform; static const UE4CodeGen_Private::FNamePropertyParams NewProp_OptionalSocketName; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_ParentToSocketTo_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_ParentToSocketTo; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ReturnValue_SetBit(void* Obj) { ((GrippableSphereComponent_eventRequestsSocketing_Parms*)Obj)->ReturnValue = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventRequestsSocketing_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ReturnValue_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_RelativeTransform = { "RelativeTransform", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventRequestsSocketing_Parms, RelativeTransform), Z_Construct_UScriptStruct_FTransform_NetQuantize, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FNamePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_OptionalSocketName = { "OptionalSocketName", nullptr, (EPropertyFlags)0x0010000000000180, UE4CodeGen_Private::EPropertyGenFlags::Name, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventRequestsSocketing_Parms, OptionalSocketName), METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ParentToSocketTo_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ParentToSocketTo = { "ParentToSocketTo", nullptr, (EPropertyFlags)0x0010000000080180, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventRequestsSocketing_Parms, ParentToSocketTo), Z_Construct_UClass_USceneComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ParentToSocketTo_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ParentToSocketTo_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_RelativeTransform, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_OptionalSocketName, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::NewProp_ParentToSocketTo, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Returns if the object wants to be socketed\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Returns if the object wants to be socketed" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "RequestsSocketing", nullptr, nullptr, sizeof(GrippableSphereComponent_eventRequestsSocketing_Parms), Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics { static const UE4CodeGen_Private::FEnumPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FBytePropertyParams NewProp_ReturnValue_Underlying; 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::FEnumPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Enum, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventSecondaryGripType_Parms, ReturnValue), Z_Construct_UEnum_VRExpansionPlugin_ESecondaryGripType, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::NewProp_ReturnValue_Underlying = { "UnderlyingType", nullptr, (EPropertyFlags)0x0000000000000000, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, nullptr, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::NewProp_ReturnValue_Underlying, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Secondary grip type\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Secondary grip type" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "SecondaryGripType", nullptr, nullptr, sizeof(GrippableSphereComponent_eventSecondaryGripType_Parms), Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics { struct GrippableSphereComponent_eventSetDenyGripping_Parms { bool bDenyGripping; }; static void NewProp_bDenyGripping_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bDenyGripping; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::NewProp_bDenyGripping_SetBit(void* Obj) { ((GrippableSphereComponent_eventSetDenyGripping_Parms*)Obj)->bDenyGripping = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::NewProp_bDenyGripping = { "bDenyGripping", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventSetDenyGripping_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::NewProp_bDenyGripping_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::NewProp_bDenyGripping, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Sets the Deny Gripping variable on the FBPInterfaceSettings struct\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Sets the Deny Gripping variable on the FBPInterfaceSettings struct" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "SetDenyGripping", nullptr, nullptr, sizeof(GrippableSphereComponent_eventSetDenyGripping_Parms), Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x04020401, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics { static void NewProp_bIsHeld_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bIsHeld; static const UE4CodeGen_Private::FBytePropertyParams NewProp_GripID; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_HoldingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_HoldingController; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_bIsHeld_SetBit(void* Obj) { ((GrippableSphereComponent_eventSetHeld_Parms*)Obj)->bIsHeld = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_bIsHeld = { "bIsHeld", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventSetHeld_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_bIsHeld_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_GripID = { "GripID", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventSetHeld_Parms, GripID), nullptr, METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_HoldingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_HoldingController = { "HoldingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventSetHeld_Parms, HoldingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_HoldingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_HoldingController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_bIsHeld, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_GripID, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::NewProp_HoldingController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "/*BlueprintCallable,*/" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "BlueprintCallable," }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "SetHeld", nullptr, nullptr, sizeof(GrippableSphereComponent_eventSetHeld_Parms), Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SetHeld() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_SetHeld_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics { static void NewProp_ReturnValue_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Function_MetaDataParams[]; #endif static const UE4CodeGen_Private::FFunctionParams FuncParams; }; void Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::NewProp_ReturnValue_SetBit(void* Obj) { ((GrippableSphereComponent_eventSimulateOnDrop_Parms*)Obj)->ReturnValue = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(GrippableSphereComponent_eventSimulateOnDrop_Parms), &Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::NewProp_ReturnValue_SetBit, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::NewProp_ReturnValue, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Should this object simulate on drop\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Should this object simulate on drop" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "SimulateOnDrop", nullptr, nullptr, sizeof(GrippableSphereComponent_eventSimulateOnDrop_Parms), Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics { static const UE4CodeGen_Private::FEnumPropertyParams NewProp_ReturnValue; static const UE4CodeGen_Private::FBytePropertyParams NewProp_ReturnValue_Underlying; 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::FEnumPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::NewProp_ReturnValue = { "ReturnValue", nullptr, (EPropertyFlags)0x0010000000000580, UE4CodeGen_Private::EPropertyGenFlags::Enum, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventTeleportBehavior_Parms, ReturnValue), Z_Construct_UEnum_VRExpansionPlugin_EGripInterfaceTeleportBehavior, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FBytePropertyParams Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::NewProp_ReturnValue_Underlying = { "UnderlyingType", nullptr, (EPropertyFlags)0x0000000000000000, UE4CodeGen_Private::EPropertyGenFlags::Byte, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, nullptr, METADATA_PARAMS(nullptr, 0) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::NewProp_ReturnValue, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::NewProp_ReturnValue_Underlying, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// How an interfaced object behaves when teleporting\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "How an interfaced object behaves when teleporting" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "TeleportBehavior", nullptr, nullptr, sizeof(GrippableSphereComponent_eventTeleportBehavior_Parms), Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x0C020C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior_Statics::FuncParams); } return ReturnFunction; } struct Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics { static const UE4CodeGen_Private::FFloatPropertyParams NewProp_DeltaTime; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripInformation_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GripInformation; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GrippingController_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_GrippingController; 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_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_DeltaTime = { "DeltaTime", nullptr, (EPropertyFlags)0x0010000000000080, UE4CodeGen_Private::EPropertyGenFlags::Float, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventTickGrip_Parms, DeltaTime), METADATA_PARAMS(nullptr, 0) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GripInformation_MetaData[] = { { "NativeConst", "" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GripInformation = { "GripInformation", nullptr, (EPropertyFlags)0x0010008008000182, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventTickGrip_Parms, GripInformation), Z_Construct_UScriptStruct_FBPActorGripInformation, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GripInformation_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GripInformation_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GrippingController_MetaData[] = { { "EditInline", "true" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GrippingController = { "GrippingController", nullptr, (EPropertyFlags)0x0010000000080080, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(GrippableSphereComponent_eventTickGrip_Parms, GrippingController), Z_Construct_UClass_UGripMotionControllerComponent_NoRegister, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GrippingController_MetaData, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GrippingController_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_DeltaTime, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GripInformation, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::NewProp_GrippingController, }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::Function_MetaDataParams[] = { { "Category", "VRGripInterface" }, { "Comment", "// Event triggered each tick on the interfaced object when gripped, can be used for custom movement or grip based logic\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Event triggered each tick on the interfaced object when gripped, can be used for custom movement or grip based logic" }, }; #endif const UE4CodeGen_Private::FFunctionParams Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::FuncParams = { (UObject*(*)())Z_Construct_UClass_UGrippableSphereComponent, nullptr, "TickGrip", nullptr, nullptr, sizeof(GrippableSphereComponent_eventTickGrip_Parms), Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::PropPointers, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::PropPointers), RF_Public|RF_Transient|RF_MarkAsNative, (EFunctionFlags)0x08420C00, 0, 0, METADATA_PARAMS(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::Function_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::Function_MetaDataParams)) }; UFunction* Z_Construct_UFunction_UGrippableSphereComponent_TickGrip() { static UFunction* ReturnFunction = nullptr; if (!ReturnFunction) { UE4CodeGen_Private::ConstructUFunction(ReturnFunction, Z_Construct_UFunction_UGrippableSphereComponent_TickGrip_Statics::FuncParams); } return ReturnFunction; } UClass* Z_Construct_UClass_UGrippableSphereComponent_NoRegister() { return UGrippableSphereComponent::StaticClass(); } struct Z_Construct_UClass_UGrippableSphereComponent_Statics { static UObject* (*const DependentSingletons[])(); static const FClassFunctionLinkInfo FuncInfo[]; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam Class_MetaDataParams[]; #endif #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_VRGripInterfaceSettings_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_VRGripInterfaceSettings; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bReplicateMovement_MetaData[]; #endif static void NewProp_bReplicateMovement_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bReplicateMovement; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bRepGripSettingsAndGameplayTags_MetaData[]; #endif static void NewProp_bRepGripSettingsAndGameplayTags_SetBit(void* Obj); static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bRepGripSettingsAndGameplayTags; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GameplayTags_MetaData[]; #endif static const UE4CodeGen_Private::FStructPropertyParams NewProp_GameplayTags; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripLogicScripts_MetaData[]; #endif static const UE4CodeGen_Private::FArrayPropertyParams NewProp_GripLogicScripts; #if WITH_METADATA static const UE4CodeGen_Private::FMetaDataPairParam NewProp_GripLogicScripts_Inner_MetaData[]; #endif static const UE4CodeGen_Private::FObjectPropertyParams NewProp_GripLogicScripts_Inner; static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[]; static const UE4CodeGen_Private::FImplementedInterfaceParams InterfaceParams[]; static const FCppClassTypeInfoStatic StaticCppClassTypeInfo; static const UE4CodeGen_Private::FClassParams ClassParams; }; UObject* (*const Z_Construct_UClass_UGrippableSphereComponent_Statics::DependentSingletons[])() = { (UObject* (*)())Z_Construct_UClass_USphereComponent, (UObject* (*)())Z_Construct_UPackage__Script_VRExpansionPlugin, }; const FClassFunctionLinkInfo Z_Construct_UClass_UGrippableSphereComponent_Statics::FuncInfo[] = { { &Z_Construct_UFunction_UGrippableSphereComponent_AdvancedGripSettings, "AdvancedGripSettings" }, // 3858742925 { &Z_Construct_UFunction_UGrippableSphereComponent_AllowsMultipleGrips, "AllowsMultipleGrips" }, // 4194410644 { &Z_Construct_UFunction_UGrippableSphereComponent_ClosestGripSlotInRange, "ClosestGripSlotInRange" }, // 1833628512 { &Z_Construct_UFunction_UGrippableSphereComponent_DenyGripping, "DenyGripping" }, // 2790603032 { &Z_Construct_UFunction_UGrippableSphereComponent_GetGripScripts, "GetGripScripts" }, // 2253861506 { &Z_Construct_UFunction_UGrippableSphereComponent_GetGripStiffnessAndDamping, "GetGripStiffnessAndDamping" }, // 4028062609 { &Z_Construct_UFunction_UGrippableSphereComponent_GetPrimaryGripType, "GetPrimaryGripType" }, // 973795139 { &Z_Construct_UFunction_UGrippableSphereComponent_GripBreakDistance, "GripBreakDistance" }, // 3394767814 { &Z_Construct_UFunction_UGrippableSphereComponent_GripLateUpdateSetting, "GripLateUpdateSetting" }, // 2264069606 { &Z_Construct_UFunction_UGrippableSphereComponent_GripMovementReplicationType, "GripMovementReplicationType" }, // 4008020653 { &Z_Construct_UFunction_UGrippableSphereComponent_IsHeld, "IsHeld" }, // 425855232 { &Z_Construct_UFunction_UGrippableSphereComponent_OnChildGrip, "OnChildGrip" }, // 2338153130 { &Z_Construct_UFunction_UGrippableSphereComponent_OnChildGripRelease, "OnChildGripRelease" }, // 1849178379 { &Z_Construct_UFunction_UGrippableSphereComponent_OnEndSecondaryUsed, "OnEndSecondaryUsed" }, // 547204766 { &Z_Construct_UFunction_UGrippableSphereComponent_OnEndUsed, "OnEndUsed" }, // 194551407 { &Z_Construct_UFunction_UGrippableSphereComponent_OnGrip, "OnGrip" }, // 1074675598 { &Z_Construct_UFunction_UGrippableSphereComponent_OnGripRelease, "OnGripRelease" }, // 1084454678 { &Z_Construct_UFunction_UGrippableSphereComponent_OnInput, "OnInput" }, // 1064470370 { &Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGrip, "OnSecondaryGrip" }, // 3390241218 { &Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryGripRelease, "OnSecondaryGripRelease" }, // 1189092991 { &Z_Construct_UFunction_UGrippableSphereComponent_OnSecondaryUsed, "OnSecondaryUsed" }, // 882327301 { &Z_Construct_UFunction_UGrippableSphereComponent_OnUsed, "OnUsed" }, // 3724980285 { &Z_Construct_UFunction_UGrippableSphereComponent_RequestsSocketing, "RequestsSocketing" }, // 2478142567 { &Z_Construct_UFunction_UGrippableSphereComponent_SecondaryGripType, "SecondaryGripType" }, // 2282089315 { &Z_Construct_UFunction_UGrippableSphereComponent_SetDenyGripping, "SetDenyGripping" }, // 1415429377 { &Z_Construct_UFunction_UGrippableSphereComponent_SetHeld, "SetHeld" }, // 1445369346 { &Z_Construct_UFunction_UGrippableSphereComponent_SimulateOnDrop, "SimulateOnDrop" }, // 2065748632 { &Z_Construct_UFunction_UGrippableSphereComponent_TeleportBehavior, "TeleportBehavior" }, // 4056678846 { &Z_Construct_UFunction_UGrippableSphereComponent_TickGrip, "TickGrip" }, // 3318684722 }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::Class_MetaDataParams[] = { { "BlueprintSpawnableComponent", "" }, { "BlueprintType", "true" }, { "ClassGroupNames", "VRExpansionPlugin" }, { "Comment", "/**\n*\n*/" }, { "HideCategories", "Object LOD Lighting TextureStreaming Object LOD Lighting TextureStreaming Activation Components|Activation Trigger" }, { "IncludePath", "Grippables/GrippableSphereComponent.h" }, { "IsBlueprintBase", "true" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ObjectInitializerConstructorDeclared", "" }, }; #endif #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_VRGripInterfaceSettings_MetaData[] = { { "Category", "VRGripInterface" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_VRGripInterfaceSettings = { "VRGripInterfaceSettings", nullptr, (EPropertyFlags)0x0010008000000025, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UGrippableSphereComponent, VRGripInterfaceSettings), Z_Construct_UScriptStruct_FBPInterfaceProperties, METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_VRGripInterfaceSettings_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_VRGripInterfaceSettings_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement_MetaData[] = { { "Category", "VRGripInterface|Replication" }, { "Comment", "// Overrides the default of : true and allows for controlling it like in an actor, should be default of off normally with grippable components\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Overrides the default of : true and allows for controlling it like in an actor, should be default of off normally with grippable components" }, }; #endif void Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement_SetBit(void* Obj) { ((UGrippableSphereComponent*)Obj)->bReplicateMovement = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement = { "bReplicateMovement", nullptr, (EPropertyFlags)0x0010000000000025, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(UGrippableSphereComponent), &Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement_SetBit, METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags_MetaData[] = { { "Category", "VRGripInterface|Replication" }, { "Comment", "// Requires bReplicates to be true for the component\n" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Requires bReplicates to be true for the component" }, }; #endif void Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags_SetBit(void* Obj) { ((UGrippableSphereComponent*)Obj)->bRepGripSettingsAndGameplayTags = 1; } const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags = { "bRepGripSettingsAndGameplayTags", nullptr, (EPropertyFlags)0x0010000000000025, UE4CodeGen_Private::EPropertyGenFlags::Bool | UE4CodeGen_Private::EPropertyGenFlags::NativeBool, RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(bool), sizeof(UGrippableSphereComponent), &Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags_SetBit, METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GameplayTags_MetaData[] = { { "Category", "GameplayTags" }, { "Comment", "/** Tags that are set on this object */" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, { "ToolTip", "Tags that are set on this object" }, }; #endif const UE4CodeGen_Private::FStructPropertyParams Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GameplayTags = { "GameplayTags", nullptr, (EPropertyFlags)0x0010000000000025, UE4CodeGen_Private::EPropertyGenFlags::Struct, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UGrippableSphereComponent, GameplayTags), Z_Construct_UScriptStruct_FGameplayTagContainer, METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GameplayTags_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GameplayTags_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_MetaData[] = { { "Category", "VRGripInterface" }, { "EditInline", "true" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, }; #endif const UE4CodeGen_Private::FArrayPropertyParams Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts = { "GripLogicScripts", nullptr, (EPropertyFlags)0x001000800000003d, UE4CodeGen_Private::EPropertyGenFlags::Array, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UGrippableSphereComponent, GripLogicScripts), METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_MetaData)) }; #if WITH_METADATA const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_Inner_MetaData[] = { { "Category", "VRGripInterface" }, { "EditInline", "true" }, { "ModuleRelativePath", "Public/Grippables/GrippableSphereComponent.h" }, }; #endif const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_Inner = { "GripLogicScripts", nullptr, (EPropertyFlags)0x0002000000080008, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, 0, Z_Construct_UClass_UVRGripScriptBase_NoRegister, METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_Inner_MetaData, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_Inner_MetaData)) }; const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UClass_UGrippableSphereComponent_Statics::PropPointers[] = { (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_VRGripInterfaceSettings, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bReplicateMovement, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_bRepGripSettingsAndGameplayTags, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GameplayTags, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts, (const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UGrippableSphereComponent_Statics::NewProp_GripLogicScripts_Inner, }; const UE4CodeGen_Private::FImplementedInterfaceParams Z_Construct_UClass_UGrippableSphereComponent_Statics::InterfaceParams[] = { { Z_Construct_UClass_UVRGripInterface_NoRegister, (int32)VTABLE_OFFSET(UGrippableSphereComponent, IVRGripInterface), false }, { Z_Construct_UClass_UGameplayTagAssetInterface_NoRegister, (int32)VTABLE_OFFSET(UGrippableSphereComponent, IGameplayTagAssetInterface), false }, }; const FCppClassTypeInfoStatic Z_Construct_UClass_UGrippableSphereComponent_Statics::StaticCppClassTypeInfo = { TCppClassTypeTraits<UGrippableSphereComponent>::IsAbstract, }; const UE4CodeGen_Private::FClassParams Z_Construct_UClass_UGrippableSphereComponent_Statics::ClassParams = { &UGrippableSphereComponent::StaticClass, "Engine", &StaticCppClassTypeInfo, DependentSingletons, FuncInfo, Z_Construct_UClass_UGrippableSphereComponent_Statics::PropPointers, InterfaceParams, UE_ARRAY_COUNT(DependentSingletons), UE_ARRAY_COUNT(FuncInfo), UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::PropPointers), UE_ARRAY_COUNT(InterfaceParams), 0x00B010A4u, METADATA_PARAMS(Z_Construct_UClass_UGrippableSphereComponent_Statics::Class_MetaDataParams, UE_ARRAY_COUNT(Z_Construct_UClass_UGrippableSphereComponent_Statics::Class_MetaDataParams)) }; UClass* Z_Construct_UClass_UGrippableSphereComponent() { static UClass* OuterClass = nullptr; if (!OuterClass) { UE4CodeGen_Private::ConstructUClass(OuterClass, Z_Construct_UClass_UGrippableSphereComponent_Statics::ClassParams); } return OuterClass; } IMPLEMENT_CLASS(UGrippableSphereComponent, 1069726349); template<> VREXPANSIONPLUGIN_API UClass* StaticClass<UGrippableSphereComponent>() { return UGrippableSphereComponent::StaticClass(); } static FCompiledInDefer Z_CompiledInDefer_UClass_UGrippableSphereComponent(Z_Construct_UClass_UGrippableSphereComponent, &UGrippableSphereComponent::StaticClass, TEXT("/Script/VRExpansionPlugin"), TEXT("UGrippableSphereComponent"), false, nullptr, nullptr, nullptr); DEFINE_VTABLE_PTR_HELPER_CTOR(UGrippableSphereComponent); PRAGMA_ENABLE_DEPRECATION_WARNINGS #ifdef _MSC_VER #pragma warning (pop) #endif
2831a28b2bf97d466cae820ea7fed5bec11303c6
029a893330bbc315eacb1dba901079d005eec1e2
/c-cpp/general-tests/test2.cpp
d92213b6b43c306ca8aefcab414c159fc6559e83
[]
no_license
0000marcell/SandBox
bff979d2afdf7d94ca9e87f35b3767428dcb12f8
1e729fb4d3963d4fc5d06a715dde174599c09e43
refs/heads/master
2021-01-24T06:48:06.946612
2017-12-01T19:42:56
2017-12-01T19:42:56
48,927,840
0
0
null
null
null
null
UTF-8
C++
false
false
303
cpp
test2.cpp
#include <iostream> using namespace std; #include <array> int main(){ int a[5] = {0, 1, 2, 3, 4}; int i = 5; for(unsigned int j = 0; j < i; j++){ for(unsigned int k = 0; k < i; k++){ if(k > 1){ break; } } cout << "it didn't work"; } cout << "it did work"; }
1c3459b4467f5830a08582e9f9d847f0979d049f
2b94524e902cea17f09c6c2dc03eb06e7c6b1732
/week5/ScopedPtr.h
9a37facacf4526e15524dbabcb4399e84c8650b4
[]
no_license
RomanSofyin/CPPIntro
6d1a3309affe080f6f34f5eabd784427eb22b34c
0835cb0ddd47f3ac4a08a0441e8e0d4941d4fa24
refs/heads/master
2021-10-24T11:41:46.023446
2019-03-25T19:15:41
2019-03-25T19:15:41
107,901,044
0
0
null
2017-12-29T09:42:34
2017-10-22T20:40:00
C++
UTF-8
C++
false
false
420
h
ScopedPtr.h
#pragma once struct Expression; struct ScopedPtr { explicit ScopedPtr(Expression *ptr = 0); ~ScopedPtr(); Expression* get() const; Expression* release(); void reset(Expression *ptr = 0); Expression& operator*() const; Expression* operator->() const; private: // prohibit using of the constructor and operator below ScopedPtr(const ScopedPtr&); ScopedPtr& operator=(const ScopedPtr&); Expression *ptr_; };
eeb8a4755e3b69d05ae429496fd869a0d5563d47
fbbbbbe16e0a6ed29a7b0e15a24feb797f27639c
/Pattern /3.cpp
67d8ae4d9c9bed14a0272febbfd2214884f054e1
[]
no_license
alok2350/DataStructure
a444b0787ec8e7e6663dd0be3e0267acab7a4920
b4d388e4f3f8550c78a023e9341f80c76b1dce16
refs/heads/master
2023-01-12T20:21:13.612030
2020-11-18T10:18:18
2020-11-18T10:18:18
313,818,418
0
0
null
null
null
null
UTF-8
C++
false
false
976
cpp
3.cpp
// Author: Alok Gupta // Date Created: 7-11-20 // Date Modified: 7-11-20 // Description: will print the incremental(at each level) half pyramid in both oreintation #include<iostream> void left_half_incremental_at_each_levele_pyramid(const int& num_level) { for(int i=1;i<=num_level;i++) { for(int j=1;j<=i;j++) { std::cout << j << " "; } std::cout << std::endl; } } void left_half_incremental_overall_pyramid(const int& num_level) { int x = 1; for(int i=1;i<=num_level;i++) { for(int j=1;j<=i;j++) { std::cout << x++ << " "; } std::cout << std::endl; } } int main() { int num_level{}; std::cout << "Enter the number of levels: "; std::cin >> num_level; left_half_incremental_at_each_levele_pyramid(num_level); std::cout << std::endl; left_half_incremental_overall_pyramid(num_level); std::cout << std::endl; return 0; }
b75b0c259f0da6facf2352be0709c7a562d64a55
d7ff47627bdee11f2088c36fccbf5d2fd2151f69
/[week0]c++stl/day1/第0周C++ STL-得分代码-20200716075413/1283239623962333184_正整数A+B/Truly.Liar_1193146496968978432_1283239623962333184.cpp
d69c761df7b533df4aa6439170b47f330038cd77
[]
no_license
HBUACM/2020-Training-camp
24c4c0b716a29a648f037980711635a707bae2ba
e0e3b2d3dc25a7d4891917ee46788ca17d816cf2
refs/heads/master
2022-11-21T06:39:23.445160
2020-07-16T12:20:13
2020-07-16T12:20:13
280,141,807
1
0
null
null
null
null
UTF-8
C++
false
false
1,046
cpp
Truly.Liar_1193146496968978432_1283239623962333184.cpp
#include<iostream> #include<stdlib.h> #include<string.h> using namespace std; int main(){ int max; bool flag1=true,flag2=true,flag3=false,flag4=false; string str1; string str2; cin >> str1; getchar(); getline(cin,str2); str1.length()<str2.length() ? max = str2.length() : max = str1.length(); for(int n=0;n<max;n++){ if(n<str1.length()){ if(str1.at(n)<48||str1.at(n)>57){ flag1=false; str1="?"; } } if(n<str2.length()){ if(str2.at(n)<48||str2.at(n)>57){ flag2=false; str2="?"; } } } if(flag1==true&&flag2==true){ int a=atof(str1.c_str()); int b=atof(str2.c_str()); if(a<1||a>1000){ flag3=true; } if(b<1||b>1000){ flag4=true; } if(flag3==true&&flag4==true){ cout<<"?"<<" + "<<"?"<<" = "<<"?"; }else if(flag3==true&&flag4==false){ cout<<"?"<<" + "<<b<<" = "<<"?"; }else if(flag3==false&&flag4==true){ cout<<a<<" + "<<"?"<<" = "<<"?"; }else if(flag3==false&&flag4==false){ cout<<a<<" + "<<b<<" = "<<a+b; } }else{ cout<<str1<<" + "<<str2<<" = "<<"?"; } }
2d3070c3d9fbbef0b9580cc0551658bb06d5f60e
0a9c56415ec323119c969e8171b92624ac0078af
/GenericNode/MiscAlgorithm.h
853730812ebb3f84b8ff3b975defd962ad7153b3
[]
no_license
lineCode/NoteUE4
f66336e7a158c602798c99482d0e6cc1359cb485
802dab96adae901363be9ff0b7349ea1fc7646d4
refs/heads/master
2023-07-17T18:47:52.709829
2021-09-04T08:17:05
2021-09-04T08:17:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,394
h
MiscAlgorithm.h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "JsonObjectConverter.h" #include "MiscAlgorithm.generated.h" /** Declare General Log Category, header file .h */ DECLARE_LOG_CATEGORY_EXTERN(LogMiscAlgorithm, Log, All); // Expand Enum As Execs UENUM() enum class EEvaluateArray : uint8 { /** Array length > 0. */ IsValid, /** Array length == 0. */ IsNotValid }; /** * */ UCLASS() class ALGORITHMSYSTEM_API UMiscAlgorithm : public UBlueprintFunctionLibrary { GENERATED_BODY() public: // wildcard /* *Filter an array based on filter function of object. * *@param Object The owner of function *@param FilterBy Filter function name, this custom function with 2 parameters, 1 input (Type same as array member), 1 return named "ReturnValue"(bool) *@param TargetArray The array to filter from *@return An array containing only those members which meet the filterBy condition. */ UFUNCTION(BlueprintCallable, CustomThunk, meta = (DisplayName = "Filter Array", CompactNodeTitle = "Filter", ArrayParm = "TargetArray,FilteredArray", ArrayTypeDependentParams = "TargetArray,FilteredArray", AutoCreateRefTerm = "FilteredArray", DefaultToSelf = "Object", AdvancedDisplay = "Object"), Category = "Utilities|Array") static void Array_Filter(const UObject* Object, const FName FilterBy, const TArray<int32>& TargetArray, TArray<int32>& FilteredArray); static void GenericArray_Filter(UObject* Object, UFunction* FilterFunction, const UArrayProperty* ArrayProp, void* SrcArrayAddr, void* FilterArrayAddr); DECLARE_FUNCTION(execArray_Filter) { P_GET_OBJECT(UObject, OwnerObject); P_GET_PROPERTY(UNameProperty, FilterBy); //Find filter function UFunction* const FilterFunction = OwnerObject->FindFunction(FilterBy); // Fitler function must have two parameters(1 input / 1 output) if (!FilterFunction || (FilterFunction->NumParms != 2)) { UE_LOG(LogTemp, Warning, TEXT("Tooltip -> Array_Filter -> Please check filter function %s "), *FilterBy.ToString()); return; } // Get target array address and ArrayProperty Stack.MostRecentProperty = nullptr; Stack.StepCompiledIn<UArrayProperty>(NULL); void* SrcArrayAddr = Stack.MostRecentPropertyAddress; UArrayProperty* SrcArrayProperty = Cast<UArrayProperty>(Stack.MostRecentProperty); if (!SrcArrayProperty) { Stack.bArrayContextFailed = true; return; } // Get filtered array address and arrayproperty Stack.MostRecentProperty = nullptr; Stack.StepCompiledIn<UArrayProperty>(NULL); void* FilterArrayAddr = Stack.MostRecentPropertyAddress; UArrayProperty* FilterArrayProperty = Cast<UArrayProperty>(Stack.MostRecentProperty); if (!FilterArrayProperty) { Stack.bArrayContextFailed = true; return; } P_FINISH; P_NATIVE_BEGIN; // ScrArrayProperty is equal to FilterArrayProperty GenericArray_Filter(OwnerObject, FilterFunction, SrcArrayProperty, SrcArrayAddr, FilterArrayAddr); P_NATIVE_END; } /* *Determines if an aray is valid(length > 0) ? * *@param TargetArray The array to get the length > 0 *@return True if length of array > 0, false otherwise. */ UFUNCTION(BlueprintPure, CustomThunk, meta = (DisplayName = "Is Valid Array", CompactNodeTitle = "VALID", ArrayParm = "TargetArray", Keywords = "num, size,valid", BlueprintThreadSafe), Category = "Utilities|Array") static bool Array_Valid(const TArray<int32>& TargetArray); static bool GenericArray_Valid(void* ArrayAddr, UArrayProperty* ArrayProperty); DECLARE_FUNCTION(execArray_Valid) { Stack.MostRecentProperty = nullptr; Stack.StepCompiledIn<UArrayProperty>(NULL); void* ArrayAddr = Stack.MostRecentPropertyAddress; UArrayProperty* ArrayProperty = Cast<UArrayProperty>(Stack.MostRecentProperty); if (!ArrayProperty) { Stack.bArrayContextFailed = true; return; } P_FINISH; P_NATIVE_BEGIN; *(bool*)RESULT_PARAM = GenericArray_Valid(ArrayAddr, ArrayProperty); P_NATIVE_END; } /* *Determines if an aray is valid(length > 0) ? * *@param TargetArray The array to get the length > 0 */ UFUNCTION(BlueprintCallable, CustomThunk, meta = (DisplayName = "Is Valid ?", ArrayParm = "TargetArray", Keywords = "num, size,valid", ExpandEnumAsExecs = "EvaluateArrayPIN", BlueprintThreadSafe), Category = "Utilities|Array") static void Array_Validv2(const TArray<int32>& TargetArray, EEvaluateArray& EvaluateArrayPIN); static void GenericArray_Validv2(void* ArrayAddr, UArrayProperty* ArrayProperty, EEvaluateArray& EvaluateArrayPIN); DECLARE_FUNCTION(execArray_Validv2) { Stack.MostRecentProperty = nullptr; Stack.StepCompiledIn<UArrayProperty>(NULL); void* ArrayAddr = Stack.MostRecentPropertyAddress; UArrayProperty* ArrayProperty = Cast<UArrayProperty>(Stack.MostRecentProperty); if (!ArrayProperty) { Stack.bArrayContextFailed = true; return; } P_GET_ENUM_REF(EEvaluateArray, EvaluateArrayPIN); P_FINISH; P_NATIVE_BEGIN; GenericArray_Validv2(ArrayAddr, ArrayProperty, EvaluateArrayPIN); P_NATIVE_END; } /** * Save any type of struct object to JSON format string, no struct type restriction * * @param StructReference The UStruct instance to read from * @return JSON String Json Object string to be filled in with data from the ustruct */ UFUNCTION(BlueprintPure, CustomThunk, meta = (CustomStructureParam = "StructReference", DisplayName = "Struct to JSON String"), Category = "File|Json") static void UStructToJsonObjectString(const int32& StructReference, FString& JSONString); //static void Generic_UStructToJsonObjectString(UStructProperty* StructProperty, void* StructPtr, FString& JSONString); /// Custom execFunciton thunk for function UStructToJsonObjectString. DECLARE_FUNCTION(execUStructToJsonObjectString) { //Get input wildcard single variable Stack.Step(Stack.Object, NULL); UStructProperty* StructProperty = ExactCast<UStructProperty>(Stack.MostRecentProperty); void* StructPtr = Stack.MostRecentPropertyAddress; //Get JsonString reference P_GET_PROPERTY_REF(UStrProperty, JSONString); P_FINISH; P_NATIVE_BEGIN; FJsonObjectConverter::UStructToJsonObjectString(StructProperty->Struct, StructPtr, JSONString, 0, 0); //Generic_UStructToJsonObjectString(StructProperty, StructPtr, JSONString); P_NATIVE_END; } };
2975eb392e9a9a31a8659477e865c58f6af3afd3
f8ff6ab5eafb761e54f771a5db85985c26f75f8c
/Editor/syntaxhighlighter.cpp
40b4d67facfad00bf1aaa573937eac524a8f6116
[]
no_license
mhassanzadeh/JsonEditor_QT
5af13425436aba5b38b437de97005182fe2673c0
3c7046b9318a530cc7a670bfda1a540131780e91
refs/heads/master
2016-09-06T11:29:44.527286
2015-08-25T07:40:51
2015-08-25T07:40:51
41,348,625
3
0
null
null
null
null
UTF-8
C++
false
false
1,357
cpp
syntaxhighlighter.cpp
#include "syntaxhighlighter.h" SyntaxHighlighter::SyntaxHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) { symbolFormat.setForeground(Qt::red); symbolFormat.setFontWeight(QFont::Bold); nameFormat.setForeground(Qt::blue); nameFormat.setFontWeight(QFont::Bold); nameFormat.setFontItalic (true); valueFormat.setForeground(Qt::darkGreen); } void SyntaxHighlighter::highlightBlock(const QString &text) { QString textBlock = text; QRegExp expression("(\\{|\\}|\\[|\\]|\\:|\\,)"); int index = expression.indexIn(textBlock); while (index >= 0) { int length = expression.matchedLength(); setFormat(index, length, symbolFormat); index = expression.indexIn(textBlock, index + length); } textBlock.replace("\\\"", " "); expression = QRegExp("\".*\" *\\:"); expression.setMinimal(true); index = expression.indexIn(textBlock); while (index >= 0) { int length = expression.matchedLength(); setFormat(index, length - 1, nameFormat); index = expression.indexIn(textBlock, index + length); } expression = QRegExp("\\: *\".*\""); expression.setMinimal(true); index = expression.indexIn(textBlock); while (index >= 0) { int length = expression.matchedLength(); setFormat(index + 1, length - 1, valueFormat); index = expression.indexIn(textBlock, index + length); } }
d04c34b4a8d14b8410d8725c828fd76ba9c97baf
582d1606a83b6e1eb468f5d625dfd3b6ca44a188
/Sculptor.h
efad69ee8ce07a1b2d81a7fcabc02dfb5b3ae654
[]
no_license
joaorafaelcfs/ProjetoEscultor3D
ddf3e604ca8792c539bd3c90417301e2c7576b74
756668f6b8e8ab66ea23dd5694a734981b66c7a0
refs/heads/master
2023-01-27T22:03:03.566860
2020-11-25T14:40:20
2020-11-25T14:40:20
315,962,578
1
0
null
null
null
null
UTF-8
C++
false
false
5,568
h
Sculptor.h
#ifndef SCULPTOR_H_INCLUDED #define SCULPTOR_H_INCLUDED /** * \brief Declaração do Struct Voxel \n * No struct Voxel é armazenado variaveis que irão determinar as cores (r,g,b) e transparência (a) do objeto, * como também teremos a propriedade isOn que define se o voxel correspondete deve ser incluído no arquivo digital. * \param r - Cor vermelha * \param g - Cor verde * \param b - Cor azul * \param a - Transparência * \param isOn - Incluir ou não no arquivo digital */ struct Voxel { float r,g,b; // Cores float a; // Transparencia bool isOn; // Included or not }; /** * \brief Classe Sculptor */ class Sculptor { protected: Voxel ***v; // 3D matrix int nx,ny,nz; // Dimensions float r,g,b,a; // Current drawing color public: /** \brief Construtor da Classe \n Aqui fazemos a alocação dinâmica de memória para o nosso vetor ***v * \param _nx -- Dimensão em x * \param _ny -- Dimensão em y * \param _nz -- Dimensão em z*/ Sculptor(int _nx, int _ny, int _nz); /** \brief Destrutor da Classe \n Aqui fazemos a liberação da memória do nosso vetor ***v */ ~Sculptor(); /** \brief Atribuição de cor ao objeto desenhado * \n As variáveis r,g,b e alpha recebem valores compreendidos em um intervalo de [0,1]. A variável r está relacionada a cor vermelha (red), * g está relacionada a cor verde (green) e b é a cor azul (blue). E por sua vez a variável alpha corresponde a transparência que o objeto terá. \n * A cada vez que o usuário quiser mudar a cor de um objeto, ele deverá chamar essa função. * \param r -- Cor vermelha * \param g -- Cor verde * \param b -- Cor azul * \param alpha -- Transparência */ void setColor(float r, float g, float b, float alpha); /** \brief Essa função é responsável por formar um voxel na posição x,y,z e fazendo isOn = true. \n Atribui a ele a cor atual definida na função setColor * \param x -- Ativação do voxel na posição x * \param y -- Ativação do voxel na posição y * \param z -- Ativação do voxel na posição z */ void putVoxel(int x, int y, int z); /** \brief Essa função é responsável por excluir um voxel na posição x,y,z e fazendo isOn = false. * \param x -- Desativa o voxel na posição x * \param y -- Desativa o voxel na posição y * \param z -- Desativa o voxel na posição z */ void cutVoxel(int x, int y, int z); /** \brief Essa função é responsável por ativar todos os voxels compreendidos no intervalo [x0,x1], [y0,y1], [z0,z1] e fazendo isOn = true. * \n Ela forma todos os voxels que estão compreendidos nesse intervalo. \n Atribui a ele a cor atual definida na função setColor * \param x0 x1 -- Ativa uma sequência de voxels no intervalo de x0 a x1 * \param y0 y1 -- Ativa uma sequência de voxels no intervalo de y0 a y1 * \param z0 z1 -- Ativa uma sequência de voxels no intervalo de z0 a z1 */ void putBox(int x0, int x1, int y0, int y1, int z0, int z1); /** \brief Essa função é responsável por desativar todos os voxels compreendidos no intervalo [x0,x1], [y0,y1], [z0,z1] e fazendo isOn = false. * \brief Ela exclui todos os voxels que estão compreendidos nesse intervalo. * \param x0 x1 -- Desativa uma sequência de voxels no intervalo de x0 a x1 * \param y0 y1 -- Desativa uma sequência de voxels no intervalo de y0 a y1 * \param z0 z1 -- Desativa uma sequência de voxels no intervalo de z0 a z1 */ void cutBox(int x0, int x1, int y0, int y1, int z0, int z1); /** \brief Ativa todos os voxels que satisfazem à equação da esfera. \n Atribui a ele a cor atual definida na função setColor * \param xcenter -- Posição central da esfera no eixo x * \param ycenter -- Posição central da esfera no eixo y * \param zcenter -- Posição central da esfera no eixo z * \param radius -- Raio da esfera */ void putSphere(int xcenter, int ycenter, int zcenter, int radius); /** \brief Desativa todos os voxels que satisfazem à equação da esfera. * \param xcenter -- Posição central da esfera no eixo x * \param ycenter -- Posição central da esfera no eixo y * \param zcenter -- Posição central da esfera no eixo z * \param radius -- Raio da esfera */ void cutSphere(int xcenter, int ycenter, int zcenter, int radius); /** \brief Ativa todos os voxels que satisfazem à equação da elipsóide. \n Atribui a ele a cor atual definida na função setColor * \param xcenter -- Posição central da elipse no eixo x * \param ycenter -- Posição central da elipse no eixo y * \param zcenter -- Posição central da elipse no eixo z * \param rx -- Raio da elipse no eixo x * \param ry -- Raio da elipse no eixo y * \param rz -- Raio da elipse no eixo z */ void putEllipsoid(int xcenter, int ycenter, int zcenter, int rx, int ry, int rz); /** \brief Desativa todos os voxels que satisfazem à equação da elipsóide. * \param xcenter -- Posição central da elipse no eixo x * \param ycenter -- Posição central da elipse no eixo y * \param zcenter -- Posição central da elipse no eixo z * \param rx -- Raio da elipse no eixo x * \param ry -- Raio da elipse no eixo y * \param rz -- Raio da elipse no eixo z */ void cutEllipsoid(int xcenter, int ycenter, int zcenter, int rx, int ry, int rz); /** \brief Aqui a função grava a escultura no formato OFF no arquivo "filename". * \param *filename -- Nome que o seu arquivo OFF receberá */ void writeOFF(char* filename); }; #ifdef __GNUC__ #include "Sculptor.cpp" #endif // SCULPTOR_H_INCLUDED #endif
a6eec2cbe26a017c589e638986f5db07d185ef03
5153386a680821cf1541cf976ef7c12ab0a0493d
/TrainTask/Solve_Question_Code/ContainsNearbyDuplicate.cpp
22cbb985984282ce9f2f031f7de4ec61975df062
[]
no_license
DriftingLQK/TrainCamp
1f1d600f90142c33ef54f5d3dc7ad76e93d45ebe
e9395499df177776f58e67d2595b658b93a01d99
refs/heads/master
2022-12-05T14:54:51.417395
2020-08-27T01:11:27
2020-08-27T01:11:27
290,640,738
0
0
null
null
null
null
GB18030
C++
false
false
1,205
cpp
ContainsNearbyDuplicate.cpp
#include <iostream> #include <vector> #include <math.h> #include <unordered_map> using namespace std; // bool ContainsNearbyDuplicate(vector<int>& nums, int k) //bool ContainsNearbyDuplicate(vector<int>&nums, int k) //{ // int len = nums.size(); //计算数组大小 // if (len<=0) // { // return false; // } // if (k<=0) // { // return false; // } // for (int i = 0; i<len - 1; i++) // { // for (int j = i + 1; j<len; j++) // { // if (nums[i] == nums[j]) // { // int c = abs(i-j); // if (c <= k) // { // return true; // } // else // { // continue; // } // // } // } // } // return false; //} // unordered_map 方法 bool ContainsNearbyDuplicate(vector<int>& nums, int k) { int len = nums.size(); //计算数组大小 if (len <= 0) { return false; } if (k <= 0) { return false; } unordered_map<int, int> record; pair<int, int>Insert_Pair; for (unsigned int i = 0; i < nums.size(); ++i) { if (record.size()> (unsigned int)k) { record.erase(nums[i - k - 1]); } if (record.find(nums[i]) == record.end()) { Insert_Pair = { nums[i], nums[i] }; record.insert(Insert_Pair); } else { return true; } } return false; }
b0148a0cc2cbd2649c4f31f3b96f6cd1344a4e7d
d805bc0b5d42cc1cc195238fafcf0abafae829c6
/particle.hpp
4f307efbfdbde88faf47e2f230c7ef71c237e9b8
[]
no_license
Paladnix/game
460d2b906a954b520a71855d75c086ff516b2a6c
206a95eb61e32bff61ccf8741b7419a338812347
refs/heads/master
2021-01-11T05:47:25.849272
2015-02-28T23:28:46
2015-02-28T23:28:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
515
hpp
particle.hpp
#ifndef PARTICLE_HPP #define PARTICLE_HPP #include "globals.hpp" class Particle { public: // Initialize position and animation. Particle(int x, int y, SDL_Rect mBox); ~Particle(); // Shows the particle. void render(); int frameCap = 10; // Checks if particle is dead. bool isDead(); inline void setFrame(int value) { frameCap = value; } private: // Offsets int mPosX, mPosY; // Current frame of animation. int mFrame; // Type of particle. LTexture *mTexture; }; #endif
bbfd10c4ad1cf19246a0c537ac5c19eee969e81e
d0e7605a8223fed5441f9f0d0a105663f47d43b6
/soundLoc.ino
5e56770854ed8519814842a90b0aa1c50cb3a70c
[]
no_license
idiot-io/soundLoc
68eb4abbf326c82045e5204da53296aa9a9a080a
e8a4929326d60185aa1a59ea95a38ff56412ed56
refs/heads/master
2021-05-31T12:29:46.748204
2016-05-03T13:41:07
2016-05-03T13:41:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,798
ino
soundLoc.ino
/* Sound Locator X-axis based on >> http://www.instructables.com/id/Sound-Locator/?ALLSTEPS ________________________ |Mic3 (Top View) Mic1| | Mic2 | |_______________________| */ #include <Wire.h> #include <Adafruit_PWMServoDriver.h> // called this way, it uses the default address 0x40 Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(); // Depending on your servo make, the pulse width min and max may vary, you // want these to be as small/large as possible without hitting the hard stop // for max range. You'll have to tweak them as necessary to match the servos you // have! #define SERVOMIN 170 // this is the 'minimum' pulse length count (out of 4096) #define SERVOMAX 510 // this is the 'maximum' pulse length count (out of 4096) // our servo # counter uint8_t servonum = 0; // Mic iput variables int mic1 = A1; // Microphone input on A1 int mic2 = A0; // Microphone input on A0 int mic3 = A2; // Microphone input on A2 // Noise threshold before changing position int threshold = 60; // Delay between samples in terms of Milliseconds int sampledelay = 2; // servo position:center int Xpos = 340; //Center void setServoPulse(uint8_t n, double pulse) { double pulselength; pulselength = 1000000; // 1,000,000 us per second pulselength /= 60; // 60 Hz Serial.print(pulselength); Serial.println(" us per period"); pulselength /= 4096; // 12 bits of resolution Serial.print(pulselength); Serial.println(" us per bit"); pulse *= 1000; pulse /= pulselength; Serial.println(pulse); pwm.setPWM(n, 0, pulse); } void setup() { // initialize the I/O pins as outputs pwm.begin(); pwm.setPWMFreq(60); // Analog servos run at ~60 Hz updates yield(); pwm.setPWM(servonum, 0, 335); delay(sampledelay); pwm.setPWM(servonum, 1, 335); delay(sampledelay); } void loop() { // read input: readMics(); // Drive each servo one at a time pwm.setPWM(servonum, 0, Xpos); delay(sampledelay); servonum ++; if (servonum > 2) servonum = 0; } void readMics() { // read the Mics Values mic1 = analogRead(A1); mic2 = analogRead(A0); mic3 = analogRead(A2); //Test if threshold hurdle met before proceeding if (mic1-mic2>threshold || mic2-mic1>threshold|| mic2-mic3>threshold || mic3-mic2>threshold || mic3-mic1>threshold || mic1-mic3>threshold) { // Sound Direction Algorithm // X-Axis Positive movement if (mic1>mic3 && mic1>mic2) { Xpos= Xpos + 10; } // X-Axis negative movement if (mic3>mic1 && mic3>mic2 ) { Xpos= Xpos - 10; } // X-Axis Center movement if (mic2>mic1 && mic2>mic3 ) { Xpos= 340; } // Keep X Axis coordinates within boundaries 0-180 if (Xpos <= 180) { Xpos=180; } if (Xpos >= 550) { Xpos=550; } } }
485bdcb8f48ae7f36d06f749b46eeb626024bc0d
18f63e189a8936bc3a5e7c6fb438fa8bc36ff06a
/1a_sobel.cpp
ea60eba2b5b121ec0365c32fd396bbd60ab4cb58
[]
no_license
Jahnvi-Rc/Edge-Detection-Sobel-Canny-Structured.-Digital-Halftoning-Dithering-Digital-Haltoning-Color-Diffuse
3bd1c6503f2ab97ced776ecc5d3a9439509c8410
04c2cb0b888a84e22bdd693de86d4c56367afaee
refs/heads/master
2022-12-05T17:26:55.848608
2020-08-30T21:31:55
2020-08-30T21:31:55
291,554,178
0
0
null
null
null
null
UTF-8
C++
false
false
5,232
cpp
1a_sobel.cpp
// This sample code reads in image data from a RAW image file and // writes it into another file // NOTE: The code assumes that the image is of size 256 x 256 and is in the // RAW format. You will need to make corresponding changes to // accommodate images of different sizes and/or types #include <stdio.h> #include <iostream> #include <stdlib.h> #include <math.h> #include <map> using namespace std; int main(int argc, char *argv[]) { // Define file pointer and variables FILE *file; int BytesPerPixel = 1; int width = 481; int height = 321; // Check for proper syntax if (argc < 3){ cout << "Syntax Error - Incorrect Parameter Usage:" << endl; cout << "program_name input_image.raw output_image.raw [BytesPerPixel = 1] [Size = 256]" << endl; return 0; } // Check if image is grayscale or color if (argc < 4){ BytesPerPixel = 1; // default is grey image } else { BytesPerPixel = atoi(argv[3]); // Check if size is specified if (argc >= 5){ width = atoi(argv[4]); height = atoi(argv[5]); } } // Allocate image data array unsigned char Imagedata[height][width][BytesPerPixel]; // Read image (filename specified by first argument) into image data matrix if (!(file=fopen(argv[1],"rb"))) { cout << "Cannot open file: " << argv[1] <<endl; exit(1); } fread(Imagedata, sizeof(unsigned char), width*height*BytesPerPixel, file); fclose(file); ///////////////////////// INSERT YOUR PROCESSING CODE HERE //////////////////////// // int i,j,k; // unsigned char grayscale[height][width]; // for(i=0;i<height;i++) // { for(j=0;j<width;j++) // grayscale[i][j]=((float)Imagedata[i][j][0]+(float)Imagedata[i][j][1]+(float)Imagedata[i][j][2])/3; // } //converting from RGB to gray image unsigned char gray_image[height][width]; int i,j,k; for (i=0;i<height;i++) { for (j=0;j<width;j++) { gray_image[i][j] = ceil(0.2989*Imagedata[i][j][0] + 0.5870*Imagedata[i][j][1] + 0.1140*Imagedata[i][j][2]); } } unsigned char extend_boundary[height+2][width+2][BytesPerPixel]; //add a boundary on top for(j=1;j<width+2;j++) { for(k=0;k<3;k++) extend_boundary[0][j][k] = extend_boundary[2][j][k]; } //adding a boundary on left for(i=0;i<height+2;i++) { for(k=0;k<3;k++) extend_boundary[i][0][k] = extend_boundary[i][2][k]; } //adding a boundary below for(j=1;j<width+2;j++) { for(k=0;k<3;k++) extend_boundary[height+1][j][k] = extend_boundary[height-1][j][k]; } //adding a boundary to the right for(i=0;i<height+2;i++) { for(k=0;k<3;k++) extend_boundary[i][width+1][k] = extend_boundary[i][width-1][k]; } //get extended image for(i = 0;i<height;i++) { for (j=0;j<width;j++) { extend_boundary[i+1][j+1][0] = Imagedata[i][j][0]; extend_boundary[i+1][j+1][1] = Imagedata[i][j][1]; extend_boundary[i+1][j+1][2] = Imagedata[i][j][2]; } } //convert to grayscale for (i=0;i<height+2;i++) { for (j=0;j<width;j++) { gray_image[i][j] = ceil(0.2989*extend_boundary[i][j][0] + 0.5870*extend_boundary[i][j][1] + 0.1140*extend_boundary[i][j][2]); } } float Thresh=0.60; int thresh; float sum=0; float cdf[256]={0}; char normalized[width][height]; int xg=0; int yg=0; float hist[256]={0}; int hist_x[]={0}; int hist_y[]={0}; int grad[width][height]; float min_grad=grad[0][0]; float max_grad=grad[0][0]; for(i=1;i<height+1;i++) { for(j=1;j<width+1;j++) { xg=-1*gray_image[i][j+1]+1*gray_image[i][j-1]-1*gray_image[i+1][j-1]+1*gray_image[i-1][j-1]-2*gray_image[i-1][j+1]+2*gray_image[i+1][j+1]; yg=-1*gray_image[i+1][j-1]+2*gray_image[i-1][j]+1*gray_image[i-1][j+1]-2*gray_image[i+1][j]+1*gray_image[i-1][j-1]-1*gray_image[i+1][j+1]; grad[i-1][j-1]=sqrt(xg*xg+yg*yg); } } for(i=0;i<height;i++) { for(j=0;j<width;j++) { if(grad[i][j]<=1020 && grad[i][j]>max_grad) max_grad=grad[i][j]; else if(grad[i][j]<=1020 && grad[i][j]<min_grad) min_grad=grad[i][j]; } } for(i=0;i<height;i++) { for(j=0;j<width;j++) { float temp = float((255/max_grad-min_grad)*(grad[i][j]-min_grad)); normalized[i][j]=(char)(temp); } } for(i=0;i<height;i++) { for(j=0;j<width;j++) hist[normalized[i][j]]++; } for(i=0;i<256;i++) hist[i]=((float)hist[i]/(width*height)); for(i=0;i<256;i++){ cdf[i]+=cdf[i-1]+hist[i]; } for(i=0;i<256;i++){ if(cdf[i]<=Thresh) thresh=i; } for(i=0;i<height;i++) { for(j=0;j<width;j++) { if(normalized[i][j]>=thresh) normalized[i][j]=0; else if(normalized[i][j]<thresh) normalized[i][j]=255; } } // Write image data (filename specified by second argument) from image data matrix if (!(file=fopen(argv[2],"wb"))) { cout << "Cannot open file: " << argv[2] << endl; exit(1); } fwrite(normalized, sizeof(unsigned char), width*height*3, file); fclose(file); return 0; }
3c32b3e0354df460fe19be32be3ef8d6ac0f94f7
8e0a47e0b094ae4605151e53f3a5c3ce4ea3efe1
/C++/OpenGL_Tetris/src/main.cpp
ed0abbe90b1dd8eec79adf688f093b13a601bc26
[]
no_license
Simon-McDonald/Code
539c6b1074350a61ceb26dba0577855963b5ffd4
3eb96f542bf1f8005c13032d5c52d4e4f6a25554
refs/heads/master
2021-01-20T07:15:51.148568
2018-04-19T11:16:42
2018-04-19T11:16:42
47,899,009
0
0
null
null
null
null
UTF-8
C++
false
false
2,587
cpp
main.cpp
/* * main.cpp * * Created on: May 7, 2017 * Author: Simon */ #include <CheckErrors.h> #include <memory> #include <map> #include <UtilityManager.hpp> #include <StopWatch.hpp> #include <WorldManager.hpp> #include "Levels.hpp" #include "ResourceManager.hpp" class ProgramManager : protected UtilityManager { public: ProgramManager(void) : shaderMap(generateShaderMap()), currentShader(nullptr), isRunning(false) { CHECKERRORS(); WorldManager::Initialise(&this->mainWindow, &this->shaderMap); currentShader = ShaderManager::getActiveShaderManager(); CHECKERRORS(); this->level.reset(generateInstance(InstanceType::MENU)); } std::map<std::string, ShaderManager> generateShaderMap(void) { std::map<std::string, ShaderManager> mapOfShaders; shaderMap.emplace("piece", std::string("TETRIS_PIECE_SHADER")); shaderMap.emplace("text", std::string("TEXT_SHADER")); shaderMap.emplace("background", std::string("BACKGROUND_SHADER")); return mapOfShaders; } bool Start(void) { isRunning = true; this->timer.Start (); return isRunning; } bool Run(void) { float deltaTime_sec = timer.Mark(); this->mainWindow.userInput(); this->mainWindow.clearWindow(); isRunning = level->update((int)(deltaTime_sec * 1000.0), this->mainWindow.getInput()); if (!isRunning) { InstanceType nextType = level->endState(); if (nextType != InstanceType::QUIT) { isRunning = true; level.reset(generateInstance(nextType)); } } this->shaderMap.at("background").useProgram(); level->renderBackground(); this->shaderMap.at("piece").useProgram(); level->render(); this->shaderMap.at("text").useProgram(); level->renderText(); this->mainWindow.updateWindow(); isRunning &= !this->mainWindow.getInput().onDown.quit; return isRunning; } ~ProgramManager(void) {} private: OpenGLWindow mainWindow; std::map<std::string, ShaderManager> shaderMap; ShaderManager *currentShader; ResourceManager resourceManager; std::unique_ptr<Instance> level; StopWatch timer; bool isRunning; }; int main(int argc, char *argv[]) { Config config("config/config.txt"); Logger logger; UtilityManager::Initialise(&config, &logger); try { ProgramManager program; if (!program.Start()) { return EXIT_FAILURE; } while (program.Run()); } catch (...) { std::cout << "Got an unknown exception!" << std::cout; return EXIT_FAILURE; } return EXIT_SUCCESS; }
4e64710d0ab65608f9322f97ed217a47420ee645
6981a415311e3ffd43fe1c73bdadbd2dbcf9f44a
/Estacion/Firmware/WeatherStation.v3.0/WeatherStation.ino
698f5a648270bd3a6ceab33d400ea1c59005e76a
[]
no_license
cslab-upm/WeatherStation
b30f7b17c83ab6da26db89a026084a3720cc9cc3
0dad87e8e63446da8e0757ffae86d452aaa9a9b4
refs/heads/master
2022-01-26T23:47:20.845266
2019-05-17T11:41:25
2019-05-17T11:41:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,026
ino
WeatherStation.ino
//////HEADERS////// #include <stdio.h> #include <string.h> #include <Wire.h> // I2C Communication #include <SD.h> #include <FreqCount.h> #include <SparkFunDS1307RTC.h> // RTC #include <BMP085.h> // termomenter/barometer #include <hh10d.hpp> // hygrometer /******INITIALIZATION******/ #define INTERVAL 60 // The amount of seconds between publications unsigned long previousSegs = 0; unsigned long currentSegs; //////SD////// File FileRead,FileWrite; String path; String anio,mes,dia,hora; //////XBEE////// /*Uses Serial1 for communication*/ char datos[80]; //max 80 bytes per packet String strDatos,d,mon,y,h,m,s; //////RTC1307////// #define PRINT_EU_DATE // date formatted dd/mm/yy #define SQW_INPUT_PIN 2 // Input pin to read SQW #define SQW_OUTPUT_PIN 13 // LED to indicate SQW's state //////BMP085////// BMP085 bmp085; // Sensor bmp085 for temperature and pression float temp=0.0; float pres=0.0; //////HH10D////// /* Hygrometer calibration */ const int HH10D_OFFSET(7732); const int HH10D_SENSITIVITY(402); float hum; //////SPARKFUN STATION////// #define pinAnem 2 // Anemometer pin #define pinPluviometro 3 // Pluviometer pin #define pinVeleta 4 // Weather vane pin #define pinReset 14 volatile int cuentaAnem=0; // Anemomenter frequency volatile int cuentaPluv=0; // Pluviometer frequency float VelSp = 0.0; // Wind speed in km/h float pluv = 0.0; //precipitation in mm String dir; // N NNW NW WNW W WSW SW SSW S SSE SE ESE E ENE NE NNE /******END OF INIT******/ /** SETUP * Initialize sensor interfaces and radio communication */ void setup() { Serial.begin(9600); initSD(); initXbee(); initRTC(); initBmp085(); initHH10D(); initSparkStation(); Serial1.println(";Sensores inicializados"); /** * It would be useful to prepare an interrupt every INTERVAL seconds, * if possible, in order to minimize power consumption. */ delay(2000); } /******END OF SETUP******/ /******LOOP******/ void loop() { // sensorSparkStation(); currentSegs = (millis() / 1000);//envío del paquete en cada intervalo establecido if(currentSegs - previousSegs >= INTERVAL) { clockRTC(); sensorBmp085(); sensorHH10D(); previousSegs = currentSegs; //printData();//serial propio de Arduino, para el desarrollo sendData();//xbee saveSD();//guarda los datos en la SD clearCounters(); //para los contadores de frecuencia del anemómetro, pluviómetro y contador de ciclos } } /******END OF LOOP******/ /*****FUNCTIONS******/ //////XBEE////// void initXbee(){ Serial1.begin(9600); Wire.begin(); Serial1.println("Comunicacion inicializada"); } void sendData(){//se envía info en cada ciclo (FREQ veces por cada Serial.print del Arduino if (rtc.hour() < 10) h = "0" + String(rtc.hour());//conversion a string de m else h = String(rtc.hour()); if (rtc.minute() < 10) m = "0" + String(rtc.minute()); else m = String(rtc.minute()); if (rtc.second() < 10) s = "0" + String(rtc.second()); else s = String(rtc.second()); if (rtc.date() < 10) d = "0" + String(rtc.date());//conversion a string de m else d = String(rtc.date()); if (rtc.month() < 10) mon = "0" + String(rtc.month()); else mon = String(rtc.month()); if (rtc.year() < 10) y = "0" + String(rtc.year()); else y = String(rtc.year()); float v=(VelSp/(INTERVAL*3.4833));//km/h float pl=(pluv);//L/m2 litro por metro cuadrado strDatos="######" + d + "/" + mon + "/" + y + "_" + h + ":" + m + ":" + s + "_T_" + String(temp) + "_P_" + String(pres) + "_H_" + String(hum) + "_V_" + String(v) + "_PL_" + String(pl) + "_D_" + String(dir) + "\n"; strDatos.toCharArray(datos,80); //sprintf(info,"######%d:%d:%d %d grados %d KPa %d humedad Km/h\n",rtc.hour(),rtc.minute(),rtc.second(),(int)temp,(int)pres,(int)hum); //Serial1.setTimeout(5000); Serial1.write("//////"); //delay(1000); Serial1.write(datos); //Serial1.write("\n"); } //////SERIAL DATA////// solo usado durante el desarrollo para comprobacion void printData(){ /*Serial.print("Temperatura: ");//grados centigrados Serial.print(temp); Serial.print(" Presion: ");//KILO pascales Serial.print(pres); Serial.print(" Humedad Rel. ");//tanto por ciento Serial.print(hum); Serial.print("%"); Serial.print(" "); printTime();//RTC Serial.print((VelSp/(FREQ)));//km/h Serial.print(" "); Serial.print(pluv/(FREQ));//mm de precipitacion Serial.print(" "); Serial.println(dir);//punto cardinal de donde proviene el viento */ } //////SD CARD////// void initSD(){ SD.begin();//sin parámetro se define por defecto CS el pin 53 en Mega Serial.println("SD Card inicializado"); } void saveSD(){//guarda en la SD los datos que se transmiten if (rtc.year() < 10) anio = "0" + String(rtc.year());//conversion a string de m else anio = String(rtc.year()); if (rtc.month() < 10) mes = "0" + String(rtc.month()); else mes = String(rtc.month()); if (rtc.date() < 10) dia = "0" + String(rtc.date()); else dia = String(rtc.date()); path = dia + "_" + mes + "_" + anio + ".txt"; //path=(String(rtc.year()) + "_" + String(rtc.month()) + "_" + String(rtc.date()) + ".txt"); FileWrite=SD.open(path,FILE_WRITE); FileWrite.print("#"); if(rtc.hour()<10){ FileWrite.print("0");FileWrite.print(rtc.hour()); } else FileWrite.print(rtc.hour()); FileWrite.print(":"); if(rtc.minute()<10){ FileWrite.print("0");FileWrite.print(rtc.minute()); } else FileWrite.print(rtc.minute()); FileWrite.print(":"); if(rtc.second()<10){ FileWrite.print("0");FileWrite.print(rtc.second()); } else FileWrite.print(rtc.second()); FileWrite.print("_T_");//grados centigrados FileWrite.print(temp); FileWrite.print("_P_");//KILO pascales FileWrite.print(pres); FileWrite.print("_H_");//tanto por ciento FileWrite.print(hum); FileWrite.print("_V_"); FileWrite.print(VelSp/(INTERVAL*3.4833));//km/h FileWrite.print("_PL_"); FileWrite.print(pluv);//mm por minuto de precipitacion FileWrite.print("_D_"); FileWrite.println(dir);//punto cardinal de donde proviene el viento FileWrite.close(); } //////RTC1307////// void initRTC(){ pinMode(SQW_INPUT_PIN, INPUT_PULLUP); pinMode(SQW_OUTPUT_PIN, OUTPUT); digitalWrite(SQW_OUTPUT_PIN, digitalRead(SQW_INPUT_PIN)); rtc.begin(); // Call rtc.begin() to initialize the library rtc.writeSQW(SQW_SQUARE_1); Serial.println("Reloj RTC1307 inicializado"); //rtc.setTime(00, 30, 18, 7, 8, 3, 17); // Uncomment to manually set time //rtc.set24Hour(); // Use rtc.set12Hour to set to 12-hour mode } void clockRTC(){ rtc.update(); } void printTime(){ Serial.print(String(rtc.hour()) + ":"); // Print hour if (rtc.minute() < 10) Serial.print('0'); // Print leading '0' for minute Serial.print(String(rtc.minute()) + ":"); // Print minute if (rtc.second() < 10) Serial.print('0'); // Print leading '0' for second Serial.print(String(rtc.second())); // Print second if (rtc.is12Hour()) // If we're in 12-hour mode { // Use rtc.pm() to read the AM/PM state of the hour if (rtc.pm()) Serial.print(" PM"); // Returns true if PM else Serial.print(" AM"); } Serial.print(" "); #ifdef PRINT_EU_DATE//self changed Serial.print(String(rtc.date()) + "/" + // Print month String(rtc.month()) + "/"); // Print date #else//USA Time Serial.print(String(rtc.month()) + "/" + // (or) print date String(rtc.date()) + "/"); // Print month #endif Serial.print(String(rtc.year())); // Print year Serial.print(" "); } //////BMP085////// void initBmp085(){ bmp085.Init();//inicialización comunicacion I2C Serial.println("Sensor BMP085 incializado"); } void sensorBmp085(){ temp=bmp085.GetTemperature(); pres=bmp085.GetPressure(); } //////HH10D////// void initHH10D(){ HH10D::initialize(); Serial.println("Sensor HH10D incializado"); } void sensorHH10D(){ hum=HH10D::getHumidity(HH10D_SENSITIVITY, HH10D_OFFSET); } //////SPARKFUN STATION////// void initSparkStation() { pinMode(pinPluviometro,INPUT); pinMode(pinAnem,INPUT); digitalWrite(pinAnem, HIGH); attachInterrupt(digitalPinToInterrupt(2), countAnemometer, FALLING); attachInterrupt(digitalPinToInterrupt(3), countPluviometer, FALLING); pinMode(pinReset, OUTPUT); digitalWrite(pinReset, HIGH); Serial.println("SparkStation inicializado"); } void countAnemometer(){ cuentaAnem++; } void countPluviometer(){ cuentaPluv++; } void clearCounters(){ cuentaAnem=0; VelSp=0.0; cuentaPluv=0; } void sensorSparkStation(){ VelSp= (cuentaAnem*2.4); //km/h dir=WindDirection(pinVeleta); pluv = (cuentaPluv * 0.2794);//mm por ciclo(por minuto) //cada cierre de contacto del reed del Pluv provoca dos falling por lo que cuenta //dos cierres, asi que lo que dividimos entre 2 } String WindDirection(int pinAnalog){ String veleta; float s; int i = analogRead(pinAnalog); s=5.0/1024.0*(float)i; if(s>=3.83&&s<=3.87){ veleta="N"; } else if(s>=3.43&&s<=3.47){ veleta="NNW"; } else if((s>=4.33)&&(s<=4.36)){ veleta="NW"; } else if((s>=4.04 )&&(s<= 4.07)){ veleta="WNW"; } else if(s>=4.61&&s<=4.64){ veleta="W"; } else if((s>=2.93 )&&(s<=2.96 )){ veleta="WSW"; } else if(s>=3.08&&s<=3.11){ veleta="SW"; } else if((s>=1.19 )&&(s<= 1.22)){ veleta="SSW"; } else if((s>=1.40 )&&(s<=1.43 )){ veleta="S"; } else if((s>= 0.60)&&(s<=0.63 )){ veleta="SSE"; } else if((s>= 0.89)&&(s<=0.92 )){ veleta="SE"; } else if((s>=0.30 )&&(s<=0.33 )){ veleta="ESE"; } else if(s>=0.44&&s<=0.47){ veleta="E"; } else if((s>=0.39 )&&(s<=0.42 )){ veleta="ENE"; } else if((s>= 2.26)&&(s<=2.29 )){ veleta="NE"; } else if((s>=1.98)&&(s<=2.01)){ veleta="NNE"; } else{ veleta="N/A"; } return veleta; } /******END OF FUNCTIONS******/
42553da3cda7a5da0866aebe45a0d4856e15ff0f
5c2539604825959886af0109293fa08e75b99ec2
/sorting/mergesort.cpp
20958cc1273db801e58d4c61650dd0f699dc6171
[]
no_license
musicakc/DataStructuresAndAlgorithms
669f236712b2723538bd1bae8a328b179408c932
f2684ce93b89e9b0711b334ba5ad0154f1aada2c
refs/heads/master
2021-01-10T06:49:05.625402
2019-03-20T17:30:14
2019-03-20T17:30:14
48,552,213
0
0
null
null
null
null
UTF-8
C++
false
false
872
cpp
mergesort.cpp
/* Merge Sort */ #include <iostream> using namespace std; void merge(int arr[], int l, int m, int r) { int L[m-l+1], R[r-m]; int i,j; //Data copied to temp arrays for(i=0; i<m-l+1; i++) L[i] = arr[l+i]; for(j=0; j<r-m; j++) R[j] = arr[m+1+j]; i=0,j=0; int k = l; while(i<m-l+1 && j<r-m) { if(L[i] <= R[j]){ arr[k] = L[i]; i++; } else { arr[k] = R[j]; j++; } k++; } while(i<m-l+1) { arr[k] = L[i]; k++; i++; } while(j<r-m) { arr[k] = R[j]; k++; j++; } } void mergesort(int arr[], int l, int r) { if(l < r) { int m = (l+r)/2; mergesort(arr, l, m); mergesort(arr, m+1, r); merge(arr, l, m, r); } } int main() { int arr[] = {4, 7, 3, 55, 90, 21, 2, 6, 0, 3, 45}; int arrlength = sizeof(arr)/sizeof(*arr); mergesort(arr, 0, arrlength); for(int i=0; i<arrlength; i++) cout<< arr[i] << " " ; return 0; }
7b6e39686830194988660a2c77485890419b4d29
2e1f96b9d60ecaec868e0b7824cab632a51a8b02
/z/server/MapLoader.cpp
8455655353749bbb39fb19459d2c39a0a6f7e49b
[]
no_license
Jose72/taller_tp_final
61076d0db7b22ba9034967cd48647d13e6aa853e
1b5e5e76d3e7fbcf919a310c802e0ecd7bb783bd
refs/heads/master
2021-01-20T17:23:16.086898
2017-06-27T19:35:09
2017-06-27T19:35:09
90,871,460
0
0
null
null
null
null
UTF-8
C++
false
false
1,943
cpp
MapLoader.cpp
#include <dirent.h> #include <iostream> #include "MapLoader.h" MapLoader::MapLoader(std::string &path): pathFolder(path), jsonHandler(path) { } void MapLoader::loadListData() { loadDirectory(pathFolder); /* for (unsigned int i = 0; i <this->dataMaps.size() ; ++i) { std::cout << this->dataMaps[i].mapName << "\n"; } */ } std::vector<dataMap> MapLoader::mapsForTeams(int cantEquipos) { std::vector<dataMap> vecDataMap; for (unsigned int i = 0; i <this->dataMaps.size() ; ++i) { if(this->dataMaps[i].cantEquipos == cantEquipos){ vecDataMap.push_back(this->dataMaps[i]); } } return vecDataMap; } void MapLoader::loadMap(std::string mapName) { std::vector<int> mapDescriptor; } void MapLoader::loadDirectory(std::string path) { DIR *dir; struct dirent *ent; std::vector<std::string> list_dir; std::string mother(path); const char * path2 = path.c_str(); if ((dir = opendir (path2)) != NULL) { while ((ent = readdir (dir)) != NULL) { std::string name(ent->d_name); if(name.find("data") != std::string::npos){ list_dir.push_back(name); } } closedir (dir); } else { /* could not open directory */ perror (""); //return EXIT_FAILURE; } std::string temp; for (unsigned int i = 0; i <list_dir.size(); ++i) { for (unsigned int j = 0; j <list_dir.size(); ++j) { if (list_dir[i] < list_dir[j]) { temp = list_dir[j]; list_dir[j] = list_dir[i]; list_dir[i] = temp; } } } for (unsigned int j = 0; j <list_dir.size() ; ++j) { std::string full_dir; full_dir.append(mother); full_dir.append("/"); full_dir.append(list_dir[j]); this->dataMaps.push_back(jsonHandler.jsonToDataMap(full_dir)); } }
40cfbc1cafe6cc750642a15405d8a68daf919585
a8fe43a7b51fd9890a2385288ba0ded949a628a1
/src/Pong.cpp
c59019dff76b968ad86cc23d43f507b6c6844fe5
[]
no_license
flamirande/pong
c8bdc812242e25cdefed563303ae74ac56ac7889
6e36d61675194bdd380230f67e30194e55c30a2b
refs/heads/master
2021-01-10T11:29:53.586216
2016-01-06T19:34:29
2016-01-06T19:34:29
49,156,276
0
0
null
null
null
null
UTF-8
C++
false
false
1,866
cpp
Pong.cpp
#include "Window.h" #include <SDL2/SDL.h> #include <SDL2/SDL_mixer.h> #include <SDL2/SDL_ttf.h> #include <stdexcept> #include <cstring> #include "GameState.h" #include "PongMenu.h" #include <stack> #include <memory> using std::runtime_error; using std::pair; using std::string; //CONSTANTS const int WINDOW_WIDTH = 800; const int WINDOW_HEIGHT = 600; const int FRAMES_PER_SECOND = 60; //GLOBAL VARIABLES Window* gWindow; void init() { //Initialize SDL if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO ) < 0 ) { throw runtime_error( strcat( "SDL could not initialize! SDL error: ", SDL_GetError() ) ); } //Initialize SDL_mixer if ( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 2048 ) < 0 ) { throw runtime_error( strcat( "SDL_mixer could not initialize! SDL_mixer error: ", Mix_GetError() ) ); } //Initialize SDL_ttf if ( TTF_Init() == -1 ) { throw runtime_error( strcat( "SDL_ttf could not initialize! SDL_ttf error: ", TTF_GetError() ) ); } //Create window gWindow = new Window( WINDOW_WIDTH, WINDOW_HEIGHT ); //Set window to fullscreen; //gWindow.fullscreen(true); } void close() { delete gWindow; gWindow = NULL; //Quit SDL_mixer Mix_Quit(); TTF_Quit(); SDL_Quit(); } int main( int argc, char* argv[] ) { init(); StateMachine state_machine; state_machine.push( std::shared_ptr<GameState>( new PongMenu( gWindow, &state_machine ) ) ); long currentTime = SDL_GetTicks(); while( !state_machine.empty() ) { std::shared_ptr<GameState> currentState = state_machine.top(); long deltaTime = SDL_GetTicks() - currentTime; currentTime += deltaTime; currentState->handle_input(); currentState->update( deltaTime ); currentState->draw(); //cap frame rate if ( deltaTime < 1000 / FRAMES_PER_SECOND ) { SDL_Delay( 1000 / FRAMES_PER_SECOND - deltaTime ); } } close(); return 0; }
22597c225327f4c2939492b1447684e123610e2c
a97a53c58ae7eb110eab7aa6fde382eaada4d63d
/GE/HydraulicComponent.cpp
bcdb5af5f5eb097455f8babfe9c4b27ab288f00c
[]
no_license
meintjesbekker/GE
8d7a0f40110fd87a58870d9ce7390cc1f2d05f45
821323f42657763c03d30c4fadd607b758417c8a
refs/heads/master
2021-12-08T10:56:51.533338
2019-08-08T19:39:56
2019-08-08T19:39:56
153,671,097
1
0
null
null
null
null
UTF-8
C++
false
false
24,250
cpp
HydraulicComponent.cpp
/*--------------------------------------------------------------------------*/ /* HydraulicComponent.cpp */ /* */ /* Purpose : Create a Hydraulic Component. */ /* Author : Meintjes Bekker */ /* Date : Copyright (C) 2000 */ /* Project : Groundwater Explorer */ /* Version : 1 */ /* Notes : Thesis, section 5.7 "Hydraulic Components". */ /*--------------------------------------------------------------------------*/ #include "stdafx.h" #include "GE.h" #include "HydraulicComponent.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif /*--------------------------------------------------------------------------*/ /* Construction */ /*--------------------------------------------------------------------------*/ CHydraulicComponent::CHydraulicComponent(CModel* pcModel /* = NULL */) : CHydraulicComponentGUI(pcModel), CGeometry(pcModel), CSidesQuadTopology(pcModel) { CIndexes::m_pcModelInfo = pcModel; m_cHydraulicComponentType = EMPTYHYDRAULICCOMPONENT; m_pcAppendPolyData = NULL; m_pcPolyDataNormals = NULL; } /*--------------------------------------------------------------------------*/ /* Destruction */ /*--------------------------------------------------------------------------*/ CHydraulicComponent::~CHydraulicComponent() { if (m_pcAppendPolyData) m_pcAppendPolyData->Delete(); if (m_pcPolyDataNormals) m_pcPolyDataNormals->Delete(); } /*--------------------------------------------------------------------------*/ /* AppendTimeIndependentPolyData */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::AppendTimeIndependentPolyData(HYDRAULICCOMPONENTTYPE cHydraulicComponentType) { if (m_pcAppendPolyData) m_pcAppendPolyData->Delete(); m_pcAppendPolyData = vtkAppendPolyData::New(); for (int i = 1; i <= m_pcModel->GetNumberOfLayers(); i++) { CreateIBDActiveCellsArray(i); if (m_bAverage) CreateAverageGeometry(i); else CreateNormalGeometry(i); // do for hydraulic component switch (cHydraulicComponentType) { case FIXED_CONCENTRATION: CreateActiveCellsArrayForFixedConcentration(i); break; case FIXED_HEADS: CreateActiveCellsArrayForFixedHeads(i); break; case HORIZONTAL_FLOW_BARRIER: CreateActiveCellsArrayForHorizontalFlowBarrier(i); break; case RESERVOIR: CreateActiveCellsArrayForReservoir(i); break; } // create topology vtkCellArray* pcCellArray = vtkCellArray::New(); if (m_bAverage) { CreateHorizontalTopology(pcCellArray, m_bAverage); CreateHorizontalTopology(pcCellArray, m_bAverage, GetAverageNumberOfLayerPoints()); } else { CreateNormalTopology(pcCellArray, m_bAverage); CreateNormalTopology(pcCellArray, m_bAverage, GetNormalNumberOfLayerPoints()); } CreateSidesTopology(pcCellArray, m_bAverage); vtkPolyData* pcPolyData = vtkPolyData::New(); pcPolyData->SetPoints(GetFloatPoints()); pcPolyData->SetPolys(pcCellArray); m_pcAppendPolyData->AddInputData(pcPolyData); m_pcAppendPolyData->Update(); if (pcCellArray) pcCellArray->Delete(); if (pcPolyData) pcPolyData->Delete(); } ComputePointNormals(); Clip(); } /*--------------------------------------------------------------------------*/ /* AppendTimeDependentPolyData */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::AppendTimeDependentPolyData(HYDRAULICCOMPONENTTYPE cHydraulicComponentType, int iStressPeriod) { if (m_pcAppendPolyData) m_pcAppendPolyData->Delete(); m_pcAppendPolyData = vtkAppendPolyData::New(); for (int i = 1; i <= m_pcModel->GetNumberOfLayers(); i++) { CreateIBDActiveCellsArray(i); if (m_bAverage) CreateAverageGeometry(i); else CreateNormalGeometry(i); // do for hydraulic component switch (cHydraulicComponentType) { case GENERAL_HEAD_BOUNDARY: CreateActiveCellsArrayForGeneralHeadBoundary(i, iStressPeriod); break; case DISCHARGE_WELL: CreateActiveCellsArrayForDischargeWell(i, iStressPeriod); break; case RECHARGE_WELL: CreateActiveCellsArrayForRechargeWell(i, iStressPeriod); break; case DRAIN: CreateActiveCellsArrayForDrain(i, iStressPeriod); break; case RIVER: CreateActiveCellsArrayForRiver(i, iStressPeriod); break; case TIME_VARIANT_SPECIFIED_CONCENTRATION: CreateActiveCellsArrayForTimeVariantSpecifiedConcentration(i, iStressPeriod); break; case TIME_VARIANT_SPECIFIED_HEAD: CreateActiveCellsArrayForTimeVariantSpecifiedHead(i, iStressPeriod); break; } // create topology vtkCellArray* pcCellArray = vtkCellArray::New(); if (m_bAverage) { CreateHorizontalTopology(pcCellArray, m_bAverage); CreateHorizontalTopology(pcCellArray, m_bAverage, GetAverageNumberOfLayerPoints()); } else { CreateHorizontalTopology(pcCellArray, m_bAverage); CreateNormalTopology(pcCellArray, m_bAverage); CreateNormalTopology(pcCellArray, m_bAverage, GetNormalNumberOfLayerPoints()); } CreateSidesTopology(pcCellArray, m_bAverage); vtkPolyData* pcPolyData = vtkPolyData::New(); pcPolyData->SetPoints(GetFloatPoints()); pcPolyData->SetPolys(pcCellArray); m_pcAppendPolyData->AddInputData(pcPolyData); m_pcAppendPolyData->Update(); if (pcCellArray) pcCellArray->Delete(); if (pcPolyData) pcPolyData->Delete(); } ComputePointNormals(); Clip(); } /*--------------------------------------------------------------------------*/ /* CreateFixedHeadCell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateFixedHeadCell() { m_cHydraulicComponentType = FIXED_HEADS; SetDescription(_T("Fixed head cell (IBOUND<0)")); SetVisibility(TRUE); SetColor(RGB(0, 0, 125)); AppendTimeIndependentPolyData(FIXED_HEADS); } /*--------------------------------------------------------------------------*/ /* CreateFixedConcentrationCell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateFixedConcentrationCell() { m_cHydraulicComponentType = FIXED_CONCENTRATION; SetDescription(_T("Fixed concentration cell (ICBOUND<0)")); SetVisibility(TRUE); SetColor(RGB(125, 0, 0)); AppendTimeIndependentPolyData(FIXED_CONCENTRATION); } /*--------------------------------------------------------------------------*/ /* CreateHorizontalFlowBarrier */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateHorizontalFlowBarrier() { m_cHydraulicComponentType = HORIZONTAL_FLOW_BARRIER; SetDescription(_T("Horizontal flow barrier (slurry wall)")); SetVisibility(TRUE); SetColor(RGB(255, 100, 0)); AppendTimeIndependentPolyData(HORIZONTAL_FLOW_BARRIER); } /*--------------------------------------------------------------------------*/ /* CreateReservoir */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateReservoir() { m_cHydraulicComponentType = RESERVOIR; SetDescription(_T("Reservoir")); SetVisibility(TRUE); SetColor(RGB(100, 0, 255)); AppendTimeIndependentPolyData(RESERVOIR); } /*--------------------------------------------------------------------------*/ /* CreateGeneralHeadBoundaryCell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateGeneralHeadBoundaryCell(int iStressPeriod) { m_cHydraulicComponentType = GENERAL_HEAD_BOUNDARY; SetDescription(_T("General-head boundary cell")); SetVisibility(TRUE); SetColor(RGB(125, 125, 125)); AppendTimeDependentPolyData(GENERAL_HEAD_BOUNDARY, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* CreateDischargeWell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateDischargeWell(int iStressPeriod) { m_cHydraulicComponentType = DISCHARGE_WELL; SetDescription(_T("Discharge well")); SetVisibility(TRUE); SetColor(RGB(255, 0, 0)); AppendTimeDependentPolyData(DISCHARGE_WELL, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* CreateRechargeWell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateRechargeWell(int iStressPeriod) { m_cHydraulicComponentType = RECHARGE_WELL; SetDescription(_T("Recharge well")); SetVisibility(TRUE); SetColor(RGB(0, 0, 255)); AppendTimeDependentPolyData(RECHARGE_WELL, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* CreateDrain */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateDrain(int iStressPeriod) { m_cHydraulicComponentType = DRAIN; SetDescription(_T("Drain")); SetVisibility(TRUE); SetColor(RGB(255, 255, 0)); AppendTimeDependentPolyData(DRAIN, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* CreateRiver */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateRiver(int iStressPeriod) { m_cHydraulicComponentType = RIVER; SetDescription(_T("River")); SetVisibility(TRUE); SetColor(RGB(105, 255, 255)); AppendTimeDependentPolyData(RIVER, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* CreateIimeVariantSpecifiedHead */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateTimeVariantSpecifiedHead(int iStressPeriod) { m_cHydraulicComponentType = TIME_VARIANT_SPECIFIED_HEAD; SetDescription(_T("Time-variant specified-head")); SetVisibility(TRUE); SetColor(RGB(100, 255, 100)); AppendTimeDependentPolyData(TIME_VARIANT_SPECIFIED_HEAD, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* CreateTimeVariantSpecifiedConcentration */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateTimeVariantSpecifiedConcentration(int iStressPeriod) { m_cHydraulicComponentType = TIME_VARIANT_SPECIFIED_CONCENTRATION; SetDescription(_T("Drain")); SetVisibility(TRUE); SetColor(RGB(255, 255, 0)); AppendTimeDependentPolyData(TIME_VARIANT_SPECIFIED_CONCENTRATION, iStressPeriod); } /*--------------------------------------------------------------------------*/ /* UpdateTimeIndependentHydraulicComponent */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::UpdateTimeIndependentHydraulicComponent() { SetVisibility(m_bVisible); SetColor(m_cColor); switch (GetHydraulicComponentType()) { case FIXED_CONCENTRATION: AppendTimeIndependentPolyData(FIXED_CONCENTRATION); break; case FIXED_HEADS: AppendTimeIndependentPolyData(FIXED_HEADS); break; case HORIZONTAL_FLOW_BARRIER: AppendTimeIndependentPolyData(HORIZONTAL_FLOW_BARRIER); break; case RESERVOIR: AppendTimeIndependentPolyData(RESERVOIR); break; } } /*--------------------------------------------------------------------------*/ /* UpdateTimeDependentHydraulicComponent */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::UpdateTimeDependentHydraulicComponent(int iStressPeriod) { SetVisibility(m_bVisible); SetColor(m_cColor); switch (GetHydraulicComponentType()) { case GENERAL_HEAD_BOUNDARY: AppendTimeDependentPolyData(GENERAL_HEAD_BOUNDARY, iStressPeriod); break; case DISCHARGE_WELL: AppendTimeDependentPolyData(DISCHARGE_WELL, iStressPeriod); break; case RECHARGE_WELL: AppendTimeDependentPolyData(RECHARGE_WELL, iStressPeriod); break; case DRAIN: AppendTimeDependentPolyData(DRAIN, iStressPeriod); break; case RIVER: AppendTimeDependentPolyData(RIVER, iStressPeriod); break; case TIME_VARIANT_SPECIFIED_HEAD: AppendTimeDependentPolyData(TIME_VARIANT_SPECIFIED_HEAD, iStressPeriod); break; case TIME_VARIANT_SPECIFIED_CONCENTRATION: AppendTimeDependentPolyData(TIME_VARIANT_SPECIFIED_CONCENTRATION, iStressPeriod); break; } } /*--------------------------------------------------------------------------*/ /* ComputePointNormals */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::ComputePointNormals() { // files can exist, but can be without data if (m_pcAppendPolyData->GetOutput()->GetNumberOfPolys() > 0 || m_pcAppendPolyData->GetOutput()->GetNumberOfStrips() > 0) { if (m_pcPolyDataNormals) m_pcPolyDataNormals->Delete(); m_pcPolyDataNormals = vtkPolyDataNormals::New(); m_pcPolyDataNormals->SetInputData(m_pcAppendPolyData->GetOutput()); } } /*--------------------------------------------------------------------------*/ /* Clip */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::Clip() { if (m_pcAppendPolyData->GetOutput()->GetNumberOfPolys() > 0 || m_pcAppendPolyData->GetOutput()->GetNumberOfStrips() > 0) DoClipPolyData(m_pcPolyDataNormals->GetOutputPort()); else DoClipPolyData(m_pcAppendPolyData->GetOutputPort()); CreateMapper(); CreateLODActor(m_pcPolyDataMapper, m_bVisible, 1, m_cColor); } /*--------------------------------------------------------------------------*/ /* UpdateActor */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::UpdateActor() { UpdateLODActor(m_bVisible, m_cColor); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArray */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArray(CString sFileExtension, int iLayer, BOOL (CHydraulicComponent::*pFunc)(float*, int, int)) { // read CBC data for IBOUND (modflow) float* array = new float[m_pcModel->GetNumberOfRows() * m_pcModel->GetNumberOfColumns()]; m_cReadFile.ReadTimeIndependentData( m_pcModel->GetFolderAndFileName().SpanExcluding(".") + "." + sFileExtension, array, m_pcModel->GetNumberOfRows(), m_pcModel->GetNumberOfColumns(), iLayer); m_bActiveCellsArray.RemoveAll(); m_bActiveCellsArray.SetSize(m_pcModel->GetNumberOfRows() * m_pcModel->GetNumberOfColumns(), 1); CreateIBDActiveCellsArray(iLayer); for (int i = 0; i < m_pcModel->GetNumberOfRows(); i++) for (int j = 0; j < m_pcModel->GetNumberOfColumns(); j++) // TRUE for active FALSE for inactive m_bActiveCellsArray[i * m_pcModel->GetNumberOfColumns() + j] = (this->*pFunc)(array, i, j); delete [] array; } /*--------------------------------------------------------------------------*/ /* CreateTimeDependentActiveCellsArray */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateTimeDependentActiveCellsArray(CString sFileExtension, int iLayer, int iStressPeriod, BOOL (CHydraulicComponent::*pFunc)(float*, int, int)) { // read CBC data for IBOUND (modflow) float* array = new float[m_pcModel->GetNumberOfRows() * m_pcModel->GetNumberOfColumns()]; m_cReadFile.ReadTimeDependentData( m_pcModel->GetFolderAndFileName().SpanExcluding(".") + "." + sFileExtension, iStressPeriod, array, m_pcModel->GetNumberOfRows(), m_pcModel->GetNumberOfColumns(), m_pcModel->GetNumberOfLayers(), iLayer); m_bActiveCellsArray.RemoveAll(); m_bActiveCellsArray.SetSize(m_pcModel->GetNumberOfRows() * m_pcModel->GetNumberOfColumns(), 1); CreateIBDActiveCellsArray(iLayer); for (int i = 0; i < m_pcModel->GetNumberOfRows(); i++) for (int j = 0; j < m_pcModel->GetNumberOfColumns(); j++) // TRUE for active FALSE for inactive m_bActiveCellsArray[i * m_pcModel->GetNumberOfColumns() + j] = (this->*pFunc)(array, i, j); delete [] array; } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForFixedHeads */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForFixedHeads(int iLayer) { CreateActiveCellsArray("ibd", iLayer, &CHydraulicComponent::TestIfActiveCellSmaller); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForFixedConcentration */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForFixedConcentration(int iLayer) { CreateActiveCellsArray("tic", iLayer, &CHydraulicComponent::TestIfActiveCellSmaller); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForHorizontalFlowBarrier */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForHorizontalFlowBarrier(int iLayer) { CreateActiveCellsArray("wac", iLayer, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForReservoir */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForReservoir(int iLayer) { CreateActiveCellsArray("c85", iLayer, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForGeneralHeadBoundary */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForGeneralHeadBoundary(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("ghc", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForDischargeWell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForDischargeWell(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("wel", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellSmaller); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForRechargeWell */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForRechargeWell(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("wel", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForDrain */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForDrain(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("drc", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForRiver */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForRiver(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("ric", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForTimeVariantSpecifiedHead */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForTimeVariantSpecifiedHead(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("ch1", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellNotEqual); } /*--------------------------------------------------------------------------*/ /* CreateActiveCellsArrayForTimeVariantSpecifiedConcentration */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateActiveCellsArrayForTimeVariantSpecifiedConcentration(int iLayer, int iStressPeriod) { CreateTimeDependentActiveCellsArray("c55", iLayer, iStressPeriod, &CHydraulicComponent::TestIfActiveCellGreater); } /*--------------------------------------------------------------------------*/ /* TestIfActiveCellSmaller */ /*--------------------------------------------------------------------------*/ BOOL CHydraulicComponent::TestIfActiveCellSmaller(float* pfArray, int iRowIndex, int iColumnIndex) { return (pfArray[iRowIndex * m_pcModel->GetNumberOfColumns() + iColumnIndex] < 0 && m_bActiveCellsArray[iRowIndex * m_pcModel->GetNumberOfColumns() + iColumnIndex]); } /*--------------------------------------------------------------------------*/ /* TestIfActiveCellNotEqual */ /*--------------------------------------------------------------------------*/ BOOL CHydraulicComponent::TestIfActiveCellNotEqual(float* pfArray, int iRowIndex, int iColumnIndex) { return (pfArray[iRowIndex * m_pcModel->GetNumberOfColumns() + iColumnIndex] != 0 && m_bActiveCellsArray[iRowIndex * m_pcModel->GetNumberOfColumns() + iColumnIndex]); } /*--------------------------------------------------------------------------*/ /* TestIfActiveCellGreater */ /*--------------------------------------------------------------------------*/ BOOL CHydraulicComponent::TestIfActiveCellGreater(float* pfArray, int iRowIndex, int iColumnIndex) { return (pfArray[iRowIndex * m_pcModel->GetNumberOfColumns() + iColumnIndex] > 0 && m_bActiveCellsArray[iRowIndex * m_pcModel->GetNumberOfColumns() + iColumnIndex]); } /*--------------------------------------------------------------------------*/ /* CreateMapper */ /*--------------------------------------------------------------------------*/ void CHydraulicComponent::CreateMapper() { if (m_pcModel->GetClip()) CMapper::CreateMapper(m_pcClipPolyData->GetOutputPort()); else if (m_pcAppendPolyData->GetOutput()->GetNumberOfPolys() > 0 || m_pcAppendPolyData->GetOutput()->GetNumberOfStrips() > 0) CMapper::CreateMapper(m_pcPolyDataNormals->GetOutputPort()); else CMapper::CreateMapper(m_pcAppendPolyData->GetOutputPort()); }
55aa325b1e51a02edb98be65a0081257c62686eb
850f29a18fe86b5a16ce9407f9cd90757356b6ad
/LeetcodeSolution/653_TwoSumIV.cpp
7a916aa43748676bd965776cede2082aff6c58c7
[]
no_license
traviszeng/AlgorithmDatastructureByCPLUSPLUS
e960fb0971bf7ffcb9c3a32ab71c8b7b2eed040d
8a5001127c2bdab809ad4db20547bd36e68f0731
refs/heads/master
2020-03-31T20:00:19.440845
2019-08-14T08:42:17
2019-08-14T08:42:17
152,520,975
0
0
null
null
null
null
UTF-8
C++
false
false
1,264
cpp
653_TwoSumIV.cpp
/** * Definition for a binary tree node. */ #include<iostream> #include<map> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void traversal(TreeNode* root, map<int, int> &bmap); bool findTarget(TreeNode* root, int k) { map<int, int> BSTmap; traversal(root, BSTmap); map<int, int>::iterator iter; for (iter = BSTmap.begin(); iter != BSTmap.end(); iter++) { if (BSTmap.size() < 2) return false; if (BSTmap.find(k - iter->first) != BSTmap.end()&&k!=(iter->first*2)) return true; } return false; } void traversal(TreeNode* root, map<int, int> &bmap) { if (root == NULL) return; bmap[root->val] = root->val; traversal(root->left,bmap); traversal(root->right,bmap); } bool findTarget2(TreeNode* root, int k) { map<int, int> m; return helper(root, k, m); } bool helper(TreeNode* &root, int k, map<int, int>& m) { if (!root) return false; if (m.find(k - root->val)->second > 0) return true; m.insert(pair<int, int>(root->val, 1)); return helper(root->left, k, m) || helper(root->right, k, m); } int main() { TreeNode *node = new TreeNode(2); node->right = new TreeNode(3); cout<<findTarget(node, 6); system("pause"); }
bbad2e68ce4b8f14cc344600a03e13e1a17d21b4
72a2ff629299b693685b5ef7972d16fcc47b428a
/Connector.cpp
f94da4e6b9f89212594784f7bac11ea00b107037
[]
no_license
ahmedabdalmageed95/OOP-flowchart-simulator
0250ad542f2fdf4847f0fae3880f3c1acc154823
201b3b7e8f3a046d0bab38c4b524a777f43548fd
refs/heads/master
2021-01-19T01:12:44.051888
2017-06-28T02:26:44
2017-06-28T02:26:44
95,619,015
1
0
null
null
null
null
UTF-8
C++
false
false
6,091
cpp
Connector.cpp
#include "Connector.h" #include "..\ApplicationManager.h" #include "Statement.h" #include "SmplAssign.h" #include "VarAssign.h" #include "SnglOpAssign.h" #include "Conditional.h" #include "Read.h" #include "Write.h" #include "Start.h" #include "End.h" Connector::Connector(Statement* Src, Statement* Dst, ApplicationManager* pAppManager, bool Cond) //When a connector is created, it must have a source statement and a destination statement //There are no free connectors in the folwchart { SrcStat = Src; DstStat = Dst; pManager=pAppManager; CondValue=NULL; if(SrcStat->GetType()==COND) { CondValue=new bool; *CondValue=Cond; } } Connector::Connector(const Connector& Conn) { if(Conn.SrcStat->GetType()==SMPL_ASSIGN) SrcStat=new SmplAssign(*(SmplAssign*)Conn.SrcStat); if(Conn.SrcStat->GetType()==VAR_ASSIGN) SrcStat=new VarAssign(*(VarAssign*)Conn.SrcStat); if(Conn.SrcStat->GetType()==SNGL_OP_ASSIGN) SrcStat=new SnglOpAssign(*(SnglOpAssign*)Conn.SrcStat); if(Conn.SrcStat->GetType()==COND) SrcStat=new Conditional(*(Conditional*)Conn.SrcStat); if(Conn.SrcStat->GetType()==READ) SrcStat=new Read(*(Read*)Conn.SrcStat); if(Conn.SrcStat->GetType()==WRITE) SrcStat=new Write(*(Write*)Conn.SrcStat); if(Conn.SrcStat->GetType()==START) SrcStat=new Start(*(Start*)Conn.SrcStat); if(Conn.DstStat->GetType()==SMPL_ASSIGN) DstStat=new SmplAssign(*(SmplAssign*)Conn.DstStat); if(Conn.DstStat->GetType()==VAR_ASSIGN) DstStat=new VarAssign(*(VarAssign*)Conn.DstStat); if(Conn.DstStat->GetType()==SNGL_OP_ASSIGN) DstStat=new SnglOpAssign(*(SnglOpAssign*)Conn.DstStat); if(Conn.DstStat->GetType()==COND) DstStat=new Conditional(*(Conditional*)Conn.DstStat); if(Conn.DstStat->GetType()==READ) DstStat=new Read(*(Read*)Conn.DstStat); if(Conn.DstStat->GetType()==WRITE) DstStat=new Write(*(Write*)Conn.DstStat); if(Conn.DstStat->GetType()==END) DstStat=new End(*(End*)Conn.DstStat); start=Conn.start; end=Conn.end; pManager=Conn.pManager; CondValue=new bool; if(Conn.CondValue!=NULL) *CondValue=*Conn.CondValue; } Connector::~Connector() { if(SrcStat->GetType()==COND) delete CondValue; } void Connector::setSrcStat(Statement *Src) { SrcStat = Src; } Statement* Connector::getSrcStat() { return SrcStat; } void Connector::setDstStat(Statement *Dst) { DstStat = Dst; } Statement* Connector::getDstStat() { return DstStat; } void Connector::setCondValue(bool Cond) { if(CondValue==NULL) CondValue=new bool; *CondValue=Cond; } bool* Connector::getCondValue() {return CondValue;} void Connector::setStartPoint(Point P) { start = P; } Point Connector::getStartPoint() { return start; } void Connector::setEndPoint(Point P) { end = P; } Point Connector::getEndPoint() { return end; } void Connector::Draw(Output* pOut) { if (dynamic_cast <SmplAssign*>(SrcStat)) { start=dynamic_cast <SmplAssign*>(SrcStat)->GetOutlet(); } else{ if (dynamic_cast <SnglOpAssign*>(SrcStat)) { start=dynamic_cast <SnglOpAssign*>(SrcStat)->GetOutlet(); } else{ if (dynamic_cast <VarAssign*>(SrcStat)) { start=dynamic_cast <VarAssign*>(SrcStat)->GetOutlet(); } else{ if (dynamic_cast <Start*>(SrcStat)) { start=dynamic_cast <Start*>(SrcStat)->GetOutlet(); } else{ if (dynamic_cast <Read*>(SrcStat)) { start=dynamic_cast <Read*>(SrcStat)->GetOutlet(); } else{ if (dynamic_cast <Write*>(SrcStat)) { start=dynamic_cast <Write*>(SrcStat)->GetOutlet(); } else{ if (dynamic_cast <Conditional*>(SrcStat)) { if(*CondValue==true) start=dynamic_cast <Conditional*>(SrcStat)->getYesOutlet(); else start=dynamic_cast <Conditional*>(SrcStat)->getNoOutlet(); } } } } } } } if (dynamic_cast <SmplAssign*>(DstStat)) { end=dynamic_cast <SmplAssign*>(DstStat)->GetInlet(); } else{ if (dynamic_cast <SnglOpAssign*>(DstStat)) { end=dynamic_cast <SnglOpAssign*>(DstStat)->GetInlet(); } else{ if (dynamic_cast <VarAssign*>(DstStat)) { end=dynamic_cast <VarAssign*>(DstStat)->GetInlet(); } else{ if (dynamic_cast <End*>(DstStat)) { end=dynamic_cast <End*>(DstStat)->GetInlet(); } else{ if (dynamic_cast <Read*>(DstStat)) { end=dynamic_cast <Read*>(DstStat)->GetInlet(); } else{ if (dynamic_cast <Write*>(DstStat)) { end=dynamic_cast <Write*>(DstStat)->GetInlet(); } else{ if (dynamic_cast <Conditional*>(DstStat)) { end=dynamic_cast <Conditional*>(DstStat)->GetInlet(); } } } } } } } pOut->DrawConnector(start,end); } void Connector::Save(ofstream &OutFile) { OutFile<<SrcStat->getID()<<"\t"<<DstStat->getID()<<"\t"; if (SrcStat->GetType()==COND) { if(*CondValue==true) OutFile<<"1"; else OutFile<<"2"; } else OutFile<<"0"; OutFile<<"\n"; } void Connector::Load(ifstream &Infile) { string str; getline(Infile,str); str+='\0'; int LeftLimit,RightLimit=-1; string ConnInfo[3],tempstring; for(int i=0;i<3;i++) { tempstring=""; LeftLimit=RightLimit; for(int j=LeftLimit+1;1;j++) { if(str[j]=='\t'||str[j]=='\0') { RightLimit=j; break; } } for(int j=LeftLimit+1;j<RightLimit;j++) tempstring+=str[j]; ConnInfo[i]=tempstring; } int SrcID=(int) round(stod(ConnInfo[0])),DstID=(int) round(stod(ConnInfo[1])),Cond=(int) round(stod(ConnInfo[2])); if(Cond==1) { if(CondValue==NULL) CondValue=new bool; *CondValue=true; } else if(Cond==2) { if(CondValue==NULL) CondValue=new bool; *CondValue=false; } for(int i=0;i<pManager->GetStatCount();i++) { if(pManager->GetStatList()[i]->getID()==SrcID) { SrcStat=pManager->GetStatList()[i]; SrcStat->setpConn(this); break; } } for(int i=0;i<pManager->GetStatCount();i++) { if(pManager->GetStatList()[i]->getID()==DstID) { DstStat=pManager->GetStatList()[i]; break; } } }
f2b711d57c4954e9258cf2eadd6e0db3a5ec47b6
7af8a7aaf7f3eddd32530a46b739fabf117b2994
/.vscode/cquery_cached_index/c@@9181-w-okapi/src@autonomous.cpp
42f48a449000c954af7b29c1fb2d6264c479e42c
[]
no_license
9181-W/9181-W-Okapi
d5acc353e73cb8c490ef35a727ae7402871bb239
e8fc091ed9d94db7cbb49331e56fa6add36f2e9c
refs/heads/master
2020-08-14T16:25:12.521952
2020-02-29T06:37:27
2020-02-29T06:37:27
215,195,657
0
0
null
null
null
null
UTF-8
C++
false
false
507
cpp
src@autonomous.cpp
#include "utils.h" #include "autos.h" #include "main.h" #include "okapi/api.hpp" using namespace okapi; void autonomous() { pros::lcd::print(0, "autonomous"); double start_time = pros::c::millis(); init_auto(); //blue_back_port_5(); //red_back_port_4(); //testing_new(); testing(); //testing_nine_diff_stack(start_time); //blue_front_port_2(); //new_blue_back_port_5(); double end_time = pros::c::millis(); pros::lcd::print(6,"autonomous Time %f", end_time - start_time); }
3791e8dc04bc13ab4bbe2422bcc79d30ac4aefe3
c831157ef0c65c429cae70dfa5ad06df0ce2bd96
/lab4/algo.cpp
72a6f84db17de221e7d0c9f25eaf9b89f0cb0b6a
[]
no_license
sergiovasquez122/CECS-328
8071cbbe61728b8c0a2afa6e9bfdeb7d9dda3993
276af9abe8434d8f34c493bbde922c585076d47a
refs/heads/master
2023-02-03T16:05:36.070938
2020-12-21T05:45:58
2020-12-21T05:45:58
288,507,720
0
0
null
null
null
null
UTF-8
C++
false
false
389
cpp
algo.cpp
// O(n) void k_closest_to_median(vector<int>& arr, int k){ double median = median_selection(arr); // O(n) vector<my_pair> diff; // O(n) for(int e : arr){ diff.push_back({abs(e - median), e}); } // O(n) int kth_idx = quick_select_idx(diff, k); //O(n) for(int i = kth_idx; i >= 0;i--){ cout << diff[i].y << " "; } cout << endl; }
ae328be9852266e3e77fbe33a9d3897ba00027c6
4a87f5e7372f7d0312f8e08ac58274cd500008bd
/trees/binaryTreeToDLL.cc
c0656edcc0e2e5439720848f0dac3f05b0c6d055
[]
no_license
mahimahans111/cpp_codes
b025c214ab3ce6a8c34bf0e23384edb74afb1818
fe6f88aca79cb8366107f3dcd08cff7f532c2242
refs/heads/master
2021-06-28T07:48:35.400033
2020-10-31T17:34:12
2020-10-31T17:34:12
211,819,858
1
4
null
2021-02-02T13:15:02
2019-09-30T09:05:21
C++
UTF-8
C++
false
false
3,858
cc
binaryTreeToDLL.cc
#include<iostream> #include<vector> #include<bits/stdc++.h> using namespace std; // TreeNode class for a node of a Binary Search Tree class TreeNode { public: int val; TreeNode* left; TreeNode* right; TreeNode(int x) { val = x; left = NULL; right = NULL; } }; class BinaryTree { public: TreeNode* head; //This is a functional problem. Write your code here. pair<TreeNode*, TreeNode*> helper(TreeNode* root){ if(root == NULL){ TreeNode*l = NULL; TreeNode*r = NULL; return pair<TreeNode*, TreeNode*>(l, r); } else if(root->left && root->right){ pair<TreeNode*, TreeNode*> lp = helper(root->left); pair<TreeNode*, TreeNode*> rp = helper(root->right); lp.second->right = root; root->left = lp.second; root->right = rp.first; rp.first->left = root; return pair<TreeNode*, TreeNode*>(lp.first, rp.second); } else if(root->left){ pair<TreeNode*, TreeNode*> lp = helper(root->left); lp.second->right = root; root->left = lp.second; root->right = NULL; return pair<TreeNode*, TreeNode*>(lp.first, root); } else if(root->right){ pair<TreeNode*, TreeNode*> rp = helper(root->right); root->right = rp.first; rp.first->left = root; root->left = NULL; return pair<TreeNode*, TreeNode*>(root, rp.second); } else if(root && !root->left && !root->right){ TreeNode*l = root; TreeNode*r = root; return pair<TreeNode*, TreeNode*>(l, r); } } TreeNode* BT2DLL(TreeNode* root) { // Write your code here...... pair<TreeNode*, TreeNode*> ans = helper(root); return ans.first; } // Don't make any changes here void printList(TreeNode* head) { TreeNode* prev = head; while (head != NULL) { cout<<head->val<<" "; prev = head; head = head->right; } cout<<endl; while (prev != NULL) { cout<<prev->val<<" "; prev = prev->left; } } // Don't make any changes here void inOrder(TreeNode* node) { if (node == NULL) { return; } inOrder(node->left); cout<<node->val<<" "; inOrder(node->right); } }; //Don't change code of utility function. TreeNode* stringToTreeNode(string input) { int first = input.find_first_not_of(' '); int last = input.find_last_not_of(' '); input = input.substr(first, (last - first + 1)); if (!input.size()) { return nullptr; } string item; stringstream ss; ss.str(input); getline(ss, item, ' '); TreeNode* root = new TreeNode(stoi(item)); queue<TreeNode*> nodeQueue; nodeQueue.push(root); while (true) { TreeNode* node = nodeQueue.front(); nodeQueue.pop(); if (!getline(ss, item, ' ')) { break; } if (item != "null") { int leftNumber = stoi(item); node->left = new TreeNode(leftNumber); nodeQueue.push(node->left); } if (!getline(ss, item, ' ')) { break; } if (item != "null") { int rightNumber = stoi(item); node->right = new TreeNode(rightNumber); nodeQueue.push(node->right); } } return root; } int main(int argc, char** argv){ string line; getline(cin, line); TreeNode* root = stringToTreeNode(line); BinaryTree bt; TreeNode* newRoot = bt.BT2DLL(root); bt.printList(newRoot); }
eeabb6005151607ad56de7a6de81586e3dd61166
ba002c05550015c691249b117e23511fff6b07be
/parserClasses.cpp
10670c08f8f08b10112aec2281bbf23f70a81c64
[]
no_license
cha100/Assignment-3
fd97671cb57755c8d5e5831e8bcfa3f282a8c0f1
83d8955d66b160fc451bea3a963198fd61b4acb1
refs/heads/master
2020-05-17T03:51:01.987640
2014-11-11T03:04:30
2014-11-11T03:04:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,931
cpp
parserClasses.cpp
//Code by : Jesse Kazemir //Student ID : 301227704 //SFU email : jkazemir@sfu.ca //Last edited: Oct. 29, 2014 //Use only the following libraries: #include "parserClasses.h" #include <string> //Complete the implementation of the following member functions: //****TokenList class function definitions****** //Creates a new token for the string input, str //Appends this new token to the TokenList //On return from the function, it will be the last token in the list void TokenList::append(const string &str) { //Create new node Token *newToken = new Token; newToken->stringRep = str; //Append token append(newToken); return; } //Appends the token to the TokenList if not null //On return from the function, it will be the last token in the list void TokenList::append(Token *token) { //Return if token is null if (token == NULL) { return; } //Reassign Pointers token->prev = tail; token->next = NULL; if (tail != NULL) { //If the list has at least one element tail->next = token; } else { //In this case TokenList is empty, so the last element is also the first head = token; } tail = token; setTokenClass(token); return; } //Removes the token from the linked list if it is not null //Deletes the token //On return from function, head, tail and the prev and next Tokens (in relation to the provided token) may be modified. void TokenList::deleteToken(Token *token) { //Return if null if (token == NULL) { return; } //Reassign pointers Token *prevToken = token->prev; Token *nextToken = token->next; if (prevToken != NULL) { prevToken->next = nextToken; } if (nextToken != NULL) { nextToken->prev = prevToken; } //Reassign Head/Tail if (token == head) { head = nextToken; } if (token == tail) { tail = prevToken; } //Delete token delete token; return; } //**************************************************// // DEFINE THIS // //**************************************************// //Input: a pointer to a token //Output: it won't return anything, but within function, it should set the token class (i.e. token->stringType) //Note: one can invoke this function before adding token to the token list void TokenList::setTokenClass(Token *token) { string temp = token->getStringRep(); char t = temp[0]; if(ensc251::isKeyword(temp)) { token->setStringType(ensc251::T_Keyword); } else if(ensc251::isBooleanValue(temp)) { token->setStringType(ensc251::T_Boolean); } else if(ensc251::isIntegerLiteral(temp)) { token->setStringType(ensc251::T_IntegerLiteral); } else if(ensc251::isFloatLiteral(temp)) { token->setStringType(ensc251::T_FloatLiteral); } else if(ensc251::isStringLiteral(temp)) { token->setStringType(ensc251::T_StringLiteral); } else if(ensc251::isIdentifier(temp)) { token->setStringType(ensc251::T_Identifier); } else if(ensc251::isOperator(temp)) { token->setStringType(ensc251::T_Operator); } else if(ensc251::isPunctuator(t)) { token->setStringType(ensc251::T_Punctuator); } else { token->setStringType(ensc251::T_Unknown); } } //****Tokenizer class function definitions****** //Computes a new tokenLength for the next token //Modifies: size_t tokenLength, and bool complete //(Optionally): may modify offset //Does NOT modify any other member variable of Tokenizer void Tokenizer::prepareNextToken() { //************************// // Initialize // //************************// //Remove any white space (tab or space) as long as the current token is not a comment if (!processingBlockComment && !processingInlineComment) { removeWhite(); } //Check for end of line if (str->length() <= offset) { complete = true; // Line is complete tokenLength = 0; // No more tokens on this line offset = 0; //Reset offset return; // tokenLength and offset are already as desired } char c1 = str->at(offset); //This is the character currently being compared, gets iterated through the string //******************************// // Check State Conditions // //******************************// if (processingIncludeStatement) { processIncludeStatement(); // Updates tokenlength and offset return; } else if (processingInlineComment) { processInlineComment(); // Updates tokenlength and offset return; } else if (processingBlockComment) { processBlockComment(); // Updates tokenlength and offset return; } //****************************************// // Check Triple Character Operators // //****************************************// string tripleOperators = ">>=@<<="; // This string is a list of all triple-character operators, separated by @ symbols. @ symbols // are not used in C++ so they should be a safe separator. This string can now be searched for // a match with any three characters. If the search returns successfully, the three characters // are a triple-character operator. char c2,c3 = '@'; // If c2 or c3 stays as '@' then it is clear they were never set to a character // in str. This way the code will not test c2 or c3 unless it is not '@' if (str->length() > offset+2) //Make sure there is a second and third character to check (not end of string) { //Create c2 and c3 in order to compare triple-character operators c2 = str->at(offset+1); c3 = str->at(offset+2); //Create a tree-character string to search tripleOperators with string tripleChar = ""; tripleChar = tripleChar + c1 + c2 + c3; //Check for triple operators if (tripleOperators.find(tripleChar) != -1) { //The current token is a triple operator tokenLength = 3; offset += 3; return; } } //****************************************// // Check Double Character Operators // //****************************************// string doubleOperators = "==@!=@<=@>=@+=@-=@*=@/=@%=@&=@|=@^=@&&@||@*/@++@--@<<@>>@::@?:@->"; // This string is a list of all double-character operators (other than // and /*), separated by // @ symbols. @ symbols are not used in C++ so they should be a safe separator. This string // can now be searched for a match with any two characters. If the search returns successfully, // the two characters are a double-character operator. // and /* are not incuded, as they have // to update the state. if (str->length() > offset+1) //Make sure there is a second character to check (not end of string) { //Create c2 in order to compare double-character operators c2 = str->at(offset+1); //Create a two-character string to search doubleOperators with string doubleChar = ""; doubleChar = doubleChar + c1 + c2; //Check for double operators if (doubleOperators.find(doubleChar) != -1) { //The current token is a double operator tokenLength = 2; offset += 2; return; } //Check for comments (// or /*) else if (c1 == '/') { if (c2 == '/') { processingInlineComment = true; tokenLength = 2; offset += 2; return; } else if (c2 == '*') { processingBlockComment = true; tokenLength = 2; offset += 2; return; } } } //****************************************// // Check Single Character Operators // //****************************************// string singleOperators = "+-*/%()[]{}<>=~^!:;,&|?"; // This string is a list of all single-character operators (other than # . ' or "). // This string can now be searched for a match with any single character. // If the search returns successfully, the character is a single operator. // # . and " are not included, as they are special cases. // Note: '-' is included, as this case is only checking the BEGINNING of a token, // and when '-' is at the beginning of a token it is ALWAYS a single-character token. if (singleOperators.find(c1) != -1) { //c1 is a single operator tokenLength = 1; offset++; return; } else if (c1 == '#') { processingIncludeStatement = true; tokenLength = 1; offset++; return; } else if (c1 == '.') { if (c2 != '@' && !isdigit(c2)) { // The character after the '.' is not a number, therefore // the '.' is a dot operator and is a single character token tokenLength = 1; offset++; return; } // Else the character after the '.' is a number, therefore // the '.' is a decimal and processed later } else if (c1 == '"') { processString(); // Updates tokenlength and offset return; } else if (c1 == '\'') { processChar(); // Updates tokenlength and offset return; } //************************// // General Case // //************************// // For tokens such as: // int (type) // while (keyword) // myint (variable name) // myfunction (function name) // 72 (literal) // 6.2 (literal with decimal) // 5e-5 (literal in scientific notation) proccessGeneral(); // Sets offset and tokenLength return; } //Sets the current string to be tokenized //Resets all Tokenizer state variables //Calls Tokenizer::prepareNextToken() as the last statement before returning. void Tokenizer::setString(string *str) { //Set new string this->str = str; //Reset state variables processingInlineComment = false; processingIncludeStatement = false; complete = false; offset = 0; tokenLength = 0; //Note: processingBlockComment is purposefully unchanged prepareNextToken(); //Sets tokenLength return; } //Returns the next token. Hint: consider the substr function //Updates the tokenizer state //Updates offset, resets tokenLength, updates processingABC member variables //Calls Tokenizer::prepareNextToken() as the last statement before returning. string Tokenizer::getNextToken() { string nextToken; nextToken = str->substr(offset-tokenLength, tokenLength); //Gets token based on known offset and tokenLength tokenLength = 0; // Reset tokenLength prepareNextToken(); return nextToken; }
b24fb7870397d950fc03990890547f986e51c516
481ae6d14e8e4eeb82f6681f120b9d0eca790997
/Game Engine/src/window.cpp
72dccc8299c38ccf5dcc13f632094e84d4f439d8
[]
no_license
himizu0/Game-Engine
739fb3d3646cfffa8683171230138f42114f45e0
bf3c0c69a70da99bfff58ab400061166195968ec
refs/heads/master
2020-04-04T15:42:59.174352
2018-11-04T04:24:12
2018-11-04T04:24:12
156,049,310
0
0
null
null
null
null
UTF-8
C++
false
false
1,903
cpp
window.cpp
#include <iostream> #include "window.h" #include "math/math.h" namespace engine { bool Window::m_keys[MAX_KEYS]; bool Window::m_buttons[MAX_BUTTONS]; double Window::m_mouseX, Window::m_mouseY; double Window::m_mouseDeltaX, Window::m_mouseDeltaY; Window::Window(int width, int height, const char* title) { if (!glfwInit()) { printf("[GLFW Error] Failed to initialize GLFW\n"); return; } m_window = glfwCreateWindow(width, height, title, nullptr, nullptr); if (m_window == nullptr) { printf("[GLFW Error] Failed to create GLFW window\n"); glfwTerminate(); return; } glfwMakeContextCurrent(m_window); glfwSetKeyCallback(m_window, keyCallback); glfwSetMouseButtonCallback(m_window, mouseButtonCallback); glfwSetCursorPosCallback(m_window, cursorPosCallback); glfwSetInputMode(m_window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); glfwSwapInterval(0); glfwWindowHint(GLFW_SAMPLES, 4); } Window::~Window() { glfwDestroyWindow(m_window); glfwTerminate(); } void Window::keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) { m_keys[key] = action != GLFW_RELEASE; } void Window::mouseButtonCallback(GLFWwindow* window, int button, int action, int mods) { m_buttons[button] = action != GLFW_RELEASE; } void Window::cursorPosCallback(GLFWwindow* window, double xpos, double ypos) { m_mouseDeltaX = xpos - m_mouseX; m_mouseDeltaY = ypos - m_mouseY; m_mouseX = xpos; m_mouseY = ypos; } void Window::close() const { glfwSetWindowShouldClose(m_window, true); } void Window::update() const { m_mouseDeltaX = 0; m_mouseDeltaY = 0; glfwSwapBuffers(m_window); glfwPollEvents(); } const math::vec2& Window::getMousePos() const { return { (float) m_mouseX, (float) m_mouseY }; } const math::vec2& Window::getMousePositionChange() const { return { (float)m_mouseDeltaX, (float) m_mouseDeltaY }; } }
964b683e22d569f5cfbd20a1d4f5a76f25adf855
4b83242b4ccc47585f118bd2b16a7361f8e96098
/SFML2/Bullet.cpp
0dbc1c21853e22cb69d619994aa4570817687771
[]
no_license
emaha/SFML2
cb6e27f902f5637fd014c40b18068ec326938040
241fd1a74e9ce3240e1161a2f4f8fdfa774b51e7
refs/heads/master
2021-01-22T08:13:25.286030
2017-01-04T17:09:04
2017-01-04T17:09:04
47,815,491
0
0
null
null
null
null
UTF-8
C++
false
false
1,374
cpp
Bullet.cpp
#include "Bullet.h" #include <SFML/Graphics.hpp> #include <iostream> #include "Player.h" using namespace std; Bullet::Bullet() { } Bullet::Bullet(int id, Vector2f position, Vector2f velocity) { init(id, position, velocity); } Bullet::~Bullet() { } void Bullet::init(int id, Vector2f position, Vector2f velocity) { this->position = position; this->velocity = velocity; this->id = id; sprite.setTextureRect(IntRect(0, 0, 20, 20)); _isAlive = true; line[0] = Vertex(position - Player::getInstance()->viewportOffset); line[1] = Vertex(position - Player::getInstance()->viewportOffset - velocity*5.0f); shape.setRadius(3); shape.setFillColor(Color::Green); shape.setPosition(position - Player::getInstance()->viewportOffset); speed = 1.0f; lifeTime = 2000; } void Bullet::update(float time) { if (isAlive()) { position += velocity * time * speed; line[0] = Vertex(position - Player::getInstance()->viewportOffset); line[1] = Vertex(position - Player::getInstance()->viewportOffset + velocity*speed * 20.0f); shape.setPosition(position - Player::getInstance()->viewportOffset); sprite.setPosition(position - Player::getInstance()->viewportOffset); if (lifeTime < 0.0f) { kill(); } lifeTime -= time; } } void Bullet::draw(RenderTarget &target) { if (isAlive()) { target.draw(shape); target.draw(line, 2, Lines); } }
b788774c7d7a572c5b083abf51cf1bf2a1a3b394
707ca2b2fa97e64c63b6d5a0e3958134d95c574e
/food.h
6b7465c45aa26313d58e1a19eb8b721f509f4748
[]
no_license
avnisalhotra/Client-server-game
fc5e9f459fc291b7ff4fadeb4b3b0570942013f4
6ad6cb87e7b7d380522cdb6c55f13ec0a265729a
refs/heads/master
2022-03-19T01:48:22.242229
2019-12-03T21:18:25
2019-12-03T21:18:25
210,996,072
0
0
null
null
null
null
UTF-8
C++
false
false
367
h
food.h
#pragma once #include <SFML/Graphics.hpp> #include <iostream> #define SFML_STATIC using namespace sf; class food { public: void Update(RenderWindow &Window, float ElapsedTime); void Render(RenderWindow &Window); void setPosition(float X, float Y); food(String tex); Sprite foodSprite; bool Active; private: static Texture Textur; };
433f5263823740b4c075a5f51eb4d54c085dd4cb
a5f3b0001cdb692aeffc444a16f79a0c4422b9d0
/main/cppu/source/uno/data.cxx
ab0f171dc7a6440bf620b42c431ea943348714f4
[ "Apache-2.0", "CPL-1.0", "bzip2-1.0.6", "LicenseRef-scancode-other-permissive", "Zlib", "LZMA-exception", "LGPL-2.0-or-later", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-philippe-de-muyter", "OFL-1.1", "LGPL-2.1-only", "MPL-1.1", "X11", "LGPL-2.1-or-later", "GPL-2.0-only", "OpenSSL", "LicenseRef-scancode-cpl-0.5", "GPL-1.0-or-later", "NPL-1.1", "MIT", "MPL-2.0", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-unknown-license-reference", "MPL-1.0", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "BSL-1.0", "LicenseRef-scancode-docbook", "LicenseRef-scancode-mit-old-style", "Python-2.0", "BSD-3-Clause", "IJG", "LicenseRef-scancode-warranty-disclaimer", "GPL-2.0-or-later", "LGPL-2.0-only", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown", "BSD-2-Clause", "Autoconf-exception-generic", "PSF-2.0", "NTP", "LicenseRef-scancode-python-cwi", "Afmparse", "W3C", "W3C-19980720", "curl", "LicenseRef-scancode-x11-xconsortium-veillard", "Bitstream-Vera", "HPND-sell-variant", "ICU" ]
permissive
apache/openoffice
b9518e36d784898c6c2ea3ebd44458a5e47825bb
681286523c50f34f13f05f7b87ce0c70e28295de
refs/heads/trunk
2023-08-30T15:25:48.357535
2023-08-28T19:50:26
2023-08-28T19:50:26
14,357,669
907
379
Apache-2.0
2023-08-16T20:49:37
2013-11-13T08:00:13
C++
UTF-8
C++
false
false
18,087
cxx
data.cxx
/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cppu.hxx" #include <cstddef> #include <stdio.h> #include "cppu/macros.hxx" #include "osl/mutex.hxx" #include "constr.hxx" #include "destr.hxx" #include "copy.hxx" #include "assign.hxx" #include "eq.hxx" #include "boost/static_assert.hpp" using namespace ::cppu; using namespace ::rtl; using namespace ::osl; namespace cppu { // Sequence<>() (default ctor) relies on this being static: uno_Sequence g_emptySeq = { 1, 0, { 0 } }; typelib_TypeDescriptionReference * g_pVoidType = 0; //-------------------------------------------------------------------------------------------------- void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * pDestType ) { // init queryInterface() td static typelib_TypeDescription * g_pQITD = 0; if (0 == g_pQITD) { MutexGuard aGuard( Mutex::getGlobalMutex() ); if (0 == g_pQITD) { typelib_TypeDescriptionReference * type_XInterface = * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ); typelib_TypeDescription * pTXInterfaceDescr = 0; TYPELIB_DANGER_GET( &pTXInterfaceDescr, type_XInterface ); OSL_ASSERT( ((typelib_InterfaceTypeDescription*)pTXInterfaceDescr)->ppAllMembers ); typelib_typedescriptionreference_getDescription( &g_pQITD, ((typelib_InterfaceTypeDescription*)pTXInterfaceDescr)->ppAllMembers[ 0 ] ); TYPELIB_DANGER_RELEASE( pTXInterfaceDescr ); } } uno_Any aRet, aExc; uno_Any * pExc = &aExc; void * aArgs[ 1 ]; aArgs[ 0 ] = &pDestType; (*((uno_Interface *) pUnoI)->pDispatcher)( (uno_Interface *) pUnoI, g_pQITD, &aRet, aArgs, &pExc ); uno_Interface * ret = 0; if (0 == pExc) { typelib_TypeDescriptionReference * ret_type = aRet.pType; switch (ret_type->eTypeClass) { case typelib_TypeClass_VOID: // common case typelib_typedescriptionreference_release( ret_type ); break; case typelib_TypeClass_INTERFACE: // tweaky... avoiding acquire/ release pair typelib_typedescriptionreference_release( ret_type ); ret = (uno_Interface *) aRet.pReserved; // serving acquired interface break; default: _destructAny( &aRet, 0 ); break; } } else { #if OSL_DEBUG_LEVEL > 1 OUStringBuffer buf( 128 ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("### exception occurred querying for interface ") ); buf.append( * reinterpret_cast< OUString const * >( &pDestType->pTypeName ) ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(": [") ); buf.append( * reinterpret_cast< OUString const * >( &pExc->pType->pTypeName ) ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] ") ); // Message is very first member buf.append( * reinterpret_cast< OUString const * >( pExc->pData ) ); OString cstr( OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) ); OSL_ENSURE( 0, cstr.getStr() ); #endif uno_any_destruct( pExc, 0 ); } return ret; } //================================================================================================== void defaultConstructStruct( void * pMem, typelib_CompoundTypeDescription * pCompType ) SAL_THROW( () ) { _defaultConstructStruct( pMem, pCompType ); } //================================================================================================== void copyConstructStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_AcquireFunc acquire, uno_Mapping * mapping ) SAL_THROW( () ) { _copyConstructStruct( pDest, pSource, pTypeDescr, acquire, mapping ); } //================================================================================================== void destructStruct( void * pValue, typelib_CompoundTypeDescription * pTypeDescr, uno_ReleaseFunc release ) SAL_THROW( () ) { _destructStruct( pValue, pTypeDescr, release ); } //================================================================================================== sal_Bool equalStruct( void * pDest, void *pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) SAL_THROW( () ) { return _equalStruct( pDest, pSource, pTypeDescr, queryInterface, release ); } //================================================================================================== sal_Bool assignStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) SAL_THROW( () ) { return _assignStruct( pDest, pSource, pTypeDescr, queryInterface, acquire, release ); } //============================================================================== uno_Sequence * copyConstructSequence( uno_Sequence * pSource, typelib_TypeDescriptionReference * pElementType, uno_AcquireFunc acquire, uno_Mapping * mapping ) { return icopyConstructSequence( pSource, pElementType, acquire, mapping ); } //============================================================================== void destructSequence( uno_Sequence * pSequence, typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr, uno_ReleaseFunc release ) { idestructSequence( pSequence, pType, pTypeDescr, release ); } //================================================================================================== sal_Bool equalSequence( uno_Sequence * pDest, uno_Sequence * pSource, typelib_TypeDescriptionReference * pElementType, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) SAL_THROW( () ) { return _equalSequence( pDest, pSource, pElementType, queryInterface, release ); } extern "C" { //################################################################################################## void SAL_CALL uno_type_constructData( void * pMem, typelib_TypeDescriptionReference * pType ) SAL_THROW_EXTERN_C() { _defaultConstructData( pMem, pType, 0 ); } //################################################################################################## void SAL_CALL uno_constructData( void * pMem, typelib_TypeDescription * pTypeDescr ) SAL_THROW_EXTERN_C() { _defaultConstructData( pMem, pTypeDescr->pWeakRef, pTypeDescr ); } //################################################################################################## void SAL_CALL uno_type_destructData( void * pValue, typelib_TypeDescriptionReference * pType, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { _destructData( pValue, pType, 0, release ); } //################################################################################################## void SAL_CALL uno_destructData( void * pValue, typelib_TypeDescription * pTypeDescr, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { _destructData( pValue, pTypeDescr->pWeakRef, pTypeDescr, release ); } //################################################################################################## void SAL_CALL uno_type_copyData( void * pDest, void * pSource, typelib_TypeDescriptionReference * pType, uno_AcquireFunc acquire ) SAL_THROW_EXTERN_C() { _copyConstructData( pDest, pSource, pType, 0, acquire, 0 ); } //################################################################################################## void SAL_CALL uno_copyData( void * pDest, void * pSource, typelib_TypeDescription * pTypeDescr, uno_AcquireFunc acquire ) SAL_THROW_EXTERN_C() { _copyConstructData( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 ); } //################################################################################################## void SAL_CALL uno_type_copyAndConvertData( void * pDest, void * pSource, typelib_TypeDescriptionReference * pType, uno_Mapping * mapping ) SAL_THROW_EXTERN_C() { _copyConstructData( pDest, pSource, pType, 0, 0, mapping ); } //################################################################################################## void SAL_CALL uno_copyAndConvertData( void * pDest, void * pSource, typelib_TypeDescription * pTypeDescr, uno_Mapping * mapping ) SAL_THROW_EXTERN_C() { _copyConstructData( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, 0, mapping ); } //################################################################################################## sal_Bool SAL_CALL uno_type_equalData( void * pVal1, typelib_TypeDescriptionReference * pVal1Type, void * pVal2, typelib_TypeDescriptionReference * pVal2Type, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { return _equalData( pVal1, pVal1Type, 0, pVal2, pVal2Type, 0, queryInterface, release ); } //################################################################################################## sal_Bool SAL_CALL uno_equalData( void * pVal1, typelib_TypeDescription * pVal1TD, void * pVal2, typelib_TypeDescription * pVal2TD, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { return _equalData( pVal1, pVal1TD->pWeakRef, pVal1TD, pVal2, pVal2TD->pWeakRef, pVal2TD, queryInterface, release ); } //################################################################################################## sal_Bool SAL_CALL uno_type_assignData( void * pDest, typelib_TypeDescriptionReference * pDestType, void * pSource, typelib_TypeDescriptionReference * pSourceType, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { return _assignData( pDest, pDestType, 0, pSource, pSourceType, 0, queryInterface, acquire, release ); } //################################################################################################## sal_Bool SAL_CALL uno_assignData( void * pDest, typelib_TypeDescription * pDestTD, void * pSource, typelib_TypeDescription * pSourceTD, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { return _assignData( pDest, pDestTD->pWeakRef, pDestTD, pSource, pSourceTD->pWeakRef, pSourceTD, queryInterface, acquire, release ); } //################################################################################################## sal_Bool SAL_CALL uno_type_isAssignableFromData( typelib_TypeDescriptionReference * pAssignable, void * pFrom, typelib_TypeDescriptionReference * pFromType, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) SAL_THROW_EXTERN_C() { if (::typelib_typedescriptionreference_isAssignableFrom( pAssignable, pFromType )) return sal_True; if (typelib_TypeClass_INTERFACE != pFromType->eTypeClass || typelib_TypeClass_INTERFACE != pAssignable->eTypeClass) { return sal_False; } // query if (0 == pFrom) return sal_False; void * pInterface = *(void **)pFrom; if (0 == pInterface) return sal_False; if (0 == queryInterface) queryInterface = binuno_queryInterface; void * p = (*queryInterface)( pInterface, pAssignable ); _release( p, release ); return (0 != p); } } //################################################################################################## //################################################################################################## //################################################################################################## #if OSL_DEBUG_LEVEL > 1 #if defined( SAL_W32) #pragma pack(push, 8) #elif defined(SAL_OS2) #pragma pack(push, 4) #endif #if defined(INTEL) \ && (defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD) \ || defined(OS2)) || defined(MACOSX) || defined(SOLARIS)) #define MAX_ALIGNMENT_4 #endif #define OFFSET_OF( s, m ) reinterpret_cast< std::size_t >((char *)&((s *)16)->m -16) #define BINTEST_VERIFY( c ) \ if (! (c)) { fprintf( stderr, "### binary compatibility test failed: %s [line %d]!!!\n", #c, __LINE__ ); abort(); } #define BINTEST_VERIFYOFFSET( s, m, n ) \ if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %" SAL_PRI_SIZET "u instead of expected %d!!!\n", OFFSET_OF(s, m), static_cast<int>(n) ); abort(); } #define BINTEST_VERIFYSIZE( s, n ) \ if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %d instead of expected %d!!!\n", (int)sizeof(s), n ); abort(); } struct C1 { sal_Int16 n1; }; struct C2 : public C1 { sal_Int32 n2 CPPU_GCC3_ALIGN( C1 ); }; struct C3 : public C2 { double d3; sal_Int32 n3; }; struct C4 : public C3 { sal_Int32 n4 CPPU_GCC3_ALIGN( C3 ); double d4; }; struct C5 : public C4 { sal_Int64 n5; sal_Bool b5; }; struct C6 : public C1 { C5 c6 CPPU_GCC3_ALIGN( C1 ); sal_Bool b6; }; struct D { sal_Int16 d; sal_Int32 e; }; struct E { sal_Bool a; sal_Bool b; sal_Bool c; sal_Int16 d; sal_Int32 e; }; struct M { sal_Int32 n; sal_Int16 o; }; struct N : public M { sal_Int16 p CPPU_GCC3_ALIGN( M ); }; struct N2 { M m; sal_Int16 p; }; struct O : public M { double p; sal_Int16 q; }; struct O2 : public O { sal_Int16 p2 CPPU_GCC3_ALIGN( O ); }; struct P : public N { double p2; }; struct empty { }; struct second : public empty { int a; }; struct AlignSize_Impl { sal_Int16 nInt16; double dDouble; }; struct Char1 { char c1; }; struct Char2 : public Char1 { char c2 CPPU_GCC3_ALIGN( Char1 ); }; struct Char3 : public Char2 { char c3 CPPU_GCC3_ALIGN( Char2 ); }; struct Char4 { Char3 chars; char c; }; class Ref { void * p; }; enum Enum { v = SAL_MAX_ENUM }; class BinaryCompatible_Impl { public: BinaryCompatible_Impl(); }; BinaryCompatible_Impl::BinaryCompatible_Impl() { BOOST_STATIC_ASSERT( ((sal_Bool) true) == sal_True && (1 != 0) == sal_True ); BOOST_STATIC_ASSERT( ((sal_Bool) false) == sal_False && (1 == 0) == sal_False ); #ifdef MAX_ALIGNMENT_4 // max alignment is 4 BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 4 ); BINTEST_VERIFYSIZE( AlignSize_Impl, 12 ); #else // max alignment is 8 BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 8 ); BINTEST_VERIFYSIZE( AlignSize_Impl, 16 ); #endif // sequence BINTEST_VERIFY( (SAL_SEQUENCE_HEADER_SIZE % 8) == 0 ); // enum BINTEST_VERIFY( sizeof( Enum ) == sizeof( sal_Int32 ) ); // any BINTEST_VERIFY( sizeof(void *) >= sizeof(sal_Int32) ); BINTEST_VERIFY( sizeof( uno_Any ) == sizeof( void * ) * 3 ); BINTEST_VERIFYOFFSET( uno_Any, pType, 0 ); BINTEST_VERIFYOFFSET( uno_Any, pData, 1 * sizeof (void *) ); BINTEST_VERIFYOFFSET( uno_Any, pReserved, 2 * sizeof (void *) ); // interface BINTEST_VERIFY( sizeof( Ref ) == sizeof( void * ) ); // string BINTEST_VERIFY( sizeof( OUString ) == sizeof( rtl_uString * ) ); // struct BINTEST_VERIFYSIZE( M, 8 ); BINTEST_VERIFYOFFSET( M, o, 4 ); BINTEST_VERIFYSIZE( N, 12 ); BINTEST_VERIFYOFFSET( N, p, 8 ); BINTEST_VERIFYSIZE( N2, 12 ); BINTEST_VERIFYOFFSET( N2, p, 8 ); #ifdef MAX_ALIGNMENT_4 BINTEST_VERIFYSIZE( O, 20 ); #else BINTEST_VERIFYSIZE( O, 24 ); #endif BINTEST_VERIFYSIZE( D, 8 ); BINTEST_VERIFYOFFSET( D, e, 4 ); BINTEST_VERIFYOFFSET( E, d, 4 ); BINTEST_VERIFYOFFSET( E, e, 8 ); BINTEST_VERIFYSIZE( C1, 2 ); BINTEST_VERIFYSIZE( C2, 8 ); BINTEST_VERIFYOFFSET( C2, n2, 4 ); #ifdef MAX_ALIGNMENT_4 BINTEST_VERIFYSIZE( C3, 20 ); BINTEST_VERIFYOFFSET( C3, d3, 8 ); BINTEST_VERIFYOFFSET( C3, n3, 16 ); BINTEST_VERIFYSIZE( C4, 32 ); BINTEST_VERIFYOFFSET( C4, n4, 20 ); BINTEST_VERIFYOFFSET( C4, d4, 24 ); BINTEST_VERIFYSIZE( C5, 44 ); BINTEST_VERIFYOFFSET( C5, n5, 32 ); BINTEST_VERIFYOFFSET( C5, b5, 40 ); BINTEST_VERIFYSIZE( C6, 52 ); BINTEST_VERIFYOFFSET( C6, c6, 4 ); BINTEST_VERIFYOFFSET( C6, b6, 48 ); BINTEST_VERIFYSIZE( O2, 24 ); BINTEST_VERIFYOFFSET( O2, p2, 20 ); #else BINTEST_VERIFYSIZE( C3, 24 ); BINTEST_VERIFYOFFSET( C3, d3, 8 ); BINTEST_VERIFYOFFSET( C3, n3, 16 ); BINTEST_VERIFYSIZE( C4, 40 ); BINTEST_VERIFYOFFSET( C4, n4, 24 ); BINTEST_VERIFYOFFSET( C4, d4, 32 ); BINTEST_VERIFYSIZE( C5, 56 ); BINTEST_VERIFYOFFSET( C5, n5, 40 ); BINTEST_VERIFYOFFSET( C5, b5, 48 ); BINTEST_VERIFYSIZE( C6, 72 ); BINTEST_VERIFYOFFSET( C6, c6, 8 ); BINTEST_VERIFYOFFSET( C6, b6, 64 ); BINTEST_VERIFYSIZE( O2, 32 ); BINTEST_VERIFYOFFSET( O2, p2, 24 ); #endif BINTEST_VERIFYSIZE( Char3, 3 ); BINTEST_VERIFYOFFSET( Char4, c, 3 ); #ifdef MAX_ALIGNMENT_4 // max alignment is 4 BINTEST_VERIFYSIZE( P, 20 ); #else // alignment of P is 8, because of P[] ... BINTEST_VERIFYSIZE( P, 24 ); BINTEST_VERIFYSIZE( second, sizeof( int ) ); #endif } #ifdef SAL_W32 # pragma pack(pop) #elif defined(SAL_OS2) # pragma pack() #endif static BinaryCompatible_Impl aTest; #endif }
972171b9a68cb26a6c5f820a3820dacc06d863e0
0ba05aba94d19fa52b7b33c02524f2c238fd6466
/src/tracker/lib/ParticleFilter.h
e31b6b1905ff5c618dacd9c03e2369ef9020bcb4
[]
no_license
zixuanwang/tracker
f6f6660dba0ba50129db00fc226e0d8321b15fe5
0237a6df19398d2f53800f61c0a3204a5f76f3c3
refs/heads/master
2020-06-03T23:14:16.194942
2013-11-26T01:41:17
2013-11-26T01:41:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
991
h
ParticleFilter.h
#ifndef PARTICLEFILTER_H #define PARTICLEFILTER_H #include <random> #include "Math.h" class ParticleFilter { public: ParticleFilter(); virtual ~ParticleFilter(); void init(const cv::Mat& image, const cv::Rect& bbox); void update(const cv::Mat& image); void get_color_model(const cv::Mat& patch, std::vector<float>& model); float distance(const std::vector<float>& v1, const std::vector<float>& v2); float likelihood(const cv::Mat& patch); void transition(const cv::Mat& image); // pass the whole image void resample(); void draw(cv::Mat& image); bool is_init(){return m_init;} int get_particle_count(){return static_cast<int>(m_point_vector.size());} private: bool m_init; float m_std; int m_box_size; std::vector<cv::Point> m_point_vector; std::vector<float> m_weight_vector; std::vector<float> m_color_template; std::mt19937 m_generator; std::normal_distribution<float> m_normal; }; #endif // PARTICLEFILTER_H
c4e58a543e96c3c448469825d96122ccc8a2abb8
69bbb578c5579237775ed6121fa5996e81b9c760
/SerialProtocol.h
3ebfa8533f3b27cec7c083e7c94ede74a292e221
[ "Apache-2.0" ]
permissive
victorhurdugaci/SerialProtocol
f16cc8786a359ab9aecfd3c94ae426b48c2fed9d
51a57b219927eda24c0ddf3ba68af634407c7b93
refs/heads/master
2021-01-01T16:49:44.856937
2019-06-18T01:25:23
2019-06-18T01:25:23
26,202,766
36
18
Apache-2.0
2019-06-18T01:25:24
2014-11-05T04:20:17
C++
UTF-8
C++
false
false
1,535
h
SerialProtocol.h
// Copyright Victor Hurdugaci (http://victorhurdugaci.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. #ifndef SERIALPROTOCOL_H #define SERIALPROTOCOL_H #include <stdlib.h> #include <string.h> #include <stdint.h> struct ProtocolState { enum Enum { // The serial object was not set NO_SERIAL = 0, // The operation succeeded SUCCESS = 1, // There is not (enought) data to process NO_DATA = 2, // The object is being received but the buffer doesn't have all the data WAITING_FOR_DATA = 3, // The size of the received payload doesn't match the expected size INVALID_SIZE = 4, // The object was received but it is not the same as one sent INVALID_CHECKSUM = 5 }; }; class SerialProtocol { public: SerialProtocol(uint8_t*, uint8_t); // Sends the current payload // // Returns a ProtocolState enum value uint8_t send(); // Tries to receive the payload from the // current available data // Will replace the payload if the receive succeeds // // Returns a ProtocolState enum value uint8_t receive(); protected: virtual bool serialAvailable() = 0; virtual void sendData(uint8_t data) = 0; virtual uint8_t readData() = 0; private: uint8_t* payload; uint8_t payloadSize; uint8_t* inputBuffer; uint8_t bytesRead; uint8_t actualChecksum; }; #endif
32a4a9c2776d42c3ff0b50fc1af8a9d7aa188ff1
f72c9031c2485487ccba5b8ef90c10095e62799e
/srm/405/div2/medium.cpp
062be6eef8d3406f04ca8957acc1ab577b1257e4
[]
no_license
ichirin2501/garbage
d209feaf5f0efdf452e04feba618c889d4346da7
fcd89b8f5185a730ca8911abecf47db21625cb2d
refs/heads/master
2021-01-01T20:00:21.260126
2015-12-06T10:50:07
2015-12-06T10:50:07
2,227,859
0
0
null
null
null
null
UTF-8
C++
false
false
1,484
cpp
medium.cpp
#include <iostream> #include <vector> #include <string> #include <map> #include <set> #include <queue> #include <stack> #include <algorithm> #include <functional> #include <numeric> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> using namespace std; #define REP(i,a,n) for(i=a; i<n; i++) #define rep(i,n) REP(i,0,n) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++) class RelativePath{ public: string makeRelative(string path, string currentDir){ int i,j; if( currentDir[currentDir.size()-1] != '/' ){ currentDir += "/"; } int n = path.size(); int m = currentDir.size(); string cd; rep(i,n){ if( path[i] != currentDir[i] ){ break; } } int idx = path.rfind("/",i-1) + 1; REP(j,i,m) if( currentDir[j] == '/' ) cd += "../"; return cd + path.substr(idx); } }; /* class RelativePath{ public: string makeRelative(string path, string cur){ string ret; int n = path.size(); int m = cur.size(); int k; if( cur[m-1]!='/' ) cur+="/"; m++; for(k=0; k<min(n,m) && path[k]==cur[k]; k++); int idx = path.find_last_of('/',k-1); int cnt = 0; for(;k<m; k++)if( cur[k]=='/' )cnt++; string tmp; while(cnt--)tmp+="../"; return tmp + path.substr(idx+1); } }; */
0e7cc0e801de050ab73f0530dc6af1fd4277b63e
827e675f0bd1856abeea25ca2f6ad2f65ca970f7
/PRMS_Client/RunProgram.h
bdd5f6cd3746aecf3885af5c4c3b7e693d043bca
[]
no_license
abham07/Software-Design1-FinalProject
abbe592a6cb6c648ec13642e6451b9f640c8a0b3
d89830fe3ee01d1a6076f92978059451b249c4d4
refs/heads/master
2016-08-12T08:29:11.214092
2015-10-26T02:36:04
2015-10-26T02:36:04
44,941,426
1
0
null
null
null
null
UTF-8
C++
false
false
148
h
RunProgram.h
// CREATED BY: ABAD HAMEED #pragma once #include "PRMS_Client.h" class RunProgram { public: RunProgram(); bool auth; void runProgram(); };
bd506e183938e709b74715504c1a5df696bc9340
abf2afb7921441e3caafe6c852232b9233dd218c
/11547.cpp
596d75734d6e2b3e7f3d1a47e4233ae733f5eaaa
[]
no_license
farhapartex/uva-solutions
97e2a01ea2db571932c8f673708ffcf657ac2a16
d14d2be95c60d3474befe4c0625ae0c9ec01749a
refs/heads/master
2020-05-23T20:59:01.588640
2019-05-17T08:14:05
2019-05-17T08:14:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
857
cpp
11547.cpp
#include<iostream> #include<cstdio> #include<stack> #include<queue> #include<vector> #include<algorithm> #include<map> #include<cstring> #include<sstream> #include<cmath> using namespace std; const double pi = 2*acos(0); #define pf printf #define sc scanf #define pb push_back #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define MAX(x,y) ((x) > (y) ? (x) : (y)) int main() { long t,n, result,prev; sc("%ld",&t); while(t--) { sc("%ld",&n); result = ((((((567*n)/9)+7492)*235)/47)-498); //pf("%ld\n",result); // while(result!=0) // { // prev = result % 10; // result /= 10; // if(result/10 == 0) // break; // } result /= 10; prev = result % 10; if(prev < 0) prev = prev *(-1); pf("%ld\n",prev); } }
e29127183dd30217c8bb2a09e2e1c5684e3998be
47511ce4f8a9fcdfc603f9f3770f49bf946ec3e6
/Carsach_project/File.cpp
d97a55dc9c25772d7c468e933978e8c07126346d
[]
no_license
AndrewLisogor/-
f4cfea95bd4bc3ac2e7a0fed5c71b6a28ea46865
bd871893149507f74e015f70109e1378e1a5bdd8
refs/heads/master
2020-04-09T20:14:25.429955
2018-12-05T19:31:32
2018-12-05T19:31:32
160,567,987
0
0
null
null
null
null
UTF-8
C++
false
false
759
cpp
File.cpp
// // Created by Andrew on 12/8/17. // #include "File.h" bool File::correct_file_name() { // ????????? ?-?? correct_file_name() struct stat buffer; return (stat(file_name.c_str(), & buffer) == 0); } File::File() { // ????????? ???????????? ????? File file_name = parsed_to_words[3]; try{ if(!correct_file_name()){ throw file_name_exeption(file_name.size(), "Inncorrect file name!"); } } catch(file_name_exeption & exp) { exp.display(); } } void file_name_exeption::display() { // ????????? ?-?? display() std::cout << "Error #" << num_of_error << "\nDescription : " << description_of_error; }
9664b44bed6d01b46841bb6d8dfd392da0c2941b
720da033f3168851eb1206ff6f42f6d91e6a29d5
/DSP/module/packet.hpp
c89271511a74fe77cb4dace048b648eeaf877685
[]
no_license
ip1996/DSPAPISketch
7281447bf74408fbada811f1050117c03c49da7a
530cac0c116b1a53e3503eb310ea4754143d7602
refs/heads/master
2021-05-19T10:07:10.130619
2020-03-31T15:27:08
2020-03-31T15:27:08
251,644,466
0
0
null
null
null
null
UTF-8
C++
false
false
594
hpp
packet.hpp
#ifndef PACKET_HPP #define PACKET_HPP namespace pipert { template<class T> class Packet { public: Packet(T data) : data(data) {} //should moving data not copy template<class T2> Packet(T data, Packet<T2> packet) : data(data) //should moving data not copy { //copy metainformation from old packet to the new one } T getData() { return data; } //should move data not copy private: int time; //timestamp when package arrived the channel int orderNumber; //if necessarry for processing the packets in order T data; //the raw data in the package }; } #endif //PACKET_HPP
6aca342900a8f2ffdf7c855c158ab790b3f48d4c
4dad3b14f12d725f405899e71eb4aa816f6b50b4
/zertco5/object/details/PoolObjectDetails.hpp
3bde0b33faf7a8093f376a0b8001c764877a660d
[]
no_license
ccitllz/zertcore5
0cdbcee3b7889e9477d7f461240a42d3212aa2bf
9f6c9a352ce1526f7fd55cb546d6a5c5c0ebee7c
refs/heads/master
2023-04-13T22:25:05.558013
2015-11-05T12:34:07
2015-11-05T12:34:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,123
hpp
PoolObjectDetails.hpp
/* * PoolObjectDetails.hpp * * Created on: 2015年10月18日 * Author: Administrator */ #ifndef ZERTCORE_OBJECT_DETAILS_POOLOBJECTDETAILS_HPP_ #define ZERTCORE_OBJECT_DETAILS_POOLOBJECTDETAILS_HPP_ #include "../PoolObject.h" namespace zertcore{ namespace object { template <class Final, class _Traits> void PoolObject<Final, _Traits>:: operator delete(void *ptr) { #ifndef ZC_RELEASE ZC_DEBUG_ASSERT(ptr == ((Final *)ptr)->raw_ptr_); ((Final *)ptr)->raw_ptr_ = nullptr; #endif /** spinlock_guard_type guard(lock_); if (pobject_pool_.is_from((Final *)ptr)) { pobject_pool_.destroy((Final *)ptr); } else */ ::operator delete(ptr); } template <class Final, class _Traits> typename _Traits::ptr PoolObject<Final, _Traits>:: create() { Final* raw_ptr = new Final();//PoolObject<Final, _Traits>::pobject_pool_.construct();// typename _Traits::ptr ptr(raw_ptr); #ifndef ZC_RELEASE ptr->raw_ptr_ = raw_ptr; #endif return ptr; } #ifdef ZC_COMPILE # include "PoolObjectCreateImpl.ipp" #endif }} #endif /* OBJECT_DETAILS_POOLOBJECTDETAILS_HPP_ */
b9df176ae0098d31d7556ddb58cc7839d36f3e84
bb09b617a266ce0e79195992b8b3add8d08c0cdd
/include/util.h
ce834ea930e0bb19b85e838783b459ccb0e2107c
[]
no_license
sbreuils/3DdigitizedReflectionsBijectivityCertification
478f954f5a1d0d4f92b7926575e99b7f115f23c0
84686ffd2243d95de2d4d5ff6f599a14a24cc7bf
refs/heads/main
2023-04-15T10:00:40.364282
2021-04-28T08:30:54
2021-04-28T08:30:54
358,583,118
0
0
null
null
null
null
UTF-8
C++
false
false
556
h
util.h
#pragma once namespace gadg { // gcd of more than two multivectors int gcd(const int a, const int b) { if (a == 0) return b; return gcd(b % a, a); } // Function to find gcd of 4 values int gcd(const int w, const int x, const int y, const int z) { int res_gcd = w; res_gcd = gcd(x, res_gcd); if (res_gcd == 1) { return 1; } res_gcd = gcd(y, res_gcd); if (res_gcd == 1) { return 1; } return gcd(z, res_gcd); } }
e93b17097e85e557c7e4ea1b9dbb4525d76f83ae
44569357b630f9684385be1fe1eaa3460e273480
/yanve/include/scene/scenemanager.h
b3eb7b97d8d31a26fc374428d22a7bef1bd78cb4
[ "MIT" ]
permissive
fesoliveira014/yanve
a2e5412ecc321200a3b73de15792af6d0c0e3158
ec1d27f68018fe5fb686f94bf38357c7a41d5491
refs/heads/master
2022-02-11T11:37:44.875608
2022-01-26T20:27:54
2022-01-26T20:27:54
174,913,839
0
0
null
2020-04-29T03:09:26
2019-03-11T02:47:27
C
UTF-8
C++
false
false
1,211
h
scenemanager.h
#pragma once #include <common.h> #include <scene/scenenode.h> namespace yanve::scene { const int RootNode = 1; struct YANVE_API RenderQueueItem { SceneNode* node; int sortKey; }; class SceneManager { public: ~SceneManager(); void YANVE_API updateNodes(); void YANVE_API updateQueues(); size_t YANVE_API addNode(SceneNode* node, SceneNode& parent); void YANVE_API removeNode(SceneNode& node); bool YANVE_API relocateNode(SceneNode& node, SceneNode& parent); YANVE_API SceneNode* resolveNodeID(size_t id) const { return (id != 0 && id - 1 < _nodes.size() ? _nodes[id - 1] : nullptr); } YANVE_API SceneNode& getRootNode() { return *_nodes[0]; } YANVE_API std::vector<RenderQueueItem>& getRenderQueue() { return _renderQueue; } public: YANVE_API static SceneManager& getInstance(); protected: SceneManager(); size_t newNode(const SceneNodeData& data, SceneNode* parent); void removeNodeRec(SceneNode& node); protected: std::vector<SceneNode*> _nodes; std::vector<size_t> _freeSlots; std::vector<SceneNode*> _renderableNodes; std::vector<size_t> _freeRenderableSlots; std::vector<SceneNode*> _lightQueue; std::vector<RenderQueueItem> _renderQueue; }; }
882ef5c569a5467a41480c36c98f4fca51665ef2
e60c0830b99e80e64fdf408509d65aa94dbf659f
/DirectXgameFramework/Classes/Object/Bullet/State/BulletStandState.h
35e4e42bd083ba3ab5209bff97e326fef9b6be80
[]
no_license
shun9/-Shooting
472721410f01e1f87f3791449ab805de50e5cddd
a495fa0313cb30a61fe0a31776c25ef02fb55ffb
refs/heads/master
2020-06-27T22:29:54.889322
2017-08-03T01:03:38
2017-08-03T01:03:38
97,072,690
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
548
h
BulletStandState.h
//************************************************/ //* @file :BulletStandState.h //* @brief :弾の待機中状態 //* @date :2017/07/24 //* @author:S.Katou //************************************************/ #pragma once #include <SL_State.h> class Bullet; class BulletStandState : public ShunLib::State<Bullet> { public: //開始処理 void Enter(Bullet* bullet)override; //実行処理 void Execute(Bullet* bullet)override; //終了処理 void Exit(Bullet* bullet)override; public: BulletStandState() {} ~BulletStandState() {} };
66c0cd65ca72ccea35e446e14faef420235f791f
e7c16164ceb387a4fba777be4744930c22bf6a31
/protocol/game/ptch2c_senditemptf.h
5343c53f1952202faf539eb2877b8814cf49591a
[]
no_license
freewayso/gameserver
a661415b18db93813b93126c7c3ecc62c69c6f3c
74738181e6b01b0f68414d27c1d2d9cd4b139a2e
refs/heads/main
2023-01-07T08:28:03.734762
2020-11-10T13:01:23
2020-11-10T13:01:23
311,651,825
2
0
null
null
null
null
UTF-8
C++
false
false
504
h
ptch2c_senditemptf.h
#ifndef __PTCH2C_SENDITEMPTF_H__ #define __PTCH2C_SENDITEMPTF_H__ // generate by ProtoGen at date: 2020/8/25 15:46:05 #include "protocol.h" #include "pb/project.pb.h" #define PTCH2C_SENDITEMPTF_TYPE 27035 class PtcH2C_SendItemPtf : public CProtocol { public: explicit PtcH2C_SendItemPtf() : CProtocol(PTCH2C_SENDITEMPTF_TYPE) { m_message = &m_Data; } virtual ~PtcH2C_SendItemPtf() { } virtual void Process(UINT32 dwConnID); public: CBR::npcdata m_Data; }; #endif
28031ef56e3aeda747e8036ed9384f927535ce71
73aadb2145c5d9260623fb8752c038bdcc8f6d1c
/src/optimization_tools/objective_function_tools/SquaredFunctionInfo.cpp
0987adbd2ec30495588cc8bde3256beb2cb8b024
[]
no_license
gangma2610/2018AMMPoseSolver
6d9c6a5f613a03554cfda22d5d7340a434e2548d
4dcbc07304e60e9ebd550371e7e4003967f14df6
refs/heads/master
2023-07-24T07:01:36.399185
2019-06-09T19:33:31
2019-06-09T19:33:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,634
cpp
SquaredFunctionInfo.cpp
#include <opengv/optimization_tools/objective_function_tools/SquaredFunctionInfo.hpp> #include <opengv/Indices.hpp> #include <iostream> SquaredFunctionInfo::SquaredFunctionInfo(const opengv::relative_pose::RelativeAdapterBase & adapter ){ opengv::Indices idx(adapter.getNumberCorrespondences()); size_t numberCorrespondences = idx.size(); M = Eigen::MatrixXd::Zero (numberCorrespondences, 18); for( size_t i = 0; i < numberCorrespondences; i++ ) { //std::cout << "iteration: " << i << std::endl; opengv::bearingVector_t d1 = adapter.getBearingVector1(idx[i]); opengv::bearingVector_t d2 = adapter.getBearingVector2(idx[i]); opengv::translation_t v1 = adapter.getCamOffset1(idx[i]); opengv::translation_t v2 = adapter.getCamOffset2(idx[i]); opengv::rotation_t R1 = adapter.getCamRotation1(idx[i]); opengv::rotation_t R2 = adapter.getCamRotation2(idx[i]); //unrotate the bearing-vectors to express everything in the body frame d1 = R1*d1; d2 = R2*d2; //generate the Plücker line coordinates Eigen::Matrix<double,6,1> l1; l1.block<3,1>(0,0) = d1; l1.block<3,1>(3,0) = v1.cross(d1); Eigen::Matrix<double,6,1> l2; l2.block<3,1>(0,0) = d2; l2.block<3,1>(3,0) = v2.cross(d2); //Calculate the kronecker product double a00 = l2(0,0) * l1(0,0); double a01 = l2(0,0) * l1(1,0); double a02 = l2(0,0) * l1(2,0);//e1->First column of the essential matrix double a03 = l2(0,0) * l1(3,0); double a04 = l2(0,0) * l1(4,0); double a05 = l2(0,0) * l1(5,0);//r1 double a06 = l2(1,0) * l1(0,0); double a07 = l2(1,0) * l1(1,0); double a08 = l2(1,0) * l1(2,0);//e2 double a09 = l2(1,0) * l1(3,0); double a10 = l2(1,0) * l1(4,0); double a11 = l2(1,0) * l1(5,0);//r2 double a12 = l2(2,0) * l1(0,0); double a13 = l2(2,0) * l1(1,0); double a14 = l2(2,0) * l1(2,0);//e3 double a15 = l2(2,0) * l1(3,0); double a16 = l2(2,0) * l1(4,0); double a17 = l2(2,0) * l1(5,0);//r3 double a18 = l2(3,0) * l1(0,0); double a19 = l2(3,0) * l1(1,0); double a20 = l2(3,0) * l1(2,0); //r1->First column of the rotation matrix //double a21 = l2(3,0) * l1(3,0); double a22 = l2(3,0) * l1(4,0); double a23 = l2(3,0) * l1(5,0); //0 double a24 = l2(4,0) * l1(0,0); double a25 = l2(4,0) * l1(1,0); double a26 = l2(4,0) * l1(2,0);//r2 //double a27 = l2(4,0) * l1(3,0); double a28 = l2(4,0) * l1(4,0); double a29 = l2(4,0) * l1(5,0);//0 double a30 = l2(5,0) * l1(0,0); double a31 = l2(5,0) * l1(1,0); double a32 = l2(5,0) * l1(2,0);//r3 //double a33 = l2(5,0) * l1(3,0); double a34 = l2(5,0) * l1(4,0); double a35 = l2(5,0) * l1(5,0);//0 M(i,0) = a00; M(i,1) = a01; M(i,2) = a02; //e1->Column M(i,3) = a06; M(i,4) = a07; M(i,5) = a08; //e2 M(i,6) = a12; M(i,7) = a13; M(i,8) = a14; //e3 M(i,9) = a03 + a18; M(i,10) = a04 + a19; M(i,11) = a05 + a20; //r1->Column R M(i,12) = a09 + a24; M(i,13) = a10 + a25; M(i,14) = a11 + a26; M(i,15) = a15 + a30; M(i,16) = a16 + a31; M(i,17) = a17 + a32; /*std::cout << "l1: " << " " << l1(0,0) << " " << l1(1,0) << " " << l1(2,0) << " " << l1(3,0) << " " << l1(4,0) << " " << l1(5,0) << std::endl; std::cout << "l2: " << " " << l2(0,0) << " " << l2(1,0) << " " << l2(2,0) << " " << l2(3,0) << " " << l2(4,0) << " " << l2(5,0) << std::endl;*/ } //std::cout << "M matrix: " << std::endl << M << std::endl; } SquaredFunctionInfo::~SquaredFunctionInfo(){} Eigen::MatrixXd SquaredFunctionInfo::get_M(){ return M; } double SquaredFunctionInfo::objective_function_value(const opengv::rotation_t & rotation, const opengv::translation_t & translation){ Eigen::MatrixXd v = Eigen::MatrixXd::Zero(18,1); v(0,0) = translation(1,0) * rotation(2,0) - translation(2,0) * rotation(1,0); v(1,0) = translation(2,0) * rotation(0,0) - translation(0,0) * rotation(2,0); v(2,0) = translation(0,0) * rotation(1,0) - translation(1,0) * rotation(0,0); v(3,0) = translation(1,0) * rotation(2,1) - translation(2,0) * rotation(1,1); v(4,0) = translation(2,0) * rotation(0,1) - translation(0,0) * rotation(2,1); v(5,0) = translation(0,0) * rotation(1,1) - translation(1,0) * rotation(0,1); v(6,0) = translation(1,0) * rotation(2,2) - translation(2,0) * rotation(1,2); v(7,0) = translation(2,0) * rotation(0,2) - translation(0,0) * rotation(2,2); v(8,0) = translation(0,0) * rotation(1,2) - translation(1,0) * rotation(0,2); v(9,0) = rotation(0,0); v(10,0) = rotation(1,0); v(11,0) = rotation(2,0); v(12,0) = rotation(0,1); v(13,0) = rotation(1,1); v(14,0) = rotation(2,1); v(15,0) = rotation(0,2); v(16,0) = rotation(1,2); v(17,0) = rotation(2,2); int n_cols = M.cols(); int n_rows = M.rows(); double function_value = 0; Eigen::MatrixXd ei = Eigen::MatrixXd::Zero(1,1); for(int i = 0; i < n_rows; ++i){ ei = M.block(i,0,1,n_cols) * v; function_value = function_value + (ei(0,0) * ei(0,0)); } //std::cout << "Is the true obj. func. called? " << function_value << std::endl; return function_value; } opengv::rotation_t SquaredFunctionInfo::rotation_gradient(const opengv::rotation_t & rotation, const opengv::translation_t & translation){ Eigen::MatrixXd v = Eigen::MatrixXd::Zero(18,1); v(0,0) = translation(1,0) * rotation(2,0) - translation(2,0) * rotation(1,0); v(1,0) = translation(2,0) * rotation(0,0) - translation(0,0) * rotation(2,0); v(2,0) = translation(0,0) * rotation(1,0) - translation(1,0) * rotation(0,0); v(3,0) = translation(1,0) * rotation(2,1) - translation(2,0) * rotation(1,1); v(4,0) = translation(2,0) * rotation(0,1) - translation(0,0) * rotation(2,1); v(5,0) = translation(0,0) * rotation(1,1) - translation(1,0) * rotation(0,1); v(6,0) = translation(1,0) * rotation(2,2) - translation(2,0) * rotation(1,2); v(7,0) = translation(2,0) * rotation(0,2) - translation(0,0) * rotation(2,2); v(8,0) = translation(0,0) * rotation(1,2) - translation(1,0) * rotation(0,2); v(9,0) = rotation(0,0); v(10,0) = rotation(1,0); v(11,0) = rotation(2,0); v(12,0) = rotation(0,1); v(13,0) = rotation(1,1); v(14,0) = rotation(2,1); v(15,0) = rotation(0,2); v(16,0) = rotation(1,2); v(17,0) = rotation(2,2); int n_cols = M.cols(); int n_rows = M.rows(); double function_value = 0; Eigen::MatrixXd ei = Eigen::MatrixXd::Zero(1,1); Eigen::Matrix3d grad = Eigen::Matrix3d::Zero(3,3); for(int i = 0; i < n_rows; ++i){ ei = M.block(i,0,1,n_cols) * v; grad(0,0) = grad(0,0) + 2 * ( ei(0,0) * (M(i,1) * translation(2,0) - M(i,2) * translation(1,0) + M(i,9)) ); grad(1,0) = grad(1,0) + 2 * ( ei(0,0) * (M(i,2) * translation(0,0) - M(i,0) * translation(2,0) + M(i,10)) ); grad(2,0) = grad(2,0) + 2 * ( ei(0,0) * (M(i,0) * translation(1,0) - M(i,1) * translation(0,0) + M(i,11)) ); grad(0,1) = grad(0,1) + 2 * ( ei(0,0) * (M(i,4) * translation(2,0) - M(i,5) * translation(1,0) + M(i,12)) ); grad(1,1) = grad(1,1) + 2 * ( ei(0,0) * (M(i,5) * translation(0,0) - M(i,3) * translation(2,0) + M(i,13)) ); grad(2,1) = grad(2,1) + 2 * ( ei(0,0) * (M(i,3) * translation(1,0) - M(i,4) * translation(0,0) + M(i,14)) ); grad(0,2) = grad(0,2) + 2 * ( ei(0,0) * (M(i,7) * translation(2,0) - M(i,8) * translation(1,0) + M(i,15)) ); grad(1,2) = grad(1,2) + 2 * ( ei(0,0) * (M(i,8) * translation(0,0) - M(i,6) * translation(2,0) + M(i,16)) ); grad(2,2) = grad(2,2) + 2 * ( ei(0,0) * (M(i,6) * translation(1,0) - M(i,7) * translation(0,0) + M(i,17)) ); } return grad; } opengv::translation_t SquaredFunctionInfo::translation_gradient(const opengv::rotation_t & rotation, const opengv::translation_t & translation){ Eigen::MatrixXd v = Eigen::MatrixXd::Zero(18,1); v(0,0) = translation(1,0) * rotation(2,0) - translation(2,0) * rotation(1,0); v(1,0) = translation(2,0) * rotation(0,0) - translation(0,0) * rotation(2,0); v(2,0) = translation(0,0) * rotation(1,0) - translation(1,0) * rotation(0,0); v(3,0) = translation(1,0) * rotation(2,1) - translation(2,0) * rotation(1,1); v(4,0) = translation(2,0) * rotation(0,1) - translation(0,0) * rotation(2,1); v(5,0) = translation(0,0) * rotation(1,1) - translation(1,0) * rotation(0,1); v(6,0) = translation(1,0) * rotation(2,2) - translation(2,0) * rotation(1,2); v(7,0) = translation(2,0) * rotation(0,2) - translation(0,0) * rotation(2,2); v(8,0) = translation(0,0) * rotation(1,2) - translation(1,0) * rotation(0,2); v(9,0) = rotation(0,0); v(10,0) = rotation(1,0); v(11,0) = rotation(2,0); v(12,0) = rotation(0,1); v(13,0) = rotation(1,1); v(14,0) = rotation(2,1); v(15,0) = rotation(0,2); v(16,0) = rotation(1,2); v(17,0) = rotation(2,2); int n_cols = M.cols(); int n_rows = M.rows(); Eigen::MatrixXd ei = Eigen::MatrixXd::Zero(1,1); opengv::translation_t grad = Eigen::Vector3d::Zero(3,1); opengv::translation_t grad_iter = Eigen::Vector3d::Zero(3,1); for(int i = 0; i < n_rows; ++i){ ei = M.block(i,0,1,n_cols) * v; grad_iter(0,0) = M(i,2) * rotation(1,0) - M(i,1) * rotation(2,0) + M(i,5) * rotation(1,1) - M(i,4) * rotation(2,1) + M(i,8) * rotation(1,2) - M(i,7) * rotation(2,2); grad_iter(1,0) = M(i,0) * rotation(2,0) - M(i,2) * rotation(0,0) + M(i,3) * rotation(2,1) - M(i,5) * rotation(0,1) + M(i,6) * rotation(2,2) - M(i,8) * rotation(0,2); grad_iter(2,0) = M(i,1) * rotation(0,0) - M(i,0) * rotation(1,0) + M(i,4) * rotation(0,1) - M(i,3) * rotation(1,1) + M(i,7) * rotation(0,2) - M(i,6) * rotation(1,2); grad = grad + (2 * ei(0,0) * grad_iter); } return grad; }
c975953e44efc7f4f38840125e41fe8e6159c764
abdafdbce1cacc70d8a8c2f52f501b58bc950676
/string/code.cpp
fa486df9a70477f722339322641fa4de5c15cf90
[]
no_license
mgsonawane/practice
176921e2762f6481cbe712b259246ac75aeee71f
67465f669883c28b99a381778d62abd6b026e0bd
refs/heads/master
2020-07-01T12:52:44.120304
2019-08-08T05:08:56
2019-08-08T05:08:56
201,181,751
0
0
null
null
null
null
UTF-8
C++
false
false
544
cpp
code.cpp
#include<iostream> #include<cstring> using namespace std; void funct() { for(int i = 0;i<10;i++) if(i %2 == 0) cout<<"even "; else { cout<<"odd"; cout<<"dont use extra line of code"; } } char* reduce(char str[]) { int n = strlen(str); int i = 0 , j = 0; while(i < n-1) { if(str[i] == str[i+1]) i++; else { str[j++] = str[i]; i++; } } str[j++] = str[i]; str[j] = '\0'; return str; } int main() { char str[] = "aaaaaaaaaaadfffe"; cout<<reduce(str)<<endl; funct(); return 0; }
e84cced38258a2559e9494639a43e27abaf6994e
acfea035e985d27d12782db2ff82b0ec789ddf4f
/LeetCode Problems/C++/tastySweets.cpp
228641b40ea0d939a5dee478050d757a98283cf6
[ "Unlicense" ]
permissive
aayushkumarmishra/HactoberFest21
15d983981fdcba320b0177319d5e63c169063614
eb4a2141f377a5ed904ba021d4049c5db12a335a
refs/heads/master
2023-08-23T22:24:35.743070
2021-10-03T05:34:28
2021-10-03T05:34:28
412,985,003
1
0
Unlicense
2021-10-03T05:28:27
2021-10-03T05:28:27
null
UTF-8
C++
false
false
1,430
cpp
tastySweets.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" int main(){ // ios_base::sync_with_stdio(false); // cin.tie(NULL); // cout.tie(NULL); int t; cin >> t; while(t--){ int n, k; cin >> n >> k; vector<int> wt(n), taste(n); for(int i = 0; i < n; i++){ cin >> wt[i]; } for(int i = 0; i < n; i++){ cin >> taste[i]; } vector<int> maxWt; deque<int> dq; for(int i = 0; i < n; i++){ while(!dq.empty() && dq.front() <= i-k){ dq.pop_front(); } while(!dq.empty() && wt[dq.back()] < wt[i]){ dq.pop_back(); } dq.push_back(i); if(i >= k-1){ maxWt.push_back(dq.front()); } } vector<int> suffix; int j = n-1; for(int i = n-1; i > n-k; i--){ if(wt[i] > wt[j]){ j = i; } suffix.push_back(j); } for(int i = suffix.size()-1; i >= 0; i--){ maxWt.push_back(suffix[i]); } vector<int> dp(n,0); int ans = 0; for(int i = n-1; i >= 0; i--){ int window = 0; if(i+1 < n) window = dp[maxWt[i+1]]; dp[i] = max(dp[i], taste[i] + window); // cout<<dp[i]<<" "; ans = max(ans,dp[i]); } cout<<ans<<endl; } }
6483abd845560987ff0562eb153b79a21f27793d
671d07cbebce39f94e90c27e6a983f75d9914d4e
/19bca1206_8.cpp
01db03075dd66d57ed3a4cc4cd9d631d703720f6
[]
no_license
Shivendrapal/shivendra
90b43aeec10954e1970f786dacf88201392d7169
72cc11691a0f6f38303e6780c82a92e3d7cb8a9c
refs/heads/master
2021-05-26T16:18:46.310975
2020-04-08T16:11:11
2020-04-08T16:11:11
254,134,368
0
0
null
null
null
null
UTF-8
C++
false
false
711
cpp
19bca1206_8.cpp
#include<iostream> using namespace std; class student { public: class result { int maths,oops,sst; int result; public: void fun2() { cout<<"THE MARKS OF STUDENT IN \n 1=MATHS\n 2=OOPS\n 3=SST"<<endl; cin>>maths>>oops>>sst; result=maths+oops+sst; cout<<endl<<endl; cout<<"RESULT OF STUDENT="<<result<<endl<<endl; } }; result obj3; public: void getdata() { cout<<"ENTER YOUR MARKS \n"; obj3.fun2(); } public: class address { public: char home[10]; public: void fun3() { cout<<"enter your address="; cin>>home; cout<<endl<<endl; cout<<"ADDRESS OF STUDENT="<<home; } }; address obj5; void fun4() { obj5.fun3(); } }; int main() { student obj9; student obj1; obj9.getdata(); obj1.fun4(); }
a173d475e649901a69641ca5b3496e12ff9812e2
99751d3d775529c0fade2f4ab1238258598d95a8
/No of prizes.cpp
ad5326a16c3f616538b3b2b96fdd595935dc2703
[]
no_license
Sahithkumar-31/Geedy-Algo
0ffec94ecc2f0aaa44c6af0b54c4ca9d0d50e220
5bd85700ae4ee1decc266fd9d3c707384956c3a8
refs/heads/main
2023-08-22T09:02:20.299771
2021-10-23T11:54:51
2021-10-23T11:54:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,098
cpp
No of prizes.cpp
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> #include <vector> #include <cmath> using namespace std; vector<int>noprize(int n) { vector<int>a; if(n<=2) { return vector<int>({n}); } long long k =static_cast<int>(floor(sqrt(n))); while((k*(k+1))/2<=n) { k++; } k--; a.reserve(k); for(int i=1;i<=k;i++) { if(i==k) { a.push_back(n); } else { n=n-i; a.push_back(i); } } return a; } using namespace std; int main() { int n; cin>>n; vector<int>prizes= noprize(n); cout<<prizes.size()<<"\n"; for(size_t i=0;i<prizes.size();++i) { cout<<prizes[i]<<" "; } }
c36af29ec74c377eec8c03f8b21c06c3008d3122
639a6c8ff4d098a625b5904f260eec19764a598f
/Sources/AddOn/Controls.cpp
57826212d51477701670f76471785214bcdd863a
[ "MIT" ]
permissive
Bishwanath-Dey-Nayan/ARCHICAD-ADD-ONS-Manager
27c8fa47d2367dca428e8e3bd80b34d0ee889ab2
8960a43ead0aa0977d675bd6155e6c9bdd43683b
refs/heads/master
2023-04-13T08:07:06.555025
2021-04-27T08:12:52
2021-04-27T08:12:52
355,536,448
0
0
null
null
null
null
UTF-8
C++
false
false
605
cpp
Controls.cpp
#include "Controls.hpp" GS::ClassInfo Controls::classInfo("Controls", GS::Guid("B45089A9-B372-460B-B145-80E6EBF107C3"), GS::ClassVersion(1, 0)); Controls::Controls() :Controls(0, 0, 0) { } Controls::Controls(UInt32 scale, UInt32 layer, UInt32 item):scale(scale), layer(layer), item(item) { } GSErrCode Controls::Read(GS::IChannel& ic) { GS::InputFrame frame(ic, classInfo); ic.Read(scale); ic.Read(layer); return ic.GetInputStatus(); } GSErrCode Controls::Write(GS::OChannel & oc) const { GS::OutputFrame frame(oc, classInfo); oc.Write(scale); oc.Write(layer); return oc.GetOutputStatus(); }
dfe86b308063c296403319a889e05f39a4f61648
da28cb13ef26f8a4092fed048d0d5f76076523d3
/graph/densegraph.h
f39a38ac654e41046b8fc819d617e60892de859e
[]
no_license
baiyeshishen/shuJuJieGou
d7dcbad57233f8549ba177a2e5e586594484c7a2
e40b5212cfab880e230dfaa0af81e87565ce9a53
refs/heads/master
2022-11-01T11:10:40.866172
2020-06-20T07:27:46
2020-06-20T07:27:46
273,659,613
0
0
null
null
null
null
UTF-8
C++
false
false
1,454
h
densegraph.h
#ifndef DENSE_GRAPH #define DENSE_GRAPH #include<vector> #include<cassert> #include<iostream> using namespace std; class DenseGraph{ private: int n,m;//分别表示顶点数和边数; bool directed; vector<vector<bool>>g;//邻接矩阵表示稠密图; bool hasEdge(int v,int w){ assert(v>=0&&v<n); assert(w>=0&&w<n); return g[v][w]; } public: DenseGraph(int n,bool directed){ this->n=n; this->m=0; this->directed=directed; for(int i=0;i<n;i++) g.push_back(vector<bool>(n,false)); } ~DenseGraph(){} int V(){return n;} int E(){return m;} void addEdge(int v,int w){ assert(v>=0&&v<n); assert(w>=0&&w<n); if(hasEdge(v,w)) return; g[v][w]=true; if(!directed) g[w][v]=true; m++; } class adjIterator{ private: DenseGraph&G; int v; int index; public: adjIterator(DenseGraph&graph,int v) :G(graph){ this->v=v; this->index=-1; } int begin(){ index=-1; return next(); } int next(){ for(index+=1;index<G.V();index++){ if(G.g[v][index]) return index; } return -1; } bool end(){ return index>=G.V(); } }; }; #endif
ee3d964daf9b0004d0f3ed0f5dd24f8eb0734375
2db07353b4c05126d4333965ba41a5f1e00ace0b
/gpu.h
12aae8626dc39fd0c7b8ae36c3f956c3330b7c1f
[]
no_license
adrianaliendo/readingnetwork
74cb507796409b996d11f15feb04ff7aaf993382
3cccd3068606bf81fc952f277128f49bc7724dc8
refs/heads/master
2020-03-25T07:38:43.514064
2014-04-28T19:00:52
2014-04-28T19:00:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,907
h
gpu.h
/* * File: gpu.h * Author: aliendo * * Created on 26 de diciembre de 2013, 11:23 AM */ #ifndef GPU_H #define GPU_H #include <iostream> #include <string> #include <sstream> #include <stdlib.h> //#include <mpi.h> // "/usr/include/openmpi-x86_64/mpi.h" using namespace std; class gpu { public: bool present; int deviceCount;//Indica el numero de GPU disponibles string *name;//Indica el nombre de cada GPU. Debe ser un arreglo del tamaño de deviceCount int *major;//Major revision number. Debe ser un arreglo del tamaño de deviceCount int *minor;//Minor revision number. Debe ser un arreglo del tamaño de deviceCount unsigned int *totalGlobalMem;//Total amount of global memory. Debe ser un arreglo del tamaño de deviceCount int *multiProcessorCount;//Number of multiprocessors. Debe ser un arreglo del tamaño de deviceCount int *numCores;//Number of cores. Debe ser un arreglo del tamaño de deviceCount unsigned int *totalConstMem;//Total amount of constant memory. Debe ser un arreglo del tamaño de deviceCount unsigned int *sharedMemPerBlock;//Total amount of shared memory per block. Debe ser un arreglo del tamaño de deviceCount int *regsPerBlock;//Total number of registers available per block. Debe ser un arreglo del tamaño de deviceCount int *warpSize;//Warp size. Debe ser un arreglo del tamaño de deviceCount int *maxThreadsPerBlock;//Maximum number of threads per block. Debe ser un arreglo del tamaño de deviceCount int *maxThreadsDim0, *maxThreadsDim1, *maxThreadsDim2;//Maximum sizes of each dimension of a block. Debe ser un arreglo del tamaño de deviceCount int *maxGridSize0, *maxGridSize1, *maxGridSize2;//Maximum sizes of each dimension of a grid. Debe ser un arreglo del tamaño de deviceCount unsigned int *memPitch;//Maximum memory pitch. Debe ser un arreglo del tamaño de deviceCount unsigned int *textureAlignment;//Texture alignment. Debe ser un arreglo del tamaño de deviceCount float *clockRate;//Clock rate. Debe ser un arreglo del tamaño de deviceCount bool *deviceOverlap;//Concurrent copy and execution. Debe ser un arreglo del tamaño de deviceCount gpu(); gpu(bool verify); /*Para empaquetado de datos*/ gpu(void *buf,int size); void pack(void *buf, int size); /*gpu(const gpu& orig); virtual ~gpu();*/ bool getPresent(); void setDeviceCount(); void setDeviceProperties(); void setPresent(); void gpuCopy(gpu aCopiar); void complete(); /*Para descubrimiento de la clase*/ int natr; string *valueatr; string *nameatr; int getNatr();//Indica el numero de atributos string getValueatr(int n);//Indica el tipo de dato del atributo string getNameatr(int n);//Indica el nombre del atributo private: void setNatr(); void setValueatr(); void setNameatr(); }; #endif /* GPU_H */
823ec03d13b6ff93c9ebc42cb85dc6f60fed8343
385cfbb27ee3bcc219ec2ac60fa22c2aa92ed8a0
/Gui3d/LayoutLeft.cpp
51ad14adb008c203a2b03ffd806f82b55c1815cd
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
palestar/medusa
edbddf368979be774e99f74124b9c3bc7bebb2a8
7f8dc717425b5cac2315e304982993354f7cb27e
refs/heads/develop
2023-05-09T19:12:42.957288
2023-05-05T12:43:35
2023-05-05T12:43:35
59,434,337
35
18
MIT
2018-01-21T01:34:01
2016-05-22T21:05:17
C++
UTF-8
C++
false
false
408
cpp
LayoutLeft.cpp
/* LayoutLeft.cpp (c)2005 Palestar Inc, Richard Lyle */ #define GUI3D_DLL #include "Gui3d/LayoutLeft.h" //---------------------------------------------------------------------------- IMPLEMENT_FACTORY( LayoutLeft, WindowLayout ); REGISTER_FACTORY_KEY( LayoutLeft, 4186565727206490347 ); LayoutLeft::LayoutLeft() {} //---------------------------------------------------------------------------- //EOF
6fc63803844a4ae6be5d27a4ffc6e96ce74ea191
bfed570d24468df3994eb876758253b70c3d375e
/src/hzip_storage/archive/archive.cpp
9fe6f44cea6126db9dfca5f8756b66238c15ef52
[]
no_license
hybridzip/hybridzip
624fc67a498c004ca2a26b0b433cccdcf953151b
8ed98b1c2058860bd5fe356320b6debbf589c37b
refs/heads/master
2023-08-04T13:12:13.604343
2023-07-21T06:30:01
2023-07-21T06:30:01
177,826,931
1
1
null
2023-07-21T06:30:03
2019-03-26T16:22:56
C++
UTF-8
C++
false
false
23,951
cpp
archive.cpp
#include "archive.h" #include <filesystem> #include <fcntl.h> #include <loguru/loguru.hpp> #include <hzip_core/utils/validation.h> #include <hzip_core/utils/utils.h> #include <hzip_core/utils/fsutils.h> #include <hzip_storage/errors/archive.h> HZ_Archive::HZ_Archive(const std::string &archive_path) { path = std::filesystem::absolute(archive_path); bool init_flag = !fsutils::check_if_file_exists(path); if (init_flag) { fsutils::create_empty_file(path); } FILE *fp; if ((fp = fopen(path.c_str(), "rb+")) == nullptr) { throw ArchiveErrors::InvalidOperationException(std::string("fopen() failed with error: ") + std::strerror(errno)); } stream = rainman::ptr<bitio::stream>(1, fp); auto sha512_path = "/" + hz_sha512(path); const char *sname = sha512_path.c_str(); // Lock archive. LOG_F(INFO, "hzip_core.archive: Requesting access to archive [%s]", path.c_str()); archive_mutex = rainman::ptr<sem_t>(sem_open(sname, O_CREAT, 0777, 1), 1); if (archive_mutex.pointer() == SEM_FAILED) { throw ArchiveErrors::InvalidOperationException(std::string("sem_open() failed with error: ") + std::strerror(errno)); } sem_wait(archive_mutex.pointer()); LOG_F(INFO, "hzip_core.archive: Access granted to archive [%s]", path.c_str()); if (init_flag) { hza_init(); } } void HZ_Archive::hza_scan() { mutex.lock(); auto readfn = [this](uint64_t n) { this->metadata.eof += n; return this->stream->read(n); }; auto seekfn = [this](uint64_t n) { this->metadata.eof += n; this->stream->seek(n); }; metadata.eof = 0; while (true) { auto marker = (HZ_ArchiveMarker) readfn(0x8); if (marker == HZ_ArchiveMarker::END) { metadata.eof -= 0x8; break; } switch (marker) { case HZ_ArchiveMarker::METADATA: { hza_scan_metadata_segment(readfn, seekfn); break; } case HZ_ArchiveMarker::BLOB: { hza_scan_blob_segment(readfn, seekfn); break; } case HZ_ArchiveMarker::MSTATE: { hza_scan_mstate_segment(readfn, seekfn); break; } case HZ_ArchiveMarker::EMPTY: { hza_scan_fragment(readfn, seekfn); break; } default: break; } } mutex.unlock(); } void HZ_Archive::hza_scan_metadata_segment(const std::function<uint64_t(uint64_t)> &read, const std::function<void(uint64_t)> &seek) { uint64_t sof = metadata.eof; // block-length is not necessary, so skip it. seek(0x40); // Read metadata entry type auto entry_type = (HZ_ArchiveMetadataEntryType) read(0x8); switch (entry_type) { case HZ_ArchiveMetadataEntryType::VERSION: { // Version ranges from 0.0.0 to ff.ff.ff metadata.version = read(0x18); if (metadata.version != HZ_ARCHIVE_VERSION) { throw ArchiveErrors::InvalidOperationException("Archive version not supported"); } break; } case HZ_ArchiveMetadataEntryType::FILEINFO: { uint64_t path_length = read(0x40); std::string _path; for (uint64_t i = 0; i < path_length; i++) { _path += (char) read(0x8); } uint64_t blob_count = read(0x3A); auto blob_ids = rainman::ptr<uint64_t>(blob_count); for (uint64_t i = 0; i < blob_count; i++) { blob_ids[i] = read(0x40); } auto file = HZ_ArchiveFile(blob_ids); metadata.file_map.set(_path, HZ_ArchiveEntry(file, sof - 0x8)); break; } case HZ_ArchiveMetadataEntryType::MSTATE_AUX: { // mstate-auxillary map assigns a string to a mstate. // this is used when the same mstate is used by other blobs. // format: <path-length (64-bit)> <path (8-bit-array)> <mstate-id (64-bit)> uint64_t path_length = read(0x40); std::string _path; for (uint64_t i = 0; i < path_length; i++) { _path += (char) read(0x8); } metadata.mstate_aux_map.set(_path, HZ_ArchiveEntry(read(0x40), sof - 0x8)); break; } } } void HZ_Archive::hza_scan_blob_segment(const std::function<uint64_t(uint64_t)> &read, const std::function<void(uint64_t)> &seek) { // BLOB format: <hza_marker (8-bit)> <block-length (64bit)> <blob-id (64-bit)> ... auto sof = metadata.eof - 0x8; auto size = read(0x40); uint64_t blob_id = read(0x40); // Skip the blob data seek(size - 0x40); metadata.blob_map[blob_id] = sof; } void HZ_Archive::hza_scan_fragment(const std::function<uint64_t(uint64_t)> &read, const std::function<void(uint64_t)> &seek) { HZ_ArchiveFragment fragment{}; fragment.sof = metadata.eof - 0x8; fragment.length = read(0x40); metadata.fragments.push_back(fragment); // Skip data block seek(fragment.length); } void HZ_Archive::hza_scan_mstate_segment(const std::function<uint64_t(uint64_t)> &read, const std::function<void(uint64_t)> &seek) { // MSTATE format: <hza_marker (8-bit)> <block-length (64bit)> <mstate-id (64-bit)> ... auto sof = metadata.eof - 0x8; auto size = read(0x40); uint64_t mstate_id = read(0x40); // Skip the blob data seek(size - 0x40); metadata.mstate_map[mstate_id] = sof; } rainman::option<uint64_t> HZ_Archive::hza_alloc_fragment(uint64_t length) { uint64_t fragment_index = 0; uint64_t fit_diff = 0xffffffffffffffff; bool found_fragment = false; // Best-fit for fragment utilization. for (uint64_t i = 0; i < metadata.fragments.size(); i++) { auto fragment = metadata.fragments[i]; if (fragment.length >= length) { uint64_t diff = fragment.length - length; if (diff < 0x48 && diff > 0) { continue; } if (diff < fit_diff) { fit_diff = diff; found_fragment = true; fragment_index = i; } } } if (found_fragment) { uint64_t psof = metadata.fragments[fragment_index].sof; if (fit_diff > 0) { metadata.fragments[fragment_index].length = fit_diff - 0x48; metadata.fragments[fragment_index].sof += 0x48 + length; stream->seek_to(metadata.fragments[fragment_index].sof); stream->write(HZ_ArchiveMarker::EMPTY, 0x8); stream->write(metadata.fragments[fragment_index].length, 0x40); } else { // If perfect fit then erase fragment. metadata.fragments.erase(metadata.fragments.begin() + fragment_index); } return rainman::option<uint64_t>(psof); } else { return rainman::option<uint64_t>(); } } void HZ_Archive::hza_init() { mutex.lock(); stream->seek_to(0); // Write archive version. stream->write(HZ_ArchiveMarker::METADATA, 0x8); stream->write(0x20, 0x40); stream->write(HZ_ArchiveMetadataEntryType::VERSION, 0x8); stream->write(HZ_ARCHIVE_VERSION, 0x18); stream->write(HZ_ArchiveMarker::END, 0x8); stream->flush(); stream->seek_to(0); LOG_F(INFO, "hzip_core.archive: Initialized archive [%s]", path.c_str()); mutex.unlock(); } void HZ_Archive::hza_create_metadata_file_entry(const std::string &file_path, const HZ_ArchiveFile& file) { // Evaluate length of entry to utilize fragmented-space. if (metadata.file_map.contains(file_path)) { mutex.unlock(); throw ArchiveErrors::InvalidOperationException("file entry cannot be overwritten"); } uint64_t length = 0; uint64_t path_length = file_path.length(); length += 0x40; length += (file_path.length() << 3); // FILEINFO-metadata-marker (8-bit) + Blob-count (n) (58-bit) + n 64-bit blob-ids length += 0x42 + (file.blob_ids.size() << 0x6); rainman::option<uint64_t> o_frag = hza_alloc_fragment(length); uint64_t sof; if (o_frag.is_some()) { uint64_t frag_sof = o_frag.inner(); sof = frag_sof; // seek to allocated fragment. stream->seek_to(frag_sof); } else { // seek to end-of-file sof = metadata.eof; stream->seek_to(metadata.eof); metadata.eof += 0x48 + length; } // Update metadata metadata.file_map.set(file_path, HZ_ArchiveEntry(file, sof)); // Write block-info stream->write(HZ_ArchiveMarker::METADATA, 0x8); stream->write(length, 0x40); stream->write(HZ_ArchiveMetadataEntryType::FILEINFO, 0x8); // Write file_path stream->write(path_length, 0x40); for (char i : file_path) { stream->write(i, 0x8); } // Write blob_count. stream->write(file.blob_ids.size(), 0x3A); // Write 64-bit blob_ids for (int i = 0; i < file.blob_ids.size(); i++) { stream->write(file.blob_ids[i], 0x40); } } HZ_ArchiveFile HZ_Archive::hza_read_metadata_file_entry(const std::string &file_path) { if (!metadata.file_map.contains(file_path)) { mutex.unlock(); throw ArchiveErrors::FileNotFoundException(file_path); } return metadata.file_map.get(file_path).data; } rainman::ptr<HZ_Blob> HZ_Archive::hza_read_blob(uint64_t id) { auto blob = rainman::ptr<HZ_Blob>(); if (!metadata.blob_map.contains(id)) { mutex.unlock(); throw ArchiveErrors::BlobNotFoundException(id); } uint64_t sof = metadata.blob_map[id]; stream->seek_to(sof); // Ignore block-marker, block-length and blob-id as we know the blob-format. stream->seek(0x88); blob->header = HZ_BlobHeader(); auto header_len = stream->read(0x40); blob->header.raw = rainman::ptr<uint8_t>(header_len); for (uint64_t i = 0; i < header_len; i++) { blob->header.raw[i] = stream->read(0x8); } blob->o_size = stream->read(0x40); blob->mstate_id = stream->read(0x40); blob->size = stream->read(0x40); blob->data = rainman::ptr<uint8_t>(blob->size); for (uint64_t i = 0; i < blob->size; i++) { blob->data[i] = stream->read(0x8); } blob->mstate = hza_read_mstate(blob->mstate_id); return blob; } uint64_t HZ_Archive::hza_write_blob(const HZ_Blob &blob) { // blob writing format: <hzmarker (8bit)> <block length (64bit)> <blob-id (64-bit)> // <blob-header <size (64-bit)> <raw (8-bit-arr)>> <blob-o-size (64-bit)> // <mstate-id (64-bit)> <blob-data <size (64-bit)> <data (8-bit arr)>> if (!metadata.mstate_map.contains(blob.mstate_id)) { mutex.unlock(); throw ArchiveErrors::MstateNotFoundException(blob.mstate_id); } uint64_t length = 0x140 + (blob.header.size() << 3) + (blob.size << 3); rainman::option<uint64_t> o_frag = hza_alloc_fragment(length); uint64_t sof; if (o_frag.is_some()) { sof = o_frag.inner(); stream->seek_to(sof); } else { sof = metadata.eof; stream->seek_to(sof); metadata.eof += 0x48 + length; } // Write block-info. stream->write(HZ_ArchiveMarker::BLOB, 0x8); stream->write(length, 0x40); // Create a new unique blob-id and write it. uint64_t blob_id = hz_rand64(); while (metadata.blob_map.contains(blob_id)) { blob_id = hz_rand64(); } stream->write(blob_id, 0x40); // Update blob-map metadata.blob_map[blob_id] = sof; // Write blob metadata. stream->write(blob.header.size(), 0x40); for (uint64_t i = 0; i < blob.header.size(); i++) { stream->write(blob.header.raw[i], 0x8); } stream->write(blob.o_size, 0x40); stream->write(blob.mstate_id, 0x40); // add dependency hza_increment_dep(blob.mstate_id); // Write blob-data stream->write(blob.size, 0x40); for (int i = 0; i < blob.size; i++) { stream->write(blob.data[i], 0x8); } return blob_id; } void HZ_Archive::hza_rm_blob(uint64_t id) { if (metadata.blob_map.contains(id)) { uint64_t sof = metadata.blob_map[id]; stream->seek_to(sof); // HZ_ASSERT(stream->read(0x8) == HZ_ArchiveMarker::BLOB, "Expected blob marker in archive stream"); // stream->seek(-0x8); stream->write(HZ_ArchiveMarker::EMPTY, 0x8); metadata.fragments.push_back(HZ_ArchiveFragment{ .sof=sof, .length=stream->read(0x40) }); // remove dependency stream->seek(0x40); auto header_length = stream->read(0x40); stream->seek(header_length << 3); stream->seek(0x40); auto mstate_id = stream->read(0x40); hza_decrement_dep(mstate_id); // erase entry from blob map metadata.blob_map.erase(id); } else { mutex.unlock(); throw ArchiveErrors::BlobNotFoundException(id); } } rainman::ptr<HZ_MState> HZ_Archive::hza_read_mstate(uint64_t id) { if (!metadata.mstate_map.contains(id)) { mutex.unlock(); throw ArchiveErrors::MstateNotFoundException(id); } auto mstate = rainman::ptr<HZ_MState>(); uint64_t sof = metadata.mstate_map[id]; stream->seek_to(sof); // Ignore block-marker, block-length and mstate-id as we know the mstate-format. stream->seek(0x88); mstate->alg = (hzcodec::algorithms::ALGORITHM) stream->read(0x40); auto length = stream->read(0x40); mstate->data = rainman::ptr<uint8_t>(length); for (uint64_t i = 0; i < length; i++) { mstate->data[i] = stream->read(0x8); } return mstate; } uint64_t HZ_Archive::hza_write_mstate(const rainman::ptr<HZ_MState>& mstate) { // mstate writing format: <hzmarker (8bit)> <block length (64bit)> // <mstate-id (64-bit)> <algorithm (64-bit)> <data-length (64-bit)> <data (8-bit-array)> uint64_t length = 0xC0 + (mstate->size() << 0x3); rainman::option<uint64_t> o_frag = hza_alloc_fragment(length); uint64_t sof; if (o_frag.is_some()) { sof = o_frag.inner(); stream->seek_to(sof); } else { sof = metadata.eof; stream->seek_to(sof); metadata.eof += 0x48 + length; } // Write block-info. stream->write(HZ_ArchiveMarker::MSTATE, 0x8); stream->write(length, 0x40); // Create new mstate-id uint64_t mstate_id = hz_rand64(); while (metadata.mstate_map.contains(mstate_id)) { mstate_id = hz_rand64(); } stream->write(mstate_id, 0x40); stream->write(mstate->alg, 0x40); // Update mstate-map metadata.mstate_map[mstate_id] = sof; // Write mstate-data stream->write(mstate->size(), 0x40); for (int i = 0; i < mstate->size(); i++) { stream->write(mstate->data[i], 0x8); } return mstate_id; } void HZ_Archive::install_mstate(const std::string &_path, const rainman::ptr<HZ_MState> &mstate) { hz_validate_path(_path); mutex.lock(); if (metadata.mstate_aux_map.contains(_path)) { mutex.unlock(); throw ArchiveErrors::InvalidOperationException("Mstate already exists"); } uint64_t id = hza_write_mstate(mstate); // Create auxillary mstate-entry. uint64_t length = 0x48; uint64_t path_length = _path.length(); length += 0x40; length += (_path.length() << 3); rainman::option<uint64_t> o_frag = hza_alloc_fragment(length); uint64_t sof; if (o_frag.is_some()) { sof = o_frag.inner(); // seek to allocated fragment. stream->seek_to(sof); } else { sof = metadata.eof; // seek to end-of-file stream->seek_to(metadata.eof); metadata.eof += 0x48 + length; } // Update metadata metadata.mstate_aux_map.set(_path, HZ_ArchiveEntry(id, sof)); metadata.mstate_inv_aux_map[id] = true; // Write block-info stream->write(HZ_ArchiveMarker::METADATA, 0x8); stream->write(length, 0x40); stream->write(HZ_ArchiveMetadataEntryType::MSTATE_AUX, 0x8); // Write file_path stream->write(path_length, 0x40); for (char i : _path) { stream->write(i, 0x8); } // Write mstate-id. stream->write(id, 0x40); mutex.unlock(); } void HZ_Archive::hza_rm_mstate(uint64_t id) { if (metadata.mstate_map.contains(id)) { if (hza_check_mstate_deps(id)) { mutex.unlock(); throw ArchiveErrors::InvalidOperationException("mstate dependency detected"); } uint64_t sof = metadata.mstate_map[id]; stream->seek_to(sof); stream->write(HZ_ArchiveMarker::EMPTY, 0x8); metadata.fragments.push_back(HZ_ArchiveFragment{ .sof=sof, .length=stream->read(0x40) }); metadata.mstate_map.erase(id); } else { LOG_F(INFO, "hzip_core.archive: mstate(0x%lx) was not found, operation ignored", id); } } bool HZ_Archive::hza_check_mstate_deps(uint64_t id) const { return metadata.dep_counter.contains(id); } void HZ_Archive::hza_increment_dep(uint64_t id) { if (!metadata.dep_counter.contains(id)) { metadata.dep_counter[id] = 1; } else { metadata.dep_counter[id]++; } } void HZ_Archive::hza_decrement_dep(uint64_t id) { if (metadata.dep_counter.contains(id)) { if (metadata.dep_counter[id] > 1) { metadata.dep_counter[id]--; } else { metadata.dep_counter.erase(id); if (!metadata.mstate_inv_aux_map.contains(id)) { hza_rm_mstate(id); } } } } void HZ_Archive::create_file(const std::string &file_path, const rainman::ptr<HZ_Blob> &blobs, uint64_t blob_count) { hz_validate_path(file_path); mutex.lock(); if (metadata.file_map.contains(file_path)) { mutex.unlock(); throw ArchiveErrors::InvalidOperationException("file already exists"); } HZ_ArchiveFile file{}; file.blob_ids = rainman::ptr<uint64_t>(blob_count); for (uint64_t i = 0; i < blob_count; i++) { file.blob_ids[i] = hza_write_blob(blobs[i]); } hza_create_metadata_file_entry(file_path, file); mutex.unlock(); } void HZ_Archive::remove_file(const std::string &file_path) { hz_validate_path(file_path); mutex.lock(); if (!metadata.file_map.contains(file_path)) { mutex.unlock(); throw ArchiveErrors::FileNotFoundException(file_path); } HZ_ArchiveEntry entry = metadata.file_map.get(file_path); uint64_t sof = entry.sof; HZ_ArchiveFile file = entry.data; stream->seek_to(sof); stream->write(HZ_ArchiveMarker::EMPTY, 0x8); metadata.fragments.push_back(HZ_ArchiveFragment{ .sof=sof, .length=stream->read(0x40) }); for (uint64_t i = 0; i < file.blob_ids.size(); i++) { hza_rm_blob(file.blob_ids[i]); } hza_metadata_erase_file(file_path); mutex.unlock(); } rainman::ptr<HZ_Blob> HZ_Archive::read_file(const std::string &file_path) { hz_validate_path(file_path); mutex.lock(); if (!metadata.file_map.contains(file_path)) { mutex.unlock(); throw ArchiveErrors::FileNotFoundException(file_path); } HZ_ArchiveFile file = hza_read_metadata_file_entry(file_path); auto blobs = rainman::ptr<HZ_Blob>(file.blob_ids.size()); for (uint64_t i = 0; i < file.blob_ids.size(); i++) { auto blob = hza_read_blob(file.blob_ids[i]); blobs[i] = *blob; } mutex.unlock(); return blobs; } void HZ_Archive::uninstall_mstate(const std::string &_path) { hz_validate_path(_path); mutex.lock(); if (!metadata.mstate_aux_map.contains(_path)) { mutex.unlock(); throw ArchiveErrors::MstateNotFoundException(0); } HZ_ArchiveEntry entry = metadata.mstate_aux_map.get(_path); uint64_t sof = entry.sof; uint64_t id = entry.data; hza_rm_mstate(id); stream->seek_to(sof); stream->write(HZ_ArchiveMarker::EMPTY, 0x8); metadata.fragments.push_back(HZ_ArchiveFragment{ .sof=sof, .length=stream->read(0x40) }); metadata.mstate_aux_map.erase(_path); metadata.mstate_inv_aux_map.erase(id); mutex.unlock(); } void HZ_Archive::inject_mstate(const rainman::ptr<HZ_MState> &mstate, const rainman::ptr<HZ_Blob> &blob) { mutex.lock(); blob->mstate_id = hza_write_mstate(mstate); blob->mstate = mstate; mutex.unlock(); } void HZ_Archive::inject_mstate(const std::string &_path, const rainman::ptr<HZ_Blob>& blob) { hz_validate_path(_path); mutex.lock(); if (!metadata.mstate_aux_map.contains(_path)) { mutex.unlock(); throw ArchiveErrors::MstateNotFoundException(0); } blob->mstate_id = metadata.mstate_aux_map.get(_path).data; blob->mstate = hza_read_mstate(blob->mstate_id); mutex.unlock(); } uint64_t HZ_Archive::install_mstate(const rainman::ptr<HZ_MState> &mstate) { mutex.lock(); uint64_t id = hza_write_mstate(mstate); mutex.unlock(); return id; } void HZ_Archive::uninstall_mstate(uint64_t id) { mutex.lock(); hza_rm_mstate(id); mutex.unlock(); } void HZ_Archive::close() { mutex.lock(); stream->seek_to(metadata.eof); stream->write(HZ_ArchiveMarker::END, 0x8); stream->flush(); mutex.unlock(); sem_post(archive_mutex.pointer()); } void HZ_Archive::load() { hza_scan(); } void HZ_Archive::create_file_entry(const std::string &file_path, const HZ_ArchiveFile& file) { mutex.lock(); hza_create_metadata_file_entry(file_path, file); mutex.unlock(); } uint64_t HZ_Archive::write_blob(const rainman::ptr<HZ_Blob> &blob) { mutex.lock(); uint64_t id = hza_write_blob(*blob); mutex.unlock(); return id; } bool HZ_Archive::check_file_exists(const std::string &file_path) { mutex.lock(); bool v = metadata.file_map.contains(file_path); mutex.unlock(); return v; } HZ_ArchiveFile HZ_Archive::read_file_entry(const std::string &file_path) { mutex.lock(); HZ_ArchiveFile file = hza_read_metadata_file_entry(file_path); mutex.unlock(); return file; } rainman::ptr<HZ_Blob> HZ_Archive::read_blob(uint64_t id) { mutex.lock(); auto blob = hza_read_blob(id); mutex.unlock(); return blob; } rainman::ptr<HZ_MState> HZ_Archive::read_mstate(const std::string& _path) { mutex.lock(); if (!metadata.mstate_aux_map.contains(_path)) { mutex.unlock(); throw ArchiveErrors::InvalidOperationException("Mstate not found"); } auto id = metadata.mstate_aux_map.get(_path).data; auto mstate = hza_read_mstate(id); mutex.unlock(); return mstate; } bool HZ_Archive::check_mstate_exists(const std::string &_path) { mutex.lock(); bool exists = metadata.mstate_aux_map.contains(_path); mutex.unlock(); return exists; } void HZ_Archive::hza_metadata_erase_file(const std::string &_file_path) { if (metadata.file_map.contains(_file_path)) { auto file = metadata.file_map.get(_file_path).data; metadata.file_map.erase(_file_path); } } std::vector<HZ_ArchiveTrieListElement> HZ_Archive::list_file_system(const std::string &prefix) { mutex.lock(); auto list = metadata.file_map.children(prefix); mutex.unlock(); return list; } std::vector<HZ_ArchiveTrieListElement> HZ_Archive::list_mstate_system(const std::string &prefix) { mutex.lock(); auto list = metadata.mstate_aux_map.children(prefix); mutex.unlock(); return list; }