![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cXObjMgrPack.h>
Public Member Functions | |
| cXObjMgrPack (cXObjDef *pRoot=nullptr) | |
| virtual | ~cXObjMgrPack () |
| cStringF | get_ScriptDir () const noexcept |
| void | put_ScriptDir (cStringF sDir) |
| virtual HRESULT | InitXObjMgr (cXObjDef *pRoot) override |
| virtual void | DisposeAllX () override |
| virtual void | AddFactory (cXObjPackFactory *pFactory) |
| virtual bool | RemoveFactory (cXObjPackFactory *pFactory) |
| virtual void | RemoveXObjDef (cXObjDef *pObj) override |
| cXObjPackPtr | FindXObjPack (const FILECHAR_t *pszFilePath) const |
| HRESULT | LoadXObjPack (const FILECHAR_t *pszFilePath) |
| virtual cXObjectPtr | FindByUID (UID_t uid) const override |
| virtual HRESULT | CreateXObjDefX (cXObjDefPtr &rpObjNew, const cXObjTypeDef *pXObjTypeDef, cAtomRef aSymName, IScriptableEnumerator *rProps) |
| virtual HRESULT | CreateXObjFromS (cXObjectPtr &rpObj, const ATOMCHAR_t *pszXObjType, const ATOMCHAR_t *pszSymName, IScriptableEnumerator &rProps) |
| HRESULT | LoadXObjRoot () |
| HRESULT | LoadAllScripts (bool bForce) |
| HRESULT | ReadXObjDir (const FILECHAR_t *pszDirName, const FILECHAR_t *pszWildcardFile=nullptr) |
| UNITTEST_FRIEND (cXObjMgrPack) | |
Public Member Functions inherited from GrayLib::cXObjMgr | |
| virtual cScriptableInterfaceDefPtr _stdcall | get_ScriptInterfaceDef () const |
| cXObjMgr (cXObjDef *pRoot=nullptr) | |
| virtual | ~cXObjMgr () |
| cXObjectPtr | GetAtHash (const cHashIterator &e) const |
| XOBJTIDX_TYPE | FindXObjTypeIdx (const ATOMCHAR_t *pszXObjTypeName) const |
| XOBJTIDX_TYPE | FindXObjTypeIdx (XOBJTID_t nXObjTypeId) const |
| cXObjTypeDef * | EnumXObjTypeDef (XOBJTIDX_TYPE index) const |
| cXObjTypeDef * | FindXObjTypeDef (const ATOMCHAR_t *pszXObjTypeName) const |
| cXObjTypeDef * | FindXObjTypeDef (XOBJTID_t nXObjTypeId) const |
| const ATOMCHAR_t * | FindXObjTypeName (XOBJTID_t nXObjTypeId) const |
| XOBJTID_t | FindXObjTypeId (const ATOMCHAR_t *pszXObjTypeName) const |
| bool | IsXObjTypeDemandLoaded (XOBJTID_t nXObjTypeId) const |
| XOBJTIDX_TYPE | RegisterXObjTypeDef (cXObjTypeDef *pXObjTypeDef) |
| ITERATE_t | UnloadXObjTypeDef (XOBJTID_t nXObjTypeId) |
| ITERATE_t | get_XObjCount () const |
| cXObjDefPtr | FindDefByUID (UID_t rid) const |
| HRESULT | AddXObjSymName (cXObjDef *pXObjDef) |
| bool | RemoveXObjSymName (const ATOMCHAR_t *pszSymName) |
| cXObjDefPtr | FindBySymName0 (const ATOMCHAR_t *pszSymName) const |
| cXObjDefPtr | FindBySymName (const ATOMCHAR_t *pszSymName) const |
| cXObjDefPtr | FindBySymNamePartial (const ATOMCHAR_t *pszNamePartial) const |
| cXObjectPtr | FindByVar (const cVariant &vID) const |
| virtual HRESULT | CreateXObjDef (OUT cXObjDefPtr &rpXObjDefNew, const cXObjTypeDef *pXObjTypeDef, cAtomRef aSymName) |
| virtual HRESULT | CreateXObjDefX (OUT cXObjDefPtr &rpXObjDefNew, const cXObjTypeDef *pXObjTypeDef, cAtomRef aSymName, IScriptableEnumerator *pProps) |
| virtual HRESULT | s_Invoke_GetObjTypes (OUT cVariant &vValRet) |
| virtual HRESULT | s_Invoke_FindObjects (const cVariant &vArgs, OUT cVariant &vValRet) |
| HRESULT | s_Invoke_DumpConst (const cVariant &vArgs) |
| virtual UID_t | MakeUID (XOBJTID_t nXObjTypeId, UIDINDEX_t nIndex) |
| HRESULT | AssignFreeUID (cXObject *pObj, UIDINDEX_t nIndex) |
| virtual HRESULT | AddXObj (cXObject *pXObj) |
| HRESULT | AddXObjCheck (cXObject *pXObj, UIDINDEX_t nIndex=k_HASHCODE_CLEAR) |
| virtual void | RemoveXObj (cXObject *pXObj) |
| virtual HRESULT | AddXObjDef (cXObjDef *pXObjDef) |
| HRESULT | AddXObjDefCheck (cXObjDef *pXObjDef, UIDINDEX_t nIndex) |
| STDMETHOD() | FindByUID (UID_t uid, OUT IXObject **ppObj) override |
| STDMETHOD() | FindByStr (const ATOMCHAR_t *pszID, OUT IXObject **ppObj) override |
| STDMETHOD() | FindBySymName (const ATOMCHAR_t *pszSymName, OUT IXObject **ppObj) override |
| STDMETHOD() | CreateInstance (IUnknown *pUnkOuter, const IID &riid, OUT void **ppvObject) override |
| STDMETHOD() | LockServer (BOOL fLock) override |
| STDMETHOD() | QueryInterface (const IID &riid, OUT void __RPC_FAR *__RPC_FAR *ppvObject) override |
| STDMETHOD() | s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet) |
| UNITTEST_FRIEND (cXObjMgr) | |
| IUNKNOWN_DISAMBIG_R (cRefBase) | |
Public Member Functions inherited from Gray::CObject | |
| virtual | ~CObject () |
| virtual bool | isValidCheck () const noexcept |
| < memory allocation and structure definitions are valid. More... | |
| virtual void | AssertValid () const |
| < memory allocation and structure definitions are valid. More... | |
| virtual void | Serialize (cArchive &a) |
Public Member Functions inherited from Gray::cHeapObject | |
| cHeapObject () | |
| virtual | ~cHeapObject () |
| bool | IsValidInsideN (INT_PTR index) const |
| bool | IsValidInsidePtr (void const *pTest) const |
| virtual size_t | GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const |
| virtual bool | isValidCheck () const noexcept |
Public Member Functions inherited from Gray::cRefBase | |
| cRefBase (int iRefCount=0) noexcept | |
| virtual | ~cRefBase () |
| int | get_RefCount () const noexcept |
| HASHCODE_t | get_HashCode () const noexcept |
| STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept | |
| virtual void | onFinalRelease () |
| bool | isValidObj () const noexcept |
| STDMETHOD_ (ULONG, AddRef)(void) override | |
| STDMETHOD_ (ULONG, Release)(void) override | |
| STDMETHOD() | QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override |
| void | IncRefCount () |
| void | DecRefCount () |
| bool | isStaticConstruct () const noexcept |
| void | StaticConstruct () |
| void | StaticDestruct () |
| bool | isDestructing () noexcept |
| void | SetDestructing () |
Static Public Member Functions | |
| static cXObjMgrPack * | get_Single () |
| static cXObjMgrPack & | I () |
Static Public Member Functions inherited from GrayLib::cXObjMgr | |
| static HRESULT | CheckValidSignature (UINT32 nGrayLibVer, size_t nSizeofThis) |
Static Public Member Functions inherited from Gray::cSingleton< TYPE > | |
| static TYPE *__stdcall | get_Single () |
| template<class TYPE2 > | |
| static TYPE2 *__stdcall | get_SingleT () |
| static TYPE &__stdcall | I () |
Static Public Member Functions inherited from Gray::cSingletonStatic< TYPE > | |
| static bool | isSingleCreated () noexcept |
| static TYPE * | get_SingleU () noexcept |
| static TYPE * | get_Single () |
| template<class TYPE2 > | |
| static TYPE2 *__stdcall | get_SingleCast () |
| static TYPE & | I () noexcept |
Static Public Member Functions inherited from Gray::cSingletonRegister | |
| static void __stdcall | ReleaseModule (HMODULE hMod) |
Public Attributes | |
| TIMESYSD_t | m_iScriptCacheTime |
| Params for control. More... | |
Public Attributes inherited from GrayLib::cXObjMgr | |
| const cObjectSignature | m_Sig |
| Used to check for compatible config and alignments. More... | |
| cHashTableRef< cXObject, UID_t, 6 > | m_XObjHash |
| the hash of cXObject objects by UID. Some may be in private hash! cUIDManagerArray? IXObjModPlugin More... | |
Protected Member Functions | |
| HRESULT | ReadXObjPack (const FILECHAR_t *pszPathName, const cFileStatus &status) |
| Manually load a new resource file by name. More... | |
| cXObjPackFactory * | FindXObjFactory (const FILECHAR_t *pszTitle) const |
Protected Member Functions inherited from Gray::cSingletonSmart< cXObjMgr > | |
| cSingletonSmart (cXObjMgr *pObject, const TYPEINFO_t &rAddrCode, int iRefCountStart=0) | |
| const void * | get_HeapPtr () const noexcept override |
| Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More... | |
Protected Member Functions inherited from Gray::cSingleton< TYPE > | |
| cSingleton (TYPE *pObject, const TYPEINFO_t &rAddrCode=typeid(TYPE)) noexcept | |
| virtual | ~cSingleton () |
Protected Member Functions inherited from Gray::cSingletonStatic< TYPE > | |
| cSingletonStatic (TYPE *pObject) noexcept | |
| virtual | ~cSingletonStatic () noexcept |
Protected Member Functions inherited from Gray::cSingletonRegister | |
| cSingletonRegister (const TYPEINFO_t &rAddrCode) noexcept | |
| virtual | ~cSingletonRegister () |
| void | RegisterSingleton () |
Protected Attributes | |
| cArraySortSymName< cXObjPack > | m_aXObjPacks |
| All package files we need to get script blocks from. SYMNAME sorted. More... | |
| cArrayRef< cXObjPack > | m_aXObjPacksToLoad |
| Files queued to be read later. (load order used at startup) More... | |
| cArrayRef< cXObjModule > | m_aXObjModulesToLoad |
| plug-in DLL/SO's are dangerous and must be treated special. Read order is important here (they may cascade)! sorted by insert order. More... | |
| cArrayPtr< cXObjPackFactory > | m_aPackFactories |
| what file extensions can we handle for packages? How to load each type. More... | |
| cStringF | m_sScriptDir |
| default base directory for script/DLL/SO/Module resource files/packs More... | |
| cScriptContext | m_ScriptContextRoot |
| global/default/Root context. PLEVEL_Owner More... | |
| cScriptExec | m_ScriptExecBest |
| set sm_pExpExecBest with a default value. Preferred script execution/evaluation engine. More... | |
Protected Attributes inherited from GrayLib::cXObjMgr | |
| cArraySortSymName< cXObjDef > | m_aXObjSymNames |
| Store all cXObjDef(s) sorted by SymName or get_SymName() More... | |
| cThreadLockCount | m_LockXObj |
| used to lock access m_XObjHash More... | |
| cArrayPtr< cXObjTypeDef > | m_aXObjTypeDefs |
| Metadata info about the cXObject types i use. XOBJTID_t, XOBJTIDX_TYPE = index in this array. More... | |
Protected Attributes inherited from Gray::cSingletonRegister | |
| HMODULE | m_hModuleLoaded |
| What modules loaded this ? So singletons can be destroyed if DLL/SO unloads. More... | |
Additional Inherited Members | |
Public Types inherited from GrayLib::cXObjMgr | |
| enum | M_TYPE_ { M_QTY } |
Static Public Attributes inherited from GrayLib::cXObjMgr | |
| static cScriptableMethod | sm_Methods [M_QTY+1] |
| static cScriptableInterfaceDef | sm_ScriptInterfaceDef |
| static cXObjTypeDef | sm_DEFAULT = { k_XOBJTID_DEFAULT, "Default", XOBJTYPF_0, nullptr, "Dynamic XObject" } |
| Used to create a bare XObject. More... | |
Static Public Attributes inherited from Gray::cSingletonRegister | |
| static cThreadLockFast | sm_LockSingle |
| common lock for all cSingleton. More... | |
Static Protected Attributes inherited from Gray::cSingletonStatic< TYPE > | |
| static TYPE * | sm_pThe = nullptr |
| pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More... | |
overload cXObjMgr to Manage all my XObject files and resource XObj indexed here. Loads packages / Modules / Plug-ins and scripts to create system objects.
| GrayLib::cXObjMgrPack::cXObjMgrPack | ( | cXObjDef * | pRoot = nullptr | ) |
|
virtual |
|
virtual |
What file types do i know how to enumerate? e.g. cJSXEngine,
|
virtual |
Create an object of some type from a IScriptableEnumerator. ASSUME SetObjStateLoaded is called.
|
virtual |
Load XObject or params from script file. ASSUME SetObjStateLoaded is called.
|
overridevirtual |
IXObjMgr Dispose of all my objects. Assume i am closing.
Reimplemented from GrayLib::cXObjMgr.
|
overridevirtual |
Get the cXObject by its UID. This can be overridden to add support for special cUIDRangeMask ranges.
Reimplemented from GrayLib::cXObjMgr.
|
protected |
Find the cXObjPackFactory to support this type of file by extension.
| cXObjPackPtr GrayLib::cXObjMgrPack::FindXObjPack | ( | const FILECHAR_t * | pszFilePath | ) | const |
Just match the symbolic titles (not the whole path) "x.ini" is not in here.
|
inlinenoexcept |
|
inlinestatic |
overload cSingletonSmart<cXObjMgr> to use cXObjMgrPack
|
inlinestatic |
overload cSingletonSmart<cXObjMgr> to use cXObjMgrPack
IXObjMgr Set up the scripting system. Connect cUID::k_ROOT object to the default context.
Reimplemented from GrayLib::cXObjMgr.
| HRESULT GrayLib::cXObjMgrPack::LoadAllScripts | ( | bool | bForce | ) |
Attempt to resync / reload all the resources. maybe scripts have changed?
| HRESULT GrayLib::cXObjMgrPack::LoadXObjPack | ( | const FILECHAR_t * | pszFilePath | ) |
Manually add a file/directory to the list of things to load. add to my list of resource files and load immediately.
|
inline |
Load and read all scripts from the script root directory.
| void GrayLib::cXObjMgrPack::put_ScriptDir | ( | cStringF | sDir | ) |
| HRESULT GrayLib::cXObjMgrPack::ReadXObjDir | ( | const FILECHAR_t * | pszDirName, |
| const FILECHAR_t * | pszWildcardFile = nullptr |
||
| ) |
Add a bunch of files in a directory to my resource file list. Load the scripts as we go.
|
protected |
Manually load a new resource file by name.
protected. Read a specific file by its full path. Scan it for resources that could be registered.
|
virtual |
Remove all uses of this factory.
|
overridevirtual |
called by DisposeThis()
Reimplemented from GrayLib::cXObjMgr.
| GrayLib::cXObjMgrPack::UNITTEST_FRIEND | ( | cXObjMgrPack | ) |
|
protected |
what file extensions can we handle for packages? How to load each type.
|
protected |
plug-in DLL/SO's are dangerous and must be treated special. Read order is important here (they may cascade)! sorted by insert order.
|
protected |
All package files we need to get script blocks from. SYMNAME sorted.
Files queued to be read later. (load order used at startup)
| TIMESYSD_t GrayLib::cXObjMgrPack::m_iScriptCacheTime |
Params for control.
Time in Milli seconds to keep a cached script open.
|
protected |
global/default/Root context. PLEVEL_Owner
|
protected |
set sm_pExpExecBest with a default value. Preferred script execution/evaluation engine.
|
protected |
default base directory for script/DLL/SO/Module resource files/packs