![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cXObject.h>
Public Types | |
enum | P_TYPE_ { P_QTY } |
enum | M_TYPE_ { M_QTY } |
base methods that all objects have. More... | |
Public Member Functions | |
virtual cScriptableInterfaceDefPtr _stdcall | get_ScriptInterfaceDef () const |
cXObject (UID_t nUID=cUID::k_CLEAR, cXObjDef *pBaseDef=nullptr) | |
virtual | ~cXObject () |
virtual bool | isValidCheck () const noexcept override |
STDMETHOD_ (XOBJTID_t, get_XObjTypeId)() const | |
const ATOMCHAR_t * | get_XObjTypeName () const |
virtual int | get_BaseRefCount () const |
bool | isValidUID () const noexcept |
UID_t | get_UIDValue () const noexcept |
UID_t | get_HashCode () const noexcept |
STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept override | |
void | put_UIDValuePrivate (UID_t dwIndex) |
STDMETHOD_ (void, put_UIDValue)(UID_t dwIndex) | |
STDMETHOD_ (cString, get_Name)() const override | |
STDMETHOD() | put_Name (cString sName) |
STDMETHOD_ (cString, get_NameDeco)() const | |
STDMETHOD_ (cStringA, get_SymName)() const override | |
STDMETHOD() | put_SymName (cAtomRef aSymName, bool bOverwrite=false) |
HRESULT | put_SymName2 (cAtomRef aSymName) |
cXObjDef * | get_BaseDef () const |
virtual bool | put_BaseDef (cXObjDef *pDef) |
STDMETHOD_ (cAtomRef, get_BaseSymNameA)() const | |
shortcut for symbolic name for get_BaseDef() More... | |
virtual cRefPtr< cXObject > | get_ContainerObject () const |
virtual cVariant | get_ContainerVar () const |
STDMETHOD() | put_ContainerVar (const cVariant &vVal) |
bool | isMyContainer (const cXObject *pObjParent) const |
void | InitObjState () |
XObjState_TYPE | get_ObjState () const noexcept |
bool | put_ObjState (XObjState_TYPE eObjState) |
bool | isObjStateLoading () const noexcept |
bool | isObjStateLoading1 () const noexcept |
bool | isObjStateLoaded () const noexcept |
bool | isObjStateModified () const noexcept |
bool | isObjStateDisposed () const noexcept |
bool | isObjStateBad () const noexcept |
STDMETHOD() | SetObjStateLoaded () |
extra cleanup at the end of the load. More... | |
void | SetObjStateBad () |
void | SetObjStateModified () |
void | ClearObjStateModified () |
const cTimeInt & | get_TimeSaved () const noexcept |
void | put_TimeSaved (cTimeInt timeSaved) |
void | UpdateTimeSaved () |
virtual cVarTuplePtr | FindTagA (cAtomRef aTagName) const |
extra Properties/Tags More... | |
cVarTuplePtr | FindTag (const ATOMCHAR_t *pszTagName) const |
void | s_WritePropsTags (IScriptableSetter &Update) |
STDMETHOD() | s_PropPut (const cScriptableProp *pProp, const cVariant &vVal) override |
STDMETHOD() | s_PropGet (const cScriptableProp *pProp, OUT cVariant &vValRet) override |
STDMETHOD() | s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet) override |
STDMETHOD() | s_GetByName (const ATOMCHAR_t *pszPropName, OUT cVariant &rvValRet) override |
STDMETHOD() | s_TagPut (const ATOMCHAR_t *pszTagName, const cVariant &vValSet) |
STDMETHOD() | s_TagGet (const ATOMCHAR_t *pszTagName, OUT cVariant &vValRet) |
STDMETHOD() | s_LoadProps (IScriptableEnumerator &rProps) |
STDMETHOD() | s_EventSinkAdd (cXObjDef *pXObjDef, bool bRemove=false) |
cStringA | s_PropGetDumpStr (const cScriptableProp *pProp, XOBJ_DUMP_MASK_t uFlags=0) |
Enumerate methods and props. reflection/introspection. More... | |
HRESULT | s_DumpKeys (cStreamOutput &rout, XOBJ_DUMP_MASK_t uFlags, const cScriptableProp *const *ppProps, ITERATE_t iQty) |
HRESULT | s_DumpHelp (cStreamOutput &rout, const cVariant &vArgs) |
virtual HRESULT | DisposeThis () |
utility More... | |
virtual XOBJ_WEIRD_t | IsWeird () const |
virtual XOBJ_WEIRD_t | FixWeird () |
virtual size_t | GetHeapStats (OUT ITERATE_t &iAllocCount) const |
allocs for all children. does NOT include sizeof(*this) More... | |
IUNKNOWN_DISAMBIG_R (cThreadLockableRef) | |
STDMETHOD() | QueryInterface (const IID &riid, void **ppvObject) override |
![]() | |
virtual | ~cScriptableObj () |
STDMETHOD_ (cScriptableInterfaceDefPtr, get_ScriptInterfaceDef)() const | |
STDMETHOD() | s_PropGet (const cScriptableProp *pProp, OUT cVariant &vValRet) override |
STDMETHOD() | s_PropPut (const cScriptableProp *pProp, const cVariant &vVal) override |
STDMETHOD() | s_Invoke (const cScriptableMethod *pMethod, const cVariant &vArgs, OUT cVariant &vValRet) override |
const cScriptableProp * | FindPropStr (const ATOMCHAR_t *pszPropName) const |
const cScriptableMethod * | FindMethodStr (const ATOMCHAR_t *pszPropName) const |
HRESULT | s_InvokeKey (const ATOMCHAR_t *pszMethodKey, const cVariant &vArgs, OUT cVariant &vValRet) |
STDMETHOD_ (cVariant, s_Exec)(const ATOMCHAR_t *pszMethodKey | |
STDMETHOD() | s_GetEnum (ITERATE_t i, OUT cStringA &rsPropName, OUT cVariant &rvValRet) override |
STDMETHOD() | s_GetByName (const ATOMCHAR_t *pszPropName, OUT cVariant &rvValRet) override |
STDMETHOD() | s_Put (const ATOMCHAR_t *pszPropName, const cVariant &vValSet) override |
void | s_LoadPropsCommandLine (cAppArgs &args) |
HRESULT | s_LoadPropsBase (IScriptableEnumerator &rProps) |
HRESULT | s_LoadPropVar (const ATOMCHAR_t *pszPropName, const cVariant &vVal) |
HRESULT | s_WritePropNULL (IScriptableSetter &s, const cScriptableProp *pProp) |
HRESULT | s_WriteProp (IScriptableSetter &s, const cScriptableProp *pProp) |
HRESULT | s_WritePropsClass (IScriptableSetter &s, const cScriptableInterfaceDef *pClass) |
HRESULT | s_WritePropsArray (IScriptableSetter &s, const cScriptableProp *pProps, IScriptableObj *pDefaultSkip=nullptr) |
STDMETHOD() | s_WriteProps (IScriptableSetter &s) |
STDMETHOD_ (cVariant, s_Get)(const ATOMCHAR_t *pszPropName) | |
cVariant | s_Get (const cScriptableProp &rProp) |
STDMETHOD_ (cString, s_GetStr)(const ATOMCHAR_t *pszPropName) | |
STDMETHOD_ (float, s_GetFloat)(const ATOMCHAR_t *pszPropName) | |
STDMETHOD() | GetTypeInfoCount (UINT *pctinfo) |
![]() | |
cThreadLockableRef (int iStaticRefCount=0) noexcept | |
virtual | ~cThreadLockableRef () |
virtual void | onThreadLockFail (TIMESYSD_t dwWaitMS) |
![]() | |
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 () |
![]() | |
THREADID_t | get_ThreadLockOwner () const |
![]() | |
virtual | ~CObject () |
virtual void | AssertValid () const |
< memory allocation and structure definitions are valid. More... | |
virtual void | Serialize (cArchive &a) |
![]() | |
cHeapObject () | |
virtual | ~cHeapObject () |
bool | IsValidInsideN (INT_PTR index) const |
bool | IsValidInsidePtr (void const *pTest) const |
virtual size_t | GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const |
Public Attributes | |
cVarMap | m_TagMap |
attach extra tags here. (e.g. properties that don't apply to all instances. ASSUME NO OVERLAP with defined props.) More... | |
![]() | |
const cVariant & | vArgs = cVariant::k_VarNULL) |
Static Public Attributes | |
static cScriptableInterfaceDef | sm_ScriptInterfaceDef |
static cScriptableProp | sm_Props [P_QTY+1] |
static cScriptableMethod | sm_Methods [M_QTY+1] |
static ITERATE_t | sm_iLoadingCount = 0 |
are we loading ? LoadXObject() reentrant ? More... | |
Protected Attributes | |
CHEAPOBJECT_IMPL | |
cRefPtr< cXObjDef > | m_pBaseDef |
This XObject is based on a template of other XObject/XObjDef. overloads it's props via m_TagMap. More... | |
Additional Inherited Members | |
![]() | |
static HRESULT GRAYCALL | CopyAllProps (IScriptableSetter *pObjDest, IScriptableEnumerator &rProps, int iStart=0) |
![]() | |
cLockableBase () noexcept | |
~cLockableBase () | |
LONG | get_LockCount () const |
bool | isLocked () const |
void | IncLockCount () |
LONG | DecLockCount () |
void | Lock () |
LONG | Unlock () |
![]() | |
const void * | get_HeapPtr () const noexcept override |
Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More... | |
Base class for object that is defined by references.
a cXObject is/has:
|
explicit |
MUST connect the UID to the cXObjMgr later. when the object is loaded.
|
virtual |
ASSUME we disconnect the UID from the cXObjMgr BEFORE in DisposeThis()
void GrayLib::cXObject::ClearObjStateModified | ( | ) |
I just saved this.
|
virtual |
utility
detach my children etc.
Destroy this object even though there may be references to it. indicate to anyone who looks that this is a deleted object ? Pre-destructor cleanup things can be done since virtuals don't work in destructors.
Reimplemented in GrayGUI::cXStaticMultiScroll, GrayLib::cXObjPack, GrayLib::cXObjModule, GrayLib::cXObjDef, GrayJS::cJSXFile, GrayMapData::cMapPatch, GrayLib::cXObjPackChild, GrayGUI::cXWindow, GrayGUI::cXToolTip, GrayGUI::cXMenu, GrayGUI::cXDialog, GrayGUI::cXDTBase, GrayGUI::cXTableBox, GrayGUI::cXSpinCounter, GrayGUI::cXListBox, and GrayGUI::cXComboBox.
cVarTuplePtr GrayLib::cXObject::FindTag | ( | const ATOMCHAR_t * | pszTagName | ) | const |
Find a type specific tag for the object. If atom doesn't already exist, i know the var doesn't either.
|
virtual |
extra Properties/Tags
|
virtual |
Try to fix any problems with this object. called from SetObjStateLoaded();
|
inline |
get Base template definition object.
|
inlinevirtual |
The number of references to this object that "don't count" towards actual usage. e.g. references made from the cXObjMgr Used to unload cXObject not actually in use.
Reimplemented in GrayLib::cXObjDef.
What parent object contains this object in the root hierarchy?
Reimplemented in GrayGUI::cXWindow, and GrayLib::cXObjPackChild.
|
virtual |
String name of my parent as i am connected to the rest of the system.
|
inlinenoexcept |
If cXObject is used in a cHash, this as the Hash ID.
|
inlinenoexcept |
|
inlinevirtual |
Reimplemented in GrayLib::cXObjEventSink, GrayLib::cXObjDef, and GrayLib::cScriptContextObj.
|
inlinenoexcept |
When was this cXObject last persisted?
|
inlinenoexcept |
const ATOMCHAR_t * GrayLib::cXObject::get_XObjTypeName | ( | ) | const |
Get FOURCC name of the object type. NOT exactly the same as cScriptableInterfaceDef::get_Name()
|
virtual |
allocs for all children. does NOT include sizeof(*this)
get allocs for all children. does not include sizeof(*this) NOT include size of m_pBaseDef.
Reimplemented in GrayLib::cXObjDef.
void GrayLib::cXObject::InitObjState | ( | ) |
bool GrayLib::cXObject::isMyContainer | ( | const cXObject * | pObjParent | ) | const |
Is this a parent up my parent chain ? grandparent ?
|
noexcept |
Is the object is broken? Not loaded correctly?
|
noexcept |
is Disposed ?
|
inlinenoexcept |
Loaded or modified.
|
inlinenoexcept |
init or loading
|
inlinenoexcept |
init or loading
|
inlinenoexcept |
|
overridevirtualnoexcept |
Reimplemented from Gray::cHeapObject.
|
inlinenoexcept |
Should check this against UIDMgr ?
|
virtual |
GrayLib::cXObject::IUNKNOWN_DISAMBIG_R | ( | cThreadLockableRef | ) |
|
inlinevirtual |
put Base template definition object.
|
inline |
Set hierarchy container with extra information. "(x,y,z)" Point on the ground, "(#UID,x,y,z)" = on another object (Attached?), (sFilename) definition file), or nothing (root or child of root)
|
inline |
set display name for the object. No article decoration. e.g. "Thing" override this to provide storage.
bool GrayLib::cXObject::put_ObjState | ( | XObjState_TYPE | eObjState | ) |
Alternate SYMNAME for this. Not its primary SYMNAME. Give it another SYMNAME= even if it already has one. it's OK to have multiple SYMNAMEs.
|
inline |
When was this cXObject last persisted?
void GrayLib::cXObject::put_UIDValuePrivate | ( | UID_t | dwIndex | ) |
lowest level to set the UID. does not call virtuals!
|
override |
COM like IUnknown interface support. QueryInterface = a dynamic cast to another interface type.
HRESULT GrayLib::cXObject::s_DumpHelp | ( | cStreamOutput & | rout, |
const cVariant & | vArgs | ||
) |
Dump info about this object to the rout. vArgs = a prop/method name for the object.
HRESULT GrayLib::cXObject::s_DumpKeys | ( | cStreamOutput & | rout, |
XOBJ_DUMP_MASK_t | uFlags, | ||
const cScriptableProp *const * | ppProps, | ||
ITERATE_t | iQty | ||
) |
Dump info about this object to rout.
|
inline |
Some objects allow a cXObjDef (with designated interfaces) to be attached to handle methods fired on it.
|
override |
helper for s_PropGet return HRESULT_WIN32_C(ERROR_UNKNOWN_PROPERTY);
|
override |
Execute command from script
HRESULT GrayLib::cXObject::s_LoadProps | ( | IScriptableEnumerator & | rProps | ) |
Load keys for the object from the current section pointer in a cScriptFileReader file.
|
override |
cStringA GrayLib::cXObject::s_PropGetDumpStr | ( | const cScriptableProp * | pProp, |
XOBJ_DUMP_MASK_t | uFlags = 0 |
||
) |
Enumerate methods and props. reflection/introspection.
get a single prop key/value as a dump string. Use current cScriptContext
|
override |
Basic object Scripting/Loading/Prop access services.
HRESULT GrayLib::cXObject::s_TagGet | ( | const ATOMCHAR_t * | pszTagName, |
OUT cVariant & | vValRet | ||
) |
HRESULT GrayLib::cXObject::s_TagPut | ( | const ATOMCHAR_t * | pszTagName, |
const cVariant & | vValSet | ||
) |
void GrayLib::cXObject::s_WritePropsTags | ( | IScriptableSetter & | Update | ) |
void GrayLib::cXObject::SetObjStateBad | ( | ) |
unloading from memory ?
HRESULT GrayLib::cXObject::SetObjStateLoaded | ( | ) |
extra cleanup at the end of the load.
We are done loading this object. allow the world to see it. Assume Attached it to cXObjMgr::AddXObj. extra cleanup at the end of the load. XOBJ_WEIRD_CODE()
void GrayLib::cXObject::SetObjStateModified | ( | ) |
Some fields of this object are dirty and must be flushed back to the persistent storage.
GrayLib::cXObject::STDMETHOD_ | ( | cAtomRef | , |
get_BaseSymNameA | |||
) | const |
shortcut for symbolic name for get_BaseDef()
|
override |
|
inline |
Get an article decorated name. e.g. "a Thing"
|
override |
|
inlineoverridenoexcept |
virtual accessors for scripting. (virtual is less efficient)
GrayLib::cXObject::STDMETHOD_ | ( | void | , |
put_UIDValue | |||
) |
|
inline |
Override this to return a FOURCC code identifying the top level object type. XOBJTID_t is normally registered with cXObjMgr for cXObjTypeDef. in this case this object is purely dynamic.
void GrayLib::cXObject::UpdateTimeSaved | ( | ) |
The resource was saved or just read from the database/scriptfile/registry/etc
|
protected |
This XObject is based on a template of other XObject/XObjDef. overloads it's props via m_TagMap.
cVarMap GrayLib::cXObject::m_TagMap |
attach extra tags here. (e.g. properties that don't apply to all instances. ASSUME NO OVERLAP with defined props.)
|
static |
are we loading ? LoadXObject() reentrant ?
|
static |
|
static |
|
static |