RobWorkProject
23.9.11-
|
archive for loading and saving serializable classes to an ini-file format. More...
#include <INIArchive.hpp>
Inherits InputArchive, and OutputArchive.
Public Member Functions | |
INIArchive () | |
constructor | |
INIArchive (const std::string &filename) | |
INIArchive (std::ostream &ofs) | |
virtual | ~INIArchive () |
destructor | |
void | close () |
close this archive for streaming | |
bool | isOpen () |
test if this archive is openned for manipulation. If this is false then no storage will be performed. More... | |
void | flush () |
flush the archive. Anything stored in buffers will be flushed to the actual media that has been openned. More... | |
Public Member Functions inherited from InputArchive | |
InputArchive () | |
constructor | |
void | readEnterScope (const std::string &id, const std::string &idDefault="") |
enter specific scope with id when reading. More... | |
void | readLeaveScope (const std::string &id, const std::string &idDefault="") |
leave specific scope with id when reading. More... | |
bool | readBool (const std::string &id) |
read boolean | |
int | readInt (const std::string &id) |
read integer | |
unsigned int | readUInt (const std::string &id) |
read unsigned integer | |
int8_t | readInt8 (const std::string &id) |
read 8 bit integer | |
uint8_t | readUInt8 (const std::string &id) |
read 8 bit unsigned integer | |
int64_t | readInt64 (const std::string &id) |
read 64 bit integer | |
uint64_t | readUInt64 (const std::string &id) |
read 64 bit unsigned integer | |
double | readDouble (const std::string &id) |
read double floating point | |
std::string | readString (const std::string &id) |
read string | |
template<class T > | |
void | read (T &object, const std::string &id) |
Read object with identifier id from archive. More... | |
template<class T > | |
void | read (T &object, const std::string &id, const std::string &idDefault) |
Read object with identifier id from archive. More... | |
template<class T > | |
InputArchive & | operator>> (T &dst) |
Stream operator for streaming from archive to object. More... | |
Public Member Functions inherited from Archive | |
virtual | ~Archive () |
destructor | |
void | open (const std::string &filename) |
open file for reading and writing More... | |
void | open (std::iostream &stream) |
initialize archive for reading and/or writing to a stream More... | |
void | open (std::ostream &ofs) |
open an output stream for writing | |
void | open (std::istream &ifs) |
open an inputstream for reading | |
Public Member Functions inherited from OutputArchive | |
virtual | ~OutputArchive () |
destructor | |
void | writeEnterScope (const std::string &id, const std::string &idDefault="") |
create a serialized scope in which objects can be written More... | |
void | writeLeaveScope (const std::string &id, const std::string &idDefault="") |
leave the current scope More... | |
template<class T > | |
void | write (const T &object, const std::string &id) |
generic write method. This method will write any objects that are either derived from the rw::common::Serializable class or where overloaded read() write() methods exists. More... | |
template<class T > | |
void | write (const T &object, const std::string &id, const std::string &id_default) |
Same as write(object,id) however an additional parameter is given which is the default identifier to use in case id is empty. More... | |
template<class T > | |
OutputArchive & | operator<< (T &dst) |
Output stream operator. | |
Protected Member Functions | |
void | doWriteEnterScope (const std::string &id) |
Enter a scope. More... | |
void | doWriteLeaveScope (const std::string &id) |
Leave a scope. More... | |
void | doReadEnterScope (const std::string &id) |
Enter a scope. More... | |
void | doReadLeaveScope (const std::string &id) |
Leave a scope. More... | |
void | doOpenArchive (const std::string &filename) |
open file for reading and writing More... | |
void | doOpenArchive (std::iostream &stream) |
initialize archive for reading and/or writing to a stream More... | |
void | doOpenOutput (std::ostream &ofs) |
open an output stream for writing More... | |
void | doOpenInput (std::istream &ifs) |
open an inputstream for reading More... | |
virtual void | doWrite (bool val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (int8_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (uint8_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (int16_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (uint16_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (int32_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (uint32_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (int64_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (uint64_t val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (float val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (double val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (const std::string &val, const std::string &id) |
Write value val to archive with identifier id. More... | |
void | doWrite (const std::vector< bool > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< int8_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< uint8_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< int16_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< uint16_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< int32_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< uint32_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< int64_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< uint64_t > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< float > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< double > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const std::vector< std::string > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
void | doWrite (const Eigen::MatrixXd &val, const std::string &id) |
Write an Eigen matrix to output. More... | |
void | doWrite (const Eigen::VectorXd &val, const std::string &id) |
Write an Eigen vector to output. More... | |
template<class T > | |
void | writeValue (const std::vector< T > &val, const std::string &id) |
Write vector val to archive with identifier id. More... | |
template<class T > | |
void | writeValue (const T &val, const std::string &id) |
Write value val to archive with identifier id. More... | |
template<class Derived > | |
void | writeMatrix (const Eigen::DenseCoeffsBase< Derived, Eigen::ReadOnlyAccessors > &val, const std::string &id) |
Write a generic Eigen matrix to output. More... | |
std::pair< std::string, std::string > | getNameValue () |
Split a line in a name and a value. More... | |
virtual void | doRead (bool &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (int8_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (uint8_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (int16_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (uint16_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (int32_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (uint32_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (int64_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (uint64_t &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (float &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (double &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (std::string &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
virtual void | doRead (std::vector< bool > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< int8_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< uint8_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< int16_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< uint16_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< int32_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< uint32_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< int64_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< uint64_t > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< float > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< double > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (std::vector< std::string > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
virtual void | doRead (Eigen::MatrixXd &val, const std::string &id) |
Read an Eigen matrix from input. More... | |
virtual void | doRead (Eigen::VectorXd &val, const std::string &id) |
Read an Eigen vector from input. More... | |
template<class T > | |
void | readValue (std::vector< T > &val, const std::string &id) |
Read vector val with identifier id from archive. More... | |
template<class T > | |
void | readValue (T &val, const std::string &id) |
Read value val with identifier id from archive. More... | |
template<class Derived > | |
void | readMatrix (Eigen::PlainObjectBase< Derived > &val, const std::string &id) |
Read a generic Eigen matrix. More... | |
bool | getLine () |
Read one line from input. More... | |
Protected Member Functions inherited from InputArchive | |
template<class T > | |
void | doRead (T &object, const std::string &id) |
Read object with identifier id from archive. More... | |
Protected Member Functions inherited from OutputArchive | |
template<class T > | |
void | doWrite (const T &object, const std::string &id) |
handles serialization of an object. The object must either be a primitive type, inherit from Serializable or there must exist an overloaded method rw::common::serialization::write(const T& data, class OutputArchive& oarchive, const std::string& id) More... | |
Static Protected Attributes | |
static const int | MAX_LINE_WIDTH = 1000 |
Maximum number of characters in one line. | |
archive for loading and saving serializable classes to an ini-file format.
|
protectedvirtual |
|
protectedvirtual |
initialize archive for reading and/or writing to a stream
stream | [in] the stream |
Implements Archive.
|
protectedvirtual |
open an inputstream for reading
Implements Archive.
|
protectedvirtual |
open an output stream for writing
Implements Archive.
|
protectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read an Eigen matrix from input.
val | [out] the result. |
id | [in] identifier for the matrix. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read an Eigen vector from input.
val | [out] the result. |
id | [in] identifier for the matrix. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
protectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
protectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
protectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
inlineprotectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
protectedvirtual |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
Implements InputArchive.
|
protectedvirtual |
|
protectedvirtual |
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write an Eigen matrix to output.
val | [in] the matrix to output. |
id | [in] identifier for the matrix. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write an Eigen vector to output.
val | [in] the vector to output. |
id | [in] identifier for the matrix. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
protectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
inlineprotectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
protectedvirtual |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |
Implements OutputArchive.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
flush the archive. Anything stored in buffers will be flushed to the actual media that has been openned.
Implements Archive.
|
protected |
Read one line from input.
Line length is maximum MAX_LINE_WIDTH.
|
inlineprotected |
Split a line in a name and a value.
|
inlinevirtual |
|
inlineprotected |
Read a generic Eigen matrix.
val | [out] the result. |
id | [in] identifier for the matrix - gives a warning if it does not match the id in the file. |
|
inlineprotected |
Read vector val with identifier id from archive.
val | [out] the vector from archive. |
id | [in] the identifier. |
|
inlineprotected |
Read value val with identifier id from archive.
val | [out] the value from archive. |
id | [in] the identifier. |
|
inlineprotected |
Write a generic Eigen matrix to output.
val | [in] the matrix to output. |
id | [in] identifier for the matrix. |
|
inlineprotected |
Write vector val to archive with identifier id.
val | [in] vector to write. |
id | [in] identifier for the vector. |
|
inlineprotected |
Write value val to archive with identifier id.
val | [in] value to write. |
id | [in] identifier for the value. |