Core Library  1.7.0.0
Library containing core utilities and tools for threading, networking, logging, INI and CSV file management etc.
core_lib::serialize Namespace Reference

The serialize namespace. More...

Namespaces

 archives
 The archives namespace.
 
 impl
 The implementation namespace.
 

Classes

struct  protobuf_iarchive
 In archive placeholder struct for serializing Google protocol buffers. More...
 
struct  protobuf_oarchive
 Out archive placeholder struct for serializing Google protocol buffers. More...
 
struct  raw_iarchive
 In archive placeholder struct for serializing POD objects. More...
 
struct  raw_oarchive
 Out archive placeholder struct for serializing POD objects. More...
 

Typedefs

using char_vector_t = std::vector< char >
 Typedef for char vector.
 

Functions

template<typename T , typename OA = archives::out_port_bin_t>
char_vector_t ToCharVector (const T &object)
 Serialize an object into a char vector. More...
 
template<typename T , typename OA = archives::out_port_bin_t>
void ToCharVector (const T &object, char_vector_t &result)
 Serialize an object into a char vector. More...
 
template<typename T , typename IA = archives::in_port_bin_t>
ToObject (const char_vector_t &charVector)
 Deserialize a char vector into a corresponding object. More...
 

Detailed Description

The serialize namespace.

Function Documentation

◆ ToCharVector() [1/2]

template<typename T , typename OA = archives::out_port_bin_t>
char_vector_t core_lib::serialize::ToCharVector ( const T &  object)

Serialize an object into a char vector.

Parameters
[in]object- A boost serializable object of type T.
Returns
A char vector to receive serialized object.

Convenience function to use for serializing objects to a char vector. Using this function is preferred to directly using ToCharVectorImpl functors.

This overload creates new memory.

◆ ToCharVector() [2/2]

template<typename T , typename OA = archives::out_port_bin_t>
void core_lib::serialize::ToCharVector ( const T &  object,
char_vector_t result 
)

Serialize an object into a char vector.

Parameters
[in]object- A boost serializable object of type T.
[out]result- A char vector to receive serialized object.

Convenience function to use for serializing objects to a char vector. Using this function is preferred to directly using ToCharVectorImpl functors.

This overload uses the memory passed in and resizes if necessary.

◆ ToObject()

template<typename T , typename IA = archives::in_port_bin_t>
T core_lib::serialize::ToObject ( const char_vector_t charVector)

Deserialize a char vector into a corresponding object.

Parameters
[in]charVector- A char vector containing a boost serialized object of type T.
Returns
A serializable object of type T to receive deserialized vector.

Convenience function to use for deserializing a char vector (containing serialized data created using ToCharVector). Using this function is preferred to directly using ToObjectImpl functors.