osgEarth 2.1.1
Public Member Functions | Protected Member Functions | Private Attributes

osgEarth::Revisioned< T > Class Template Reference

Collaboration diagram for osgEarth::Revisioned< T >:

List of all members.

Public Member Functions

void dirty ()
virtual void sync (Revision &externalRevision) const
bool outOfSyncWith (const Revision &externalRevision) const
virtual bool inSyncWith (const Revision &externalRevision) const

Protected Member Functions

 Revisioned ()
void setAlwaysDirty (bool value)

Private Attributes

Revision _revision
bool _alwaysDirty

Detailed Description

template<typename T>
class osgEarth::Revisioned< T >

Base class for a revisioned object. A Revisioned object is one that keeps track of its state with a version number. Other objects can then hold a Revision object (see above) and use it to see if they are up to date with this object, thereby enabling passive data model synchronization.

Definition at line 48 of file Revisioning.


Constructor & Destructor Documentation

template<typename T>
osgEarth::Revisioned< T >::Revisioned ( ) [inline, protected]

Definition at line 73 of file Revisioning.

: _revision(0), _alwaysDirty(false) { }

Member Function Documentation

template<typename T>
void osgEarth::Revisioned< T >::dirty ( ) [inline]

Marks this object as dirty

Definition at line 52 of file Revisioning.

                     {
            ++_revision;
        }
template<typename T>
virtual bool osgEarth::Revisioned< T >::inSyncWith ( const Revision externalRevision) const [inline, virtual]

Returns true if the external object is at the same revision as this object.

Definition at line 68 of file Revisioning.

                                                                          {
            return _alwaysDirty ? false : _revision == externalRevision;
        }

Here is the caller graph for this function:

template<typename T>
bool osgEarth::Revisioned< T >::outOfSyncWith ( const Revision externalRevision) const [inline]

Returns true if the external object is at a different revision that this object.

Definition at line 63 of file Revisioning.

                                                                    {
            return !inSyncWith( externalRevision );
        }
template<typename T>
void osgEarth::Revisioned< T >::setAlwaysDirty ( bool  value) [inline, protected]

Marks this object as always being dirty (i.e. inSyncWith() will always return false)

Definition at line 76 of file Revisioning.

                                          {
            _alwaysDirty = value;
        }
template<typename T>
virtual void osgEarth::Revisioned< T >::sync ( Revision externalRevision) const [inline, virtual]

Synchronizes the external revision number with this revision, effectively bringing the external object up to date.

Definition at line 58 of file Revisioning.

                                                              {
            externalRevision = _revision;
        }

Member Data Documentation

template<typename T>
bool osgEarth::Revisioned< T >::_alwaysDirty [private]

Definition at line 82 of file Revisioning.

template<typename T>
Revision osgEarth::Revisioned< T >::_revision [private]

Definition at line 81 of file Revisioning.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines