RobWorkProject
Public Member Functions | Protected Member Functions | List of all members
InputArchive Class Referenceabstract

an archive interface for reading from a serialized class. More...

#include <InputArchive.hpp>

Inherits Archive.

Inherited by BINArchive, and INIArchive.

Public Member Functions

 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
 
boost::int8_t readInt8 (const std::string &id)
 read 8 bit integer
 
boost::uint8_t readUInt8 (const std::string &id)
 read 8 bit unsigned integer
 
boost::int64_t readInt64 (const std::string &id)
 read 64 bit integer
 
boost::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 >
InputArchiveoperator>> (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
 
virtual bool isOpen ()=0
 test if this archive is openned for manipulation. If this is false then no storage will be performed. More...
 
virtual void close ()=0
 close the archive.
 
virtual void flush ()=0
 flush the archive. Anything stored in buffers will be flushed to the actual media that has been openned.
 

Protected Member Functions

template<class T >
void doRead (T &object, const std::string &id)
 Read object with identifier id from archive. More...
 
virtual void doRead (bool &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::int8_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::uint8_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::int16_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::uint16_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::int32_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::uint32_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::int64_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (boost::uint64_t &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (float &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (double &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (std::string &val, const std::string &id)=0
 Read value val with identifier id from archive. More...
 
virtual void doRead (std::vector< bool > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::int8_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::uint8_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::int16_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::uint16_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::int32_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::uint32_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::int64_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< boost::uint64_t > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< float > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< double > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (std::vector< std::string > &val, const std::string &id)=0
 Read vector val with identifier id from archive. More...
 
virtual void doRead (Eigen::MatrixXd &val, const std::string &id)=0
 Read an Eigen matrix from input. More...
 
virtual void doRead (Eigen::VectorXd &val, const std::string &id)=0
 Read an Eigen vector from input. More...
 
virtual void doReadEnterScope (const std::string &id)=0
 Enter a scope. More...
 
virtual void doReadLeaveScope (const std::string &id)=0
 Leave a scope. More...
 
- Protected Member Functions inherited from Archive
virtual void doOpenArchive (const std::string &filename)=0
 open file for reading and writing More...
 
virtual void doOpenArchive (std::iostream &stream)=0
 initialize archive for reading and/or writing to a stream More...
 
virtual void doOpenInput (std::istream &ifs)=0
 open an inputstream for reading More...
 
virtual void doOpenOutput (std::ostream &ofs)=0
 open an output stream for writing More...
 

Detailed Description

an archive interface for reading from a serialized class.

Member Function Documentation

◆ doRead() [1/27]

void doRead ( T &  object,
const std::string &  id 
)
inlineprotected

Read object with identifier id from archive.

Parameters
object[out] the object from archive.
id[in] the identifier.

◆ doRead() [2/27]

virtual void doRead ( bool &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [3/27]

virtual void doRead ( boost::int8_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [4/27]

virtual void doRead ( boost::uint8_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [5/27]

virtual void doRead ( boost::int16_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [6/27]

virtual void doRead ( boost::uint16_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [7/27]

virtual void doRead ( boost::int32_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [8/27]

virtual void doRead ( boost::uint32_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [9/27]

virtual void doRead ( boost::int64_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [10/27]

virtual void doRead ( boost::uint64_t &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [11/27]

virtual void doRead ( float &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [12/27]

virtual void doRead ( double &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [13/27]

virtual void doRead ( std::string &  val,
const std::string &  id 
)
protectedpure virtual

Read value val with identifier id from archive.

Parameters
val[out] the value from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [14/27]

virtual void doRead ( std::vector< bool > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [15/27]

virtual void doRead ( std::vector< boost::int8_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [16/27]

virtual void doRead ( std::vector< boost::uint8_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [17/27]

virtual void doRead ( std::vector< boost::int16_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [18/27]

virtual void doRead ( std::vector< boost::uint16_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [19/27]

virtual void doRead ( std::vector< boost::int32_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [20/27]

virtual void doRead ( std::vector< boost::uint32_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [21/27]

virtual void doRead ( std::vector< boost::int64_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [22/27]

virtual void doRead ( std::vector< boost::uint64_t > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [23/27]

virtual void doRead ( std::vector< float > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [24/27]

virtual void doRead ( std::vector< double > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [25/27]

virtual void doRead ( std::vector< std::string > &  val,
const std::string &  id 
)
protectedpure virtual

Read vector val with identifier id from archive.

Parameters
val[out] the vector from archive.
id[in] the identifier.

Implemented in INIArchive, and BINArchive.

◆ doRead() [26/27]

virtual void doRead ( Eigen::MatrixXd &  val,
const std::string &  id 
)
protectedpure virtual

Read an Eigen matrix from input.

Parameters
val[out] the result.
id[in] identifier for the matrix.

Implemented in INIArchive, and BINArchive.

◆ doRead() [27/27]

virtual void doRead ( Eigen::VectorXd &  val,
const std::string &  id 
)
protectedpure virtual

Read an Eigen vector from input.

Parameters
val[out] the result.
id[in] identifier for the matrix.

Implemented in INIArchive, and BINArchive.

◆ doReadEnterScope()

virtual void doReadEnterScope ( const std::string &  id)
protectedpure virtual

Enter a scope.

Parameters
id[in] identifier for the scope.

Implemented in INIArchive, and BINArchive.

◆ doReadLeaveScope()

virtual void doReadLeaveScope ( const std::string &  id)
protectedpure virtual

Leave a scope.

Parameters
id[in] identifier for the scope.

Implemented in INIArchive, and BINArchive.

◆ operator>>()

InputArchive& operator>> ( T &  dst)
inline

Stream operator for streaming from archive to object.

Parameters
dst[out] the object from archive.
Returns
a reference to the archive for chaining.

◆ read() [1/2]

void read ( T &  object,
const std::string &  id 
)
inline

Read object with identifier id from archive.

Parameters
object[out] the object from archive.
id[in] the identifier.

◆ read() [2/2]

void read ( T &  object,
const std::string &  id,
const std::string &  idDefault 
)
inline

Read object with identifier id from archive.

Parameters
object[out] the object from archive.
id[in] the identifier.
idDefault[in] (optional) default identifier used if id is an empty string.

◆ readEnterScope()

void readEnterScope ( const std::string &  id,
const std::string &  idDefault = "" 
)
inline

enter specific scope with id when reading.

Parameters
id[in] id of the scope to enter
idDefault[in] the default scope id

◆ readLeaveScope()

void readLeaveScope ( const std::string &  id,
const std::string &  idDefault = "" 
)
inline

leave specific scope with id when reading.

Parameters
id[in] id of the scope to leave
idDefault[in] the default scope id

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