Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cXObjEventSinks.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cXObjEventSource_H
7 #define _INC_cXObjEventSource_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cXObjEventSink.h"
13 
14 namespace GrayLib
15 {
16  class GRAYLIB_LINK cXObjEventSinks : public cArraySortValue<cXObjEventSink, EVENTPRI_TYPE>
17  {
23 
24  protected:
28 
29  private:
30  HRESULT EventSinkAddX(cXObjEventSink* pEventSink);
31  void UpdateEventsHandledMask();
32 
33  public:
34  cXObjEventSinks(cScriptableInterfaceDef* pEventSinkInterfaceDef);
35  virtual ~cXObjEventSinks();
36 
37  bool HasEventHandler(EVENTX_TYPE iMethod) const
38  {
40  if (GetSize() == 0)
41  return false;
42  return m_EventsHandled.HasEventHandler(iMethod);
43  }
44 
46  {
47  return m_pEventSinkInterfaceDef;
48  }
49 
50  HRESULT EventSinkAdd(cXObjDef* pEventSink, bool bRemove);
51  EVENTRET_TYPE DispatchEvent(cXObject* pObjThis, const cScriptableMethod* pMethod, const cVariant& vArgs);
52 
53  HRESULT v_GetEventSinks(OUT cVariant& vValRet) const;
54  HRESULT v_PutEventSinks(const cVariant& vVal);
55  };
56 };
57 
58 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cScriptableEventsMask.h:34
bool HasEventHandler(EVENTX_TYPE i) const noexcept
Definition: cScriptableEventsMask.h:57
Definition: cScriptableInterface.h:300
Definition: cScriptableInterface.h:97
Definition: cVariant.h:26
Definition: cXObjDef.h:17
Definition: cXObjEventSink.h:49
Definition: cXObjEventSinks.h:17
bool HasEventHandler(EVENTX_TYPE iMethod) const
Definition: cXObjEventSinks.h:37
cScriptableEventsMask m_EventsHandled
union of all triggers handled by all my EventSinks. optimize not firing not handled events.
Definition: cXObjEventSinks.h:26
const cScriptableInterfaceDef * get_EventSinkInterfaceDef() const
Definition: cXObjEventSinks.h:45
cScriptableInterfaceDef * m_pEventSinkInterfaceDef
Interface that lists fired events cScriptableMethod are we scripting for ?
Definition: cXObjEventSinks.h:27
Definition: cXObject.h:78
Definition: cArraySortRef.h:113
Definition: cMesh.h:22
SCRIPTPROPID_t EVENTX_TYPE
a EVENTX_TYPE_
Definition: cScriptableEventsMask.h:29
EVENTRET_TYPE
Definition: cXObjEventSink.h:32