OSG::ReflexiveContainerType Class Reference

#include <OSGReflexiveContainerType.h>

Inheritance diagram for OSG::ReflexiveContainerType:

OSG::DataType OSG::TypeBase OSG::FieldBundleType OSG::FieldContainerType List of all members.

Public Types

enum  InitPhase { Static = 0x0000, SystemPre = 0x0001, SystemPost = 0x0002, FactoryPost = 0x0004 }

Public Member Functions

bool operator== (const TypeBase &other) const
bool operator!= (const TypeBase &other) const
UInt32 getId (void) const
 Get method for attribute Id.
const IDStringgetName (void) const
 Get method for attribute name.
const Char8 * getCName (void) const
 Get method for name as C string.
const TypeBasegetParent (void) const
const IDStringgetParentName (void) const
const Char8 * getCParentName (void) const
UInt32 getNameSpace (void) const
bool isInitialized (void) const
virtual bool isDerivedFrom (const TypeBase &other) const
virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Constructors


 ReflexiveContainerType (const Char8 *szName, const Char8 *szParentName=NULL, const Char8 *szGroupName=NULL, const UInt32 uiNameSpace=0, InitalInsertDescFunc descInsertFunc=NULL, bool bDescsAddable=false, BitVector bvUnmarkedOnCreate=0)
Destructor


virtual ~ReflexiveContainerType (void)
Helper


UInt16 getGroupId (void) const
Get


FieldDescriptionBasegetFieldDesc (UInt32 uiFieldId)
FieldDescriptionBasegetFieldDesc (UInt32 uiFieldId) const
FieldDescriptionBasegetFieldDesc (const Char8 *szFieldName)
FieldDescriptionBasegetFieldDesc (const Char8 *szFieldName) const
UInt32 getNumFieldDescs (void) const
Set


BitVector getUnmarkedOnCreate (void)
your_category


void addInitialDesc (FieldDescriptionBase *pDesc)
Container Access


UInt32 addDescription (const FieldDescriptionBase &desc)
bool subDescription (UInt32 uiFieldId)
Operators


bool operator== (const DataType &other) const
bool operator!= (const DataType &other) const

Static Public Attributes

static const UInt32 GlobalNamespace = 0

Protected Types

Type information


typedef std::map< IDStringLink,
FieldDescriptionBase * > 
DescMap
typedef std::vector< FieldDescriptionBase * > DescVec
typedef DescMap::iterator DescMapIt
typedef DescMap::const_iterator DescMapConstIt
typedef DescVec::iterator DescVecIt
typedef DescVec::const_iterator DescVecConstIt

Protected Member Functions

Fields


 ReflexiveContainerType (const ReflexiveContainerType &source)
Changed


bool initFields (void)
bool initParentFields (void)
virtual bool initialize (void)
virtual void terminate (void)

Protected Attributes

UInt32 _uiTypeId
UInt32 _uiNameSpace
TypeBase_pParentType
IDString _szName
IDString _szParentName
bool _bInitialized
Member


UInt16 _uiGroupId
bool _bDescsAddable
IDString _szGroupName
DescVec _vInitialDescs
DescMap _mDescMap
DescVec _vDescVec
InitalInsertDescFunc _descInsertFunc
BitVector _bvUnmarkedOnCreate

Private Types

typedef DataType Inherited

Private Member Functions

void operator= (const ReflexiveContainerType &source)
 prohibit default function (move to 'public' if needed)

Detailed Description

Definition at line 61 of file OSGReflexiveContainerType.h.


Member Typedef Documentation

Definition at line 172 of file OSGReflexiveContainerType.h.

typedef std::vector< FieldDescriptionBase *> OSG::ReflexiveContainerType::DescVec [protected]

Definition at line 173 of file OSGReflexiveContainerType.h.

typedef DescMap::iterator OSG::ReflexiveContainerType::DescMapIt [protected]

Definition at line 175 of file OSGReflexiveContainerType.h.

typedef DescMap::const_iterator OSG::ReflexiveContainerType::DescMapConstIt [protected]

Definition at line 176 of file OSGReflexiveContainerType.h.

typedef DescVec::iterator OSG::ReflexiveContainerType::DescVecIt [protected]

Definition at line 178 of file OSGReflexiveContainerType.h.

typedef DescVec::const_iterator OSG::ReflexiveContainerType::DescVecConstIt [protected]

Definition at line 179 of file OSGReflexiveContainerType.h.

Reimplemented from OSG::DataType.

Reimplemented in OSG::FieldBundleType, and OSG::FieldContainerType.

Definition at line 234 of file OSGReflexiveContainerType.h.


Member Enumeration Documentation

enum OSG::TypeBase::InitPhase [inherited]

Enumerator:
Static 
SystemPre 
SystemPost 
FactoryPost 

Definition at line 82 of file OSGTypeBase.h.

00083     {
00084         Static      = 0x0000,
00085         SystemPre   = 0x0001,
00086         SystemPost  = 0x0002,
00087         FactoryPost = 0x0004
00088     };


Constructor & Destructor Documentation

ReflexiveContainerType::ReflexiveContainerType ( const Char8 *  szName,
const Char8 *  szParentName = NULL,
const Char8 *  szGroupName = NULL,
const UInt32  uiNameSpace = 0,
InitalInsertDescFunc  descInsertFunc = NULL,
bool  bDescsAddable = false,
BitVector  bvUnmarkedOnCreate = 0 
)

Definition at line 58 of file OSGReflexiveContainerType.cpp.

00065                                                     :
00066 
00067      Inherited        (             szName,
00068                               szParentName,
00069                                uiNameSpace),
00070 
00071     _uiGroupId        (                  0),
00072     _bDescsAddable    (      bDescsAddable),
00073     _szGroupName      (        szGroupName),
00074 
00075     _vInitialDescs    (                   ),
00076 
00077     _mDescMap         (                   ),
00078     _vDescVec         (                   ),
00079 
00080    _descInsertFunc    (descInsertFunc     ),
00081    _bvUnmarkedOnCreate(~bvUnmarkedOnCreate)      
00082 {
00083 }

ReflexiveContainerType::~ReflexiveContainerType ( void   )  [virtual]

Definition at line 107 of file OSGReflexiveContainerType.cpp.

References terminate().

00108 {
00109     terminate();
00110 }

ReflexiveContainerType::ReflexiveContainerType ( const ReflexiveContainerType source  )  [protected]

Definition at line 85 of file OSGReflexiveContainerType.cpp.

00086                                           :
00087      Inherited         (source                    ),
00088 
00089     _uiGroupId         (source._uiGroupId         ),
00090     _bDescsAddable     (source._bDescsAddable     ),
00091     _szGroupName       (source._szGroupName       ),
00092 
00093     _vInitialDescs     (                          ),
00094 
00095     _mDescMap          (                          ),
00096     _vDescVec          (                          ),
00097 
00098     _descInsertFunc    (source._descInsertFunc    ),
00099     _bvUnmarkedOnCreate(source._bvUnmarkedOnCreate)      
00100 {
00101 }


Member Function Documentation

UInt16 OSG::ReflexiveContainerType::getGroupId ( void   )  const [inline]

Definition at line 42 of file OSGReflexiveContainerType.inl.

References _uiGroupId.

Referenced by OSG::AttachmentContainer::findAttachment(), OSG::XWindowBase::getClassGroupId(), OSG::WindowBase::getClassGroupId(), OSG::VisitSubTreeBase::getClassGroupId(), OSG::ViewportBase::getClassGroupId(), OSG::VertexProgramChunkBase::getClassGroupId(), OSG::TwoSidedLightingChunkBase::getClassGroupId(), OSG::TransformChunkBase::getClassGroupId(), OSG::TransformBase::getClassGroupId(), OSG::TiledQuadTreeTerrainBase::getClassGroupId(), OSG::TileCameraDecoratorBase::getClassGroupId(), OSG::TextureTransformChunkBase::getClassGroupId(), OSG::TextureSelectChunkBase::getClassGroupId(), OSG::TextureObjRefChunkBase::getClassGroupId(), OSG::TextureObjChunkBase::getClassGroupId(), OSG::TextureGrabForegroundBase::getClassGroupId(), OSG::TextureGrabBackgroundBase::getClassGroupId(), OSG::TextureEnvChunkBase::getClassGroupId(), OSG::TextureChunkBase::getClassGroupId(), OSG::TextureBufferBase::getClassGroupId(), OSG::TextureBaseChunkBase::getClassGroupId(), OSG::TextureBackgroundBase::getClassGroupId(), OSG::TexGenChunkBase::getClassGroupId(), OSG::SwitchMaterialBase::getClassGroupId(), OSG::SwitchBase::getClassGroupId(), OSG::StringAttributeMapBase::getClassGroupId(), OSG::StereoCameraDecoratorBase::getClassGroupId(), OSG::StereoBufferViewportBase::getClassGroupId(), OSG::StencilChunkBase::getClassGroupId(), OSG::StatsAttachmentBase::getClassGroupId(), OSG::StatisticsForegroundBase::getClassGroupId(), OSG::StateChunkBase::getClassGroupId(), OSG::StateBase::getClassGroupId(), OSG::StageDataBase::getClassGroupId(), OSG::StageBase::getClassGroupId(), OSG::SpotLightBase::getClassGroupId(), OSG::SortLastWindowBase::getClassGroupId(), OSG::SortFirstWindowBase::getClassGroupId(), OSG::SolidBackgroundBase::getClassGroupId(), OSG::SkyBackgroundBase::getClassGroupId(), OSG::SimpleTexturedMaterialBase::getClassGroupId(), OSG::SimpleStatisticsForegroundBase::getClassGroupId(), OSG::SimpleStageBase::getClassGroupId(), OSG::SimpleShadowMapEngineDataBase::getClassGroupId(), OSG::SimpleShadowMapEngineBase::getClassGroupId(), OSG::SimpleMaterialBase::getClassGroupId(), OSG::SHLParameterChunkBase::getClassGroupId(), OSG::SHLChunkBase::getClassGroupId(), OSG::ShearedStereoCameraDecoratorBase::getClassGroupId(), OSG::ShadowMapEngineBase::getClassGroupId(), OSG::ShaderParameterVec4fBase::getClassGroupId(), OSG::ShaderParameterVec3fBase::getClassGroupId(), OSG::ShaderParameterVec2fBase::getClassGroupId(), OSG::ShaderParameterStringBase::getClassGroupId(), OSG::ShaderParameterRealBase::getClassGroupId(), OSG::ShaderParameterMVec4fBase::getClassGroupId(), OSG::ShaderParameterMVec3fBase::getClassGroupId(), OSG::ShaderParameterMVec2fBase::getClassGroupId(), OSG::ShaderParameterMRealBase::getClassGroupId(), OSG::ShaderParameterMMatrixBase::getClassGroupId(), OSG::ShaderParameterMIntBase::getClassGroupId(), OSG::ShaderParameterMatrixBase::getClassGroupId(), OSG::ShaderParameterIntBase::getClassGroupId(), OSG::ShaderParameterChunkBase::getClassGroupId(), OSG::ShaderParameterBoolBase::getClassGroupId(), OSG::ShaderParameterBase::getClassGroupId(), OSG::ShaderChunkBase::getClassGroupId(), OSG::SepiaComposerBase::getClassGroupId(), OSG::ScreenLODBase::getClassGroupId(), OSG::ScaleManipulatorBase::getClassGroupId(), OSG::RotateManipulatorBase::getClassGroupId(), OSG::RenderOptionsBase::getClassGroupId(), OSG::RenderBufferBase::getClassGroupId(), OSG::RegisterCombinersChunkBase::getClassGroupId(), OSG::ReflexiveContainer::getClassGroupId(), OSG::QuadTreeTerrainBase::getClassGroupId(), OSG::ProxyGroupBase::getClassGroupId(), OSG::ProjectionCameraDecoratorBase::getClassGroupId(), OSG::ProgramChunkBase::getClassGroupId(), OSG::PolygonForegroundBase::getClassGroupId(), OSG::PolygonChunkBase::getClassGroupId(), OSG::PolygonBackgroundBase::getClassGroupId(), OSG::PointLightBase::getClassGroupId(), OSG::PointChunkBase::getClassGroupId(), OSG::PipelineComposerBase::getClassGroupId(), OSG::PerspectiveCameraBase::getClassGroupId(), OSG::PassiveWindowBase::getClassGroupId(), OSG::PassiveViewportBase::getClassGroupId(), OSG::PassiveBackgroundBase::getClassGroupId(), OSG::ParticlesBase::getClassGroupId(), OSG::ParallelComposerBase::getClassGroupId(), OSG::OrthographicCameraBase::getClassGroupId(), OSG::OffCenterPerspectiveCameraBase::getClassGroupId(), OSG::MultiPassMaterialBase::getClassGroupId(), OSG::MultiDisplayWindowBase::getClassGroupId(), OSG::MoveManipulatorBase::getClassGroupId(), OSG::MatrixCameraDecoratorBase::getClassGroupId(), OSG::MatrixCameraBase::getClassGroupId(), OSG::MaterialGroupBase::getClassGroupId(), OSG::MaterialDrawableBase::getClassGroupId(), OSG::MaterialChunkBase::getClassGroupId(), OSG::MaterialBase::getClassGroupId(), OSG::ManipulatorBase::getClassGroupId(), OSG::LineChunkBase::getClassGroupId(), OSG::LightEnvBase::getClassGroupId(), OSG::LightEngineBase::getClassGroupId(), OSG::LightChunkBase::getClassGroupId(), OSG::LightBase::getClassGroupId(), OSG::InverseTransformBase::getClassGroupId(), OSG::InlineBase::getClassGroupId(), OSG::ImageForegroundBase::getClassGroupId(), OSG::ImageComposerBase::getClassGroupId(), OSG::ImageBase::getClassGroupId(), OSG::HDRStageDataBase::getClassGroupId(), OSG::HDRStageBase::getClassGroupId(), OSG::GroupBase::getClassGroupId(), OSG::GradientBackgroundBase::getClassGroupId(), OSG::GrabForegroundBase::getClassGroupId(), OSG::GeoVectorPropertyBase::getClassGroupId(), OSG::GeoStatsAttachmentBase::getClassGroupId(), OSG::GeoPropertyBase::getClassGroupId(), OSG::GeoMultiPropertyDataBase::getClassGroupId(), OSG::GeoMultiPropertyBase::getClassGroupId(), OSG::GeometryBase::getClassGroupId(), OSG::GeoIntegralPropertyBase::getClassGroupId(), OSG::FrameBufferObjectBase::getClassGroupId(), OSG::FrameBufferAttachmentBase::getClassGroupId(), OSG::FragmentProgramChunkBase::getClassGroupId(), OSG::ForegroundBase::getClassGroupId(), OSG::FileGrabForegroundBase::getClassGroupId(), OSG::FieldContainer::getClassGroupId(), OSG::FBOViewportBase::getClassGroupId(), OSG::DrawableBase::getClassGroupId(), OSG::DistanceLODBase::getClassGroupId(), OSG::DirectionalLightBase::getClassGroupId(), OSG::DepthClearBackgroundBase::getClassGroupId(), OSG::DepthChunkBase::getClassGroupId(), OSG::CubeTextureObjChunkBase::getClassGroupId(), OSG::CubeTextureChunkBase::getClassGroupId(), OSG::ContainerPoolBase::getClassGroupId(), OSG::ComponentTransformBase::getClassGroupId(), OSG::ColorMaskChunkBase::getClassGroupId(), OSG::ColorBufferViewportBase::getClassGroupId(), OSG::ClusterWindowBase::getClassGroupId(), OSG::ClipPlaneChunkBase::getClassGroupId(), OSG::ChunkOverrideGroupBase::getClassGroupId(), OSG::ChunkMaterialBase::getClassGroupId(), OSG::CameraDecoratorBase::getClassGroupId(), OSG::CameraBase::getClassGroupId(), OSG::BlendChunkBase::getClassGroupId(), OSG::BinarySwapComposerBase::getClassGroupId(), OSG::BillboardBase::getClassGroupId(), OSG::BalancedMultiWindowBase::getClassGroupId(), OSG::BackgroundBase::getClassGroupId(), OSG::AlgorithmStageBase::getClassGroupId(), OSG::AlgorithmBase::getClassGroupId(), and OSG::ReflexiveContainer::getGroupId().

00043 {
00044     return _uiGroupId;
00045 }

FieldDescriptionBase * OSG::ReflexiveContainerType::getFieldDesc ( UInt32  uiFieldId  )  [inline]

FieldDescriptionBase * OSG::ReflexiveContainerType::getFieldDesc ( UInt32  uiFieldId  )  const [inline]

Definition at line 57 of file OSGReflexiveContainerType.inl.

References _vDescVec.

00059 {
00060     if(uiFieldId - 1 < _vDescVec.size())
00061         return _vDescVec[uiFieldId - 1];
00062     else
00063         return NULL;
00064 }

FieldDescriptionBase * OSG::ReflexiveContainerType::getFieldDesc ( const Char8 *  szFieldName  )  [inline]

Definition at line 67 of file OSGReflexiveContainerType.inl.

References _mDescMap.

00069 {
00070     DescMapIt descIt = _mDescMap.find(IDStringLink(szFieldName));
00071 
00072     return (descIt == _mDescMap.end()) ? NULL : (*descIt).second;
00073 }

FieldDescriptionBase * OSG::ReflexiveContainerType::getFieldDesc ( const Char8 *  szFieldName  )  const [inline]

Definition at line 76 of file OSGReflexiveContainerType.inl.

References _mDescMap.

00078 {
00079     DescMapConstIt descIt = _mDescMap.find(IDStringLink(szFieldName));
00080 
00081     return (descIt == _mDescMap.end()) ? NULL : (*descIt).second;
00082 }

UInt32 OSG::ReflexiveContainerType::getNumFieldDescs ( void   )  const [inline]

BitVector OSG::ReflexiveContainerType::getUnmarkedOnCreate ( void   )  [inline]

Definition at line 91 of file OSGReflexiveContainerType.inl.

References _bvUnmarkedOnCreate.

00092 {
00093     return _bvUnmarkedOnCreate;
00094 }

void ReflexiveContainerType::addInitialDesc ( FieldDescriptionBase pDesc  ) 

Definition at line 259 of file OSGReflexiveContainerType.cpp.

References _vInitialDescs.

Referenced by OSG::XWindowBase::classDescInserter(), OSG::WindowBase::classDescInserter(), OSG::VisitSubTreeBase::classDescInserter(), OSG::ViewportBase::classDescInserter(), OSG::TypedGeoVectorProperty< GeoPropertyDesc >::classDescInserter(), OSG::TypedGeoIntegralProperty< GeoPropertyDesc >::classDescInserter(), OSG::TransformChunkBase::classDescInserter(), OSG::TransformBase::classDescInserter(), OSG::TiledQuadTreeTerrainBase::classDescInserter(), OSG::TileCameraDecoratorBase::classDescInserter(), OSG::TextureTransformChunkBase::classDescInserter(), OSG::TextureSelectChunkBase::classDescInserter(), OSG::TextureObjRefChunkBase::classDescInserter(), OSG::TextureObjChunkBase::classDescInserter(), OSG::TextureGrabForegroundBase::classDescInserter(), OSG::TextureGrabBackgroundBase::classDescInserter(), OSG::TextureEnvChunkBase::classDescInserter(), OSG::TextureChunkBase::classDescInserter(), OSG::TextureBufferBase::classDescInserter(), OSG::TextureBaseChunkBase::classDescInserter(), OSG::TextureBackgroundBase::classDescInserter(), OSG::TexGenChunkBase::classDescInserter(), OSG::SwitchMaterialBase::classDescInserter(), OSG::SwitchBase::classDescInserter(), OSG::StringAttributeMapBase::classDescInserter(), OSG::StereoCameraDecoratorBase::classDescInserter(), OSG::StereoBufferViewportBase::classDescInserter(), OSG::StencilChunkBase::classDescInserter(), OSG::StatisticsForegroundBase::classDescInserter(), OSG::StateChunkBase::classDescInserter(), OSG::StateBase::classDescInserter(), OSG::StageDataBase::classDescInserter(), OSG::StageBase::classDescInserter(), OSG::SpotLightBase::classDescInserter(), OSG::SortLastWindowBase::classDescInserter(), OSG::SortFirstWindowBase::classDescInserter(), OSG::SolidBackgroundBase::classDescInserter(), OSG::SkyBackgroundBase::classDescInserter(), OSG::SimpleTexturedMaterialBase::classDescInserter(), OSG::SimpleStatisticsForegroundBase::classDescInserter(), OSG::SimpleStageBase::classDescInserter(), OSG::SimpleShadowMapEngineDataBase::classDescInserter(), OSG::SimpleShadowMapEngineBase::classDescInserter(), OSG::SimpleMaterialBase::classDescInserter(), OSG::SHLParameterChunkBase::classDescInserter(), OSG::SHLChunkBase::classDescInserter(), OSG::ShearedStereoCameraDecoratorBase::classDescInserter(), OSG::ShadowMapEngineBase::classDescInserter(), OSG::ShaderParameterVec4fBase::classDescInserter(), OSG::ShaderParameterVec3fBase::classDescInserter(), OSG::ShaderParameterVec2fBase::classDescInserter(), OSG::ShaderParameterStringBase::classDescInserter(), OSG::ShaderParameterRealBase::classDescInserter(), OSG::ShaderParameterMVec4fBase::classDescInserter(), OSG::ShaderParameterMVec3fBase::classDescInserter(), OSG::ShaderParameterMVec2fBase::classDescInserter(), OSG::ShaderParameterMRealBase::classDescInserter(), OSG::ShaderParameterMMatrixBase::classDescInserter(), OSG::ShaderParameterMIntBase::classDescInserter(), OSG::ShaderParameterMatrixBase::classDescInserter(), OSG::ShaderParameterIntBase::classDescInserter(), OSG::ShaderParameterChunkBase::classDescInserter(), OSG::ShaderParameterBoolBase::classDescInserter(), OSG::ShaderParameterBase::classDescInserter(), OSG::ShaderChunkBase::classDescInserter(), OSG::ScreenLODBase::classDescInserter(), OSG::ProxyGroupBase::classDescInserter(), OSG::ProgramChunkBase::classDescInserter(), OSG::PolygonChunkBase::classDescInserter(), OSG::PointLightBase::classDescInserter(), OSG::PointChunkBase::classDescInserter(), OSG::PipelineComposerBase::classDescInserter(), OSG::OrthographicCameraBase::classDescInserter(), OSG::OffCenterPerspectiveCameraBase::classDescInserter(), OSG::NodeCore::classDescInserter(), OSG::Node::classDescInserter(), OSG::MultiPassMaterialBase::classDescInserter(), OSG::MatrixCameraDecoratorBase::classDescInserter(), OSG::MatrixCameraBase::classDescInserter(), OSG::MaterialDrawableBase::classDescInserter(), OSG::MaterialChunkBase::classDescInserter(), OSG::MaterialBase::classDescInserter(), OSG::ManipulatorBase::classDescInserter(), OSG::LightEngineBase::classDescInserter(), OSG::LightChunkBase::classDescInserter(), OSG::LightBase::classDescInserter(), OSG::InlineBase::classDescInserter(), OSG::ImageForegroundBase::classDescInserter(), OSG::ImageComposerBase::classDescInserter(), OSG::ImageBase::classDescInserter(), OSG::HDRStageBase::classDescInserter(), OSG::GrabForegroundBase::classDescInserter(), OSG::GeoPropertyBase::classDescInserter(), OSG::FrameBufferObjectBase::classDescInserter(), OSG::FrameBufferAttachmentBase::classDescInserter(), OSG::ForegroundBase::classDescInserter(), OSG::FieldContainer::classDescInserter(), OSG::FieldBundleAttachment::classDescInserter(), OSG::DirectionalLightBase::classDescInserter(), OSG::ContainerPoolBase::classDescInserter(), OSG::ComponentTransformBase::classDescInserter(), OSG::ColorMaskChunkBase::classDescInserter(), OSG::ClusterWindowBase::classDescInserter(), OSG::ClipPlaneChunkBase::classDescInserter(), OSG::CameraDecoratorBase::classDescInserter(), OSG::CameraBase::classDescInserter(), OSG::BinarySwapComposerBase::classDescInserter(), OSG::BackgroundBase::classDescInserter(), and OSG::AttachmentContainer::classDescInserter().

00260 {
00261     if(pDesc != NULL)
00262     {
00263         _vInitialDescs.push_back(pDesc);
00264     }
00265 }

UInt32 ReflexiveContainerType::addDescription ( const FieldDescriptionBase desc  ) 

Definition at line 267 of file OSGReflexiveContainerType.cpp.

References _bDescsAddable, _mDescMap, OSG::TypeBase::_szName, _vDescVec, OSG::FieldDescriptionBase::clone(), OSG::FieldDescriptionBase::getCName(), OSG::FieldDescriptionBase::getTypeId(), OSG::FieldDescriptionBase::isValid(), OSG::IDString::str(), and SWARNING.

00268 {
00269     UInt32         returnValue = 0;
00270     DescMapConstIt descIt;
00271     DescVecIt      descVIt;
00272 
00273     FieldDescriptionBase *pDesc;
00274     FieldDescriptionBase *pNullDesc = NULL;
00275 
00276     if(_bDescsAddable == false)
00277         return returnValue;
00278 
00279     descIt = _mDescMap.find(IDStringLink(desc.getCName()));
00280 
00281     if(desc.isValid())
00282     {
00283         if(descIt == _mDescMap.end())
00284         {
00285             pDesc = desc.clone();
00286 
00287             _mDescMap[IDStringLink(pDesc->getCName())] = pDesc;
00288 
00289             descVIt = std::find(_vDescVec.begin(),
00290                                 _vDescVec.end(),
00291                                  pNullDesc);
00292 
00293             if(descVIt == _vDescVec.end())
00294             {
00295                 _vDescVec.push_back(pDesc);
00296 
00297                 returnValue = _vDescVec.size();
00298             }
00299             else
00300             {
00301                 (*descVIt) = pDesc;
00302 
00303                 returnValue  = descVIt - _vDescVec.begin();
00304                 returnValue += 1;
00305             }
00306         }
00307         else
00308         {
00309             SWARNING << "ERROR: Double field description "
00310                         << "in " << _szName.str() << " from "
00311                         << desc.getCName() << " (id:"
00312                         << desc.getTypeId() << ")" << std::endl;
00313         }
00314     }
00315     else
00316     {
00317         SWARNING << "ERROR: Invalid field description "
00318                     << "in " << _szName.str() << " from "
00319                     << desc.getTypeId() << std::endl;
00320     }
00321 
00322     return returnValue;
00323 }

bool ReflexiveContainerType::subDescription ( UInt32  uiFieldId  ) 

Definition at line 325 of file OSGReflexiveContainerType.cpp.

References _bDescsAddable, _mDescMap, _vDescVec, OSG::FieldDescriptionBase::getCName(), and getFieldDesc().

00326 {
00327     FieldDescriptionBase *pDesc = getFieldDesc(uiFieldId);
00328     DescMapIt             descMIt;
00329     DescVecIt             descVIt;
00330     bool                  returnValue = true;
00331 
00332     if(pDesc == NULL || _bDescsAddable == false)
00333         return false;
00334 
00335     descMIt = _mDescMap.find(IDStringLink(pDesc->getCName()));
00336 
00337     if(descMIt != _mDescMap.end())
00338     {
00339         _mDescMap.erase(descMIt);
00340     }
00341     else
00342     {
00343         returnValue = false;
00344     }
00345 
00346     descVIt = std::find(_vDescVec.begin(), _vDescVec.end(), pDesc);
00347 
00348     if(descVIt != _vDescVec.end())
00349     {
00350         (*descVIt) = NULL;
00351 
00352         returnValue &= true;
00353     }
00354     else
00355     {
00356         returnValue = false;
00357     }
00358 
00359     delete pDesc;
00360 
00361     return returnValue;
00362 }

bool ReflexiveContainerType::initFields ( void   )  [protected]

Definition at line 167 of file OSGReflexiveContainerType.cpp.

References _mDescMap, OSG::TypeBase::_szName, _vDescVec, _vInitialDescs, OSG::TypeBase::getCName(), OSG::IDString::str(), and SWARNING.

Referenced by initialize().

00168 {
00169     bool      returnValue = true;
00170     UInt32    i;
00171     DescMapIt descIt;
00172 
00173     for(i = 0; i < _vInitialDescs.size(); i++)
00174     {
00175         if(_vInitialDescs[i]->isValid())
00176         {
00177             descIt =
00178                 _mDescMap.find(IDStringLink(_vInitialDescs[i]->getCName()));
00179 
00180             if(descIt == _mDescMap.end())
00181             {
00182                 _mDescMap[IDStringLink(_vInitialDescs[i]->getCName())] =
00183                     _vInitialDescs[i];
00184 
00185                 _vDescVec.push_back(_vInitialDescs[i]);
00186             }
00187             else
00188             {
00189                 SWARNING << "ERROR: Double field description "
00190                          << "in " << _szName.str() << "from "
00191                          << _vInitialDescs[i]->getCName()
00192                          << _vInitialDescs[i]->getTypeId() << std::endl;
00193 
00194                 returnValue = false;
00195             }
00196         }
00197         else
00198         {
00199             SWARNING << "ERROR: Invalid field description "
00200                      << "in " << _szName.str() << "from "
00201                      << _vInitialDescs[i]->getTypeId() << std::endl;
00202 
00203             returnValue = false;
00204         }
00205 
00206     }
00207 
00208     std::sort(_vDescVec.begin(), _vDescVec.end(), FieldDescriptionBasePLT());
00209 
00210     return returnValue;
00211 }

bool ReflexiveContainerType::initParentFields ( void   )  [protected]

Definition at line 213 of file OSGReflexiveContainerType.cpp.

References _mDescMap, OSG::TypeBase::_pParentType, OSG::TypeBase::_szParentName, _vDescVec, OSG::TypeBase::isInitialized(), OSG::IDString::str(), and SWARNING.

Referenced by initialize().

00214 {
00215     bool      returnValue = true;
00216     DescMapIt dPIt;
00217 
00218     ReflexiveContainerType *pReflexParent =
00219         dynamic_cast<ReflexiveContainerType *>(_pParentType);
00220 
00221     if(pReflexParent != NULL)
00222     {
00223         if(pReflexParent->isInitialized() == true)
00224         {
00225             for(  dPIt  = pReflexParent->_mDescMap.begin();
00226                   dPIt != pReflexParent->_mDescMap.end  ();
00227                 ++dPIt)
00228             {
00229                 if(_mDescMap.find((*dPIt).first) == _mDescMap.end())
00230                 {
00231                     _mDescMap[(*dPIt).first] = (*dPIt).second;
00232                 }
00233                 else
00234                 {
00235                     SWARNING << "ERROR: Can't add field "
00236                              << "description a second time: "
00237                              << (*dPIt).first.str() << std::endl;
00238                 }
00239             }
00240 
00241             _vDescVec.insert(_vDescVec.end(),
00242                               pReflexParent->_vDescVec.begin(),
00243                               pReflexParent->_vDescVec.end  ());
00244 
00245         }
00246         else
00247         {
00248             SWARNING << "ERROR: parent not initialized "
00249                      << "name " << _szParentName.str()
00250                      << std::endl;
00251 
00252             returnValue = false;
00253         }
00254     }
00255 
00256     return returnValue;
00257 }

bool ReflexiveContainerType::initialize ( void   )  [protected, virtual]

Reimplemented from OSG::TypeBase.

Reimplemented in OSG::FieldBundleType, and OSG::FieldContainerType.

Definition at line 113 of file OSGReflexiveContainerType.cpp.

References OSG::TypeBase::_bInitialized, _descInsertFunc, _vDescVec, FDEBUG, FWARNING, OSG::TypeBase::getCName(), initFields(), OSG::TypeBase::initialize(), and initParentFields().

00114 {
00115     if(_bInitialized == true)
00116         return true;
00117 
00118     _bInitialized = Inherited::initialize();
00119 
00120     if(_bInitialized == false)
00121         return false;
00122 
00123     if(_descInsertFunc != NULL)
00124     {
00125         _descInsertFunc(this);
00126     }
00127 
00128     _bInitialized = initParentFields();
00129 
00130     if(_bInitialized == false)
00131         return false;
00132 
00133     _bInitialized = initFields      ();
00134 
00135     if(_bInitialized == false)
00136         return false;
00137 
00138 
00139     FDEBUG(("init ContainerType %s (%d)\n",
00140             getCName(),
00141             int(_bInitialized)));
00142 
00143     if(_vDescVec.size() > sizeof(BitVector) * 8)
00144     {
00145         FWARNING(("FCType %s has %d (>%d) fields!\n",
00146                    getCName(),
00147                   _vDescVec.size(),
00148                    sizeof(BitVector) * 8));
00149     }
00150 
00151     return true;
00152 }

void ReflexiveContainerType::terminate ( void   )  [protected, virtual]

Reimplemented from OSG::TypeBase.

Reimplemented in OSG::FieldBundleType, and OSG::FieldContainerType.

Definition at line 155 of file OSGReflexiveContainerType.cpp.

References OSG::TypeBase::_bInitialized, and _vInitialDescs.

Referenced by ~ReflexiveContainerType().

00156 {
00157     _bInitialized = false;
00158 
00159     for(UInt32 i = 0; i < _vInitialDescs.size(); ++i)
00160     {
00161         delete _vInitialDescs[i];
00162     }
00163 
00164     _vInitialDescs.clear();
00165 }

void OSG::ReflexiveContainerType::operator= ( const ReflexiveContainerType source  )  [private]

bool DataType::operator== ( const DataType other  )  const [inherited]

Definition at line 83 of file OSGDataType.cpp.

00084 {
00085     return *(static_cast<const Inherited *>(this)) == other;
00086 }

bool TypeBase::operator== ( const TypeBase other  )  const [inherited]

Compare two TypeBase objects for equality. They are equal, iff they describe the same type as determined by comparing the stored type ids.

Parameters:
[in] other TypeBase instance to compare this with.
Returns:
true if this and other refer to the same type, false otherwise.

Definition at line 353