#pragma once #include "CKTypes.hpp" #include "../XContainer/XTypes.hpp" #include #include #include #include #include namespace LibCmo::CK2 { /** * @brief Current Version of CK Engine (Day/Month/Year) */ constexpr const CKDWORD CKVERSION = 0x05082002u; /** * @brief Current Version of Dev */ constexpr const CKDWORD DEVVERSION = 0x02050000u; constexpr const CKGUID VIRTOOLS_GUID = CKGUID(0x56495254u, 0x4f4f4c53u); // ========== Class registration utilities ========== //using CKClassRegisterFct = std::function; using CKClassCreationFct = std::function; using CKClassReleaseFct = std::function; using CKClassNameFct = std::function; //using CKClassDependenciesFct = std::function; //using CKClassDependenciesCountFct = std::function; struct CKClassDesc { CKBOOL Done; // Initialized upon class registration CK_CLASSID Self; CK_CLASSID Parent; // Class Identifier of parent class //CKClassRegisterFct RegisterFct; // Pointer to Class Specific Registration function CKClassCreationFct CreationFct; // Pointer to Class instance creation function CKClassReleaseFct ReleaseFct; // Pointer to Class instance release function CKClassNameFct NameFct; // Pointer to Class name function //CKClassDependenciesFct DependsFct; // Pointer to Class dependencies function (Copy,delete,replace...) //CKClassDependenciesCountFct DependsCountFct; // Pointer to Class dependencies Count function (Copy,delete,replace...) //// Initialized by class specific registration function //CKDWORD DefaultOptions; // Default options for this class //CKDWORD DefaultCopyDependencies; //CKDWORD DefaultDeleteDependencies; //CKDWORD DefaultReplaceDependencies; //CKDWORD DefaultSaveDependencies; //CKGUID Parameter; // Associated parameter GUID // Initialized when building class hierarchy table CKINT DerivationLevel; // O => CKObject , etc.. XContainer::XBitArray Parents; // Bit Mask of parents classes XContainer::XBitArray Children; // Bit Mask of children classes //XContainer::XBitArray ToBeNotify; // Mask for Classes that should warn the objects of this class when they are deleted //XContainer::XBitArray CommonToBeNotify; // idem but merged with sub classes masks //XContainer::XSArray ToNotify; // List of ClassID to notify when an object of this class is deleted (inverse of ToBeNotify) CKClassDesc() : Done(CKFALSE), Self(CK_CLASSID::CKCID_OBJECT), Parent(CK_CLASSID::CKCID_OBJECT), CreationFct(nullptr), ReleaseFct(nullptr), NameFct(nullptr), DerivationLevel(0), Parents(), Children() {} CKClassDesc(const CKClassDesc& rhs) = default; CKClassDesc(CKClassDesc&& rhs) = default; CKClassDesc& operator=(const CKClassDesc& rhs) = default; CKClassDesc& operator=(CKClassDesc& rhs) = default; }; }