Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cXObjEventSink Class Referenceabstract

#include <cXObjEventSink.h>

Inheritance diagram for GrayLib::cXObjEventSink:
GrayLib::cXObjPackChild GrayLib::cXObjDef GrayLib::cXObject GrayLib::cScriptableObj IXObject Gray::cThreadLockableRef Gray::CObject Gray::cHeapObject IScriptableObj Gray::cRefBase Gray::cThreadLockStub Gray::IHeapObject IUnknown Gray::cLockableBase

Public Types

enum  P_TYPE_ { P_QTY }
 
typedef cXObjDef CSCRIPTABLE_SUPER_t
 
- Public Types inherited from GrayLib::cXObjDef
enum  P_TYPE_ { P_QTY }
 
enum  M_TYPE_ { M_QTY }
 
typedef cXObject CSCRIPTABLE_SUPER_t
 
- Public Types inherited from GrayLib::cXObject
enum  P_TYPE_ { P_QTY }
 
enum  M_TYPE_ { M_QTY }
 base methods that all objects have. More...
 

Public Member Functions

 cXObjEventSink (UID_t rid, cAtomRef aSymName, EVENTPRI_TYPE ePriorityLevel=EVENTPRI_MEDIUM)
 
virtual ~cXObjEventSink ()
 
EVENTPRI_TYPE get_SortValue () const noexcept
 
virtual void CopyXObject (const cXObjDef *pDef)
 
virtual const cScriptableInterfaceDefget_EventSinkInterfaceDef () const =0
 
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
 
HRESULT FindEventHandlerN (const ATOMCHAR_t *pszEventName) const
 
HRESULT RegisterEventHandlerN (const ATOMCHAR_t *pszEventName)
 
bool UnregisterEventHandlerN (const ATOMCHAR_t *pszEventName)
 
void InitEventHandlers ()
 
void RegisterEventHandler (EVENTX_TYPE eEvent)
 
void UnregisterEventHandler (EVENTX_TYPE eEvent)
 
bool HasEventHandler (EVENTX_TYPE eEvent) const
 
virtual cScriptableInterfaceDefPtr _stdcall get_ScriptInterfaceDef () const
 
- Public Member Functions inherited from GrayLib::cXObjPackChild
 cXObjPackChild (UID_t rid, cAtomRef aSymName)
 
virtual ~cXObjPackChild ()
 
virtual cXObjectPtr get_ContainerObject () const
 
void put_ContainterFile (cXObjPack *pContainerFile)
 
virtual HRESULT DisposeThis ()
 utility More...
 
HRESULT InvokeMethod (const cScriptableMethod *pMethod, const cVariant &vArgs, cVariant &vValRet)
 
- Public Member Functions inherited from GrayLib::cXObjDef
 cXObjDef (UID_t rid, cAtomRef aSymName)
 
virtual ~cXObjDef ()
 
STDMETHOD() SetObjStateLoaded ()
 extra cleanup at the end of the load. More...
 
bool hasSymName () const noexcept
 Get the SYMNAME of the resource item. (Used for saving,scripting) may be number or name. More...
 
cAtomRef get_SymNameA () const
 
 STDMETHOD_ (cStringA, get_SymName)() const override
 
STDMETHOD() put_SymName (cAtomRef aSymName, bool bOverwrite=false) override
 
HRESULT put_SymName2 (cAtomRef aSymName)
 
 STDMETHOD_ (cString, get_Name)() const override
 
virtual cString get_Description () const
 
virtual void put_Description (cString sDescription)
 
virtual cString get_DescriptionFull () const
 
virtual bool isResourceLoaded () const
 
virtual void UnloadXObject ()
 
virtual HRESULT LoadXObject ()
 
virtual HRESULT ReloadXObject ()
 
virtual HRESULT SaveXObject ()
 
virtual int get_BaseRefCount () const override
 
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_WriteProps (IScriptableSetter &reg) override
 
virtual size_t GetHeapStats (OUT ITERATE_t &iAllocCount) const override
 allocs for all children. does NOT include sizeof(*this) More...
 
- Public Member Functions inherited from GrayLib::cXObject
 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_tget_XObjTypeName () 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)
 
cXObjDefget_BaseDef () const
 
virtual bool put_BaseDef (cXObjDef *pDef)
 
 STDMETHOD_ (cAtomRef, get_BaseSymNameA)() const
 shortcut for symbolic name for get_BaseDef() More...
 
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 cTimeIntget_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 XOBJ_WEIRD_t IsWeird () const
 
virtual XOBJ_WEIRD_t FixWeird ()
 
 IUNKNOWN_DISAMBIG_R (cThreadLockableRef)
 
STDMETHOD() QueryInterface (const IID &riid, void **ppvObject) override
 
- Public Member Functions inherited from GrayLib::cScriptableObj
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 cScriptablePropFindPropStr (const ATOMCHAR_t *pszPropName) const
 
const cScriptableMethodFindMethodStr (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)
 
- Public Member Functions inherited from Gray::cThreadLockableRef
 cThreadLockableRef (int iStaticRefCount=0) noexcept
 
virtual ~cThreadLockableRef ()
 
virtual void onThreadLockFail (TIMESYSD_t dwWaitMS)
 
- 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 ()
 
- Public Member Functions inherited from Gray::cThreadLockStub
THREADID_t get_ThreadLockOwner () const
 
- Public Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
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
 

Static Public Member Functions

static bool IsHandledEvent (EVENTRET_TYPE hRes) noexcept
 
- Static Public Member Functions inherited from GrayLib::cXObjDef
static cAtomRef GRAYCALL MakeSymName (const ATOMCHAR_t *pszTypeName, ITERATE_t iEnum)
 
- Static Public Member Functions inherited from GrayLib::cScriptableObj
static HRESULT GRAYCALL CopyAllProps (IScriptableSetter *pObjDest, IScriptableEnumerator &rProps, int iStart=0)
 

Public Attributes

 CHEAPOBJECT_IMPL
 
- Public Attributes inherited from GrayLib::cXObjPackChild
cRefBasePtr m_pContainerRef
 m_pContainerFile specific args that represent the contents of the child More...
 
- Public Attributes inherited from GrayLib::cXObjDef
 CHEAPOBJECT_IMPL
 
TIMESYS_t m_timeLastUsed
 system time when last used. for caching More...
 
- Public Attributes inherited from GrayLib::cXObject
cVarMap m_TagMap
 attach extra tags here. (e.g. properties that don't apply to all instances. ASSUME NO OVERLAP with defined props.) More...
 
- Public Attributes inherited from GrayLib::cScriptableObj
const cVariantvArgs = cVariant::k_VarNULL)
 

Static Public Attributes

static cScriptableInterfaceDef sm_ScriptInterfaceDef
 
static cScriptableProp sm_Props [P_QTY+1]
 
- Static Public Attributes inherited from GrayLib::cXObjDef
static cScriptableInterfaceDef sm_ScriptInterfaceDef
 
static cScriptableProp sm_Props [P_QTY+1]
 
static cScriptableMethod sm_Methods [M_QTY+1]
 
- Static Public Attributes inherited from GrayLib::cXObject
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

EVENTPRI_TYPE m_ePriorityLevel
 how to sort in cXObjEventSinks More...
 
cScriptableEventsMask m_EventsHandled
 What events/methods from my get_EventSinkInterfaceDef do i actually handle? More...
 
- Protected Attributes inherited from GrayLib::cXObjPackChild
cXObjPackPtr m_pContainerFile
 What parent file am i attached to? may be a DLL,Script,LUA,etc. get_ContainerObject() More...
 
- Protected Attributes inherited from GrayLib::cXObject
 CHEAPOBJECT_IMPL
 
cRefPtr< cXObjDefm_pBaseDef
 This XObject is based on a template of other XObject/XObjDef. overloads it's props via m_TagMap. More...
 

Friends

class cXObjEventSinks
 

Additional Inherited Members

- Protected Member Functions inherited from Gray::cLockableBase
 cLockableBase () noexcept
 
 ~cLockableBase ()
 
LONG get_LockCount () const
 
bool isLocked () const
 
void IncLockCount ()
 
LONG DecLockCount ()
 
void Lock ()
 
LONG Unlock ()
 
- Protected Member Functions inherited from Gray::cHeapObject
const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 

Detailed Description

This object represents a script (or set of) that can also be an event sink. It may or may not handle events fired at it. Observer pattern http://en.wikipedia.org/wiki/Observer_pattern linked to a part of a Script. This can be attached to cXObject via s_EventSinkAdd The script may be in many forms: GrayScript, DLL, JavaScript, LUA ? Exposes an interface of calls that may be made. similar to COM's dispinterface. parts of this are executable.

Member Typedef Documentation

◆ CSCRIPTABLE_SUPER_t

Member Enumeration Documentation

◆ P_TYPE_

Enumerator
P_QTY 

Constructor & Destructor Documentation

◆ cXObjEventSink()

GrayLib::cXObjEventSink::cXObjEventSink ( UID_t  rid,
cAtomRef  aSymName,
EVENTPRI_TYPE  ePriorityLevel = EVENTPRI_MEDIUM 
)

m_pContainerFile to be filled in later.

◆ ~cXObjEventSink()

GrayLib::cXObjEventSink::~cXObjEventSink ( )
virtual

Member Function Documentation

◆ CopyXObject()

void GrayLib::cXObjEventSink::CopyXObject ( const cXObjDef pDef)
virtual

Dupe this Def

Reimplemented from GrayLib::cXObjDef.

◆ FindEventHandlerN()

HRESULT GrayLib::cXObjEventSink::FindEventHandlerN ( const ATOMCHAR_t pszEventName) const

Register the event handled by name. Get the interface for dispatch of triggers.

Returns
EVENTX_TYPE

◆ get_EventSinkInterfaceDef()

virtual const cScriptableInterfaceDef* GrayLib::cXObjEventSink::get_EventSinkInterfaceDef ( ) const
pure virtual

◆ get_ScriptInterfaceDef()

virtual cScriptableInterfaceDefPtr _stdcall GrayLib::cXObjEventSink::get_ScriptInterfaceDef ( ) const
inlinevirtual

Reimplemented from GrayLib::cXObjDef.

◆ get_SortValue()

EVENTPRI_TYPE GrayLib::cXObjEventSink::get_SortValue ( ) const
inlinenoexcept

< So this can get processed in proper priority level. sorted by this!

◆ HasEventHandler()

bool GrayLib::cXObjEventSink::HasEventHandler ( EVENTX_TYPE  eEvent) const
inline

◆ InitEventHandlers()

void GrayLib::cXObjEventSink::InitEventHandlers ( )
inline

◆ IsHandledEvent()

static bool GrayLib::cXObjEventSink::IsHandledEvent ( EVENTRET_TYPE  hRes)
inlinestaticnoexcept

◆ RegisterEventHandler()

void GrayLib::cXObjEventSink::RegisterEventHandler ( EVENTX_TYPE  eEvent)
inline

◆ RegisterEventHandlerN()

HRESULT GrayLib::cXObjEventSink::RegisterEventHandlerN ( const ATOMCHAR_t pszEventName)

◆ s_Invoke()

HRESULT GrayLib::cXObjEventSink::s_Invoke ( const cScriptableMethod pMethod,
const cVariant vArgs,
OUT cVariant vValRet 
)
override

Invoke the event for this particular listener. Can be Called via actual event, GrayScript or Browser.

◆ s_PropGet()

HRESULT GrayLib::cXObjEventSink::s_PropGet ( const cScriptableProp pProp,
OUT cVariant vValRet 
)
override

◆ s_PropPut()

HRESULT GrayLib::cXObjEventSink::s_PropPut ( const cScriptableProp pProp,
const cVariant vVal 
)
override

◆ UnregisterEventHandler()

void GrayLib::cXObjEventSink::UnregisterEventHandler ( EVENTX_TYPE  eEvent)
inline

◆ UnregisterEventHandlerN()

bool GrayLib::cXObjEventSink::UnregisterEventHandlerN ( const ATOMCHAR_t pszEventName)

Friends And Related Function Documentation

◆ cXObjEventSinks

friend class cXObjEventSinks
friend

Member Data Documentation

◆ CHEAPOBJECT_IMPL

GrayLib::cXObjEventSink::CHEAPOBJECT_IMPL

◆ m_ePriorityLevel

EVENTPRI_TYPE GrayLib::cXObjEventSink::m_ePriorityLevel
protected

how to sort in cXObjEventSinks

◆ m_EventsHandled

cScriptableEventsMask GrayLib::cXObjEventSink::m_EventsHandled
protected

What events/methods from my get_EventSinkInterfaceDef do i actually handle?

◆ sm_Props

cScriptableProp GrayLib::cXObjEventSink::sm_Props
static
Initial value:
=
{
#define cXObjEventSinkProp(a,b,c)
}
#define CSCRIPT_PROP_END
Definition: cScriptableInterface.h:264

◆ sm_ScriptInterfaceDef

cScriptableInterfaceDef GrayLib::cXObjEventSink::sm_ScriptInterfaceDef
static

The documentation for this class was generated from the following files: