Workspace 6.21.5
Public Member Functions | List of all members
State Class Reference

Defines state info for an object. More...

#include <Mesh/DataStructures/state.h>

Inheritance diagram for State:
[legend]

Public Member Functions

 State (unsigned stateSize, unsigned integerDataSize)
 
 ~State ()
 
void addToIntegerData (int index, long val)
 
void addToState (int index, const Vector3d &v)
 
void addToState (int index, double val)
 
void copyIntegerData (int index, const State &s)
 
void copyState (int index, const State &s)
 
void copyStateVector (int index, const State &s)
 
long getIntegerData (int index) const
 
double getState (int index) const
 
Vector3d getStateVector (int index) const
 
void setIntegerData (int index, long val)
 
void setState (int index, const Vector3d &v)
 
void setState (int index, double val)
 
Deprecated functions
void CopyIntegerData (int index, const State &s)
 
void AddToIntegerData (int index, long val)
 
void SetIntegerData (int index, long val)
 
long GetIntegerData (int index) const
 
void CopyStateVector (int index, const State &s)
 
void CopyState (int index, const State &s)
 
void AddToState (int index, const Vector3d &v)
 
void AddToState (int index, double val)
 
double GetState (int index) const
 
Vector3d GetStateVector (int index) const
 
void SetState (int index, double val)
 
void SetState (int index, const Vector3d &v)
 

Detailed Description

Some classes use this as a base class. This behaviour can be thought of as turning the subclass into a stateful object.

Constructor & Destructor Documentation

◆ State()

State ( unsigned  stateSize,
unsigned  integerDataSize 
)
Parameters
stateSizeThe size of the state_ double array.
integerDataSizeThe size of the integerData_ integer array.

The constructor requires the sizes to use for the double and integer arrays. Only a StateControl subclass should be allocating state objects since they are the ones who control what stateSize and integerDataSize are.

◆ ~State()

~State ( )

The destructor deallocates the state arrays.

Member Function Documentation

◆ addToIntegerData()

void addToIntegerData ( int  index,
long  val 
)
inline
Parameters
indexThe index of the integer state to add to.
valThe value to add to the specified integer state.

◆ AddToIntegerData()

void AddToIntegerData ( int  index,
long  val 
)
inline

◆ addToState() [1/2]

void addToState ( int  index,
const Vector3d v 
)
inline
Parameters
indexThe index of the vector state to add to.
vThe value to add to the specified vector state.

◆ AddToState() [1/2]

void AddToState ( int  index,
const Vector3d v 
)
inline

◆ addToState() [2/2]

void addToState ( int  index,
double  val 
)
inline
Parameters
indexThe index of the scalar state to add to.
valThe value to add to the specified scalar state.

◆ AddToState() [2/2]

void AddToState ( int  index,
double  val 
)
inline

◆ copyIntegerData()

void copyIntegerData ( int  index,
const State s 
)
inline
Parameters
indexThe index of the integer state to copy. This must be the same for both the source and destination of the copy.
sThe state to copy the integer state from.

It is assumed that s is managed by the same StateControl as this object, so the layout of the integerData_ array will be the same.

◆ CopyIntegerData()

void CopyIntegerData ( int  index,
const State s 
)
inline

◆ copyState()

void copyState ( int  index,
const State s 
)
inline
Parameters
indexThe index of the scalar state to copy. This must be the same for both the source and destination of the copy.
sThe state to copy the scalar state from.

It is assumed that s is managed by the same StateControl as this object, so the layout of the state_ array will be the same.

◆ CopyState()

void CopyState ( int  index,
const State s 
)
inline

◆ copyStateVector()

void copyStateVector ( int  index,
const State s 
)
inline
Parameters
indexThe index of the vector state to copy. This must be the same for both the source and destination of the copy.
sThe state to copy the vector state from.

It is assumed that s is managed by the same StateControl as this object, so the layout of the state_ array will be the same.

◆ CopyStateVector()

void CopyStateVector ( int  index,
const State s 
)
inline

◆ getIntegerData()

long getIntegerData ( int  index) const
inline
Returns
The integer state at index.

◆ GetIntegerData()

long GetIntegerData ( int  index) const
inline

◆ getState()

double getState ( int  index) const
inline
Returns
The scalar state at index.

◆ GetState()

double GetState ( int  index) const
inline

◆ getStateVector()

Vector3d getStateVector ( int  index) const
inline
Returns
The vector state at index.

◆ GetStateVector()

Vector3d GetStateVector ( int  index) const
inline

◆ setIntegerData()

void setIntegerData ( int  index,
long  val 
)
inline
Parameters
indexThe index of the integer state to set.
valThe value to set the specified integer state to.

◆ SetIntegerData()

void SetIntegerData ( int  index,
long  val 
)
inline

◆ setState() [1/2]

void setState ( int  index,
const Vector3d v 
)
inline
Parameters
indexThe index of the vector state to set.
vThe value to set the specified vector state to.

◆ SetState() [1/2]

void SetState ( int  index,
const Vector3d v 
)
inline

◆ setState() [2/2]

void setState ( int  index,
double  val 
)
inline
Parameters
indexThe index of the scalar state to set.
valThe value to set the specified scalar state to.

◆ SetState() [2/2]

void SetState ( int  index,
double  val 
)
inline