Utils for Input/Output operations of serializable objects.
More...
#include <SerialIO.h>
|
template<class SerialClass > |
void | write (std::string &path, SerialClass *object, bool fastCompression=true) |
|
template<typename SerialClass > |
SerialClass * | read (std::string &path, bool fastCompression=true) |
|
|
| SerialIO ()=default |
| Singleton constructor.
|
|
Utils for Input/Output operations of serializable objects.
- Author
- Alberto M. Esmoris Pena
- Version
- 1.0
◆ getInstance()
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
-
SerialClass | Specify the serializable type to use |
- Parameters
-
path | Path to read the serialized object from |
fastCompression | Specify 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
-
SerialClass | Specify the serializable type to use |
- Parameters
-
path | Path to write the serialized object to |
object | Object to be serialized and stored |
fastCompression | Specify 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: