VTK
Public Member Functions | Protected Attributes | List of all members
vtkStateStorage Class Reference

Class to make storing and comparing state quick and easy. More...

#include <vtkStateStorage.h>

Public Member Functions

 vtkStateStorage ()
 
void Clear ()
 
template<class T >
void Append (const T &value, const char *name)
 
bool operator!= (const vtkStateStorage &b) const
 
vtkStateStorageoperator= (const vtkStateStorage &b)
 

Protected Attributes

std::vector< unsigned char > Storage
 

Detailed Description

Class to make storing and comparing state quick and easy.

vtkStateStorage is just a thin wrapper around std::vector<unsigned char> It is best to use this class as an ivar so that allocs do not happen too often.

Example usage:

// compute the new state in a temp ivar
// note that clear does not free memory
this->TempState.Clear();
this->TempState.Append(act->GetProperty()->GetMTime(), "property mtime");
this->TempState.Append(
this->CurrentInput ? this->CurrentInput->GetMTime() : 0, "input mtime");
this->TempState.Append(
act->GetTexture() ? act->GetTexture()->GetMTime() : 0, "texture mtime");
// now compare against the last state value
if (this->VBOBuildState != this->TempState)
{
// set the ivar to the new state
this->VBOBuildState = this->TempState;
do something...
}

Definition at line 131 of file vtkStateStorage.h.

Constructor & Destructor Documentation

◆ vtkStateStorage()

vtkStateStorage::vtkStateStorage ( )
inline

Definition at line 134 of file vtkStateStorage.h.

Member Function Documentation

◆ Clear()

void vtkStateStorage::Clear ( void  )
inline

Definition at line 137 of file vtkStateStorage.h.

◆ Append()

template<class T >
void vtkStateStorage::Append ( const T &  value,
const char *  name 
)
inline

Definition at line 159 of file vtkStateStorage.h.

◆ operator!=()

bool vtkStateStorage::operator!= ( const vtkStateStorage b) const
inline

Definition at line 143 of file vtkStateStorage.h.

◆ operator=()

vtkStateStorage& vtkStateStorage::operator= ( const vtkStateStorage b)
inline

Definition at line 145 of file vtkStateStorage.h.

Member Data Documentation

◆ Storage

std::vector<unsigned char> vtkStateStorage::Storage
protected

Definition at line 152 of file vtkStateStorage.h.


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