MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Attributes
mds::base::CData< T > Class Template Reference

Class template providing data allocation functions. More...

#include <mdsData.h>

Inheritance diagram for mds::base::CData< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef CDataAllocator< T > base
typedef base::tConstData tConstData
 Const data type.
typedef base::tConstDataPtr tConstDataPtr
 Pointer to the constant data.
typedef base::tData tData
 Data type.
typedef base::tDataPtr tDataPtr
 Pointer to the data.

Public Member Functions

tDataat (tSize i)
 Returns reference to the element [i].
const tDataat (tSize i) const
 CData ()
 Default constructor allocates data of zero length.
 CData (EEmptyConst)
 This constructor does no allocation of the data.
 CData (tSize Size)
 Constructor that allocates a given size of data.
 CData (tConstDataPtr pData, tSize Size)
 Constructor that copies a specified data.
 CData (const CData &Data)
 Constructor copies a given data.
CDatacreate (tSize Size)
 Allocates memory for data of a given size.
CDatacreate (tConstDataPtr pData, tSize Size)
 Allocates memory and copies the specified data.
CDatacreate (const CData &Data)
 Allocates memory and copies the specified data.
CDatafill (const tData &Value)
 Fills the entire data.
template<class Function >
Function forEach (Function Func)
template<class Function >
Function forEach (Function Func) const
template<class Function >
Function forEach (Function Func)
 Calls function object for every element.
template<class Function >
Function forEach (Function Func) const
 Calls function object for every element.
template<class Function >
Function forRange (tSize i, tSize j, Function Func)
 Calls function object for all elements in the range <i, j>.
template<class Function >
Function forRange (tSize i, tSize j, Function Func)
template<class Function >
Function forRange (tSize i, tSize j, Function Func) const
 Calls function object for all elements in the range <i, j>.
template<class Function >
Function forRange (tSize i, tSize j, Function Func) const
tDataPtr getPtr (tSize i)
 Returns pointer to the element [i].
tConstDataPtr getPtr (tSize i) const
tDataPtr getPtr ()
 Returns pointer to the data.
tConstDataPtr getPtr () const
tSize getSize () const
 Returns size of the data.
bool isWithinBlock (tSize i, tSize j) const
 Returns true if the specified range of elements lie within a continuous block of memory.
tDataoperator() (tSize i)
 Returns reference to the subscripted element [i].
const tDataoperator() (tSize i) const
CDataoperator= (const CData &Data)
 Assignment operator.
CDataset (tSize i, const T &Value)
 Sets the element of matrix at the position [i].
 ~CData ()
 Destructor.

Protected Attributes

tDataPtr m_pData
 Pointer to the allocated data.
tSize m_Size
 Size of the allocated data.

Detailed Description

template<typename T>
class mds::base::CData< T >

Class template providing data allocation functions.


Member Typedef Documentation

template<typename T>
typedef CDataAllocator<T> mds::base::CData< T >::base
template<typename T>
typedef base::tConstData mds::base::CData< T >::tConstData

Const data type.

Reimplemented from mds::base::CDataAllocator< T >.

template<typename T>
typedef base::tConstDataPtr mds::base::CData< T >::tConstDataPtr

Pointer to the constant data.

Reimplemented from mds::base::CDataAllocator< T >.

Reimplemented in mds::img::CKernel3D, mds::img::CKernel2D, and mds::img::CKernel1D.

template<typename T>
typedef base::tData mds::base::CData< T >::tData

Data type.

Reimplemented from mds::base::CDataAllocator< T >.

Reimplemented in mds::img::CKernel3D, mds::img::CKernel2D, and mds::img::CKernel1D.

template<typename T>
typedef base::tDataPtr mds::base::CData< T >::tDataPtr

Pointer to the data.

Reimplemented from mds::base::CDataAllocator< T >.

Reimplemented in mds::img::CKernel3D, mds::img::CKernel2D, and mds::img::CKernel1D.


Constructor & Destructor Documentation

template<typename T >
CData::CData ( )

Default constructor allocates data of zero length.

template<typename T >
CData::CData ( EEmptyConst  ) [explicit]

This constructor does no allocation of the data.

  • Be sure that one of the methods create() is called somewhere later.
  • Use with care!
template<typename T >
CData::CData ( tSize  Size) [explicit]

Constructor that allocates a given size of data.

  • Data of the zero size can be also allocated.
template<typename T >
CData::CData ( tConstDataPtr  pData,
tSize  Size 
)

Constructor that copies a specified data.

template<typename T >
mds::base::CData< T >::CData ( const CData< T > &  Data)

Constructor copies a given data.

template<typename T >
CData::~CData ( )

Destructor.

  • Deallocates the data.

Member Function Documentation

template<typename T>
tData& mds::base::CData< T >::at ( tSize  i)

Returns reference to the element [i].

Reimplemented in mds::img::CKernel1D.

template<typename T>
const tData& mds::base::CData< T >::at ( tSize  i) const

Reimplemented in mds::img::CKernel1D.

template<typename T >
CData< T > & CData::create ( tSize  Size)

Allocates memory for data of a given size.

  • Returns reference to this.

Reimplemented in mds::img::CKernel3D, mds::img::CKernel2D, and mds::img::CKernel1D.

template<typename T >
CData< T > & CData::create ( tConstDataPtr  pData,
tSize  Size 
)

Allocates memory and copies the specified data.

  • Returns reference to this.
template<typename T >
CData< T > & mds::base::CData< T >::create ( const CData< T > &  Data)

Allocates memory and copies the specified data.

  • Returns reference to this.
template<typename T >
CData< T > & CData::fill ( const tData Value)

Fills the entire data.

template<typename T>
template<class Function >
Function mds::base::CData< T >::forEach ( Function  Func)
template<typename T>
template<class Function >
Function mds::base::CData< T >::forEach ( Function  Func) const
template<typename T >
template<class Function >
Function mds::base::CData< T >::forEach ( Function  Func)

Calls function object for every element.

template<typename T >
template<class Function >
Function mds::base::CData< T >::forEach ( Function  Func) const

Calls function object for every element.

template<typename T >
template<class Function >
Function mds::base::CData< T >::forRange ( tSize  i,
tSize  j,
Function  Func 
)

Calls function object for all elements in the range <i, j>.

template<typename T>
template<class Function >
Function mds::base::CData< T >::forRange ( tSize  i,
tSize  j,
Function  Func 
)
template<typename T >
template<class Function >
Function mds::base::CData< T >::forRange ( tSize  i,
tSize  j,
Function  Func 
) const

Calls function object for all elements in the range <i, j>.

template<typename T>
template<class Function >
Function mds::base::CData< T >::forRange ( tSize  i,
tSize  j,
Function  Func 
) const
template<typename T>
tDataPtr mds::base::CData< T >::getPtr ( tSize  i)

Returns pointer to the element [i].

Reimplemented in mds::img::CKernel1D.

template<typename T>
tConstDataPtr mds::base::CData< T >::getPtr ( tSize  i) const

Reimplemented in mds::img::CKernel1D.

template<typename T>
tDataPtr mds::base::CData< T >::getPtr ( )

Returns pointer to the data.

Reimplemented in mds::img::CKernel3D, mds::img::CKernel2D, and mds::img::CKernel1D.

template<typename T>
tConstDataPtr mds::base::CData< T >::getPtr ( ) const
template<typename T>
tSize mds::base::CData< T >::getSize ( ) const
template<typename T>
bool mds::base::CData< T >::isWithinBlock ( tSize  i,
tSize  j 
) const

Returns true if the specified range of elements lie within a continuous block of memory.

template<typename T>
tData& mds::base::CData< T >::operator() ( tSize  i)

Returns reference to the subscripted element [i].

Reimplemented in mds::img::CKernel1D.

template<typename T>
const tData& mds::base::CData< T >::operator() ( tSize  i) const

Reimplemented in mds::img::CKernel1D.

template<typename T >
CData< T > & CData::operator= ( const CData< T > &  Data)

Assignment operator.

template<typename T>
CData& mds::base::CData< T >::set ( tSize  i,
const T &  Value 
)

Sets the element of matrix at the position [i].


Member Data Documentation

template<typename T>
tDataPtr mds::base::CData< T >::m_pData [protected]

Pointer to the allocated data.

template<typename T>
tSize mds::base::CData< T >::m_Size [protected]

Size of the allocated data.


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