osg::DefaultUserDataContainer Class Reference

`#include <UserDataContainer>`

Inheritance diagram for osg::DefaultUserDataContainer:

## Public Member Functions

| DefaultUserDataContainer ()
| DefaultUserDataContainer (const DefaultUserDataContainer &udc, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
| META_Object (osg, DefaultUserDataContainer) virtual void setThreadSafeRefUnref(bool threadSafe)
virtual void | setUserData (Referenced *obj)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () const
virtual unsigned int | addUserObject (Object *obj)
virtual void | setUserObject (unsigned int i, Object *obj)
virtual void | removeUserObject (unsigned int i)
virtual Object * | getUserObject (unsigned int i)
virtual const Object * | getUserObject (unsigned int i) const
virtual unsigned int | getNumUserObjects () const
virtual unsigned int | getUserObjectIndex (const osg::Object *obj, unsigned int startPos=0) const
virtual unsigned int | getUserObjectIndex (const std::string &name, unsigned int startPos=0) const
virtual void | setDescriptions (const DescriptionList &descriptions)
virtual DescriptionList & | getDescriptions ()
virtual const DescriptionList & | getDescriptions () const
virtual unsigned int | getNumDescriptions () const
virtual void | addDescription (const std::string &desc)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
template<class T>
unsigned int | addUserObject (const osg::ref_ptr< T > &obj)
Public Member Functions inherited from osg::UserDataContainer
| UserDataContainer ()
| UserDataContainer (const UserDataContainer &udc, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual bool | isSameKindAs (const Object *obj) const
virtual const char * | libraryName () const
virtual const char * | className () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
template<class T>
unsigned int | addUserObject (const osg::ref_ptr< T > &obj)
virtual Object * | getUserObject (const std::string &name, unsigned int startPos=0)
virtual const Object * | getUserObject (const std::string &name, unsigned int startPos=0) const
template<class T>
void | setUserData (const ref_ptr< T > &ud)
Public Member Functions inherited from osg::Object
| Object ()
| Object (bool threadSafeRefUnref)
| Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual Object * | cloneType () const =0
virtual Object * | clone (const CopyOp &) const =0
std::string | getCompoundClassName () const
virtual Node * | asNode ()
virtual const Node * | asNode () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () const
virtual void | setThreadSafeRefUnref (bool threadSafe)
virtual void | setName (const std::string &name)
void | setName (const char *name)
const std::string & | getName () const
void | setDataVariance (DataVariance dv)
DataVariance | getDataVariance () const
virtual void | computeDataVariance ()
void | setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void | setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
template<class T>
void | setUserData (const ref_ptr< T > &ud)
template<typename T>
bool | getUserValue (const std::string &name, T &value) const
template<typename T>
void | setUserValue (const std::string &name, const T &value)
virtual void | resizeGLObjectBuffers (unsigned int)
virtual void | releaseGLObjects (osg::State *=0) const
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool | getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Types

typedef std::vector< osg::ref_ptr< osg::Object > > | ObjectList

## Protected Member Functions

virtual | ~DefaultUserDataContainer ()
Protected Member Functions inherited from osg::UserDataContainer
virtual | ~UserDataContainer ()
Protected Member Functions inherited from osg::Object
virtual | ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

ref_ptr< Referenced > | _userData
DescriptionList | _descriptionList
ObjectList | _objectList
Protected Attributes inherited from osg::Object
std::string | _name
DataVariance | _dataVariance
osg::UserDataContainer * | _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Public Types inherited from osg::UserDataContainer
typedef std::vector< std::string > | DescriptionList
Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

Internal structure for storing all user data.

## Member Typedef Documentation

## ObjectList

typedef std::vector< osg::ref_ptr<osg::Object> > osg::DefaultUserDataContainer::ObjectList

protected

## Constructor & Destructor Documentation

## DefaultUserDataContainer() [1/2]

osg::DefaultUserDataContainer::DefaultUserDataContainer | ( |  | ) |

Referenced by DefaultUserDataContainer(), and META_Object().

## DefaultUserDataContainer() [2/2]

osg::DefaultUserDataContainer::DefaultUserDataContainer | ( | const DefaultUserDataContainer & | udc,
|  | const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY )

References DefaultUserDataContainer(), and osg::CopyOp::SHALLOW_COPY.

## ~DefaultUserDataContainer()

virtual osg::DefaultUserDataContainer::~DefaultUserDataContainer | ( |  | ) |

inline protected virtual

## Member Function Documentation

## addDescription()

virtual void osg::DefaultUserDataContainer::addDescription | ( | const std::string & | desc | ) |

virtual

Add a description string.

Implements osg::UserDataContainer.

## addUserObject() [1/2]

template<class T>

unsigned int osg::UserDataContainer::addUserObject | ( | const osg::ref_ptr< T > & | obj | ) |

inline

## addUserObject() [2/2]

virtual unsigned int osg::DefaultUserDataContainer::addUserObject | ( | Object * | obj | ) |

virtual

Add user data object. Returns the index position of object added.

Implements osg::UserDataContainer.

## getDescriptions() [1/2]

virtual DescriptionList & osg::DefaultUserDataContainer::getDescriptions | ( |  | ) |

virtual

Get the description list.

Implements osg::UserDataContainer.

## getDescriptions() [2/2]

virtual const DescriptionList & osg::DefaultUserDataContainer::getDescriptions | ( |  | ) | const

virtual

Get the const description list.

Implements osg::UserDataContainer.

## getNumDescriptions()

virtual unsigned int osg::DefaultUserDataContainer::getNumDescriptions | ( |  | ) | const

virtual

Get number of description strings.

Implements osg::UserDataContainer.

## getNumUserObjects()

virtual unsigned int osg::DefaultUserDataContainer::getNumUserObjects | ( |  | ) | const

virtual

Get number of user objects assigned to this object.

Implements osg::UserDataContainer.

## getUserData() [1/2]

virtual Referenced * osg::DefaultUserDataContainer::getUserData | ( |  | ) |

virtual

Get user data.

Implements osg::UserDataContainer.

## getUserData() [2/2]

virtual const Referenced * osg::DefaultUserDataContainer::getUserData | ( |  | ) | const

virtual

Get const user data.

Implements osg::UserDataContainer.

## getUserObject() [1/2]

virtual Object * osg::DefaultUserDataContainer::getUserObject | ( | unsigned int | i | ) |

virtual

Get user data object as specified index position.

Implements osg::UserDataContainer.

## getUserObject() [2/2]

virtual const Object * osg::DefaultUserDataContainer::getUserObject | ( | unsigned int | i | ) | const

virtual

Get const user data object as specified index position.

Implements osg::UserDataContainer.

## getUserObjectIndex() [1/2]

virtual unsigned int osg::DefaultUserDataContainer::getUserObjectIndex | ( | const osg::Object * | obj,
|  | unsigned int | startPos = 0 ) const

virtual

Get the index position of specified user data object.

Implements osg::UserDataContainer.

## getUserObjectIndex() [2/2]

virtual unsigned int osg::DefaultUserDataContainer::getUserObjectIndex | ( | const std::string & | name,
|  | unsigned int | startPos = 0 ) const

virtual

Get the index position of first user data object that matches specified name.

Implements osg::UserDataContainer.

## META_Object()

osg::DefaultUserDataContainer::META_Object | ( | osg | ,
|  | DefaultUserDataContainer | )

References DefaultUserDataContainer(), and osg::Object::setThreadSafeRefUnref().

## removeUserObject()

virtual void osg::DefaultUserDataContainer::removeUserObject | ( | unsigned int | i | ) |

virtual

Remove element from the list of user data objects.

Implements osg::UserDataContainer.

## setDescriptions()

virtual void osg::DefaultUserDataContainer::setDescriptions | ( | const DescriptionList & | descriptions | ) |

virtual

Set the list of string descriptions.

Implements osg::UserDataContainer.

## setUserData() [1/2]

template<class T>

void osg::Object::setUserData | ( | const ref_ptr< T > & | ud | ) |

inline

## setUserData() [2/2]

virtual void osg::DefaultUserDataContainer::setUserData | ( | Referenced * | obj | ) |

virtual

Set user data, data must be subclassed from Referenced to allow automatic memory handling. If your own data isn't directly subclassed from Referenced then create an adapter object which points to your own object and handles the memory addressing.

Implements osg::UserDataContainer.

References osg::UserDataContainer::addUserObject(), and osg::Object::setUserData().

## setUserObject()

virtual void osg::DefaultUserDataContainer::setUserObject | ( | unsigned int | i,
|  | Object * | obj )

virtual

Add element to list of user data objects.

Implements osg::UserDataContainer.

## Member Data Documentation

## _descriptionList

DescriptionList osg::DefaultUserDataContainer::_descriptionList

protected

## _objectList

ObjectList osg::DefaultUserDataContainer::_objectList

protected

## _userData

ref_ptr<Referenced> osg::DefaultUserDataContainer::_userData

protected

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

- UserDataContainer