MeVisLab Toolbox Reference
DCMTree_Serialization Namespace Reference

Classes

class  Deserializable
 Interface which provides a method to deserialize an object. More...
 
class  DeserializerIntf
 Interface of a class, which can be used to deserialize objects without a default constructor. More...
 
class  FileSink
 Class to write DCMtree as file stream. More...
 
class  FileSource
 Class to read DCMtree file stream. More...
 
class  Serializable
 Interface which provides a method to serialize an object. More...
 
class  SerializerIntf
 Interface of a class, which can be used to serialize objects. More...
 
class  Sink
 Interface of a data sink for the serialization of objects. More...
 
class  Source
 Interface of a data source for the deserialization of objects. More...
 

Enumerations

enum  TypeCode {
  TC_BOOL , TC_SIGNED_INT , TC_UNSIGNED_INT , TC_SIGNED_SHORT ,
  TC_UNSIGNED_SHORT , TC_SIGNED_LONG , TC_UNSIGNED_LONG , TC_FLOAT ,
  TC_DOUBLE , TC_STRING , TC_PAIR , TC_VECTOR ,
  TC_MAP , TC_SET , TC_MULTIMAP , TC_ENUM ,
  TC_OTHER , TC_SIGNED_LONG_LONG , TC_UNSIGNED_LONG_LONG
}
 Used to encode type of next serialized value into the stream. More...
 

Functions

void serializeX (Sink &sink, const DCMTree::TransferSyntax &syntax)
 
void deserializeX (Source &source, DCMTree::TransferSyntax &syntax)
 
void serializeX (Sink &sink, const DCMTree::Vr &vr)
 
void deserializeX (Source &source, DCMTree::Vr &vr)
 
template<typename T >
void serializePrimitiveX (Sink &sink, T value)
 Serializes a primitive type like int, long.
 
template<typename T >
void deserializePrimitiveX (Source &source, T &value)
 Deserializes a primitive type like int, long.
 
void serializeX (Sink &sink, int value)
 Serializes an int.
 
void deserializeX (Source &source, int &value)
 Deserializes an int.
 
void serializeX (Sink &sink, unsigned int value)
 Serializes an unsigned int.
 
void deserializeX (Source &source, unsigned int &value)
 Deserializes an unsigned int.
 
void serializeX (Sink &sink, short value)
 Serializes an short.
 
void deserializeX (Source &source, short &value)
 Deserializes an short.
 
void serializeX (Sink &sink, unsigned short value)
 Serializes an unsigned short.
 
void deserializeX (Source &source, unsigned short &value)
 Deserializes an unsigned short.
 
void serializeX (Sink &sink, long value)
 Serializes an long.
 
void deserializeX (Source &source, long &value)
 Deserializes an long.
 
void serializeX (Sink &sink, unsigned long value)
 Serializes an unsigned long.
 
void deserializeX (Source &source, unsigned long &value)
 Deserializes an unsigned long.
 
void serializeX (Sink &sink, long long value)
 Serializes an long.
 
void deserializeX (Source &source, long long &value)
 Deserializes an long.
 
void serializeX (Sink &sink, unsigned long long value)
 Serializes an unsigned long.
 
void deserializeX (Source &source, unsigned long long &value)
 Deserializes an unsigned long.
 
void serializeX (Sink &sink, float value)
 Serializes an float.
 
void deserializeX (Source &source, float &value)
 Deserializes an float.
 
void serializeX (Sink &sink, const double &value)
 Serializes an double.
 
void deserializeX (Source &source, double &value)
 Deserializes an double.
 
void serializeX (Sink &sink, bool value)
 Serializes an bool .
 
void deserializeX (Source &source, bool &value)
 Deserializes an bool .
 
void serializeX (Sink &sink, const std::string &value)
 Serializes a QString.
 
void deserializeX (Source &source, std::string &value)
 Deserializes a QString.
 
template<typename T >
void serializeEnumX (Sink &sink, T value)
 Serializes an enum.
 
template<typename T >
void deserializeEnumX (Source &source, T &value)
 Deserializes an enum.
 
void serializeX (Sink &sink, const Serializable &value)
 Serializes a Serializable.
 
void deserializeX (Source &source, Deserializable &value)
 Deserializes a Deserializable.
 
template<typename T >
void serializeX (Sink &sink, boost::shared_ptr< T > value)
 Serializes boost::shared_ptr<T>.
 
template<typename T >
void deserializeIntoNewX (Source &source, boost::shared_ptr< T > &value)
 Deserializes boost::shared_ptr<T>.
 
template<typename T >
void deserializeIntoExistingX (Source &source, boost::shared_ptr< T > value)
 Deserializes boost::shared_ptr<T>.
 
template<typename T , typename U >
void serializeX (Sink &sink, const std::pair< T, U > &value)
 Serializes std::pair<T,U>.
 
template<typename T , typename U >
void deserializeX (Source &source, std::pair< T, U > &value)
 Deserializes std::pair<T,U>.
 
template<typename T , typename U >
void serializeX (Sink &sink, const std::map< T, U > &value)
 Serializes std::map<T,U>.
 
template<typename T , typename U >
void deserializeX (Source &source, std::map< T, U > &value)
 Deserializes std::map<T,U>.
 
template<typename T , typename U >
void serializeX (Sink &sink, const std::multimap< T, U > &value)
 Serializes std::multimap<T,U>.
 
template<typename T , typename U >
void deserializeX (Source &source, std::multimap< T, U > &value)
 Deserializes std::multimap<T,U>.
 
template<typename T >
void serializeX (Sink &sink, const std::set< T > &value)
 Serializes std::set<T>.
 
template<typename T >
void deserializeX (Source &source, std::set< T > &value)
 Deserializes std::set<T>.
 
template<typename T >
void serializeX (Sink &sink, const std::vector< T > &vl)
 Serializes a std::vector of serializable objects.
 
template<typename T >
void deserializeX (Source &source, std::vector< T > &vl)
 Deserializes a std::vector of deserializable objects.
 
template<typename T >
void serializeX (SerializerIntf< T > &serializer, Sink &sink, const T &value)
 Serializes an object with the help of a SerializerIntf.
 
template<typename T >
void deserializeX (DeserializerIntf< T > &deserializer, Source &source, T &value)
 Deserializes an object with the help of a DeserializerIntf.
 
template<typename T >
bool serialize (Sink &sink, const T &value)
 Adapts serializeX to return an error code instead of throwing an exception.
 
template<typename T >
bool deserialize (Source &source, T &value)
 Adapts deserializeX to return an error code instead of throwing an exception.
 

Enumeration Type Documentation

◆ TypeCode

Used to encode type of next serialized value into the stream.

This is not a very cross-compiler friendly way of doing this. It should use size specific declarations like boost uint32_t

Enumerator
TC_BOOL 

bool

TC_SIGNED_INT 

signed int

TC_UNSIGNED_INT 

unsigned int

TC_SIGNED_SHORT 

signed short

TC_UNSIGNED_SHORT 

unsigned short

TC_SIGNED_LONG 

signed long

TC_UNSIGNED_LONG 

unsigned long

TC_FLOAT 

float

TC_DOUBLE 

double

TC_STRING 

QString.

TC_PAIR 

std::pair

TC_VECTOR 

std::vector

TC_MAP 

CondVar.

TC_SET 

std::set

TC_MULTIMAP 

std::multimap

TC_ENUM 

Enum type.

TC_OTHER 

Other type.

TC_SIGNED_LONG_LONG 

signed long

TC_UNSIGNED_LONG_LONG 

unsigned long

Definition at line 36 of file DCMTree_Serialization.h.

Function Documentation

◆ deserialize()

template<typename T >
bool DCMTree_Serialization::deserialize ( Source & source,
T & value )
inline

Adapts deserializeX to return an error code instead of throwing an exception.

Definition at line 376 of file DCMTree_SerializationHelper.h.

References deserializeX().

◆ deserializeEnumX()

template<typename T >
void DCMTree_Serialization::deserializeEnumX ( Source & source,
T & value )
inline

Deserializes an enum.

Definition at line 131 of file DCMTree_SerializationHelper.h.

References deserializePrimitiveX(), mlrange_cast(), T, and TC_ENUM.

◆ deserializeIntoExistingX()

template<typename T >
void DCMTree_Serialization::deserializeIntoExistingX ( Source & source,
boost::shared_ptr< T > value )
inline

Deserializes boost::shared_ptr<T>.

T has to be deserializable type.

Parameters
valueMust not be null.

Definition at line 173 of file DCMTree_SerializationHelper.h.

References deserializeX().

◆ deserializeIntoNewX()

template<typename T >
void DCMTree_Serialization::deserializeIntoNewX ( Source & source,
boost::shared_ptr< T > & value )
inline

Deserializes boost::shared_ptr<T>.

T has to be deserializable type with a default constructor.

Parameters
valueMay be null. Is initialized with a new, default constructed object before deserialization.

Definition at line 163 of file DCMTree_SerializationHelper.h.

References deserializeX(), and T.

◆ deserializePrimitiveX()

template<typename T >
void DCMTree_Serialization::deserializePrimitiveX ( Source & source,
T & value )
inline

Deserializes a primitive type like int, long.

Definition at line 44 of file DCMTree_SerializationHelper.h.

Referenced by deserializeEnumX(), and deserializeX().

◆ deserializeX() [1/21]

template<typename T >
void DCMTree_Serialization::deserializeX ( DeserializerIntf< T > & deserializer,
Source & source,
T & value )
inline

Deserializes an object with the help of a DeserializerIntf.

Definition at line 355 of file DCMTree_SerializationHelper.h.

References mlrange_cast().

◆ deserializeX() [2/21]

void DCMTree_Serialization::deserializeX ( Source & source,
bool & value )

Deserializes an bool .

◆ deserializeX() [3/21]

◆ deserializeX() [4/21]

void DCMTree_Serialization::deserializeX ( Source & source,
DCMTree::Vr & vr )

◆ deserializeX() [5/21]

void DCMTree_Serialization::deserializeX ( Source & source,
Deserializable & value )
inline

◆ deserializeX() [6/21]

void DCMTree_Serialization::deserializeX ( Source & source,
double & value )

Deserializes an double.

◆ deserializeX() [7/21]

void DCMTree_Serialization::deserializeX ( Source & source,
float & value )

Deserializes an float.

◆ deserializeX() [8/21]

void DCMTree_Serialization::deserializeX ( Source & source,
int & value )

Deserializes an int.

◆ deserializeX() [9/21]

void DCMTree_Serialization::deserializeX ( Source & source,
long & value )

Deserializes an long.

◆ deserializeX() [10/21]

void DCMTree_Serialization::deserializeX ( Source & source,
long long & value )

Deserializes an long.

◆ deserializeX() [11/21]

void DCMTree_Serialization::deserializeX ( Source & source,
short & value )

Deserializes an short.

◆ deserializeX() [12/21]

template<typename T , typename U >
void DCMTree_Serialization::deserializeX ( Source & source,
std::map< T, U > & value )
inline

Deserializes std::map<T,U>.

T and U have to be deserializable types.

Definition at line 217 of file DCMTree_SerializationHelper.h.

References deserializeX(), mlrange_cast(), T, and TC_MAP.

◆ deserializeX() [13/21]

template<typename T , typename U >
void DCMTree_Serialization::deserializeX ( Source & source,
std::multimap< T, U > & value )
inline

Deserializes std::multimap<T,U>.

T and U have to be deserializable types.

Definition at line 253 of file DCMTree_SerializationHelper.h.

References deserializeX(), mlrange_cast(), T, TC_MULTIMAP, and U.

◆ deserializeX() [14/21]

template<typename T , typename U >
void DCMTree_Serialization::deserializeX ( Source & source,
std::pair< T, U > & value )
inline

Deserializes std::pair<T,U>.

T and U have to be deserializable types.

Definition at line 189 of file DCMTree_SerializationHelper.h.

References deserializeX(), and TC_PAIR.

◆ deserializeX() [15/21]

template<typename T >
void DCMTree_Serialization::deserializeX ( Source & source,
std::set< T > & value )
inline

Deserializes std::set<T>.

T has to be deserializable type.

Definition at line 290 of file DCMTree_SerializationHelper.h.

References deserializeX(), mlrange_cast(), T, and TC_SET.

◆ deserializeX() [16/21]

void DCMTree_Serialization::deserializeX ( Source & source,
std::string & value )

Deserializes a QString.

◆ deserializeX() [17/21]

template<typename T >
void DCMTree_Serialization::deserializeX ( Source & source,
std::vector< T > & vl )
inline

Deserializes a std::vector of deserializable objects.

Definition at line 327 of file DCMTree_SerializationHelper.h.

References deserializePrimitiveX(), deserializeX(), mlrange_cast(), and TC_VECTOR.

◆ deserializeX() [18/21]

void DCMTree_Serialization::deserializeX ( Source & source,
unsigned int & value )

Deserializes an unsigned int.

◆ deserializeX() [19/21]

void DCMTree_Serialization::deserializeX ( Source & source,
unsigned long & value )

Deserializes an unsigned long.

◆ deserializeX() [20/21]

void DCMTree_Serialization::deserializeX ( Source & source,
unsigned long long & value )

Deserializes an unsigned long.

◆ deserializeX() [21/21]

void DCMTree_Serialization::deserializeX ( Source & source,
unsigned short & value )

Deserializes an unsigned short.

◆ serialize()

template<typename T >
bool DCMTree_Serialization::serialize ( Sink & sink,
const T & value )
inline

Adapts serializeX to return an error code instead of throwing an exception.

Definition at line 362 of file DCMTree_SerializationHelper.h.

References serializeX().

◆ serializeEnumX()

template<typename T >
void DCMTree_Serialization::serializeEnumX ( Sink & sink,
T value )
inline

Serializes an enum.

Definition at line 123 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), serializePrimitiveX(), and TC_ENUM.

◆ serializePrimitiveX()

template<typename T >
void DCMTree_Serialization::serializePrimitiveX ( Sink & sink,
T value )
inline

Serializes a primitive type like int, long.

Definition at line 37 of file DCMTree_SerializationHelper.h.

References mlrange_cast().

Referenced by serializeEnumX(), and serializeX().

◆ serializeX() [1/22]

template<typename T >
void DCMTree_Serialization::serializeX ( SerializerIntf< T > & serializer,
Sink & sink,
const T & value )
inline

Serializes an object with the help of a SerializerIntf.

Definition at line 348 of file DCMTree_SerializationHelper.h.

References mlrange_cast().

◆ serializeX() [2/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
bool value )

Serializes an bool .

◆ serializeX() [3/22]

template<typename T >
void DCMTree_Serialization::serializeX ( Sink & sink,
boost::shared_ptr< T > value )
inline

Serializes boost::shared_ptr<T>.

T has to be a serializable type.

Definition at line 153 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), and serializeX().

◆ serializeX() [4/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
const DCMTree::TransferSyntax & syntax )

◆ serializeX() [5/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
const DCMTree::Vr & vr )

◆ serializeX() [6/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
const double & value )

Serializes an double.

◆ serializeX() [7/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
const Serializable & value )
inline

◆ serializeX() [8/22]

template<typename T , typename U >
void DCMTree_Serialization::serializeX ( Sink & sink,
const std::map< T, U > & value )
inline

Serializes std::map<T,U>.

T and U have to be serializable types.

Definition at line 198 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), serializeX(), and TC_MAP.

◆ serializeX() [9/22]

template<typename T , typename U >
void DCMTree_Serialization::serializeX ( Sink & sink,
const std::multimap< T, U > & value )
inline

Serializes std::multimap<T,U>.

T and U have to be serializable types.

Definition at line 234 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), serializeX(), and TC_MULTIMAP.

◆ serializeX() [10/22]

template<typename T , typename U >
void DCMTree_Serialization::serializeX ( Sink & sink,
const std::pair< T, U > & value )
inline

Serializes std::pair<T,U>.

T and U have to be serializable types.

Definition at line 180 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), serializeX(), and TC_PAIR.

◆ serializeX() [11/22]

template<typename T >
void DCMTree_Serialization::serializeX ( Sink & sink,
const std::set< T > & value )
inline

Serializes std::set<T>.

T has to be serializable type.

Definition at line 272 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), serializeX(), and TC_SET.

◆ serializeX() [12/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
const std::string & value )

Serializes a QString.

◆ serializeX() [13/22]

template<typename T >
void DCMTree_Serialization::serializeX ( Sink & sink,
const std::vector< T > & vl )
inline

Serializes a std::vector of serializable objects.

Definition at line 307 of file DCMTree_SerializationHelper.h.

References mlrange_cast(), serializePrimitiveX(), serializeX(), and TC_VECTOR.

◆ serializeX() [14/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
float value )

Serializes an float.

◆ serializeX() [15/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
int value )

Serializes an int.

◆ serializeX() [16/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
long long value )

Serializes an long.

◆ serializeX() [17/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
long value )

Serializes an long.

◆ serializeX() [18/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
short value )

Serializes an short.

◆ serializeX() [19/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
unsigned int value )

Serializes an unsigned int.

◆ serializeX() [20/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
unsigned long long value )

Serializes an unsigned long.

◆ serializeX() [21/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
unsigned long value )

Serializes an unsigned long.

◆ serializeX() [22/22]

void DCMTree_Serialization::serializeX ( Sink & sink,
unsigned short value )

Serializes an unsigned short.