Plasma Engine  2.0
Loading...
Searching...
No Matches
PlatformProfile.h
1#pragma once
2
3#include <Core/CoreDLL.h>
4#include <Foundation/Reflection/Reflection.h>
5
8
10class PL_CORE_DLL plProfileConfigData : public plReflectedClass
11{
12 PL_ADD_DYNAMIC_REFLECTION(plProfileConfigData, plReflectedClass);
13
14public:
17
18 virtual void SaveRuntimeData(plChunkStreamWriter& inout_stream) const;
19 virtual void LoadRuntimeData(plChunkStreamReader& inout_stream);
20};
21
23
24class PL_CORE_DLL plPlatformProfile final : public plReflectedClass
25{
26 PL_ADD_DYNAMIC_REFLECTION(plPlatformProfile, plReflectedClass);
27
28public:
31
32 void SetConfigName(plStringView sName) { m_sName = sName; }
33 plStringView GetConfigName() const { return m_sName; }
34
35 void SetTargetPlatform(plStringView sPlatform) { m_sTargetPlatform = sPlatform; }
36 plStringView GetTargetPlatform() const { return m_sTargetPlatform; }
37
38 void Clear();
39 void AddMissingConfigs();
40
41 template <typename TYPE>
42 const TYPE* GetTypeConfig() const
43 {
44 return static_cast<const TYPE*>(GetTypeConfig(plGetStaticRTTI<TYPE>()));
45 }
46
47 template <typename TYPE>
48 TYPE* GetTypeConfig()
49 {
50 return static_cast<TYPE*>(GetTypeConfig(plGetStaticRTTI<TYPE>()));
51 }
52
53 const plProfileConfigData* GetTypeConfig(const plRTTI* pRtti) const;
54 plProfileConfigData* GetTypeConfig(const plRTTI* pRtti);
55
56 plResult SaveForRuntime(plStringView sFile) const;
57 plResult LoadForRuntime(plStringView sFile);
58
60 plUInt32 GetLastModificationCounter() const { return m_uiLastModificationCounter; }
61
62private:
63 plUInt32 m_uiLastModificationCounter = 0;
64 plString m_sName;
65 plString m_sTargetPlatform = "Windows";
67};
68
Reader for the chunk format that plChunkStreamWriter writes.
Definition ChunkStream.h:47
A stream writer that separates data into 'chunks', which act like sub-streams.
Definition ChunkStream.h:12
Definition DynamicArray.h:81
Definition PlatformProfile.h:25
plUInt32 GetLastModificationCounter() const
Returns a number indicating when the profile counter changed last. By storing and comparing this valu...
Definition PlatformProfile.h:60
Base class for configuration objects that store e.g. asset transform settings or runtime configuratio...
Definition PlatformProfile.h:11
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54