Helios++
Helios software for LiDAR simulations
SerialIO Class Reference

Utils for Input/Output operations of serializable objects. More...

#include <SerialIO.h>

Collaboration diagram for SerialIO:

Public Member Functions

template<class SerialClass >
void write (std::string &path, SerialClass *object, bool fastCompression=true)
 
template<typename SerialClass >
SerialClass * read (std::string &path, bool fastCompression=true)
 

Static Public Member Functions

static SerialIOgetInstance ()
 

Private Member Functions

 SerialIO ()=default
 Singleton constructor.
 

Static Private Attributes

static SerialIOinstance = nullptr
 Pointer to singleton instance of SerialIO.
 

Detailed Description

Utils for Input/Output operations of serializable objects.

Author
Alberto M. Esmoris Pena
Version
1.0

Member Function Documentation

◆ getInstance()

SerialIO * SerialIO::getInstance ( )
static

Obtain the singleton instance of SerialIO. It will be instantiated iff no instance is available

Returns
Singleton instance of SerialIO

◆ read()

template<typename SerialClass >
SerialClass* SerialIO::read ( std::string &  path,
bool  fastCompression = true 
)

Read a serialized object and build corresponding instance from it.

Template Parameters
SerialClassSpecify the serializable type to use
Parameters
pathPath to read the serialized object from
fastCompressionSpecify if use the fast compression mode (true), which means the compression will be as fast as possible, or the best compression mode (false), which means the compression will lead to a size as small as possible at expenses of execution time.
Returns
Instance built from serialized object file

◆ write()

template<class SerialClass >
void SerialIO::write ( std::string &  path,
SerialClass *  object,
bool  fastCompression = true 
)

Serialize an object and write it to a file.

Template Parameters
SerialClassSpecify the serializable type to use
Parameters
pathPath to write the serialized object to
objectObject to be serialized and stored
fastCompressionSpecify if use the fast compression mode (true), which means the compression will be as fast as possible, or the best compression mode (false), which means the compression will lead to a size as small as possible at expenses of execution time.

The documentation for this class was generated from the following files: