MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 > Class Template Reference

Global signal helpful for distribution of global events within an application. More...

#include <mdsGlobalSignal.h>

Inheritance diagram for mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CLASS_SINGLETON }
 Templates that require members of the CSingleton class can use this enum to check the existence. More...
enum  { LONGEVITY = L }
 Object longevity. More...
enum  { ID = Id }
 Signal identification. More...
enum  { NUM_OF_PARAMS = tHandler::NUM_OF_PARAMS }
 Number of handler parameters. More...
enum  { CLASS_OBJECT }
 Templates that require members of the CObject class can use this enum to check the existence. More...
enum  { HEAP_OBJECT = 0x70616568 }
 Signature used to recognize objects on the heap. More...
typedef mds::base::CFunctor< R,
P1, P2, P3, P4 > 
tHandler
 Handler type.
typedef
mds::base::CLibraryLockableObject
< CSignal >::CLock 
tLock
 Lock that may be used to provide mutual access.
typedef tHandler::tParam1 tParam1
typedef tHandler::tParam2 tParam2
typedef tHandler::tParam3 tParam3
typedef tHandler::tParam4 tParam4
typedef tHandler::tResult tResult
 Handler parameters.
typedef CSignal< R, P1, P2, P3,
P4 > 
tSignal
 Encapsulated signal.

Public Member Functions

void block (tSignalConnection &sc)
 Blocks a given signal handler.
void blockAllButThis (tSignalConnection &sc)
 Blocks all others signal handlers.
template<typename F >
tSignalConnection connect (F Func)
template<class O , typename F >
tSignalConnection connect (const O &pObject, F pMemFunc)
tSignalConnection connect (const tHandler &handler)
 Registers a new signal handler.
template<typename F >
tSignalConnection connect (F Func)
 Registers a new signal handler.
template<class O , typename F >
tSignalConnection connect (const O &pObject, F pMemFunc)
 Constructor creates functor encapsulating pointer to member function.
void disconnect (tSignalConnection &sc)
 Unregisters an existing signal handler.
void disconnectAll ()
 Unregisters all existing signal handlers.
int getId () const
 Returns global signal identifier.
int getNumOfConnections ()
 Returns the number of registered handlers.
int getReferencesCount () const
 Returns the number of references.
void invoke ()
 Invokes the signal.
void invoke (tParam1 p1)
void invoke (tParam1 p1, tParam2 p2)
void invoke (tParam1 p1, tParam2 p2, tParam3 p3)
void invoke (tParam1 p1, tParam2 p2, tParam3 p3, tParam4 p4)
tResult invoke2 ()
 Invokes the signal and returns value obtained by combining all values returned by individual handlers.
tResult invoke2 (tParam1 p1)
tResult invoke2 (tParam1 p1, tParam2 p2)
tResult invoke2 (tParam1 p1, tParam2 p2, tParam3 p3)
tResult invoke2 (tParam1 p1, tParam2 p2, tParam3 p3, tParam4 p4)
bool isBlocked (tSignalConnection &sc)
 Returns true if a given signal is blocked.
bool isOnHeap () const
 Returns true if the object is allocated on the heap.
void lock ()
 Locks the object.
 MDS_SHAREDPTR (CGlobalSignal)
 Smart pointer type.
 MDS_SHAREDPTR (CSignal)
 Smart pointer type.
void unblock (tSignalConnection &sc)
 Unblocks a given signal handler.
void unblockAll ()
 Unblocks all signal handlers.
void unlock ()
 Locks the object.
 ~CGlobalSignal ()
 Destructor.

Static Public Member Functions

static void * operator new (std::size_t Size)
 Allocates a new object on the heap.

Protected Types

typedef
CSignalConnection::tConnectionId 
tConnectionId
 Connection identifier.
typedef std::map
< tConnectionId, SHandlerInfo
tHandlers
 Map of registered signal handlers.

Protected Member Functions

void addReference () const
 Increase the reference counter.
bool delReference () const
 Decrease the reference counter.
tConnectionId getUniqueId ()
 Creates a new unique connection number.

Protected Attributes

tHandlers m_Handlers
 All registered signal handlers.
int m_iHeapObject
 Flag initialized if the object is on the heap.
int m_iReferences
 The number of references to the object.
tConnectionId m_NextId
 Next free connection identifier.

Detailed Description

template<int Id, typename R, typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
class mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 >

Global signal helpful for distribution of global events within an application.


Member Typedef Documentation

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef CSignalConnection::tConnectionId mds::mod::CSignal< R, P1, P2, P3, P4 >::tConnectionId [protected, inherited]

Connection identifier.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef mds::base::CFunctor<R, P1, P2, P3, P4> mds::mod::CSignal< R, P1, P2, P3, P4 >::tHandler [inherited]

Handler type.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef std::map<tConnectionId, SHandlerInfo> mds::mod::CSignal< R, P1, P2, P3, P4 >::tHandlers [protected, inherited]

Map of registered signal handlers.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef mds::base::CLibraryLockableObject<CSignal>::CLock mds::mod::CSignal< R, P1, P2, P3, P4 >::tLock [inherited]

Lock that may be used to provide mutual access.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef tHandler::tParam1 mds::mod::CSignal< R, P1, P2, P3, P4 >::tParam1 [inherited]
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef tHandler::tParam2 mds::mod::CSignal< R, P1, P2, P3, P4 >::tParam2 [inherited]
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef tHandler::tParam3 mds::mod::CSignal< R, P1, P2, P3, P4 >::tParam3 [inherited]
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef tHandler::tParam4 mds::mod::CSignal< R, P1, P2, P3, P4 >::tParam4 [inherited]
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef tHandler::tResult mds::mod::CSignal< R, P1, P2, P3, P4 >::tResult [inherited]

Handler parameters.

template<int Id, typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
typedef CSignal<R, P1, P2, P3, P4> mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 >::tSignal

Encapsulated signal.


Member Enumeration Documentation

template<int L>
anonymous enum [inherited]

Templates that require members of the CSingleton class can use this enum to check the existence.

Enumerator:
CLASS_SINGLETON 
template<int L>
anonymous enum [inherited]

Object longevity.

Enumerator:
LONGEVITY 
template<int Id, typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
anonymous enum

Signal identification.

Enumerator:
ID 
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
anonymous enum [inherited]

Number of handler parameters.

Enumerator:
NUM_OF_PARAMS 
anonymous enum [inherited]

Templates that require members of the CObject class can use this enum to check the existence.

Enumerator:
CLASS_OBJECT 
anonymous enum [inherited]

Signature used to recognize objects on the heap.

Enumerator:
HEAP_OBJECT 

Constructor & Destructor Documentation

template<int Id, typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 >::~CGlobalSignal ( )

Destructor.


Member Function Documentation

void mds::base::CObject::addReference ( ) const [protected, inherited]

Increase the reference counter.

template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::block ( tSignalConnection sc) [inherited]

Blocks a given signal handler.

template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::blockAllButThis ( tSignalConnection sc) [inherited]

Blocks all others signal handlers.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
template<typename F >
tSignalConnection mds::mod::CSignal< R, P1, P2, P3, P4 >::connect ( Func) [inherited]
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
template<class O , typename F >
tSignalConnection mds::mod::CSignal< R, P1, P2, P3, P4 >::connect ( const O &  pObject,
pMemFunc 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
tSignalConnection CSignal::connect ( const tHandler handler) [inherited]

Registers a new signal handler.

  • Returns unique connection identifier.
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
template<typename F >
tSignalConnection mds::mod::CSignal< R, P1, P2, P3, P4 >::connect ( Func) [inherited]

Registers a new signal handler.

  • Returns unique connection identifier.
  • Parameter F is a function type.
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
template<class O , typename F >
tSignalConnection mds::mod::CSignal< R, P1, P2, P3, P4 >::connect ( const O &  pObject,
pMemFunc 
) [inherited]

Constructor creates functor encapsulating pointer to member function.

  • Parameter O is pointer to an object.
  • M is pointer to the object member function.
bool mds::base::CObject::delReference ( ) const [protected, inherited]

Decrease the reference counter.

  • Returns true if the decremented number of references is lower or equal to zero and object must be deleted.
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::disconnect ( tSignalConnection sc) [inherited]

Unregisters an existing signal handler.

template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::disconnectAll ( ) [inherited]

Unregisters all existing signal handlers.

template<int Id, typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
int mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 >::getId ( ) const

Returns global signal identifier.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
int mds::mod::CSignal< R, P1, P2, P3, P4 >::getNumOfConnections ( ) [inherited]

Returns the number of registered handlers.

Returns the number of references.

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
tConnectionId mds::mod::CSignal< R, P1, P2, P3, P4 >::getUniqueId ( ) [protected, inherited]

Creates a new unique connection number.

template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::invoke ( ) [inherited]

Invokes the signal.

  • Use method with appropriate number of parameters!
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::invoke ( tParam1  p1) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::invoke ( tParam1  p1,
tParam2  p2 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::invoke ( tParam1  p1,
tParam2  p2,
tParam3  p3 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::invoke ( tParam1  p1,
tParam2  p2,
tParam3  p3,
tParam4  p4 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
CSignal< R, P1, P2, P3, P4 >::tResult CSignal::invoke2 ( ) [inherited]

Invokes the signal and returns value obtained by combining all values returned by individual handlers.

  • Use method with appropriate number of parameters!
  • Allowed only for non-void return types!
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
CSignal< R, P1, P2, P3, P4 >::tResult CSignal::invoke2 ( tParam1  p1) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
CSignal< R, P1, P2, P3, P4 >::tResult CSignal::invoke2 ( tParam1  p1,
tParam2  p2 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
CSignal< R, P1, P2, P3, P4 >::tResult CSignal::invoke2 ( tParam1  p1,
tParam2  p2,
tParam3  p3 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
CSignal< R, P1, P2, P3, P4 >::tResult CSignal::invoke2 ( tParam1  p1,
tParam2  p2,
tParam3  p3,
tParam4  p4 
) [inherited]
template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
bool CSignal::isBlocked ( tSignalConnection sc) [inherited]

Returns true if a given signal is blocked.

bool mds::base::CObject::isOnHeap ( ) const [inherited]

Returns true if the object is allocated on the heap.

void mds::base::CLockableObject< CSignal< R, P1, P2, P3, P4 > >::lock ( ) [inherited]

Locks the object.

template<int Id, typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
mds::mod::CGlobalSignal< Id, R, P1, P2, P3, P4 >::MDS_SHAREDPTR ( CGlobalSignal< Id, R, P1, P2, P3, P4 >  )

Smart pointer type.

  • Declares type tSmartPtr.
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
mds::mod::CSignal< R, P1, P2, P3, P4 >::MDS_SHAREDPTR ( CSignal< R, P1, P2, P3, P4 >  ) [inherited]

Smart pointer type.

  • Declares type tSmartPtr.
static void* mds::base::CObject::operator new ( std::size_t  Size) [static, inherited]

Allocates a new object on the heap.

template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::unblock ( tSignalConnection sc) [inherited]

Unblocks a given signal handler.

template<typename R , typename P1 , typename P2 , typename P3 , typename P4 >
void CSignal::unblockAll ( ) [inherited]

Unblocks all signal handlers.

void mds::base::CLockableObject< CSignal< R, P1, P2, P3, P4 > >::unlock ( ) [inherited]

Locks the object.


Member Data Documentation

template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
tHandlers mds::mod::CSignal< R, P1, P2, P3, P4 >::m_Handlers [protected, inherited]

All registered signal handlers.

int mds::base::CObject::m_iHeapObject [mutable, protected, inherited]

Flag initialized if the object is on the heap.

int mds::base::CObject::m_iReferences [mutable, protected, inherited]

The number of references to the object.

  • Zero if there is no reference.
template<typename R , typename P1 = tNull, typename P2 = tNull, typename P3 = tNull, typename P4 = tNull>
tConnectionId mds::mod::CSignal< R, P1, P2, P3, P4 >::m_NextId [protected, inherited]

Next free connection identifier.


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