OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types
ValueHolder< V > Class Template Reference

#include <value_holder.hh>

Public Types

typedef V * VPtr
typedef VPtrVPtrPtr

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)
ValueHolderoperator= (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
VPtrGetRows ()
const VPtrGetRows () const
int GetRowCount () const
VPtrPtrGetSlices ()
const VPtrPtrGetSlices () 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 ()

Detailed Description

template<typename V>
class ost::img::image_state::ValueHolder< V >

Definition at line 57 of file value_holder.hh.


Member Typedef Documentation

typedef V* VPtr

Definition at line 59 of file value_holder.hh.

typedef VPtr* VPtrPtr

Definition at line 60 of file value_holder.hh.


Constructor & Destructor Documentation

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!

ValueHolder ( const Size s,
ValueHolder< U > &  v 
)
inline

initialize with a size and an existing value holder, grabbing the memory

Definition at line 79 of file value_holder.hh.

free allocated memory upon destruction


Member Function Documentation

int DataCount ( ) const
inline

return number of data items DEPRECATED

Definition at line 182 of file value_holder.hh.

VPtr GetData ( )
inline

return pointer to raw data

Definition at line 177 of file value_holder.hh.

const VPtr GetData ( ) const
inline

const version of GetData()

Definition at line 179 of file value_holder.hh.

int GetDataCount ( ) const
inline

return number of data items

this is the volume: width*height*depth

Definition at line 188 of file value_holder.hh.

static DataType GetDataType ( )
static
unsigned int GetDepth ( ) const
inline

Definition at line 129 of file value_holder.hh.

const VPtr GetEnd ( ) const
inline

Definition at line 190 of file value_holder.hh.

unsigned int GetHeight ( ) const
inline

Definition at line 127 of file value_holder.hh.

unsigned int GetPhysicalSize ( ) const
inline

Definition at line 137 of file value_holder.hh.

int GetRowCount ( ) const
inline

return number of row pointers

this is width*height

Definition at line 200 of file value_holder.hh.

VPtr* GetRows ( )
inline

return pointer to row pointers

Definition at line 193 of file value_holder.hh.

const VPtr* GetRows ( ) const
inline

const version of GetRows()

Definition at line 195 of file value_holder.hh.

Size GetSize ( ) const
int GetSliceCount ( ) const
inline

return number of slices

equals the width

Definition at line 210 of file value_holder.hh.

VPtrPtr* GetSlices ( )
inline

return pointer to slice pointers

Definition at line 203 of file value_holder.hh.

const VPtrPtr* GetSlices ( ) const
inline

const version of GetSlices()

Definition at line 205 of file value_holder.hh.

unsigned int GetVolume ( ) const
inline

Definition at line 131 of file value_holder.hh.

unsigned int GetWidth ( ) const
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]


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