/Users/brown170/Projects/Current/coral_msu_repo/trunk/src/coralutils/locobject.h File Reference

#include "parametermap.h"
#include "message.h"
#include <string>
#include <map>

Include dependency graph for locobject.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CObject
class  CLocatorBase
class  CLocator< T >
class  CObjectRegistry

Defines

#define __USING_RTTI__
#define REGISTER_OBJECT(reg, CObjDerived, ID)
#define CREATE_OBJECT(reg, CObjTarg, lo, ID)
#define REGISTER_GLOBAL_OBJECT(CObj)
#define UNREGISTER_GLOBAL_OBJECT(CObj)   GlobalObjectRegistry.Unregister(#CObj);
#define CREATE_GLOBAL_OBJECT(CObjTarg, lo, CObj)
#define DYNAMIC_CAST(CObj, ClassName)   dynamic_cast<ClassName*>(&(*CObj))
#define PTR_CAST(T, DestPtr, SrcPtr)
#define REF_CAST(T, DestRef, SrcRef)
#define CONST_CAST(Data, DataType)   *const_cast<DataType*>(&Data)

Functions

ostream & operator<< (ostream &strm, const CLocatorBase &lo)
template<class T >
bool operator< (const CLocator< T > &l, const CLocator< T > &r)
template<class T >
bool operator== (const CLocator< T > &l, const CLocator< T > &r)
ostream & operator<< (ostream &strm, const CObjectRegistry &m)

Variables

CObjectRegistry GlobalObjectRegistry


Define Documentation

#define __USING_RTTI__

Definition at line 6 of file locobject.h.

#define CONST_CAST ( Data,
DataType   )     *const_cast<DataType*>(&Data)

Definition at line 264 of file locobject.h.

#define CREATE_GLOBAL_OBJECT ( CObjTarg,
lo,
CObj   ) 

Value:

CLocator<CObjTarg> lo; \
    { \
        CObject* pObj = GlobalObjectRegistry.Create(#CObj); \
        PTR_CAST(CObjTarg*, pObjTarg, pObj); \
        lo.AttachObject(pObjTarg); \
    }

Definition at line 213 of file locobject.h.

#define CREATE_OBJECT ( reg,
CObjTarg,
lo,
ID   ) 

Value:

CLocator<CObjTarg> lo; \
    { \
        string id = ID; \
        CObject* pObj = reg.Create(id); \
        PTR_CAST(CObjTarg*, pObjTarg, pObj); \
        lo.AttachObject(pObjTarg); \
        lo->setObjType(id); \
    }

Definition at line 184 of file locobject.h.

#define DYNAMIC_CAST ( CObj,
ClassName   )     dynamic_cast<ClassName*>(&(*CObj))

Definition at line 225 of file locobject.h.

#define PTR_CAST ( T,
DestPtr,
SrcPtr   ) 

Value:

T DestPtr = dynamic_cast<T>(SrcPtr); \
                if (DestPtr == NULL) {\
                        MESSAGE<<"Dynamic cast of "#SrcPtr" to type "#T" failed."<<ENDM_FATAL; \
            exit(-1);\
                }

Definition at line 233 of file locobject.h.

#define REF_CAST ( T,
DestRef,
SrcRef   ) 

Value:

try { \
                        T DestRef = dynamic_cast<T>(SrcRef); \
                } \
                catch (...) { \
                        MESSAGE<<"Dynamic cast of "#SrcRef" to type "#T" failed."<<ENDM_FATAL; \
            exit(-1);\
                } \
                T DestRef = static_cast<T>(SrcRef);

Definition at line 240 of file locobject.h.

#define REGISTER_GLOBAL_OBJECT ( CObj   ) 

Value:

{ \
        CLocator<CObj> lo(new CObj); \
        GlobalObjectRegistry.Register(lo, #CObj); \
    }

Definition at line 204 of file locobject.h.

#define REGISTER_OBJECT ( reg,
CObjDerived,
ID   ) 

Value:

{ \
        string id = ID; \
        CLocator<CObjDerived> lo(new CObjDerived); \
        reg.Register(lo, id); \
        lo->setObjType(id); \
    }

Definition at line 176 of file locobject.h.

#define UNREGISTER_GLOBAL_OBJECT ( CObj   )     GlobalObjectRegistry.Unregister(#CObj);

Definition at line 210 of file locobject.h.


Function Documentation

template<class T >
bool operator< ( const CLocator< T > &  l,
const CLocator< T > &  r 
) [inline]

Definition at line 128 of file locobject.h.

ostream& operator<< ( ostream &  strm,
const CObjectRegistry m 
) [inline]

Definition at line 164 of file locobject.h.

ostream& operator<< ( ostream &  strm,
const CLocatorBase lo 
) [inline]

Definition at line 87 of file locobject.h.

template<class T >
bool operator== ( const CLocator< T > &  l,
const CLocator< T > &  r 
) [inline]

Definition at line 140 of file locobject.h.


Variable Documentation

Definition at line 12 of file locobject.cc.


Generated on Fri Feb 6 13:30:16 2009 for CorAL by  doxygen 1.5.8