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