MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class template managing references to a block of memory that is allocated in parts as a sequence of smaller memory blocks. More...
#include <mdsPartedData.h>
Classes | |
struct | SRefInfo |
Structure containing information on allocated data and the number of references. More... | |
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 | |
tData & | at (tSize i) |
Returns reference to the element [i]. | |
const tData & | at (tSize i) const |
CPartedData () | |
Default constructor allocates data of zero length. | |
CPartedData (EEmptyConst) | |
This constructor does no allocation of the data. | |
CPartedData (tSize Size) | |
Constructor that allocates a given size of data. | |
CPartedData (tConstDataPtr pData, tSize Size) | |
Constructor that copies a specified data. | |
CPartedData (const CPartedData &Data) | |
Constructor copies a given data. | |
CPartedData (const CPartedData &Data, EMakeRef) | |
Constructor which makes reference to an existing data. | |
CPartedData & | create (tSize Size) |
Allocates data of a given size. | |
CPartedData & | create (tConstDataPtr pData, tSize Size) |
Allocates data and copies the specified data to it. | |
CPartedData & | create (const CPartedData &Data) |
Allocates data and copies the specified data. | |
CPartedData & | create (const CPartedData &Data, EMakeRef) |
Makes a new reference to existing data. | |
CPartedData & | fill (const tData &Value) |
Initializes the data. | |
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 | forEach (Function Func) |
template<class Function > | |
Function | forEach (Function Func) const |
template<class Function > | |
Function | forRange (tSize i, tSize j, Function Func) |
Calls function object for every element. | |
template<class Function > | |
Function | forRange (tSize i, tSize j, Function Func) const |
Calls function object for every element. | |
template<class Function > | |
Function | forRange (tSize i, tSize j, Function Func) |
template<class Function > | |
Function | forRange (tSize i, tSize j, Function Func) const |
int | getNumOfReferences () const |
Returns the number of references to the data. | |
tDataPtr | getPtr (tSize i) |
Returns pointer to the given element. | |
tConstDataPtr | getPtr (tSize i) const |
tDataPtr | getPtr () |
Returns pointer to the beginning of the data. | |
tConstDataPtr | getPtr () const |
tSize | getSize () const |
Returns data size. | |
bool | isWithinBlock (tSize i, tSize j) const |
Returns true if the specified range of elements lie within a continuous block of memory. | |
tData & | operator() (tSize i) |
Returns reference to the subscripted element [i]. | |
const tData & | operator() (tSize i) const |
CPartedData & | operator= (const CPartedData &Data) |
Assignment operator. | |
CPartedData & | set (tSize i, const T &Value) |
Sets the element of matrix at the position [i]. | |
~CPartedData () | |
Destructor deallocates the data if the number of references decreases to zero. | |
Protected Types | |
typedef tDataPtr * | tDataBlocks |
Vector of allocated data blocks. | |
Protected Attributes | |
SRefInfo * | m_pRef |
Pointer to the structure containing the referenced data. |
Class template managing references to a block of memory that is allocated in parts as a sequence of smaller memory blocks.
typedef CDataAllocator<T> mds::base::CPartedData< T >::base |
typedef base::tConstData mds::base::CPartedData< T >::tConstData |
Const data type.
Reimplemented from mds::base::CDataAllocator< T >.
typedef base::tConstDataPtr mds::base::CPartedData< T >::tConstDataPtr |
Pointer to the constant data.
Reimplemented from mds::base::CDataAllocator< T >.
typedef base::tData mds::base::CPartedData< T >::tData |
Data type.
Reimplemented from mds::base::CDataAllocator< T >.
typedef tDataPtr* mds::base::CPartedData< T >::tDataBlocks [protected] |
Vector of allocated data blocks.
typedef base::tDataPtr mds::base::CPartedData< T >::tDataPtr |
Pointer to the data.
Reimplemented from mds::base::CDataAllocator< T >.
CPartedData::CPartedData | ( | ) |
Default constructor allocates data of zero length.
CPartedData::CPartedData | ( | EEmptyConst | ) | [explicit] |
This constructor does no allocation of the data.
CPartedData::CPartedData | ( | tSize | Size | ) | [explicit] |
Constructor that allocates a given size of data.
CPartedData::CPartedData | ( | tConstDataPtr | pData, |
tSize | Size | ||
) |
Constructor that copies a specified data.
mds::base::CPartedData< T >::CPartedData | ( | const CPartedData< T > & | Data | ) |
Constructor copies a given data.
mds::base::CPartedData< T >::CPartedData | ( | const CPartedData< T > & | Data, |
EMakeRef | |||
) |
Constructor which makes reference to an existing data.
CPartedData::~CPartedData | ( | ) |
Destructor deallocates the data if the number of references decreases to zero.
tData& mds::base::CPartedData< T >::at | ( | tSize | i | ) |
Returns reference to the element [i].
const tData& mds::base::CPartedData< T >::at | ( | tSize | i | ) | const |
CPartedData< T > & CPartedData::create | ( | tSize | Size | ) |
Allocates data of a given size.
CPartedData< T > & CPartedData::create | ( | tConstDataPtr | pData, |
tSize | Size | ||
) |
Allocates data and copies the specified data to it.
CPartedData< T > & mds::base::CPartedData< T >::create | ( | const CPartedData< T > & | Data | ) |
Allocates data and copies the specified data.
CPartedData< T > & mds::base::CPartedData< T >::create | ( | const CPartedData< T > & | Data, |
EMakeRef | |||
) |
Makes a new reference to existing data.
CPartedData< T > & CPartedData::fill | ( | const tData & | Value | ) |
Initializes the data.
Function mds::base::CPartedData< T >::forEach | ( | Function | Func | ) |
Calls function object for every element.
Function mds::base::CPartedData< T >::forEach | ( | Function | Func | ) | const |
Calls function object for every element.
Function mds::base::CPartedData< T >::forEach | ( | Function | Func | ) |
Function mds::base::CPartedData< T >::forEach | ( | Function | Func | ) | const |
Function mds::base::CPartedData< T >::forRange | ( | tSize | i, |
tSize | j, | ||
Function | Func | ||
) |
Calls function object for every element.
Function mds::base::CPartedData< T >::forRange | ( | tSize | i, |
tSize | j, | ||
Function | Func | ||
) | const |
Calls function object for every element.
Function mds::base::CPartedData< T >::forRange | ( | tSize | i, |
tSize | j, | ||
Function | Func | ||
) |
Function mds::base::CPartedData< T >::forRange | ( | tSize | i, |
tSize | j, | ||
Function | Func | ||
) | const |
int mds::base::CPartedData< T >::getNumOfReferences | ( | ) | const |
Returns the number of references to the data.
tDataPtr mds::base::CPartedData< T >::getPtr | ( | tSize | i | ) |
Returns pointer to the given element.
tConstDataPtr mds::base::CPartedData< T >::getPtr | ( | tSize | i | ) | const |
tDataPtr mds::base::CPartedData< T >::getPtr | ( | ) |
Returns pointer to the beginning of the data.
tConstDataPtr mds::base::CPartedData< T >::getPtr | ( | ) | const |
tSize mds::base::CPartedData< T >::getSize | ( | ) | const |
Returns data size.
bool mds::base::CPartedData< T >::isWithinBlock | ( | tSize | i, |
tSize | j | ||
) | const |
Returns true if the specified range of elements lie within a continuous block of memory.
tData& mds::base::CPartedData< T >::operator() | ( | tSize | i | ) |
Returns reference to the subscripted element [i].
const tData& mds::base::CPartedData< T >::operator() | ( | tSize | i | ) | const |
CPartedData< T > & CPartedData::operator= | ( | const CPartedData< T > & | Data | ) |
Assignment operator.
CPartedData& mds::base::CPartedData< T >::set | ( | tSize | i, |
const T & | Value | ||
) |
Sets the element of matrix at the position [i].
SRefInfo* mds::base::CPartedData< T >::m_pRef [protected] |
Pointer to the structure containing the referenced data.