FREE::CallbackCtrlEventBase Class Reference
[Events]

Abstract event object in f.r.e.e., used for every kind of callback... More...

#include <freControllerEvents.h>

Inheritance diagram for FREE::CallbackCtrlEventBase:

Inheritance graph
FREE::CallbackCtrlEvent\< T \>
[legend]
Collaboration diagram for FREE::CallbackCtrlEventBase:

Collaboration graph
FREE::SessionComponentCacheFREE::ComponentCacheCollection\< TCache \>FREE::KeyedCollectionBase\< std::string, TCache, FREE::ComponentCacheIdentifier\< TCache \> \>FREE::SmartCollectionBase\< TElement \>FREE::CollectionBase\< TElement, itk::SmartPointer\< TElement \> \>FREE::ComponentControllerInterfaceFREE::CtrlProfile::ProfileInheritanceFREE::XMLStringMultiMapFREE::XMLStreamObject
[legend]

List of all members.

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)
SessionComponentCacheGetACR ()
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
SessionComponentCachem_ACR
itk::SimpleMutexLock m_ACRMutex


Detailed Description

Abstract event object in f.r.e.e., used for every kind of callback...

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.

Remarks:
This type of event is thread save. A mutex is controlling the execution of the function pointer to avoid multiple calls at the same time.

Definition at line 50 of file freControllerEvents.h.


Member Typedef Documentation

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)

Reimplemented in FREE::CallbackCtrlEvent< T >.

Definition at line 54 of file freControllerEvents.h.

typedef CallbackCtrlEventBase FREE::CallbackCtrlEventBase::Self

Reimplemented in FREE::CallbackCtrlEvent< T >.

Definition at line 57 of file freControllerEvents.h.

typedef itk::SmartPointer<Self> FREE::CallbackCtrlEventBase::Pointer

Reimplemented in FREE::CallbackCtrlEvent< T >.

Definition at line 58 of file freControllerEvents.h.


Constructor & Destructor Documentation

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]

Definition at line 42 of file freControllerEvents.cxx.

References m_ACR, and m_CallEvent.


Member Function Documentation

FREE::CallbackCtrlEventBase::freNewEventBaseMacro ( CallbackCtrlEventBase  ,
CallEvent   
)

virtual const char* FREE::CallbackCtrlEventBase::GetNameOfClass (  )  const [inline, virtual]

Reimplemented in FREE::CallbackCtrlEvent< T >.

Definition at line 61 of file freControllerEvents.h.

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.

Here is the call graph for this function:

FREE::SessionComponentCache::GetRootCache

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.

Here is the call graph for this function:

FREE::SessionComponentCache::GetRootCache

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.

Parameters:
[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.
Returns:
If true, pData is valid.

Definition at line 50 of file freControllerEvents.cxx.

References m_CallEvent, and m_ExecutionMutex.


Member Data Documentation

CallEvent FREE::CallbackCtrlEventBase::m_CallEvent [private]

Reimplemented in FREE::CallbackCtrlEvent< T >.

Definition at line 76 of file freControllerEvents.h.

Referenced by CallbackCtrlEventBase(), and Execute().

SessionComponentCache* FREE::CallbackCtrlEventBase::m_ACR [private]

Definition at line 77 of file freControllerEvents.h.

Referenced by CallbackCtrlEventBase(), GetACR(), IsLegalSender(), and SetACR().

itk::SimpleMutexLock FREE::CallbackCtrlEventBase::m_ACRMutex [private]

Definition at line 79 of file freControllerEvents.h.

Referenced by IsLegalSender().

itk::SimpleMutexLock FREE::CallbackCtrlEventBase::m_ExecutionMutex [protected]

Definition at line 88 of file freControllerEvents.h.

Referenced by FREE::CallbackCtrlEvent< T >::Execute(), and Execute().


The documentation for this class was generated from the following files:
Generated at Sat Oct 13 18:29:23 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000