osg::SingleFunctorStore Class Reference

#include <OSGSingleFunctorStore.h>

List of all members.

Public Types

Types



typedef NewActionTypes::Functor Functor

Public Member Functions

Constructors



 SingleFunctorStore (void)
Destructor



 ~SingleFunctorStore (void)
Empty



bool empty (void) const
Functor Registration



void regFunctor (const Functor &refFunc, const FieldContainerType &refType)
void unregFunctor (void)
void regDefaultFunctor (const Functor &refFunc)
void unregDefaultFunctor (void)
Functor Access



FunctorgetFunctor (const FieldContainerType &refType)
FunctorgetDefaultFunctor (void)

Private Attributes

UInt32 _uiTypeId
Functor _func
Functor _defaultFunc
bool _bHasFunctor
bool _bHasDefaultFunctor

Detailed Description

Definition at line 51 of file OSGSingleFunctorStore.h.


Member Typedef Documentation

Definition at line 59 of file OSGSingleFunctorStore.h.


Constructor & Destructor Documentation

osg::SingleFunctorStore::SingleFunctorStore ( void   )  [inline]

Definition at line 45 of file OSGSingleFunctorStore.inl.

00046     : _uiTypeId          (0    ),
00047       _func              (     ),
00048       _defaultFunc       (     ),
00049       _bHasFunctor       (false),
00050       _bHasDefaultFunctor(false)
00051 {
00052 }

osg::SingleFunctorStore::~SingleFunctorStore ( void   )  [inline]

Definition at line 58 of file OSGSingleFunctorStore.inl.

00059 {
00060 }


Member Function Documentation

bool osg::SingleFunctorStore::empty ( void   )  const [inline]

Definition at line 66 of file OSGSingleFunctorStore.inl.

References _bHasDefaultFunctor, and _bHasFunctor.

00067 {
00068     return _bHasFunctor | _bHasDefaultFunctor;
00069 }

void osg::SingleFunctorStore::regFunctor ( const Functor refFunc,
const FieldContainerType refType 
) [inline]

Definition at line 75 of file OSGSingleFunctorStore.inl.

References _bHasFunctor, _func, _uiTypeId, and osg::TypeBase::getId().

00077 {
00078     _uiTypeId    = refType.getId();
00079     _func        = refFunc;
00080     _bHasFunctor = true;
00081 }

void osg::SingleFunctorStore::unregFunctor ( void   )  [inline]

Definition at line 84 of file OSGSingleFunctorStore.inl.

References _bHasFunctor.

00085 {
00086     _bHasFunctor = false;
00087 }

void osg::SingleFunctorStore::regDefaultFunctor ( const Functor refFunc  )  [inline]

Definition at line 90 of file OSGSingleFunctorStore.inl.

References _bHasDefaultFunctor, and _defaultFunc.

00091 {
00092     _defaultFunc        = refFunc;
00093     _bHasDefaultFunctor = true;
00094 }

void osg::SingleFunctorStore::unregDefaultFunctor ( void   )  [inline]

Definition at line 97 of file OSGSingleFunctorStore.inl.

References _bHasDefaultFunctor.

00098 {
00099     _bHasDefaultFunctor = false;
00100 }

SingleFunctorStore::Functor * osg::SingleFunctorStore::getFunctor ( const FieldContainerType refType  )  [inline]

Definition at line 106 of file OSGSingleFunctorStore.inl.

References _bHasDefaultFunctor, _bHasFunctor, _defaultFunc, _func, _uiTypeId, and osg::TypeBase::getId().

00107 {
00108     Functor *pRetFunc = NULL;
00109 
00110     if(_bHasFunctor && (refType.getId() == _uiTypeId))
00111     {
00112         pRetFunc = &_func;
00113     }
00114     else if(_bHasDefaultFunctor)
00115     {
00116         pRetFunc = &_defaultFunc;
00117     }
00118 
00119     return pRetFunc;
00120 }

SingleFunctorStore::Functor * osg::SingleFunctorStore::getDefaultFunctor ( void   )  [inline]

Definition at line 123 of file OSGSingleFunctorStore.inl.

References _bHasDefaultFunctor, and _defaultFunc.

00124 {
00125     if(_bHasDefaultFunctor)
00126     {
00127         return &_defaultFunc;
00128     }
00129     else
00130     {
00131         return NULL;
00132     }
00133 }


Member Data Documentation

Definition at line 105 of file OSGSingleFunctorStore.h.

Referenced by getFunctor(), and regFunctor().

Definition at line 107 of file OSGSingleFunctorStore.h.

Referenced by getFunctor(), and regFunctor().

Definition at line 108 of file OSGSingleFunctorStore.h.

Referenced by getDefaultFunctor(), getFunctor(), and regDefaultFunctor().

Definition at line 110 of file OSGSingleFunctorStore.h.

Referenced by empty(), getFunctor(), regFunctor(), and unregFunctor().


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

Generated on 8 Feb 2010 for OpenSG by  doxygen 1.6.1