OSG::DataType Class Reference

#include <OSGDataType.h>

Inheritance diagram for OSG::DataType:

OSG::TypeBase OSG::FieldType OSG::ReflexiveContainerType OSG::FieldBundleType OSG::FieldContainerType List of all members.

Public Types

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

Public Member Functions

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
bool operator== (const TypeBase &other) const
bool operator!= (const TypeBase &other) const
virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Constructors


 DataType (const Char8 *szName, const Char8 *szParentName, const UInt32 uiNameSpace=GlobalNamespace)
Destructors


virtual ~DataType (void)
Operators


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

Static Public Attributes

static const UInt32 GlobalNamespace = 0

Protected Types

typedef TypeBase Inherited

Protected Member Functions

 DataType (const DataType &source)
virtual bool initialize (void)
virtual void terminate (void)

Protected Attributes

UInt32 _uiTypeId
UInt32 _uiNameSpace
TypeBase_pParentType
IDString _szName
IDString _szParentName
bool _bInitialized

Private Member Functions

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

Detailed Description

Definition at line 52 of file OSGDataType.h.


Member Typedef Documentation

typedef TypeBase OSG::DataType::Inherited [protected]


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

DataType::DataType ( const Char8 *  szName,
const Char8 *  szParentName,
const UInt32  uiNameSpace = GlobalNamespace 
)

Definition at line 60 of file OSGDataType.cpp.

00062                                                :
00063     Inherited(szName, szParentName, uiNameSpace)
00064 {
00065 }

DataType::~DataType ( void   )  [virtual]

Definition at line 76 of file OSGDataType.cpp.

00077 {
00078 }

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

Definition at line 67 of file OSGDataType.cpp.

00067                                          :
00068     Inherited(source)
00069 {
00070 }


Member Function Documentation

bool DataType::operator== ( const DataType other  )  const

Definition at line 83 of file OSGDataType.cpp.

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

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

Definition at line 88 of file OSGDataType.cpp.

00089 {
00090     return ! (*this == other);
00091 }

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

bool TypeBase::initialize ( void   )  [protected, virtual, inherited]

Initialize this object and set dependent members.

Returns:
true if the initialization succeeded, false otherwise.

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

Definition at line 143 of file OSGTypeBase.cpp.

References OSG::TypeBase::_bInitialized, OSG::TypeBase::_pParentType, OSG::TypeBase::_szName, OSG::TypeBase::_szParentName, OSG::TypeBase::_uiNameSpace, OSG::endLog(), FDEBUG, OSG::TypeBase::GlobalNamespace, OSG::TypeBase::initialize(), OSG::IDString::isEmpty(), OSG::IDString::str(), SWARNING, and OSG::SingletonHolder< SingletonT >::the().

Referenced by OSG::TypeBase::initialize(), OSG::ReflexiveContainerType::initialize(), OSG::FieldContainerType::initialize(), and OSG::FieldBundleType::initialize().

00144 {
00145     if(_bInitialized == true)
00146         return _bInitialized;
00147 
00148     if(_szParentName.isEmpty() == false)
00149     {
00150         _pParentType =
00151             TypeFactory::the()->findType(_szParentName.str(), _uiNameSpace);
00152 
00153         if(_pParentType == NULL)
00154         {
00155             _pParentType =
00156                 TypeFactory::the()->findType(_szParentName.str(),
00157                                               GlobalNamespace);
00158         }
00159 
00160         if(_pParentType == NULL)
00161         {
00162             SWARNING << "ERROR: could not find parent type named "
00163                      << _szParentName.str()
00164                      << " in "
00165                      << _szName.str()
00166                      << endLog;
00167         }
00168         else
00169         {
00170             _bInitialized = _pParentType->initialize();
00171         }
00172     }
00173     else
00174     {
00175         _bInitialized = true;
00176     }
00177 
00178     FDEBUG(("Initialized Type %s | %d\n",_szName.str(), _bInitialized));
00179 
00180     return _bInitialized;
00181 }

void TypeBase::terminate ( void   )  [protected, virtual, inherited]

Perform cleanup operations for this object, does nothing for this class. Override in a derived class.

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

Definition at line 186 of file OSGTypeBase.cpp.

00187 {
00188 }

UInt32 TypeBase::getId ( void   )  const [inherited]

Returns:
The type id.

Definition at line 239 of file OSGTypeBase.cpp.

References OSG::TypeBase::_uiTypeId.

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

00240 {
00241     return _uiTypeId;
00242 }

const IDString & TypeBase::getName ( void   )  const [inherited]

Returns:
The types name.

Definition at line 248 of file OSGTypeBase.cpp.

References OSG::TypeBase::_szName.

Referenced by OSG::NodeCore::dump(), OSG::FieldContainer::dump(), and OSG::TypeFactoryBase::registerType().

00249 {
00250     return _szName;
00251 }

const Char8 * TypeBase::getCName ( void   )  const [inherited]

const TypeBase & TypeBase::getParent ( void   )  const [inherited]

Returns an object describing the parent of the type described by this.

Returns:
TypeBase instance describing the parent.
Note:
This method can only be used after initialize has been called.

Definition at line 268 of file OSGTypeBase.cpp.

References OSG::TypeBase::_pParentType.

00269 {
00270    return (*_pParentType);
00271 }

const IDString & TypeBase::getParentName ( void   )  const [inherited]

Returns the parent types name.

Returns:
Name of the parent type.

Definition at line 277 of file OSGTypeBase.cpp.

References OSG::TypeBase::_szParentName.

00278 {
00279     return _szParentName;
00280 }

const Char8 * TypeBase::getCParentName ( void   )  const [inherited]

Returns the parent types name as a C string.

Returns:
Name of the parent type as a C string.

Definition at line 286 of file OSGTypeBase.cpp.

References OSG::TypeBase::_szParentName, and OSG::IDString::str().

00287 {
00288     return _szParentName.str();
00289 }

UInt32 TypeBase::getNameSpace ( void   )  const [inherited]

Returns the namespace the descibed type belongs to.

Returns:
Namespace of the type.

Definition at line 295 of file OSGTypeBase.cpp.

References OSG::TypeBase::_uiNameSpace.

Referenced by OSG::TypeFactoryBase::registerType().

00296 {
00297     return _uiNameSpace;
00298 }

bool TypeBase::isInitialized ( void   )  const [inherited]

Returns whether this was initialized.

Returns:
true if this was initialized, false otherwise.

Definition at line 306 of file OSGTypeBase.cpp.

References OSG::TypeBase::_bInitialized.

Referenced by OSG::ReflexiveContainerType::initParentFields().

00307 {
00308     return _bInitialized;
00309 }

bool TypeBase::isDerivedFrom ( const TypeBase other  )  const [virtual, inherited]

Returns whether this type is derived from the type described by other.

Parameters:
[in] other Type to test if it is a parent of this type.
Returns:
true if other is a parent of this type, false otherwise.
Note:
This method can only be used after initialize has been called.

Definition at line 318 of file OSGTypeBase.cpp.

References OSG::TypeBase::_pParentType, and OSG::TypeBase::_uiTypeId.

Referenced by OSG::NFIOBase::getFCCount(), OSG::OSBCommonElement::getFCPtrType(), OSG::NFIOGeneric::getFCPtrType(), OSG::FieldContainerType::initBaseType(), OSG::OSGLoader::mapExtIntFieldType(), OSG::OSBGeometryElement::preWrite(), OSG::OSBCommonElement::preWriteFieldContainer(), OSG::OSBCommonElement::readFieldContent(), OSG::OSGWriter::FCInfoHelper::setName(), OSG::ClusterServer::start(), and OSG::NFIOBase::writeFCFields().

00319 {
00320     bool      returnValue = false;
00321     TypeBase *pCurrType   = _pParentType;
00322 
00323     if(_uiTypeId == other._uiTypeId)
00324     {
00325         returnValue = true;
00326     }
00327     else
00328     {
00329         while(pCurrType != NULL && returnValue == false)
00330         {
00331             if(other._uiTypeId == pCurrType->_uiTypeId)
00332             {
00333                 returnValue = true;
00334             }
00335             else
00336             {
00337                 pCurrType = pCurrType->_pParentType;
00338             }
00339         }
00340     }
00341 
00342     return returnValue;
00343 }

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 of file OSGTypeBase.cpp.

References OSG::TypeBase::_uiTypeId.

00354 {
00355     return _uiTypeId == other._uiTypeId;
00356 }

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

Compare two TypeBase objects for inequality. They are not equal if equality comparison returns false, i.e. they refer to different types.

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

Definition at line 364 of file OSGTypeBase.cpp.

00365 {
00366     return ! (*this == other);
00367 }

void TypeBase::dump ( UInt32  uiIndent = 0,
const BitVector  bvFlags = 0 
) const [virtual, inherited]

Print information about this object for debugging purposes.

Parameters:
[in] uiIndent Number of spaces to indent output.

Reimplemented in OSG::FieldContainerType.

Definition at line 375 of file OSGTypeBase.cpp.

References OSG::endLog(), OSG::TypeBase::getCName(), OSG::TypeBase::getId(), OSG::indentLog(), and PLOG.

00377 {
00378     indentLog(uiIndent, PLOG);
00379     PLOG << "TypeBase : " << getId() << " | " << getCName() << endLog;
00380 }


Member Data Documentation

const UInt32 OSG::TypeBase::GlobalNamespace = 0 [static, inherited]

Definition at line 76 of file OSGTypeBase.h.

Referenced by OSG::TypeBase::initialize().

UInt32 OSG::TypeBase::_uiTypeId [protected, inherited]

Unique id of type in global type system.

Definition at line 155 of file OSGTypeBase.h.

Referenced by OSG::TypeBase::getId(), OSG::TypeBase::isDerivedFrom(), OSG::TypeBase::operator==(), and OSG::TypeBase::TypeBase().

UInt32 OSG::TypeBase::_uiNameSpace [protected, inherited]

Namespace that the id belongs to.

Definition at line 157 of file OSGTypeBase.h.

Referenced by OSG::TypeBase::getNameSpace(), and OSG::TypeBase::initialize().

TypeBase* OSG::TypeBase::_pParentType [protected, inherited]

The type of the parent if one was registered.

Definition at line 159 of file OSGTypeBase.h.

Referenced by OSG::TypeBase::getParent(), OSG::TypeBase::initialize(), OSG::ReflexiveContainerType::initParentFields(), and OSG::TypeBase::isDerivedFrom().

IDString OSG::TypeBase::_szName [protected, inherited]

IDString OSG::TypeBase::_szParentName [protected, inherited]

bool OSG::TypeBase::_bInitialized [protected, inherited]


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