CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
CNORXZ::cer Namespace Reference

Classes

struct  Header
 
struct  InputFormatMap
 
struct  InputFormatMap< Format::BINARY >
 
struct  InputFormatMap< Format::JSON >
 
struct  InputFormatMap< Format::XML >
 
struct  OutputFormatMap
 
struct  OutputFormatMap< Format::BINARY >
 
struct  OutputFormatMap< Format::JSON >
 
struct  OutputFormatMap< Format::XML >
 

Enumerations

enum class  Format { BINARY = 1u , JSON = 2u , XML = 3u }
 
enum class  ContentType { ARRAY = 1u , MAP = 2u }
 

Functions

template<class Archive >
void save (Archive &ar, const Header &h, const std::uint32_t version)
 
template<class Archive >
void load (Archive &ar, Header &h, const std::uint32_t version)
 
Header mkHeader (const ContentType content)
 
template<class Archive >
RangePtr save_load (Archive &ar, const String &name, RangePtr &r)
 
template<Format F, typename T >
void write (std::ostream &os, const MArray< T > &data)
 
template<Format F, typename T >
void read (std::istream &is, MArray< T > &data)
 
template<Format F, typename T >
void writeFile (const String &name, const MArray< T > &data)
 
template<Format F, typename T >
void readFile (const String &name, MArray< T > &data)
 
template<typename T >
void writeBINARYFile (const String &name, const MArray< T > &data)
 
template<typename T >
void readBINARYFile (const String &name, MArray< T > &data)
 
template<typename T >
void writeJSONFile (const String &name, const MArray< T > &data)
 
template<typename T >
void readJSONFile (const String &name, MArray< T > &data)
 
template<typename T >
void writeXMLFile (const String &name, const MArray< T > &data)
 
template<typename T >
void readXMLFile (const String &name, MArray< T > &data)
 

Enumeration Type Documentation

◆ ContentType


Content type enum class.

Enumerator
ARRAY 
MAP 

Definition at line 33 of file cer_base.h.

◆ Format


Archive format enum class.

Enumerator
BINARY 
JSON 
XML 

Definition at line 24 of file cer_base.h.

Function Documentation

◆ load()

template<class Archive >
void CNORXZ::cer::load ( Archive & ar,
Header & h,
const std::uint32_t version )

Deserialze header from archive.

Parameters
arSource archive.
hTarget header reference.
versionVersion.

Definition at line 31 of file cer_header.cc.h.

◆ mkHeader()

Header CNORXZ::cer::mkHeader ( const ContentType content)
inline

Create header.

Parameters
contentContent type.

Definition at line 35 of file cer_header.h.

◆ read()

template<Format F, typename T >
void CNORXZ::cer::read ( std::istream & is,
MArray< T > & data )

Deserialize MArray from stream

Template Parameters
FFormat enum class [BINARY,JSON,XML].
TArray element value type.
Parameters
isInput stream.
dataTarget array.

Definition at line 36 of file utilities.cc.h.

◆ readBINARYFile()

template<typename T >
void CNORXZ::cer::readBINARYFile ( const String & name,
MArray< T > & data )
inline

Read and deserialize MArray from cereal compatibel binary file.

Template Parameters
TArray element value type.
Parameters
nameFile name.
datatarget array.

Definition at line 124 of file utilities.h.

◆ readFile()

template<Format F, typename T >
void CNORXZ::cer::readFile ( const String & name,
MArray< T > & data )

Read and deserialize MArray from cereal compatibel file.

Template Parameters
FFormat enum class [BINARY,JSON,XML].
TArray element value type.
Parameters
nameFile name.
datatarget array.

Definition at line 60 of file utilities.cc.h.

◆ readJSONFile()

template<typename T >
void CNORXZ::cer::readJSONFile ( const String & name,
MArray< T > & data )
inline

Read and deserialize MArray from cereal compatibel json file.

Template Parameters
TArray element value type.
Parameters
nameFile name.
datatarget array.

Definition at line 142 of file utilities.h.

◆ readXMLFile()

template<typename T >
void CNORXZ::cer::readXMLFile ( const String & name,
MArray< T > & data )
inline

Read and deserialize MArray from cereal compatibel xml file.

Template Parameters
TArray element value type.
Parameters
nameFile name.
datatarget array.

Definition at line 160 of file utilities.h.

◆ save()

template<class Archive >
void CNORXZ::cer::save ( Archive & ar,
const Header & h,
const std::uint32_t version )

Serialze header, store in archive.

Parameters
arTarget archive.
hInput header.
versionVersion.

Definition at line 22 of file cer_header.cc.h.

◆ save_load()

template<class Archive >
RangePtr CNORXZ::cer::save_load ( Archive & ar,
const String & name,
RangePtr & r )

Deserialize and register range from cereal archive. Always use this function to load ranges from archives so that it is registered in the map of the range factories. Otherwise there might be more than one instance of the same range.

Parameters
arArchive to read from.
nameArchive key.
rTarget range pointer.

Definition at line 24 of file range_save_load.cc.h.

◆ write()

template<Format F, typename T >
void CNORXZ::cer::write ( std::ostream & os,
const MArray< T > & data )

Serialize MArray to stream

Template Parameters
FFormat enum class [BINARY,JSON,XML].
TArray element value type.
Parameters
osOutput stream.
dataArray to be serialized.

Definition at line 25 of file utilities.cc.h.

◆ writeBINARYFile()

template<typename T >
void CNORXZ::cer::writeBINARYFile ( const String & name,
const MArray< T > & data )
inline

Serialize MArray and write to binary file.

Template Parameters
TArray element value type.
Parameters
nameFile name.
dataArray to be saved.

Definition at line 115 of file utilities.h.

◆ writeFile()

template<Format F, typename T >
void CNORXZ::cer::writeFile ( const String & name,
const MArray< T > & data )

Serialize MArray and write to file.

Template Parameters
FFormat enum class [BINARY,JSON,XML].
TArray element value type.
Parameters
nameFile name.
dataArray to be saved.

Definition at line 50 of file utilities.cc.h.

◆ writeJSONFile()

template<typename T >
void CNORXZ::cer::writeJSONFile ( const String & name,
const MArray< T > & data )
inline

Serialize MArray and write to json file.

Template Parameters
TArray element value type.
Parameters
nameFile name.
dataArray to be saved.

Definition at line 133 of file utilities.h.

◆ writeXMLFile()

template<typename T >
void CNORXZ::cer::writeXMLFile ( const String & name,
const MArray< T > & data )
inline

Serialize MArray and write to xml file.

Template Parameters
TArray element value type.
Parameters
nameFile name.
dataArray to be saved.

Definition at line 151 of file utilities.h.