#include <Object.h>
Inheritance diagram for nvsg::Object:
Public Member Functions | |
unsigned int | getObjectCode () const |
Identify an object at runtime by means of its object code. | |
virtual NVSG_API bool | isDataShared (void) const |
Determine whether the data of this object is shared. | |
virtual NVSG_API DataID | getDataID (void) const |
Get the DataID of the data of this object. | |
NVSG_API void | setName (const std::string &name) |
Set the name of the object using C++ style string. | |
NVSG_API const std::string & | getName (void) const |
Get the name of the object. | |
NVSG_API bool | waitToRead (size_t milliseconds=0xFFFFFFFF) const |
Acquire read access in a multithreaded environment. | |
NVSG_API void | doneReading (void) const |
Signal when finished reading the object. | |
NVSG_API bool | waitToWrite (size_t milliseconds=0xFFFFFFFF) const |
Acquire write access in a multithreaded enviroment. | |
NVSG_API void | doneWriting (void) const |
Signal when finished writing the object. | |
Protected Member Functions | |
NVSG_API | Object (void) |
Constructor. | |
NVSG_API | Object (const Object &rhs) |
Copy constructor. | |
virtual NVSG_API | ~Object () |
Protected destructor to prevent explicit creation on stack. | |
Protected Attributes | |
unsigned int | m_objectCode |
object code (unique per object type) | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T> | |
T * | beginEdit (const T *obj) |
template<typename T> | |
const T * | endEdit (T *&obj) |
This class maintains a name and a user pointer for all objects that derive from it.
|
Constructor.
|
|
Copy constructor.
|
|
Protected destructor to prevent explicit creation on stack.
|
|
Identify an object at runtime by means of its object code.
|
|
Determine whether the data of this object is shared.
Reimplemented in nvsg::AnimatedQuads, nvsg::AnimatedTransform, nvsg::AnimatedTriangles, nvsg::Animation< T >, nvsg::CgFx, nvsg::DirectedLight, nvsg::Drawable, nvsg::FaceAttribute, nvsg::GeoNode, nvsg::GeoSet, nvsg::Group, nvsg::JitterCamera, nvsg::LightSource, nvsg::Material, nvsg::Node, nvsg::PointLight, nvsg::Quads, nvsg::QuadStrips, nvsg::SimpleCamera, nvsg::SkinnedTriangles, nvsg::SpotLight, nvsg::StateAttribute, nvsg::StateSet, nvsg::StereoCamera, nvsg::Switch, nvsg::TextureAttributeItem, nvsg::TextureAttribute, nvsg::Transform, nvsg::Triangles, nvsg::TriStrips, nvsg::Animation< nvmath::Trafo >, and nvsg::Animation< VNVector >. |
|
Get the DataID of the data of this object.
Reimplemented in nvsg::AnimatedQuads, nvsg::AnimatedTransform, nvsg::AnimatedTriangles, nvsg::Animation< T >, nvsg::CgFx, nvsg::DirectedLight, nvsg::Drawable, nvsg::FaceAttribute, nvsg::GeoNode, nvsg::GeoSet, nvsg::Group, nvsg::JitterCamera, nvsg::LightSource, nvsg::Material, nvsg::Node, nvsg::PointLight, nvsg::Quads, nvsg::QuadStrips, nvsg::SimpleCamera, nvsg::SkinnedTriangles, nvsg::SpotLight, nvsg::StateAttribute, nvsg::StateSet, nvsg::StereoCamera, nvsg::Switch, nvsg::TextureAttributeItem, nvsg::TextureAttribute, nvsg::Transform, nvsg::Triangles, nvsg::TriStrips, nvsg::Animation< nvmath::Trafo >, and nvsg::Animation< VNVector >. |
|
Set the name of the object using C++ style string.
|
|
Get the name of the object.
|
|
Acquire read access in a multithreaded environment. For safety in a multithreaded environment, an object maintains a read/write locking mechanism that allows contemporaneous access by multiple readers but restricts write access to a single writer.
|
|
Signal when finished reading the object. Read access to this object, acquired by a previous call to waitToRead, is ended by a call to this function. |
|
Acquire write access in a multithreaded enviroment. For safety in a multithreaded environment, an object maintains a read/write locking mechanism that allows contemporaneous access for multiple readers but restricts write access to a single writer.
|
|
Signal when finished writing the object. Write access to this object, acquired by a previous call to waitToWrite, is ended by a call to this function. |
|
Initiates a safe edit operation on an NVSG Object. The function returns when the calling thread successfully obtained write access to the object. If the object is currently locked for write or read access from a concurrent thread, the calling thread enters the wait state. It uses no processor time while waiting to obtain write access. After getting write access to the object, the function returns a pointer to the non-const object. Throught this pointer, the const and especially the non-const interface of the object can be accessed. When the function returns, the object is protected against any write or read access from concurrent threads. After the desired edit operation has been completed, the write lock for the object must be released through a corresponding call to endEdit . Missing the endEdit call after completing the edit operation can cause the system to become deadlocked!
|
|
Ends an edit operation on an NVSG Object. The function ends an edit operation that previously has been initiated through a call to beginEdit . The function must be called with the pointer to the non-const object, that has been returned by the matching call to beginEdit. The write lock for the object will be released and the function returns a pointer to the const object, through which only the const interface of the object could be utilized. Immediately after the call, the passed pointer to the non-const object becomes invalid. Hence, using the pointer to the non-const object after this call leads to undefined behavior!
|
|
object code (unique per object type)
|