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

#include <cXObjEventSinks.h>

Inheritance diagram for GrayLib::cXObjEventSinks:
Gray::cArraySortValue< cXObjEventSink, EVENTPRI_TYPE > Gray::cArraySortRef< TYPE, TYPE_KEY > Gray::cArraySortFacade< cRefPtr< TYPE >, TYPE *, TYPE_KEY > Gray::cArraySorted< TYPE, TYPE_ARG, TYPE_KEY > Gray::cArrayTyped< TYPE, TYPE_ARG > Gray::CArray< TYPE, ARG_TYPE > Gray::CObject

Public Member Functions

 cXObjEventSinks (cScriptableInterfaceDef *pEventSinkInterfaceDef)
 
virtual ~cXObjEventSinks ()
 
bool HasEventHandler (EVENTX_TYPE iMethod) const
 
const cScriptableInterfaceDefget_EventSinkInterfaceDef () const
 
HRESULT EventSinkAdd (cXObjDef *pEventSink, bool bRemove)
 
EVENTRET_TYPE DispatchEvent (cXObject *pObjThis, const cScriptableMethod *pMethod, const cVariant &vArgs)
 
HRESULT v_GetEventSinks (OUT cVariant &vValRet) const
 
HRESULT v_PutEventSinks (const cVariant &vVal)
 
- Public Member Functions inherited from Gray::cArraySortValue< cXObjEventSink, EVENTPRI_TYPE >
virtual ~cArraySortValue ()
 
ITERATE_t FindIForAK (const cXObjEventSink *pBase) const
 
bool RemoveArgKey (cXObjEventSink *pBase)
 
ITERATE_t AddAfter (cXObjEventSink *pBase)
 
- Public Member Functions inherited from Gray::cArraySortRef< TYPE, TYPE_KEY >
void DisposeAll ()
 
- Public Member Functions inherited from Gray::cArraySortFacade< cRefPtr< TYPE >, TYPE *, TYPE_KEY >
virtual ~cArraySortFacade ()
 
bool IsValidIndex (ITERATE_t i) const noexcept
 
REF_t GetAt (ITERATE_t index) const noexcept
 
REF_t GetAtCheck (ITERATE_t nIndex) const
 
TYPEFindArgForKey (TYPE_KEY key1) const noexcept
 
ITERATE_t FindIForAC_BRUTEFORCE (const TYPE * pData) const
 
ELEM_t PopHead ()
 
ELEM_t PopTail ()
 
void DeleteAll ()
 
- Public Member Functions inherited from Gray::cArraySorted< TYPE, TYPE_ARG, TYPE_KEY >
virtual ~cArraySorted ()
 
ITERATE_t FindINear (REF_t pNew, COMPARE_t &iCompareRes) const
 
ITERATE_t FindINearKey (KEY_t key, COMPARE_t &iCompareRes) const
 
ITERATE_t FindIForKey (KEY_t key) const
 
ITERATE_t FindIFirstForKey (TYPE_KEY nKey) const
 
ITERATE_t FindILastForKey (TYPE_KEY nKey) const
 
ITERATE_t AddPresorted (ITERATE_t index, COMPARE_t iCompareRes, TYPE_ARG pNew)
 
bool RemoveKey (TYPE_KEY key)
 
ITERATE_t Add (TYPE_ARG pNew)
 
void AddArray (const SUPER_t &a)
 
- Public Member Functions inherited from Gray::cArrayTyped< TYPE, TYPE_ARG >
void QSort ()
 
 cArrayTyped () noexcept
 
 cArrayTyped (const THIS_t &rArray)
 
 cArrayTyped (ITERATE_t iSize)
 
virtual ~cArrayTyped ()
 
bool isValidCheck () const noexcept
 < memory allocation and structure definitions are valid. More...
 
bool IsValidIndex (ITERATE_t i) const noexcept
 
ITERATE_t ClampValidIndex (ITERATE_t i) const noexcept
 
size_t GetHeapStats (OUT ITERATE_t &iAllocCount) const noexcept
 
void AssertValidIndex (ITERATE_t nIndex) const
 
const TYPEGetAtSecure (ITERATE_t nIndex) const
 
TYPEElementAtSecure (ITERATE_t nIndex)
 
REF_t ConstElementAt (ITERATE_t nIndex) const
 
TYPEoperator[] (ITERATE_t nIndex)
 
const TYPEoperator[] (ITERATE_t nIndex) const
 
TYPEHead ()
 
TYPETail ()
 
TYPEElementAtHead ()
 
TYPEElementAtTail ()
 
REF_t ConstHead () const
 
REF_t ConstTail () const
 
REF_t GetAtTail ()
 
void UnLinkIndex (ITERATE_t nIndex)
 
void Swap (ITERATE_t i, ITERATE_t j)
 
void SetCopy (const cArrayTyped< TYPE, TYPE_ARG > &aValues)
 
const cArrayTyped< TYPE, TYPE_ARG > & operator= (const cArrayTyped< TYPE, TYPE_ARG > &aValues)
 
ITERATE_t FindIFor (TYPE_ARG arg) const
 
bool HasArg (TYPE_ARG arg) const
 
void RemoveLast ()
 
ELEM_t PopHead ()
 
ELEM_t PopTail ()
 
bool RemoveArg (TYPE_ARG arg)
 
void UnLinkArg (TYPE_ARG arg)
 
ITERATE_t AddTail (TYPE_ARG newElement)
 
ITERATE_t PushTail (TYPE_ARG newElement)
 
void AddHead (TYPE_ARG newElement)
 
TYPEget_DataWork () const
 
void AddArray (const SUPER_t &src)
 
bool IsEqualArray (const SUPER_t &aValues) const
 
bool isArraySorted () const
 
bool isArraySortedND () const
 
- Public Member Functions inherited from Gray::CArray< TYPE, ARG_TYPE >
 CArray () noexcept
 
 CArray (THIS_t &&ref) noexcept
 
virtual ~CArray ()
 
bool IsValidMallocSize () const noexcept
 
ITERATE_t GetSize () const noexcept
 
ITERATE_t GetUpperBound () const noexcept
 
bool IsEmpty () const noexcept
 
void SetSize (ITERATE_t nNewSize)
 
ITERATE_t GetMallocSize () const noexcept
 
void RemoveAll ()
 Clean up. More...
 
const TYPEGetAt (ITERATE_t nIndex) const
 
TYPEElementAt (ITERATE_t nIndex)
 
void SetAt (ITERATE_t nIndex, ARG_TYPE newElement)
 
const TYPEGetData () const
 
TYPEGetData ()
 
void SetDataArrayPtr (TYPE *pData, ITERATE_t nSize)
 
void SetAtGrow (ITERATE_t nIndex, ARG_TYPE newElement)
 
ITERATE_t Add (ARG_TYPE newElement)
 
void Copy (const CArray &src)
 
TYPEoperator[] (ITERATE_t nIndex)
 
const TYPEoperator[] (ITERATE_t nIndex) const
 
void InsertAt (ITERATE_t nIndex, ARG_TYPE newElement)
 
void RemoveAt (ITERATE_t nIndex)
 
void RemoveAt (ITERATE_t nIndex, ITERATE_t iQty)
 
void MoveElement (ITERATE_t iFrom, ITERATE_t iTo)
 
- 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)
 

Protected Attributes

cScriptableEventsMask m_EventsHandled
 union of all triggers handled by all my EventSinks. optimize not firing not handled events. More...
 
cScriptableInterfaceDefm_pEventSinkInterfaceDef
 Interface that lists fired events cScriptableMethod are we scripting for ? More...
 
- Protected Attributes inherited from Gray::CArray< TYPE, ARG_TYPE >
TYPEm_pData
 the actual array of data More...
 
ITERATE_t m_nSize
 Number of elements (upperBound - 1) More...
 

Additional Inherited Members

- Public Types inherited from Gray::cArraySortValue< cXObjEventSink, EVENTPRI_TYPE >
typedef cArraySortRef< cXObjEventSink, EVENTPRI_TYPE > SUPER_t
 
typedef SUPER_t::REF_t REF_t
 
typedef SUPER_t::KEY_t KEY_t
 
- Public Types inherited from Gray::cArraySortFacade< cRefPtr< TYPE >, TYPE *, TYPE_KEY >
typedef cArraySorted< cRefPtr< TYPE >, TYPE *, TYPE_KEY > SUPER_t
 
typedef SUPER_t::REF_t REF_t
 
typedef SUPER_t::ELEM_t ELEM_t
 
- Public Types inherited from Gray::cArraySorted< TYPE, TYPE_ARG, TYPE_KEY >
typedef cArrayTyped< TYPE, TYPE_ARG > SUPER_t
 
typedef TYPE_KEY KEY_t
 
typedef SUPER_t::REF_t REF_t
 
- Public Types inherited from Gray::cArrayTyped< TYPE, TYPE_ARG >
typedef CArray< TYPE, TYPE_ARG > SUPER_t
 
typedef cArrayTyped< TYPE, TYPE_ARG > THIS_t
 
typedef ITERATE_t iterator
 
typedef ITERATE_t const_iterator
 
typedef TYPE ELEM_t
 What type is stored. More...
 
typedef TYPE_ARG REF_t
 How to refer to this? value or ref or pointer? More...
 
- Protected Member Functions inherited from Gray::cArraySortValue< cXObjEventSink, EVENTPRI_TYPE >
virtual COMPARE_t CompareData (REF_t pData1, REF_t pData2) const noexcept override
 
virtual COMPARE_t CompareKey (KEY_t key1, REF_t pBase) const override
 
- Protected Member Functions inherited from Gray::cArraySorted< TYPE, TYPE_ARG, TYPE_KEY >
virtual COMPARE_t CompareKey (KEY_t key1, REF_t Data2) const
 
bool RemoveArgKey (REF_t pObj, KEY_t key)
 
- Protected Member Functions inherited from Gray::cArrayTyped< TYPE, TYPE_ARG >
ITERATE_t QSortPartition (ITERATE_t iLeft, ITERATE_t iRight)
 
void QSort (ITERATE_t iLeft, ITERATE_t iRight)
 
- Protected Member Functions inherited from Gray::CArray< TYPE, ARG_TYPE >
bool IsValidIndex (ITERATE_t i) const noexcept
 

Detailed Description

Array/Collection of cXObjEventSink. All of the same cScriptableInterfaceDef type! m_pEventSinkInterfaceDef I represent the publisher/source, track all my listeners/subscribers/sinks. For dispatching an event to possibly a list of event listeners/handlers Observer pattern http://en.wikipedia.org/wiki/Observer_pattern

Constructor & Destructor Documentation

◆ cXObjEventSinks()

GrayLib::cXObjEventSinks::cXObjEventSinks ( cScriptableInterfaceDef pEventSinkInterfaceDef)

◆ ~cXObjEventSinks()

GrayLib::cXObjEventSinks::~cXObjEventSinks ( void  )
virtual

Member Function Documentation

◆ DispatchEvent()

EVENTRET_TYPE GrayLib::cXObjEventSinks::DispatchEvent ( cXObject pObjThis,
const cScriptableMethod pMethod,
const cVariant vArgs 
)

Call methods for all attached cXObjEventSink called from s_EventFireObj etc pMethod = from get_EventSinkInterfaceDef() TODO return value in vValRet ?

◆ EventSinkAdd()

HRESULT GrayLib::cXObjEventSinks::EventSinkAdd ( cXObjDef pEventSink,
bool  bRemove 
)

Add/Remove EventSink interfaces to this object. Must be of the correct interface type. cXObjEventSink

◆ get_EventSinkInterfaceDef()

const cScriptableInterfaceDef* GrayLib::cXObjEventSinks::get_EventSinkInterfaceDef ( ) const
inline

◆ HasEventHandler()

bool GrayLib::cXObjEventSinks::HasEventHandler ( EVENTX_TYPE  iMethod) const
inline

is anyone listening? Don't fire event if no-one wants it.

◆ v_GetEventSinks()

HRESULT GrayLib::cXObjEventSinks::v_GetEventSinks ( OUT cVariant vValRet) const

Get my list of event sink defs.

◆ v_PutEventSinks()

HRESULT GrayLib::cXObjEventSinks::v_PutEventSinks ( const cVariant vVal)

Set the array of event handlers.

Member Data Documentation

◆ m_EventsHandled

cScriptableEventsMask GrayLib::cXObjEventSinks::m_EventsHandled
protected

union of all triggers handled by all my EventSinks. optimize not firing not handled events.

What events from my interface do ANY of my cXObjEventSink handle?

◆ m_pEventSinkInterfaceDef

cScriptableInterfaceDef* GrayLib::cXObjEventSinks::m_pEventSinkInterfaceDef
protected

Interface that lists fired events cScriptableMethod are we scripting for ?


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