#include <freControllerEvents.h>


Public Types | |
| typedef long | CallbackType |
| typedef bool(* | CallEvent )(const IDPath &senderID, CallbackType callbackID, void *pData, SessionComponentCache *pSender, long threadID) |
| typedef CallbackCtrlEventBase | Self |
| typedef itk::SmartPointer < Self > | Pointer |
Public Member Functions | |
| freNewEventBaseMacro (CallbackCtrlEventBase, CallEvent) | |
| virtual const char * | GetNameOfClass () const |
| void | SetACR (SessionComponentCache *pCache) |
| SessionComponentCache * | GetACR () |
| bool | IsLegalSender (SessionComponentCache *pSender) |
| virtual bool | Execute (const IDPath &senderID, CallbackType callbackID, void *pData, SessionComponentCache *pSender, long threadID=0) |
Protected Member Functions | |
| CallbackCtrlEventBase (CallEvent pCE) | |
| CallbackCtrlEventBase () | |
Protected Attributes | |
| itk::SimpleMutexLock | m_ExecutionMutex |
Private Member Functions | |
| CallbackCtrlEventBase (const Self &) | |
| void | operator= (const Self &) |
Private Attributes | |
| CallEvent | m_CallEvent |
| SessionComponentCache * | m_ACR |
| itk::SimpleMutexLock | m_ACRMutex |
CallbackCtrlEventBase is the generic event object within f.r.e.e. and used to realize callbacks to nonstatic member functions of f.r.e.e. objects. This Event is used for callback based data retrieval or other situations where a controller should get the possibility to interact or make a request. For an event an authorised cache root (ACR) can be defined. This ACR is the root cache of a session and always unique. An event will only be executed, if event and sender have the same ACR. By this way the event can be limited to special session. If the ACR is null, every sender may pass.
Definition at line 50 of file freControllerEvents.h.
| typedef long FREE::CallbackCtrlEventBase::CallbackType |
Definition at line 53 of file freControllerEvents.h.
| typedef bool(* FREE::CallbackCtrlEventBase::CallEvent)(const IDPath &senderID, CallbackType callbackID, void *pData, SessionComponentCache *pSender, long threadID) |
| typedef itk::SmartPointer<Self> FREE::CallbackCtrlEventBase::Pointer |
| FREE::CallbackCtrlEventBase::CallbackCtrlEventBase | ( | const Self & | ) | [private] |
| FREE::CallbackCtrlEventBase::CallbackCtrlEventBase | ( | CallEvent | pCE | ) | [protected] |
Implementation of FREE::CallbackCtrlEventBase //////////////////////
Definition at line 35 of file freControllerEvents.cxx.
References m_ACR, and m_CallEvent.
| FREE::CallbackCtrlEventBase::CallbackCtrlEventBase | ( | ) | [protected] |
| FREE::CallbackCtrlEventBase::freNewEventBaseMacro | ( | CallbackCtrlEventBase | , | |
| CallEvent | ||||
| ) |
| virtual const char* FREE::CallbackCtrlEventBase::GetNameOfClass | ( | ) | const [inline, virtual] |
| void FREE::CallbackCtrlEventBase::SetACR | ( | SessionComponentCache * | pCache | ) |
Sets the ACR for the event. You may use any cache of the session because the function will call pCache->GetRootCache(). If the passed cache pointer is NULL, the event is set to no limitation.
Definition at line 70 of file freControllerEvents.cxx.
References FREE::SessionComponentCache::GetRootCache(), and m_ACR.

| SessionComponentCache * FREE::CallbackCtrlEventBase::GetACR | ( | ) |
Returns the pointer to the ACR if set.
Definition at line 84 of file freControllerEvents.cxx.
References m_ACR.
| bool FREE::CallbackCtrlEventBase::IsLegalSender | ( | SessionComponentCache * | pSender | ) |
Returns if the passed cache may execute the event. If return is false the execution will be blocked.
Definition at line 91 of file freControllerEvents.cxx.
References FREE::SessionComponentCache::GetRootCache(), m_ACR, and m_ACRMutex.

| void FREE::CallbackCtrlEventBase::operator= | ( | const Self & | ) | [private] |
Reimplemented in FREE::CallbackCtrlEvent< T >.
| bool FREE::CallbackCtrlEventBase::Execute | ( | const IDPath & | senderID, | |
| CallbackType | callbackID, | |||
| void * | pData, | |||
| SessionComponentCache * | pSender, | |||
| long | threadID = 0 | |||
| ) | [virtual] |
This Event is used for callback based data retrieval or other situations where a controller should get the possibility to interact or make a request.
| [in] | senderID | IDPath specifying the component that is making the callback |
| [in] | callbackID | Defines the callback type and so the meaning of pData. The meaning depends on the sender of the callback, where the meaning of flag and pData are also explained. |
| [in,out] | pData | Void pointer to a data structure may be passed or requested with the callback. Meaning and use depend on the senderID and callbackID. |
| [in,out] | pSender | Pointer to the session component cache that was active when the event was executed. |
| [in] | threadID | ID of the Thread executing the event. By default this value is 0. This ID is not unique over the complete system, it should only be assumed that it is unique in the context of the sender. |
Definition at line 50 of file freControllerEvents.cxx.
References m_CallEvent, and m_ExecutionMutex.
Reimplemented in FREE::CallbackCtrlEvent< T >.
Definition at line 76 of file freControllerEvents.h.
Referenced by CallbackCtrlEventBase(), and Execute().
Definition at line 77 of file freControllerEvents.h.
Referenced by CallbackCtrlEventBase(), GetACR(), IsLegalSender(), and SetACR().
itk::SimpleMutexLock FREE::CallbackCtrlEventBase::m_ACRMutex [private] |
itk::SimpleMutexLock FREE::CallbackCtrlEventBase::m_ExecutionMutex [protected] |
Definition at line 88 of file freControllerEvents.h.
Referenced by FREE::CallbackCtrlEvent< T >::Execute(), and Execute().
1.5.3 written by Dimitri van Heesch,
© 1997-2000