humoto
Public Member Functions | Private Attributes | List of all members
humoto::config::msgpack::Writer Class Reference

Detailed Description

Configuration writer class.

Definition at line 21 of file writer.h.

#include <writer.h>

Public Member Functions

 Writer (const std::string &file_name)
 Constructor. More...
 
 ~Writer ()
 Destructor. More...
 
void ascend ()
 Ends a nested map in the configuration file. More...
 
void descend (const std::string &map_name, const std::size_t num_entries)
 Starts a nested map in the configuration file. More...
 
void flush ()
 Flush the configuration to the file. More...
 
void initRoot ()
 Starts a nested map in the configuration file. More...
 
template<typename t_Scalar , int t_rows, int t_flags>
void writeCompound (const Eigen::Matrix< t_Scalar, t_rows, 1, t_flags > &entry, const std::string &entry_name)
 Write a configuration entry (vector) More...
 
template<typename t_Scalar , int t_rows, int t_cols, int t_flags>
void writeCompound (const Eigen::Matrix< t_Scalar, t_rows, t_cols, t_flags > &entry, const std::string &entry_name)
 Write a configuration entry (matrix) More...
 
template<typename t_VectorEntryType >
void writeCompound (const std::vector< std::vector< t_VectorEntryType > > &entry, const std::string &entry_name) const
 Write configuration entry (std::vector<std::vector<std::string>>) More...
 
template<typename t_VectorEntryType >
void writeCompound (const std::vector< t_VectorEntryType > &entry, const std::string &entry_name)
 Read configuration entry (std::vector) More...
 
template<typename t_EnumType >
void writeEnum (const t_EnumType entry, const std::string &entry_name)
 Write a configuration entry (enum) More...
 
template<typename t_EntryType >
void writeScalar (const t_EntryType entry, const std::string &entry_name)
 Write a configuration entry (scalar template) More...
 

Private Attributes

std::ofstream config_ofs_
 output file stream More...
 
::msgpack::packer< std::ofstream > * packer_
 

Constructor & Destructor Documentation

◆ Writer()

humoto::config::msgpack::Writer::Writer ( const std::string &  file_name)
inlineexplicit

Constructor.

Parameters
[in]file_name

Definition at line 36 of file writer.h.

◆ ~Writer()

humoto::config::msgpack::Writer::~Writer ( )
inline

Destructor.

Definition at line 52 of file writer.h.

Member Function Documentation

◆ ascend()

void humoto::config::msgpack::Writer::ascend ( )
inline

Ends a nested map in the configuration file.

Definition at line 83 of file writer.h.

◆ descend()

void humoto::config::msgpack::Writer::descend ( const std::string &  map_name,
const std::size_t  num_entries 
)
inline

Starts a nested map in the configuration file.

Parameters
[in]map_namename of the map
[in]num_entriesnumber of child entries

Definition at line 64 of file writer.h.

◆ flush()

void humoto::config::msgpack::Writer::flush ( )
inline

Flush the configuration to the file.

Definition at line 228 of file writer.h.

◆ initRoot()

void humoto::config::msgpack::Writer::initRoot ( )
inline

Starts a nested map in the configuration file.

Definition at line 74 of file writer.h.

◆ writeCompound() [1/4]

template<typename t_Scalar , int t_rows, int t_flags>
void humoto::config::msgpack::Writer::writeCompound ( const Eigen::Matrix< t_Scalar, t_rows, 1, t_flags > &  entry,
const std::string &  entry_name 
)
inline

Write a configuration entry (vector)

Template Parameters
t_DerivedEigen template parameter
Parameters
[in]entrydata
[in]entry_namename

Definition at line 99 of file writer.h.

◆ writeCompound() [2/4]

template<typename t_Scalar , int t_rows, int t_cols, int t_flags>
void humoto::config::msgpack::Writer::writeCompound ( const Eigen::Matrix< t_Scalar, t_rows, t_cols, t_flags > &  entry,
const std::string &  entry_name 
)
inline

Write a configuration entry (matrix)

Template Parameters
t_ScalarEigen template parameter
t_rowsEigen template parameter
t_colsEigen template parameter
t_flagsEigen template parameter
Parameters
[in]entrydata
[in]entry_namename

Definition at line 128 of file writer.h.

◆ writeCompound() [3/4]

template<typename t_VectorEntryType >
void humoto::config::msgpack::Writer::writeCompound ( const std::vector< std::vector< t_VectorEntryType > > &  entry,
const std::string &  entry_name 
) const
inline

Write configuration entry (std::vector<std::vector<std::string>>)

Template Parameters
t_VectorEntryTypetype of the entry of std::vector
Parameters
[in]entryconfiguration parameter
[in]entry_namename of the configuration parameter

Definition at line 160 of file writer.h.

◆ writeCompound() [4/4]

template<typename t_VectorEntryType >
void humoto::config::msgpack::Writer::writeCompound ( const std::vector< t_VectorEntryType > &  entry,
const std::string &  entry_name 
)
inline

Read configuration entry (std::vector)

Template Parameters
t_VectorEntryTypetype of the entry of std::vector
Parameters
[in]entrydata
[in]entry_namename

Definition at line 183 of file writer.h.

◆ writeEnum()

template<typename t_EnumType >
void humoto::config::msgpack::Writer::writeEnum ( const t_EnumType  entry,
const std::string &  entry_name 
)
inline

Write a configuration entry (enum)

Template Parameters
t_EnumTypetype of the enum
Parameters
[in]entrydata
[in]entry_namename

Definition at line 200 of file writer.h.

◆ writeScalar()

template<typename t_EntryType >
void humoto::config::msgpack::Writer::writeScalar ( const t_EntryType  entry,
const std::string &  entry_name 
)
inline

Write a configuration entry (scalar template)

Template Parameters
t_EntryTypetype of the entry
Parameters
[in]entry_namename
[in]entrydata

Definition at line 217 of file writer.h.

Member Data Documentation

◆ config_ofs_

std::ofstream humoto::config::msgpack::Writer::config_ofs_
private

output file stream

Definition at line 25 of file writer.h.

◆ packer_

::msgpack::packer< std::ofstream >* humoto::config::msgpack::Writer::packer_
private

Definition at line 27 of file writer.h.


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