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