OpenStructure
|
#include <value_holder.hh>
Public Types | |
typedef V * | VPtr |
typedef VPtr * | VPtrPtr |
Public Member Functions | |
Construction, Release, etc | |
ValueHolder (unsigned int wi, unsigned int he, unsigned int de) | |
ValueHolder (const Size &s) | |
ValueHolder (const Size &s, const Size &ps) | |
ValueHolder (const ValueHolder< V > &h) | |
template<typename U > | |
ValueHolder (const Size &s, ValueHolder< U > &v) | |
ValueHolder & | operator= (const ValueHolder< V > &h) |
~ValueHolder () | |
VPtr | ReleaseData () |
void | Swap (ValueHolder &vh) |
Data Access | |
access is either via interface that uses the internal row and slice pointers, or these pointers may be retrieved directly. | |
V & | Value (const Index &i) |
const V & | Value (const Index &i) const |
V & | Value (unsigned int i) |
const V & | Value (unsigned int i) const |
VPtr | GetData () |
const VPtr | GetData () const |
int | DataCount () const |
int | GetDataCount () const |
const VPtr | GetEnd () const |
VPtr * | GetRows () |
const VPtr * | GetRows () const |
int | GetRowCount () const |
VPtrPtr * | GetSlices () |
const VPtrPtr * | GetSlices () const |
int | GetSliceCount () const |
Property access | |
unsigned int | GetWidth () const |
unsigned int | GetHeight () const |
unsigned int | GetDepth () const |
unsigned int | GetVolume () const |
Size | GetSize () const |
unsigned int | GetPhysicalSize () const |
long | MemSize () const |
static DataType | GetDataType () |
Definition at line 57 of file value_holder.hh.
typedef V* VPtr |
Definition at line 59 of file value_holder.hh.
Definition at line 60 of file value_holder.hh.
ValueHolder | ( | unsigned int | wi, |
unsigned int | he, | ||
unsigned int | de | ||
) |
initialization with explicit width, height, and depth
ValueHolder | ( | const Size & | s | ) |
initialization with size
ValueHolder | ( | const Size & | s, |
const Size & | ps | ||
) |
initialization with size and physical size
ValueHolder | ( | const ValueHolder< V > & | h | ) |
copy ctor provides full copy!
|
inline |
initialize with a size and an existing value holder, grabbing the memory
Definition at line 79 of file value_holder.hh.
~ValueHolder | ( | ) |
free allocated memory upon destruction
|
inline |
return number of data items DEPRECATED
Definition at line 182 of file value_holder.hh.
|
inline |
return pointer to raw data
Definition at line 177 of file value_holder.hh.
|
inline |
const version of GetData()
Definition at line 179 of file value_holder.hh.
|
inline |
return number of data items
this is the volume: width*height*depth
Definition at line 188 of file value_holder.hh.
|
static |
|
inline |
Definition at line 129 of file value_holder.hh.
|
inline |
Definition at line 190 of file value_holder.hh.
|
inline |
Definition at line 127 of file value_holder.hh.
|
inline |
Definition at line 137 of file value_holder.hh.
|
inline |
|
inline |
return pointer to row pointers
Definition at line 193 of file value_holder.hh.
|
inline |
const version of GetRows()
Definition at line 195 of file value_holder.hh.
Size GetSize | ( | ) | const |
|
inline |
|
inline |
return pointer to slice pointers
Definition at line 203 of file value_holder.hh.
|
inline |
const version of GetSlices()
Definition at line 205 of file value_holder.hh.
|
inline |
Definition at line 131 of file value_holder.hh.
|
inline |
Definition at line 125 of file value_holder.hh.
long MemSize | ( | ) | const |
ValueHolder& operator= | ( | const ValueHolder< V > & | h | ) |
assignement provides full copy!
Not exception safe, ie the state of value holder is undefined if something goes wrong here. This is on purpose to allow memory efficient assignement!
VPtr ReleaseData | ( | ) |
release the held data, invalidates holder!
the data area is returned, but no longer belongs to the value holder. it now belongs to the caller, who must eiter free it explicitely, or use it in a constructor argument to a new value holder.
void Swap | ( | ValueHolder< V > & | vh | ) |
swap data with another value holder
V& Value | ( | const Index & | i | ) |
return direct r/w access to the value without boundary check
The lookup is based on an integer triplet encapsulated within Index. Efficient lookup using helper tables.
const V& Value | ( | const Index & | i | ) | const |
return direct ro access to the value without boundary check
The lookup is based on an integer triplet encapsulated within Index. Efficient lookup using helper tables.
V& Value | ( | unsigned int | i | ) |
return direct r/w access to the value without boundary check
DEPRECATED! Use GetData()[i]
const V& Value | ( | unsigned int | i | ) | const |
return direct ro access to the value without boundary check
DEPRECATED! Use GetData()[i]