This class is a cache handler that can be used to monitor the modifications made to elements or fields. More...
#include <Inventor/caches/SoNodeDependencies.h>
Public Member Functions | |
SoNodeDependencies () | |
~SoNodeDependencies () | |
bool | isValid (SoState *state) const |
Returns true if the cache is valid for the given state. | |
void | updateCache (SoState *state) |
Update cache according to given state. | |
void | invalidate () |
Manually invalidate the cache. | |
template<typename SO_ELEMENT > | |
void | addDependency () |
Add given element type as a dependency for the cache. | |
void | addDependency (SoField &field) |
Add given field as a dependency for the cache. | |
void | addDependency (SoType type, int classStackIndex) |
Add given element type as a dependency for the cache. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
This class is a cache handler that can be used to monitor the modifications made to elements or fields.
In order to add new Elements or Fields to be monitored by the cache, use the appropriate addDependency() method.
If one of the added elements or fields has been modified since the last call to updateCache(), the isValid() method will return false, and a subsequent call to updateCache() will make it valid again.
Additionnally, the handled cache can be manually invalidated using the invalidate() method.
Definition at line 50 of file SoNodeDependencies.h.
SoNodeDependencies::SoNodeDependencies | ( | ) |
SoNodeDependencies::~SoNodeDependencies | ( | ) |
|
inline |
Add given element type as a dependency for the cache.
Definition at line 76 of file SoNodeDependencies.h.
void SoNodeDependencies::addDependency | ( | SoField & | field | ) |
Add given field as a dependency for the cache.
void SoNodeDependencies::addDependency | ( | SoType | type, |
int | classStackIndex | ||
) |
Add given element type as a dependency for the cache.
void SoNodeDependencies::invalidate | ( | ) |
Manually invalidate the cache.
bool SoNodeDependencies::isValid | ( | SoState * | state | ) | const |
Returns true if the cache is valid for the given state.
void SoNodeDependencies::updateCache | ( | SoState * | state | ) |
Update cache according to given state.
After this call, the cache will be valid.