Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::FieldFactory Class Reference
[Fields]

#include <OSGFieldFactory.h>

List of all members.

Get

const Char8getFieldTypeName (UInt32 typeId)
*static UInt32 getNFieldTypes (void)
static FieldTypegetFieldType (UInt32 typeId)
static FieldTypegetFieldType (const Char8 *szName)

Public Member Functions

Destructor
*virtual ~FieldFactory (void)
Create
*FieldcreateField (UInt32 typeId)
FieldcreateField (const Char8 *szName)

Static Public Member Functions

The
*static FieldFactorythe (void)

Protected Member Functions

Constructors
FieldFactory (void)

Private Member Functions

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

Static Private Member Functions

static void addType (FieldType *pType)

Static Private Attributes

static FieldFactory _the
static std::map< UInt32, FieldType * > * _fieldTypeM = NULL

Friends

class FieldType
class Field


Detailed Description

Definition at line 65 of file OSGFieldFactory.h.


Constructor & Destructor Documentation

FieldFactory::~FieldFactory void   )  [virtual]
 

Definition at line 60 of file OSGFieldFactory.cpp.

References SINFO.

00061 {
00062     SINFO << "INFO: Destroy Singleton FieldFactory" << std::endl;
00063 }

FieldFactory::FieldFactory void   )  [protected]
 

Definition at line 171 of file OSGFieldFactory.cpp.

00172 {
00173 }

osg::FieldFactory::FieldFactory const FieldFactory source  )  [private]
 


Member Function Documentation

Field * FieldFactory::createField UInt32  typeId  ) 
 

Definition at line 68 of file OSGFieldFactory.cpp.

References osg::FieldType::_createMethod, and getFieldType().

Referenced by osg::DynFieldAttachment< AttachmentDescT >::addField().

00069 {
00070     FieldType *pType = getFieldType(typeId);
00071 
00072 
00073     if((pType                != NULL) &&
00074        (pType->_createMethod != NULL))
00075     {
00076         return pType->_createMethod();
00077     }
00078     else
00079     {
00080         return NULL;
00081     }
00082 }

Field * FieldFactory::createField const Char8 szName  ) 
 

Definition at line 84 of file OSGFieldFactory.cpp.

References osg::FieldType::_createMethod, and getFieldType().

00085 {
00086     FieldType *pType          = getFieldType(szName);
00087 
00088     if((pType                != NULL) &&
00089        (pType->_createMethod != NULL))
00090     {
00091         return pType->_createMethod();
00092     }
00093     else
00094     {
00095         return NULL;
00096     }
00097 }

UInt32 FieldFactory::getNFieldTypes void   )  [static]
 

Definition at line 102 of file OSGFieldFactory.cpp.

References _fieldTypeM.

00103 {
00104     if(_fieldTypeM != NULL) 
00105         return _fieldTypeM->size();
00106 
00107     return 0;
00108 }

FieldType * FieldFactory::getFieldType UInt32  typeId  )  [static]
 

Definition at line 134 of file OSGFieldFactory.cpp.

References _fieldTypeM.

Referenced by addType(), createField(), getFieldTypeName(), osg::VRMLNodeDesc::prototypeAddField(), and osg::FieldContainerFactory::writeSingleTypeFCD().

00135 {
00136     std::map<UInt32, FieldType *>::iterator  mIt;
00137 
00138     if(_fieldTypeM == NULL)
00139         return NULL;
00140    
00141     mIt = _fieldTypeM->find(typeId);
00142 
00143     if(mIt != _fieldTypeM->end())
00144     {
00145         return (*mIt).second;
00146     }
00147     else
00148     {
00149         return NULL;
00150     }
00151 }

FieldType * FieldFactory::getFieldType const Char8 szName  )  [static]
 

Definition at line 110 of file OSGFieldFactory.cpp.

References _fieldTypeM.

00111 {
00112     std::map<UInt32, FieldType *>::iterator  mIt;
00113     FieldType                               *returnValue = NULL;
00114     
00115     if(_fieldTypeM != NULL) 
00116     {
00117         mIt = _fieldTypeM->begin();
00118 
00119         while(mIt != _fieldTypeM->end())
00120         {
00121             if(strcmp(szName, (*mIt).second->getCName()) == 0)
00122             {
00123                 returnValue = (*mIt).second;
00124                 break;
00125             }
00126             
00127             mIt++;
00128         }
00129     }
00130 
00131     return returnValue;
00132 }

const Char8 * FieldFactory::getFieldTypeName UInt32  typeId  ) 
 

Definition at line 153 of file OSGFieldFactory.cpp.

References osg::TypeBase::getCName(), and getFieldType().

00154 {
00155     FieldType *pFieldType = getFieldType(typeId);
00156 
00157     return pFieldType ? pFieldType->getCName() : NULL;
00158 }

FieldFactory & FieldFactory::the void   )  [static]
 

Definition at line 163 of file OSGFieldFactory.cpp.

References _the.

Referenced by osg::DynFieldAttachment< AttachmentDescT >::addField(), osg::VRMLNodeDesc::prototypeAddField(), and osg::FieldContainerFactory::writeSingleTypeFCD().

00164 {
00165     return _the;
00166 }

void FieldFactory::addType FieldType pType  )  [static, private]
 

Definition at line 182 of file OSGFieldFactory.cpp.

References _fieldTypeM, getFieldType(), and osg::TypeBase::getId().

Referenced by osg::FieldType::FieldType().

00183 {
00184     if(pType == NULL)
00185         return;
00186 
00187     if(getFieldType(pType->getId()) != NULL)
00188         return;
00189 
00190     if(_fieldTypeM == NULL)
00191         _fieldTypeM = new std::map<UInt32, FieldType *>();
00192 
00193     (*_fieldTypeM)[pType->getId()] = pType;
00194 }

void osg::FieldFactory::operator= const FieldFactory source  )  [private]
 


Friends And Related Function Documentation

friend class FieldType [friend]
 

Definition at line 120 of file OSGFieldFactory.h.

friend class Field [friend]
 

Definition at line 121 of file OSGFieldFactory.h.


Member Data Documentation

FieldFactory FieldFactory::_the [static, private]
 

Definition at line 53 of file OSGFieldFactory.cpp.

Referenced by the().

std::map< UInt32, FieldType * > * FieldFactory::_fieldTypeM = NULL [static, private]
 

Definition at line 55 of file OSGFieldFactory.cpp.

Referenced by addType(), getFieldType(), and getNFieldTypes().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:12:40 2005 for OpenSG by  doxygen 1.4.3