| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/sharedobj.h>

Public Types | |
| typedef SharedObj | VRS_ThisClass |
Public Member Functions | |
| SharedObj () | |
| SharedObj (const SharedObj &other) | |
| virtual | ~SharedObj () |
| virtual bool | isEqual (const SharedObj *other) const |
| The isEqual() method can be used to compare for object equality. | |
| bool | operator== (const SharedObj &other) const |
| virtual const ClassInfo * | classInfoVRS () const |
| For internal use in VRS. | |
| const ID & | classNameVRS () const |
| bool | isA (const ID &id) const |
| void | ref (const void *debugPointerHolder=NULL) const |
| void | unref (const void *debugPointerHolder=NULL) const |
| long | references () const |
| void | trackReferences () |
| void | outputReferences () const |
| void | setObjectName (const char *objName) |
| void | setObjectName (const std::string &objName) |
| std::string | getObjectName () const |
| void | setClientData (void *clientData) |
| void * | getClientData () const |
| Objects can be assigned unspecified client data. | |
| virtual void | modified () |
| virtual const TransactionNo & | lastTransactionNo () const |
| void | registerDestructionCB (SO< Callback1< SharedObj * > > cb) |
| void | registerModificationCB (SO< Callback1< SharedObj * > > cb) |
| void | unregisterDestructionCB (SO< Callback1< SharedObj * > > cb) |
| void | unregisterModificationCB (SO< Callback1< SharedObj * > > cb) |
| VRS_SERIALIZABLE (SharedObj) | |
Static Public Member Functions | |
| static bool | IsEqual (const SharedObj *obj1, const SharedObj *obj2) |
| static const ClassInfo * | ClassInfoVRS () |
| static const ID & | ClassNameVRS () |
| static void | outputAllTrackedObjectReferences () |
| static SO< SharedObj > | getObjectByName (const std::string &objName) |
| static const TransactionNo & | currentTransactionNo () |
Public Attributes | |
| VRS_VISITABLE_BASE | |
Protected Member Functions | |
| void | registerCB (const ID &service, SO< CallbackBase > cb) |
| Registers the given callback for the given service. | |
| bool | unregisterCB (const ID &service, SO< CallbackBase > cb) |
| SO< Iterator< SO< CallbackBase > > > | callbacks (const ID &service) const |
| Returns all callbacks registered for the given service. | |
| void | registerWO (const WeakPointerBase *wo) const |
| void | unregisterWO (const WeakPointerBase *wo) const |
Friends | |
| class | WeakPointerBase |
Reimplemented in VRS::SceneSpy.
| VRS::SharedObj::SharedObj | ( | ) |
| VRS::SharedObj::SharedObj | ( | const SharedObj & | other | ) |
| virtual VRS::SharedObj::~SharedObj | ( | ) | [virtual] |
| virtual bool VRS::SharedObj::isEqual | ( | const SharedObj * | other | ) | const [virtual] |
The isEqual() method can be used to compare for object equality.
< The constructor sets initially the reference counter to zero and assigns the current time stamp to the object. Two objects should be considered equal if they are located at the same address (if they are identical) or if all there state member variables have equal state. Override the "operator==" in derived classes to refine/define the equality definition for the corresponding class.
| bool VRS::SharedObj::operator== | ( | const SharedObj & | other | ) | const |
| static const ClassInfo* VRS::SharedObj::ClassInfoVRS | ( | ) | [static] |
Reimplemented in VRS::SceneSpy.
| virtual const ClassInfo* VRS::SharedObj::classInfoVRS | ( | ) | const [virtual] |
| static const ID& VRS::SharedObj::ClassNameVRS | ( | ) | [static] |
Reimplemented in VRS::SceneSpy.
| const ID& VRS::SharedObj::classNameVRS | ( | ) | const |
| bool VRS::SharedObj::isA | ( | const ID & | id | ) | const |
Shared objects provide runtime type information. The static method `ClassName' returns the (unique) class name string. `className' returns the class name of an object. `isA' returns true if the given name corresponds to one of the subclasses.
| void VRS::SharedObj::ref | ( | const void * | debugPointerHolder = NULL |
) | const |
| void VRS::SharedObj::unref | ( | const void * | debugPointerHolder = NULL |
) | const |
| long VRS::SharedObj::references | ( | ) | const |
Shareable objects maintain a reference counter. Objects which hold a reference or pointer to a shareable object increment its reference counter. If the object is not refered any more, the reference counter must be decremented. If the reference counter gets zero, the object is deleted.
| void VRS::SharedObj::trackReferences | ( | ) |
| void VRS::SharedObj::outputReferences | ( | ) | const |
| static void VRS::SharedObj::outputAllTrackedObjectReferences | ( | ) | [static] |
!!! DEBUG mode only !!! trackReferences() marks an object for tracking the source code locations of all pointers referencing the object. ouputReferences() outputs the stored locations to the error output stream. outputAllTrackedObjectReferences() outputs the stored locations of all tracked objects to the error output stream. !!! DEBUG mode only !!!
| void VRS::SharedObj::setObjectName | ( | const char * | objName | ) |
| void VRS::SharedObj::setObjectName | ( | const std::string & | objName | ) |
| std::string VRS::SharedObj::getObjectName | ( | ) | const |
Objects can be assigned a textual name. If an object has no name an empty string is returned by the method getObjectName(). The named objects can be retrieved again by calling the static method getObjectByName(), which returns the last object that got "objName" assigned or NULL if no object with such a name exists.
| void VRS::SharedObj::setClientData | ( | void * | clientData | ) |
| void* VRS::SharedObj::getClientData | ( | ) | const |
Objects can be assigned unspecified client data.
| virtual void VRS::SharedObj::modified | ( | ) | [virtual] |
Reimplemented in VRS::BSpline, VRS::SequenceContainerSTL< T, STL_CONTAINER >, VRS::Curve, VRS::Extrusion, VRS::Facet, VRS::SOUND::BufferAL, VRS::SOUND::BufferDataAL, VRS::PolygonSet, VRS::LODNode, VRS::SceneAdjuster, VRS::TimeGroup, VRS::Sky, VRS::CurveText, VRS::Text, VRS::TextField, VRS::TriangleSet, VRS::SequenceContainerSTL< VRS::TexEnvCombineGL::CombineMode, std::vector< VRS::VRS::TexEnvCombineGL::CombineMode > >, VRS::SequenceContainerSTL< VRS::SO< VRS::AttributeComposite >, std::vector< VRS::VRS::SO< VRS::VRS::AttributeComposite > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Callback2< VRS::SO< VRS::ButtonEvent >, VRS::Vector3Base< T > > >, std::vector< VRS::VRS::SO< VRS::VRS::Callback2< VRS::VRS::SO< VRS::VRS::ButtonEvent >, VRS::VRS::Vector3Base< T > > > > >, VRS::SequenceContainerSTL< GLenum, std::vector< GLenum > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Callback2< VRS::SO< VRS::ButtonEvent >, VRS::Bounds > >, std::vector< VRS::VRS::SO< VRS::VRS::Callback2< VRS::VRS::SO< VRS::VRS::ButtonEvent >, VRS::VRS::Bounds > > > >, VRS::SequenceContainerSTL< VRS::WO< EnvironmentRenderer::WaterSurface >, std::vector< VRS::VRS::WO< EnvironmentRenderer::WaterSurface > > >, VRS::SequenceContainerSTL< VRS::Facet::Loop, std::vector< VRS::VRS::Facet::Loop > >, VRS::SequenceContainerSTL< VRS::SO< VRS::SceneThing >, std::vector< VRS::VRS::SO< VRS::VRS::SceneThing > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Shadowed >, std::vector< VRS::VRS::SO< VRS::VRS::Shadowed > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::ShadowCaster >, std::vector< VRS::VRS::SO< VRS::VRS::ShadowCaster > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::IntersectionInfo >, std::vector< VRS::VRS::SO< VRS::VRS::IntersectionInfo > > >, VRS::SequenceContainerSTL< VRS::SO< EnvironmentRenderer::CloudLayer >, std::vector< VRS::VRS::SO< EnvironmentRenderer::CloudLayer > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Iterator< VRS::SO< VRS::Image > > >, std::vector< VRS::VRS::SO< VRS::VRS::Iterator< VRS::VRS::SO< VRS::VRS::Image > > > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Alternative >, std::vector< VRS::VRS::SO< VRS::VRS::Alternative > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Array< VRS::SO< VRS::MonoAttribute > > >, std::vector< VRS::VRS::SO< VRS::VRS::Array< VRS::VRS::SO< VRS::VRS::MonoAttribute > > > > >, VRS::SequenceContainerSTL< VRS::ShaderProgramGL::Parameter *, std::vector< VRS::VRS::ShaderProgramGL::Parameter * > >, VRS::SequenceContainerSTL< VRS::Bounds, std::vector< VRS::VRS::Bounds > >, VRS::SequenceContainerSTL< VRS::SO< VRS::CubeEnvMirror >, std::vector< VRS::VRS::SO< VRS::VRS::CubeEnvMirror > > >, VRS::SequenceContainerSTL< bool, std::vector< bool > >, VRS::SequenceContainerSTL< VRS::SO< VRS::PolyAttribute >, std::vector< VRS::VRS::SO< VRS::VRS::PolyAttribute > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::GL2::EXTSHADER::ShaderHandler >, std::vector< VRS::VRS::SO< VRS::GL2::EXTSHADER::ShaderHandler > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Cache >, std::vector< VRS::VRS::SO< VRS::VRS::Cache > > >, VRS::SequenceContainerSTL< VRS::IntervalMapper::IntervalInfo, std::vector< VRS::VRS::IntervalMapper::IntervalInfo > >, VRS::SequenceContainerSTL< VRS::FragmentProgramNV::LocalParameter *, std::vector< VRS::VRS::FragmentProgramNV::LocalParameter * > >, VRS::SequenceContainerSTL< VRS::SO< VRS::ImageManipulator >, std::vector< VRS::VRS::SO< VRS::VRS::ImageManipulator > > >, VRS::SequenceContainerSTL< VRS::WO< VRS::Canvas >, std::deque< VRS::VRS::WO< VRS::VRS::Canvas > > >, VRS::SequenceContainerSTL< VRS::SO< EnvironmentRenderer::GreenSpace >, std::vector< VRS::VRS::SO< EnvironmentRenderer::GreenSpace > > >, VRS::SequenceContainerSTL< VRS::UndoNavigation::Keyframe, std::vector< VRS::VRS::UndoNavigation::Keyframe > >, VRS::SequenceContainerSTL< VRS::VertexProgramNV::MatrixTracking *, std::vector< VRS::VRS::VertexProgramNV::MatrixTracking * > >, VRS::SequenceContainerSTL< VRS::SO< VRS::AbstractStateHandler >, std::vector< VRS::VRS::SO< VRS::VRS::AbstractStateHandler > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::SOUND::BufferAL >, std::vector< VRS::VRS::SO< VRS::SOUND::BufferAL > > >, VRS::SequenceContainerSTL< VRS::TimeGroup::ChildInterval, std::vector< VRS::VRS::TimeGroup::ChildInterval > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Array< VRS::Vector3Base< T > > >, std::vector< VRS::VRS::SO< VRS::VRS::Array< VRS::VRS::Vector3Base< T > > > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::PolyAttribute >, std::deque< VRS::VRS::SO< VRS::VRS::PolyAttribute > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::PBufferCanvasGL >, std::vector< VRS::VRS::SO< VRS::VRS::PBufferCanvasGL > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Constraint >, std::deque< VRS::VRS::SO< VRS::VRS::Constraint > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::ShapeMaterialGL >, std::vector< VRS::VRS::SO< VRS::VRS::ShapeMaterialGL > > >, VRS::SequenceContainerSTL< VRS::Matrix4x4Base< T >, std::vector< VRS::VRS::Matrix4x4Base< T > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Iterator< VRS::Vector3Base< T > > >, std::vector< VRS::VRS::SO< VRS::VRS::Iterator< VRS::VRS::Vector3Base< T > > > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Transform >, std::vector< VRS::VRS::SO< VRS::VRS::Transform > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::GL2::EXTSHADER::HandlerObject >, std::vector< VRS::VRS::SO< VRS::GL2::EXTSHADER::HandlerObject > > >, VRS::SequenceContainerSTL< VRS::Engine *, std::vector< VRS::VRS::Engine * > >, VRS::SequenceContainerSTL< VRS::SO< VRS::BehaviorNode >, std::deque< VRS::VRS::SO< VRS::VRS::BehaviorNode > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Text >, std::vector< VRS::VRS::SO< VRS::VRS::Text > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::GL2::EXTSHADER::UberShaderProgramObject >, std::vector< VRS::VRS::SO< VRS::GL2::EXTSHADER::UberShaderProgramObject > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Callback2< VRS::SO< VRS::MotionEvent >, VRS::Bounds > >, std::vector< VRS::VRS::SO< VRS::VRS::Callback2< VRS::VRS::SO< VRS::VRS::MotionEvent >, VRS::VRS::Bounds > > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::BehaviorNode >, std::vector< VRS::VRS::SO< VRS::VRS::BehaviorNode > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Shape >, std::vector< VRS::VRS::SO< VRS::VRS::Shape > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::TexGenGL >, std::vector< VRS::VRS::SO< VRS::VRS::TexGenGL > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::SceneNode >, std::deque< VRS::VRS::SO< VRS::VRS::SceneNode > > >, VRS::SequenceContainerSTL< VRS::FragmentProgramNV::NamedParameter *, std::vector< VRS::VRS::FragmentProgramNV::NamedParameter * > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Image >, std::vector< VRS::VRS::SO< VRS::VRS::Image > > >, VRS::SequenceContainerSTL< T, std::vector< T > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Technique >, std::vector< VRS::VRS::SO< VRS::VRS::Technique > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Bezier >, std::vector< VRS::VRS::SO< VRS::VRS::Bezier > > >, VRS::SequenceContainerSTL< VRS::TimeGroup::TimeMark, std::vector< VRS::VRS::TimeGroup::TimeMark > >, VRS::SequenceContainerSTL< VRS::SO< VRS::MethodCallback1< VRS::Cache, VRS::SharedObj * > >, std::vector< VRS::VRS::SO< VRS::VRS::MethodCallback1< VRS::VRS::Cache, VRS::VRS::SharedObj * > > > >, VRS::SequenceContainerSTL< int, std::vector< int > >, VRS::SequenceContainerSTL< unsigned int, std::vector< unsigned int > >, VRS::SequenceContainerSTL< T, std::deque< T > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Callback3< ARG1, ARG2, ARG3 > >, std::vector< VRS::VRS::SO< VRS::VRS::Callback3< ARG1, ARG2, ARG3 > > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::PlanarMirror >, std::vector< VRS::VRS::SO< VRS::VRS::PlanarMirror > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Callback1< VRS::SO< VRS::EngineGL > > >, std::vector< VRS::VRS::SO< VRS::VRS::Callback1< VRS::VRS::SO< VRS::VRS::EngineGL > > > > >, VRS::SequenceContainerSTL< std::pair< VRS::VRS::VRS::SO< VRS::VRS::VRS::Callback1< VRS::VRS::VRS::SharedObj * > >, VRS::VRS::VRS::TwoPointConnection::CB_ID >, std::vector< std::pair< VRS::VRS::VRS::SO< VRS::VRS::VRS::Callback1< VRS::VRS::VRS::SharedObj * > >, VRS::VRS::VRS::TwoPointConnection::CB_ID > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::SharedObj >, std::vector< VRS::VRS::SO< VRS::VRS::SharedObj > > >, VRS::SequenceContainerSTL< double, std::vector< double > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Attribute >, std::vector< VRS::VRS::SO< VRS::VRS::Attribute > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::ImageTexture2DGL >, std::vector< VRS::VRS::SO< VRS::VRS::ImageTexture2DGL > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::PolygonSet >, std::vector< VRS::VRS::SO< VRS::VRS::PolygonSet > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Light >, std::vector< VRS::VRS::SO< VRS::VRS::Light > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::MonoAttribute >, std::vector< VRS::VRS::SO< VRS::VRS::MonoAttribute > > >, VRS::SequenceContainerSTL< VRS::VertexProgramNV::VertexParameter *, std::vector< VRS::VRS::VertexProgramNV::VertexParameter * > >, VRS::SequenceContainerSTL< VRS::Vector3Base< T >, std::vector< VRS::VRS::Vector3Base< T > > >, VRS::SequenceContainerSTL< VRS::WO< VRS::SceneGraphOperator >, std::vector< VRS::VRS::WO< VRS::VRS::SceneGraphOperator > > >, VRS::SequenceContainerSTL< VRS::SO< VRS::Curve >, std::vector< VRS::VRS::SO< VRS::VRS::Curve > > >, and VRS::SequenceContainerSTL< VRS::SO< VRS::GL2::EXTSHADER::PrototypeHandler >, std::vector< VRS::VRS::SO< VRS::GL2::EXTSHADER::PrototypeHandler > > >.
| virtual const TransactionNo& VRS::SharedObj::lastTransactionNo | ( | ) | const [virtual] |
| static const TransactionNo& VRS::SharedObj::currentTransactionNo | ( | ) | [static] |
VRS maintains a global system wide transaction number. Each modification applied to a shared object increments this counter. Each shared object stores the transaction number of its last modification. This way, we can determine if an object has been modified before another object. 'modified' assigns the current transaction number to the object and increments the transaction number. 'lastTransactionNo' returns transaction number of the last modification of the object. 'currentTransactionNo' returns the current transaction number.
`Callback' objects can observe object modifications and the destruction of a shared object. In all cases, the `callback' method of the corresponding registered callbacks will be called. The argument for the callback is a pointer to the shared object which has been modified/is going to be destructed. The destruction-callback will be called immediately BEFORE object-destruction, so all member-data can still be inspected!
| VRS::SharedObj::VRS_SERIALIZABLE | ( | SharedObj | ) |
| void VRS::SharedObj::registerCB | ( | const ID & | service, | |
| SO< CallbackBase > | cb | |||
| ) | [protected] |
Registers the given callback for the given service.
| bool VRS::SharedObj::unregisterCB | ( | const ID & | service, | |
| SO< CallbackBase > | cb | |||
| ) | [protected] |
Unregisters the given callback for the given service. Returns, if the given callback was registered for the service.
| SO<Iterator<SO<CallbackBase> > > VRS::SharedObj::callbacks | ( | const ID & | service | ) | const [protected] |
Returns all callbacks registered for the given service.
| void VRS::SharedObj::registerWO | ( | const WeakPointerBase * | wo | ) | const [protected] |
| void VRS::SharedObj::unregisterWO | ( | const WeakPointerBase * | wo | ) | const [protected] |
friend class WeakPointerBase [friend] |