MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Fast serialization of data entities and their members over shared memory. More...
#include <mdsSHMSerializer.h>
Public Types | |
enum | { CLASS_OBJECT } |
Templates that require members of the CObject class can use this enum to check the existence. More... | |
enum | { HEAP_OBJECT = 0x70616568 } |
Signature used to recognize objects on the heap. More... | |
typedef CChannelSerializer < CSHMSerializer > | tBase |
Base class. | |
typedef mds::base::CFunctor < bool, int, int > | tProgressFunc |
Progress observer (= functor). | |
typedef CProgressInitializer | tProgressInitializer |
Helper class which can be used to call methods beginProgress() and endProgress() automatically. | |
typedef CSHMSerializer | tSerializer |
Serializer type. | |
Public Member Functions | |
CHasOptions & | addOption (int Flag) |
Adds a given flag using bitwise OR operation. | |
void | beginProgress () |
This function must be called by the class realizing an operation before it starts. | |
template<typename T > | |
void | beginRead (T &Object) |
Reads information on logical group of class members from the serialized data. | |
template<typename T > | |
void | beginRead (T &Object) |
Reads information on logical group of class members from the serialized data. | |
template<typename T > | |
void | beginWrite (T &Object) |
Creates a new logical group of class members in the serialized data. | |
template<typename T > | |
void | beginWrite (T &Object) |
Creates a new logical group of class members in the serialized data. | |
bool | checkAllOptions (int Flags) const |
Checks if all specified flags are set. | |
bool | checkAnyOption (int Flags) const |
Checks if any of specified flags is set. | |
int | checkOption (int Flag) const |
Checks if a single flag is set. | |
CHasOptions & | clearOption (int Flag) |
Removes a given flag. | |
CSHMSerializer (CSharedMemChannel *pChannel, int iFlags=0) | |
Default constructor. | |
void | deregisterProgressFunc () |
Sets the default empty observer. | |
void | endProgress () |
The function must be called by the class realizing an operation every time the operation finishes. | |
template<typename T > | |
void | endRead (T &Object) |
Reads end of the logical group. | |
template<typename T > | |
void | endRead (T &Object) |
Reads end of the logical group. | |
template<typename T > | |
void | endWrite (T &Object) |
End of the logical group. | |
template<typename T > | |
void | endWrite (T &Object) |
End of the logical group. | |
CChannel * | getChannelPtr () |
Returns pointer to the I/O channel. | |
tSerializer & | getImpl () |
Returns reference to the serializer implementation. | |
const tSerializer & | getImpl () const |
int | getOptions () const |
Returns all flags. | |
int | getProgressCount () const |
Returns current value of the internal progress value. | |
int | getProgressMax () const |
Returns the maximum allowed value of the internal progress counter. | |
int | getReferencesCount () const |
Returns the number of references. | |
bool | isOnHeap () const |
Returns true if the object is allocated on the heap. | |
MDS_SHAREDPTR (CSHMSerializer) | |
Smart pointer type. | |
bool | progress (int iIncrement=1) |
Calls the registered observer. | |
template<typename T > | |
void | read (T &Value) |
Deserializes a given fundamental value. | |
template<typename T > | |
void | read (T *pData, tSize Length) |
Deserializes a given block of data. | |
template<typename T > | |
void | read (mds::base::CSHMData< T > &Value) |
Deserializes a block of data stored in a CSHMData<> structure. | |
template<typename T > | |
void | read (T &Value) |
Deserializes a given fundamental value. | |
template<typename T > | |
void | read (mds::base::CSHMData< T > &Data) |
template<typename T > | |
void | read (T *pData, tSize Length) |
Deserializes a given block of data. | |
template<typename T > | |
void | readRoot (T &Object) |
Deserializes a given data entity. | |
template<typename T > | |
void | readRoot (T &Object) |
Deserializes a given data entity. | |
void | registerProgressFunc (const tProgressFunc &Func) |
Sets observer/functor called to inform a calling process about the current state of the running operation. | |
void | setChannel (CChannel *pChannel) |
Sets the I/O channel. | |
CHasOptions & | setOption (int Flag) |
Adds a given flag using bitwise OR operation. | |
CHasOptions & | setOptions (int Flags) |
Sets complete flags. | |
void | setProgressMax (int iValue) |
Sets the maximal counter value. | |
template<typename T > | |
void | write (const T &Value) |
Serializes a given fundamental value. | |
template<typename T > | |
void | write (const T &Value) |
Serializes a given fundamental value. | |
template<typename T > | |
void | write (mds::base::CSHMData< T > &Data) |
template<typename T > | |
void | write (const T *pData, tSize Length) |
Serializes a given block of data. | |
template<typename T > | |
void | write (mds::base::CSHMData< T > &Value) |
Serializes a block of data stored in a CSHMData<> structure. | |
template<typename T > | |
void | write (const T *pData, tSize Length) |
Serializes a given block of data. | |
template<typename T > | |
void | writeRoot (T &Object) |
Serializes a given data entity. | |
template<typename T > | |
void | writeRoot (T &Object) |
Serializes a given data entity. | |
~CSHMSerializer () | |
Destructor. | |
Static Public Member Functions | |
static void * | operator new (std::size_t Size) |
Allocates a new object on the heap. | |
Protected Member Functions | |
void | addReference () const |
Increase the reference counter. | |
bool | delReference () const |
Decrease the reference counter. | |
Protected Attributes | |
int | m_iHeapObject |
Flag initialized if the object is on the heap. | |
int | m_iReferences |
The number of references to the object. | |
int | m_Options |
Optional flags. | |
CSharedMemChannelPtr | m_spActiveChannel |
Smart pointer to actively used channel. | |
CChannelPtr | m_spChannel |
Pointer to the I/O channel. |
Fast serialization of data entities and their members over shared memory.
Base class.
typedef mds::base::CFunctor<bool, int, int> mds::mod::CProgress::tProgressFunc [inherited] |
Progress observer (= functor).
typedef CProgressInitializer mds::mod::CProgress::tProgressInitializer [inherited] |
Helper class which can be used to call methods beginProgress() and endProgress() automatically.
Create static object of this type at the begining of a method that realizes an operation.
typedef CSHMSerializer mds::mod::CChannelSerializer< CSHMSerializer >::tSerializer [inherited] |
Serializer type.
anonymous enum [inherited] |
Templates that require members of the CObject class can use this enum to check the existence.
mds::mod::CSHMSerializer::CSHMSerializer | ( | CSharedMemChannel * | pChannel, |
int | iFlags = 0 |
||
) |
Default constructor.
Destructor.
CHasOptions& mds::base::CHasOptions::addOption | ( | int | Flag | ) | [inherited] |
Adds a given flag using bitwise OR operation.
void mds::base::CObject::addReference | ( | ) | const [protected, inherited] |
Increase the reference counter.
void mds::mod::CProgress::beginProgress | ( | ) | [inherited] |
This function must be called by the class realizing an operation before it starts.
void mds::mod::CSHMSerializer::beginRead | ( | T & | Object | ) |
Reads information on logical group of class members from the serialized data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::beginRead | ( | T & | Object | ) |
Reads information on logical group of class members from the serialized data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::beginWrite | ( | T & | Object | ) |
Creates a new logical group of class members in the serialized data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::beginWrite | ( | T & | Object | ) |
Creates a new logical group of class members in the serialized data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
bool mds::base::CHasOptions::checkAllOptions | ( | int | Flags | ) | const [inherited] |
Checks if all specified flags are set.
bool mds::base::CHasOptions::checkAnyOption | ( | int | Flags | ) | const [inherited] |
Checks if any of specified flags is set.
int mds::base::CHasOptions::checkOption | ( | int | Flag | ) | const [inherited] |
Checks if a single flag is set.
CHasOptions& mds::base::CHasOptions::clearOption | ( | int | Flag | ) | [inherited] |
Removes a given flag.
bool mds::base::CObject::delReference | ( | ) | const [protected, inherited] |
Decrease the reference counter.
void mds::mod::CProgress::deregisterProgressFunc | ( | ) | [inherited] |
Sets the default empty observer.
void mds::mod::CProgress::endProgress | ( | ) | [inherited] |
The function must be called by the class realizing an operation every time the operation finishes.
void mds::mod::CSHMSerializer::endRead | ( | T & | Object | ) |
Reads end of the logical group.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::endRead | ( | T & | Object | ) |
Reads end of the logical group.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::endWrite | ( | T & | Object | ) |
End of the logical group.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::endWrite | ( | T & | Object | ) |
End of the logical group.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
CChannel* mds::mod::CChannelSerializer< CSHMSerializer >::getChannelPtr | ( | ) | [inherited] |
Returns pointer to the I/O channel.
tSerializer& mds::mod::CChannelSerializer< CSHMSerializer >::getImpl | ( | ) | [inherited] |
Returns reference to the serializer implementation.
const tSerializer& mds::mod::CChannelSerializer< CSHMSerializer >::getImpl | ( | ) | const [inherited] |
int mds::base::CHasOptions::getOptions | ( | ) | const [inherited] |
Returns all flags.
int mds::mod::CProgress::getProgressCount | ( | ) | const [inherited] |
Returns current value of the internal progress value.
int mds::mod::CProgress::getProgressMax | ( | ) | const [inherited] |
Returns the maximum allowed value of the internal progress counter.
int mds::base::CObject::getReferencesCount | ( | ) | const [inherited] |
Returns the number of references.
bool mds::base::CObject::isOnHeap | ( | ) | const [inherited] |
Returns true if the object is allocated on the heap.
Smart pointer type.
static void* mds::base::CObject::operator new | ( | std::size_t | Size | ) | [static, inherited] |
Allocates a new object on the heap.
bool mds::mod::CProgress::progress | ( | int | iIncrement = 1 | ) | [inherited] |
Calls the registered observer.
void mds::mod::CSHMSerializer::read | ( | T & | Value | ) |
Deserializes a given fundamental value.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::read | ( | T * | pData, |
tSize | Length | ||
) |
Deserializes a given block of data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::read | ( | mds::base::CSHMData< T > & | Value | ) |
Deserializes a block of data stored in a CSHMData<> structure.
void mds::mod::CSHMSerializer::read | ( | T & | Value | ) |
Deserializes a given fundamental value.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::read | ( | mds::base::CSHMData< T > & | Data | ) |
void mds::mod::CSHMSerializer::read | ( | T * | pData, |
tSize | Length | ||
) |
Deserializes a given block of data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::readRoot | ( | T & | Object | ) |
Deserializes a given data entity.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::readRoot | ( | T & | Object | ) |
Deserializes a given data entity.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CProgress::registerProgressFunc | ( | const tProgressFunc & | Func | ) | [inherited] |
Sets observer/functor called to inform a calling process about the current state of the running operation.
void mds::mod::CChannelSerializer< CSHMSerializer >::setChannel | ( | CChannel * | pChannel | ) | [inherited] |
Sets the I/O channel.
CHasOptions& mds::base::CHasOptions::setOption | ( | int | Flag | ) | [inherited] |
Adds a given flag using bitwise OR operation.
CHasOptions& mds::base::CHasOptions::setOptions | ( | int | Flags | ) | [inherited] |
Sets complete flags.
void mds::mod::CProgress::setProgressMax | ( | int | iValue | ) | [inherited] |
Sets the maximal counter value.
void mds::mod::CSHMSerializer::write | ( | const T & | Value | ) |
Serializes a given fundamental value.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::write | ( | const T & | Value | ) |
Serializes a given fundamental value.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::write | ( | mds::base::CSHMData< T > & | Data | ) |
void mds::mod::CSHMSerializer::write | ( | const T * | pData, |
tSize | Length | ||
) |
Serializes a given block of data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::write | ( | mds::base::CSHMData< T > & | Value | ) |
Serializes a block of data stored in a CSHMData<> structure.
void mds::mod::CSHMSerializer::write | ( | const T * | pData, |
tSize | Length | ||
) |
Serializes a given block of data.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::writeRoot | ( | T & | Object | ) |
Serializes a given data entity.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
void mds::mod::CSHMSerializer::writeRoot | ( | T & | Object | ) |
Serializes a given data entity.
Reimplemented from mds::mod::CChannelSerializer< CSHMSerializer >.
int mds::base::CObject::m_iHeapObject [mutable, protected, inherited] |
Flag initialized if the object is on the heap.
int mds::base::CObject::m_iReferences [mutable, protected, inherited] |
The number of references to the object.
int mds::base::CHasOptions::m_Options [protected, inherited] |
Optional flags.
Smart pointer to actively used channel.
CChannelPtr mds::mod::CChannelSerializer< CSHMSerializer >::m_spChannel [protected, inherited] |
Pointer to the I/O channel.