Workspace 6.21.5
Public Member Functions | List of all members
StreamlinedStateStorage< C > Class Template Reference

#include <Mesh/DataStructures/MeshModelInterface/streamlinedstatestorage.h>

Inheritance diagram for StreamlinedStateStorage< C >:
[legend]

Public Member Functions

 StreamlinedStateStorage ()
 
 StreamlinedStateStorage (const StreamlinedStateStorage &other)
 
 ~StreamlinedStateStorage ()
 
size_type addItem ()
 
size_type addState (const DataExecution::DataObject &defaultValue)
 
size_type addState (const Vector3d &defaultValue, bool fillWithDefault=true)
 
size_type addState (double defaultValue, bool fillWithDefault=true)
 
size_type addState (int_type defaultValue, bool fillWithDefault=true)
 
size_type addState (quint16 defaultValue, bool fillWithDefault=true)
 
size_type addState (quint8 defaultValue, bool fillWithDefault=true)
 
void clear ()
 
bool digestContiguousFloatStateData (const StateHandle &state, std::function< bool(size_type numItems, size_type componentsPerItem, size_type stride, const double *data)> digestFunc) const
 
bool digestContiguousIntegerStateData (const StateHandle &state, std::function< bool(size_type numItems, size_type numComponentsPerItem, size_type stride, const int_type *data)> digestFunc) const
 
bool digestContiguousUInt16StateData (const StateHandle &state, std::function< bool(size_type numItems, size_type numComponentsPerItem, size_type stride, const quint16 *data)> digestFunc) const
 
bool digestContiguousUInt8StateData (const StateHandle &state, std::function< bool(size_type numItems, size_type numComponentsPerItem, size_type stride, const quint8 *data)> digestFunc) const
 
void emptyTrash ()
 
DataExecution::DataObjectgetDataObjectState (size_type stateIndex, size_type itemIndex) const
 
double getDoubleState (size_type stateIndex, size_type itemIndex) const
 
int getIntState (size_type stateIndex, size_type itemIndex) const
 
int getUint16State (size_type stateIndex, size_type itemIndex) const
 
int getUint8State (size_type stateIndex, size_type itemIndex) const
 
Vector3dgetVectorState (size_type stateIndex, size_type itemIndex) const
 
bool isItemValid (size_type index) const
 
bool load (MeshSerializer &serializer, const DataExecution::DataObject &defaultValue, size_type numItems, size_type &stateIndex)
 
bool load (MeshSerializer &serializer, const DataExecution::DataObject &defaultValue, size_type numItems, size_type &stateIndex)
 
void logText (const QString &msg) const
 
size_type numValidAndInvalidItems () const
 
size_type numValidItems () const
 
StreamlinedStateStorageoperator= (const StreamlinedStateStorage &other)
 
void removeAllItems ()
 
void removeDataObjectState (size_type index)
 
void removeDoubleState (size_type index)
 
void removeIntState (size_type index)
 
void removeItem (size_type index)
 
void removeUint16State (size_type index)
 
void removeUint8State (size_type index)
 
void removeVector3dState (size_type index)
 
void reserve (size_type numNodes)
 
bool resetToSize (size_type numItems)
 
bool save (MeshSerializer &serializer, const DataExecution::DataFactory &dataType, size_type stateIndex) const
 
bool save (MeshSerializer &serializer, const DataExecution::DataFactory &dataType, size_type stateIndex) const
 
void setState (size_type stateIndex, size_type itemIndex, const DataExecution::DataObject &value)
 
void setState (size_type stateIndex, size_type itemIndex, const Vector3d &value)
 
void setState (size_type stateIndex, size_type itemIndex, double value)
 
void setState (size_type stateIndex, size_type itemIndex, int_type value)
 
void setState (size_type stateIndex, size_type itemIndex, quint16 value)
 
void setState (size_type stateIndex, size_type itemIndex, quint8 value)
 

Detailed Description

template<template< typename _Type, typename _Alloc=std::allocator< _Type > > class C = std::vector>
class CSIRO::Mesh::StreamlinedStateStorage< C >

Temporary solution for flexible state storage in the new MeshModelInterface. We need to eventually add array support to the Workspace data type macros so that we can use a more general TypedArray<T>.

Storage of anything other than int_type, double and Vector3d will be done with DataObjects. The problem with this is that we store a cloned DataObject for each element which is wasteful.

Constructor & Destructor Documentation

◆ StreamlinedStateStorage() [1/2]

◆ StreamlinedStateStorage() [2/2]

StreamlinedStateStorage ( const StreamlinedStateStorage< C > &  other)
inline

◆ ~StreamlinedStateStorage()

Member Function Documentation

◆ addItem()

size_type addItem ( )
inline
Returns
The index of the new item

◆ addState() [1/6]

size_type addState ( const DataExecution::DataObject defaultValue)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ addState() [2/6]

size_type addState ( const Vector3d defaultValue,
bool  fillWithDefault = true 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ addState() [3/6]

size_type addState ( double  defaultValue,
bool  fillWithDefault = true 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ addState() [4/6]

size_type addState ( int_type  defaultValue,
bool  fillWithDefault = true 
)
inline
Returns
The index of the new state

◆ addState() [5/6]

size_type addState ( quint16  defaultValue,
bool  fillWithDefault = true 
)
inline
Returns
The index of the new state

◆ addState() [6/6]

size_type addState ( quint8  defaultValue,
bool  fillWithDefault = true 
)
inline
Returns
The index of the new state

◆ clear()

void clear ( )
inline

◆ digestContiguousFloatStateData()

bool digestContiguousFloatStateData ( const StateHandle state,
std::function< bool(size_type numItems, size_type componentsPerItem, size_type stride, const double *data)>  digestFunc 
) const
inline
Parameters
state
digestFunc
Returns

◆ digestContiguousIntegerStateData()

bool digestContiguousIntegerStateData ( const StateHandle state,
std::function< bool(size_type numItems, size_type numComponentsPerItem, size_type stride, const int_type *data)>  digestFunc 
) const
inline
Parameters
state
digestFunc
Returns

◆ digestContiguousUInt16StateData()

bool digestContiguousUInt16StateData ( const StateHandle state,
std::function< bool(size_type numItems, size_type numComponentsPerItem, size_type stride, const quint16 *data)>  digestFunc 
) const
inline
Parameters
state
digestFunc
Returns

◆ digestContiguousUInt8StateData()

bool digestContiguousUInt8StateData ( const StateHandle state,
std::function< bool(size_type numItems, size_type numComponentsPerItem, size_type stride, const quint8 *data)>  digestFunc 
) const
inline
Parameters
state
digestFunc
Returns

◆ emptyTrash()

void emptyTrash ( )
inline

◆ getDataObjectState()

DataExecution::DataObject & getDataObjectState ( size_type  stateIndex,
size_type  itemIndex 
) const
inline
Postcondition
While this call is const as far as the compiler is concerned it's not logically const as the returned reference isn't const. So constness is all dependent on what you do with the return value.

◆ getDoubleState()

double getDoubleState ( size_type  stateIndex,
size_type  itemIndex 
) const
inline

◆ getIntState()

int getIntState ( size_type  stateIndex,
size_type  itemIndex 
) const
inline

◆ getUint16State()

int getUint16State ( size_type  stateIndex,
size_type  itemIndex 
) const
inline

◆ getUint8State()

int getUint8State ( size_type  stateIndex,
size_type  itemIndex 
) const
inline

◆ getVectorState()

Vector3d & getVectorState ( size_type  stateIndex,
size_type  itemIndex 
) const
inline
Postcondition
While this call is const as far as the compiler is concerned it's not logically const as the returned reference isn't const. So constness is all dependent on what you do with the return value.

◆ isItemValid()

bool isItemValid ( size_type  index) const
inline

◆ load() [1/2]

bool load ( MeshSerializer serializer,
const DataExecution::DataObject defaultValue,
size_type  numItems,
size_type stateIndex 
)
inline

◆ load() [2/2]

bool load ( MeshSerializer serializer,
const DataExecution::DataObject defaultValue,
size_type  numItems,
size_type stateIndex 
)
inline

◆ logText()

void logText ( const QString &  msg) const
inline

◆ numValidAndInvalidItems()

size_type numValidAndInvalidItems ( ) const
inline
Returns
The number of valid and invalid items

◆ numValidItems()

size_type numValidItems ( ) const
inline
Returns
The number of valid items

◆ operator=()

StreamlinedStateStorage & operator= ( const StreamlinedStateStorage< C > &  other)
inline

◆ removeAllItems()

void removeAllItems ( )
inline

◆ removeDataObjectState()

void removeDataObjectState ( size_type  index)
inline

◆ removeDoubleState()

void removeDoubleState ( size_type  index)
inline

◆ removeIntState()

void removeIntState ( size_type  index)
inline

◆ removeItem()

void removeItem ( size_type  index)
inline

◆ removeUint16State()

void removeUint16State ( size_type  index)
inline

◆ removeUint8State()

void removeUint8State ( size_type  index)
inline

◆ removeVector3dState()

void removeVector3dState ( size_type  index)
inline

◆ reserve()

void reserve ( size_type  numNodes)
inline

◆ resetToSize()

bool resetToSize ( size_type  numItems)
inline

Used as part of load(), will remove all existing data.

◆ save() [1/2]

bool save ( MeshSerializer serializer,
const DataExecution::DataFactory dataType,
size_type  stateIndex 
) const
inline

Only saves states of natively supported types (int_type, double and Vector3d).

◆ save() [2/2]

bool save ( MeshSerializer serializer,
const DataExecution::DataFactory dataType,
size_type  stateIndex 
) const
inline

Only saves states of natively supported types (int_type, double and Vector3d).

◆ setState() [1/6]

void setState ( size_type  stateIndex,
size_type  itemIndex,
const DataExecution::DataObject value 
)
inline

◆ setState() [2/6]

void setState ( size_type  stateIndex,
size_type  itemIndex,
const Vector3d value 
)
inline

◆ setState() [3/6]

void setState ( size_type  stateIndex,
size_type  itemIndex,
double  value 
)
inline

◆ setState() [4/6]

void setState ( size_type  stateIndex,
size_type  itemIndex,
int_type  value 
)
inline

◆ setState() [5/6]

void setState ( size_type  stateIndex,
size_type  itemIndex,
quint16  value 
)
inline

◆ setState() [6/6]

void setState ( size_type  stateIndex,
size_type  itemIndex,
quint8  value 
)
inline