CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
EditorImpl.h File Reference
#include "TD_PackPush.h"
#include "Editor.h"
#include "DbIdMapping.h"
#include "FxDbCoreExtension.h"
#include "TD_PackPop.h"

Go to the source code of this file.

Classes

class  OdRxEventImpl
 
class  OdEditorImpl
 

Macros

#define FX_SAFE_CALL_REACTOR_EVENT_IMPL(reactor, method, params, index)   { reactor->method params; }
 
#define FX_BEGIN_MAIN_THREAD()    CFxDbCoreExtension::StaticExecuteInMainThread( [&]() {
 
#define FX_END_MAIN_THREAD()    } );
 
#define RXEVENT_FIRE(method, inparams, params)
 
#define EDEVENT_FIRE(method, inparams, params)
 
#define DCEVENT_FIRE(method, inparams, params, IdMappingToDatabase)
 
#define RXEVENT_FIRE_ABORT(method, inparams, params, abortmethod, abortparams)
 
#define EDEVENT_FIRE_ABORT(method, inparams, params, abortmethod, abortparams)
 

Typedefs

typedef OdSmartPtr< OdRxEventImplOdRxEventImplPtr
 
typedef OdSmartPtr< OdEditorImplOdEditorImplPtr
 

Functions

OdArray< OdRxEventReactor * > fxCopyRawReactorPointers (OdArray< OdRxEventReactorPtr > &apReactors)
 
bool fxIsValidReactor (OdRxEventReactor *pRawReactor, const OdArray< OdRxEventReactorPtr > &apReactors, unsigned iHeuristicIndex)
 

Macro Definition Documentation

◆ DCEVENT_FIRE

#define DCEVENT_FIRE (   method,
  inparams,
  params,
  IdMappingToDatabase 
)
Value:
inline void fire_##method inparams \
{ \
FX_BEGIN_MAIN_THREAD(); \
TD_AUTOLOCK( m_mutex ); \
try \
{ \
const auto reactors = fxCopyRawReactorPointers( m_reactors ); \
for (unsigned i = 0; i < reactors.size(); ++i) \
{ \
if ( fxIsValidReactor( reactors[i], m_reactors, i ) )\
reactors[i]->method params; \
} \
} \
catch( ... ) \
{ \
--m_EventCounter; \
throw; \
} \
if (!(--m_EventCounter))\
while( m_reactors.remove(OdRxEventReactorPtr()) );\
FX_END_MAIN_THREAD(); \
}
bool fxIsValidReactor(OdRxEventReactor *pRawReactor, const OdArray< OdRxEventReactorPtr > &apReactors, unsigned iHeuristicIndex)
Definition: EditorImpl.h:75
OdArray< OdRxEventReactor * > fxCopyRawReactorPointers(OdArray< OdRxEventReactorPtr > &apReactors)
Definition: EditorImpl.h:66
GLenum GLint * params
Definition: gles2_ext.h:184

Definition at line 144 of file EditorImpl.h.

◆ EDEVENT_FIRE

#define EDEVENT_FIRE (   method,
  inparams,
  params 
)
Value:
inline void fire_##method inparams \
{ \
FX_BEGIN_MAIN_THREAD(); \
TD_AUTOLOCK( m_mutex ); \
++m_EventCounter; \
try \
{ \
const auto reactors = fxCopyRawReactorPointers( m_reactors ); \
for (unsigned i = 0; i < reactors.size(); ++i) \
{ \
if ( fxIsValidReactor( reactors[i], m_reactors, i ) )\
{\
OdEditorReactorPtr edReactor = OdEditorReactor::cast(reactors[i]); \
if (edReactor.get()) edReactor->method params; \
}\
} \
} \
catch( ... ) \
{ \
--m_EventCounter; \
throw; \
} \
if (!(--m_EventCounter))\
while( m_reactors.remove(OdRxEventReactorPtr()) );\
FX_END_MAIN_THREAD(); \
}
static OdRxObjectPtr cast(const OdRxObject *pointer)
Definition: RxObject.h:640
const T * get() const
Definition: SmartPtr.h:339

Definition at line 116 of file EditorImpl.h.

◆ EDEVENT_FIRE_ABORT

#define EDEVENT_FIRE_ABORT (   method,
  inparams,
  params,
  abortmethod,
  abortparams 
)

Definition at line 198 of file EditorImpl.h.

◆ FX_BEGIN_MAIN_THREAD

#define FX_BEGIN_MAIN_THREAD ( )     CFxDbCoreExtension::StaticExecuteInMainThread( [&]() {

Definition at line 60 of file EditorImpl.h.

◆ FX_END_MAIN_THREAD

#define FX_END_MAIN_THREAD ( )     } );

Definition at line 62 of file EditorImpl.h.

◆ FX_SAFE_CALL_REACTOR_EVENT_IMPL

#define FX_SAFE_CALL_REACTOR_EVENT_IMPL (   reactor,
  method,
  params,
  index 
)    { reactor->method params; }

<group OdRx_Classes>

Definition at line 51 of file EditorImpl.h.

◆ RXEVENT_FIRE

#define RXEVENT_FIRE (   method,
  inparams,
  params 
)
Value:
inline void fire_##method inparams \
{ \
FX_BEGIN_MAIN_THREAD(); \
TD_AUTOLOCK( m_mutex ); \
++m_EventCounter; \
try \
{ \
const auto reactors = fxCopyRawReactorPointers( m_reactors ); \
for (unsigned i = 0; i < reactors.size(); ++i) \
{ \
if ( fxIsValidReactor( reactors[i], m_reactors, i ) )\
FX_SAFE_CALL_REACTOR_EVENT_IMPL( reactors[i], method, params, i ) \
} \
} \
catch( ... ) \
{ \
--m_EventCounter; \
throw; \
} \
if (!(--m_EventCounter))\
while( m_reactors.remove(OdRxEventReactorPtr()) );\
FX_END_MAIN_THREAD(); \
}

Definition at line 91 of file EditorImpl.h.

◆ RXEVENT_FIRE_ABORT

#define RXEVENT_FIRE_ABORT (   method,
  inparams,
  params,
  abortmethod,
  abortparams 
)
Value:
inline void fire_##method inparams \
{ \
FX_BEGIN_MAIN_THREAD(); \
TD_AUTOLOCK( m_mutex ); \
const auto reactors = fxCopyRawReactorPointers( m_reactors ); \
OdArray<OdRxEventReactorPtr> firedReactors(reactors.length()); \
for (unsigned i = 0; i < reactors.size(); ++i) \
{ \
if ( fxIsValidReactor( reactors[i], m_reactors, i ) ) \
{ \
try \
{ \
firedReactors.append(reactors[i]); \
reactors[i]->method params; \
} \
catch(...) \
{ \
for (unsigned j = 0; j < firedReactors.size(); ++j) \
{ \
if (m_reactors.contains(firedReactors[j])) \
firedReactors[j]->abortmethod abortparams; \
} \
throw; \
} \
} \
} \
FX_END_MAIN_THREAD(); \
}

Definition at line 168 of file EditorImpl.h.

Typedef Documentation

◆ OdEditorImplPtr

Definition at line 392 of file EditorImpl.h.

◆ OdRxEventImplPtr

Definition at line 379 of file EditorImpl.h.

Function Documentation

◆ fxCopyRawReactorPointers()

OdArray< OdRxEventReactor * > fxCopyRawReactorPointers ( OdArray< OdRxEventReactorPtr > &  apReactors)
inline

Definition at line 66 of file EditorImpl.h.

◆ fxIsValidReactor()

bool fxIsValidReactor ( OdRxEventReactor pRawReactor,
const OdArray< OdRxEventReactorPtr > &  apReactors,
unsigned  iHeuristicIndex 
)
inline

Definition at line 75 of file EditorImpl.h.