MRPT  2.0.4
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE > Class Template Reference

Detailed Description

template<typename SCHEME_CAPABLE>
class mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >

Base template class for schema-capable "archives", e.g.

JSON, YAML, from which to (de)serialize objects.

See [mrpt-serialization] for examples of use.

Note
Original version by https://github.com/rachit173 for GSoC 2018.

Definition at line 28 of file CSchemeArchive.h.

#include <mrpt/serialization/CSchemeArchive.h>

Inheritance diagram for mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >:

Public Member Functions

 CSchemeArchive ()
 Ctor that creates an own SCHEME_CAPABLE object. More...
 
 CSchemeArchive (SCHEME_CAPABLE &val)
 Ctor that uses user-providen SCHEME_CAPABLE object. More...
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const int32_t val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const uint32_t val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const int64_t val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const uint64_t val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const float val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const double val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const std::nullptr_t val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const std::string val) override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const bool val) override
 
 operator int32_t () const override
 
 operator uint32_t () const override
 
 operator int64_t () const override
 
 operator uint64_t () const override
 
 operator float () const override
 
 operator double () const override
 
 operator bool () const override
 
 operator std::string () const override
 
mrpt::serialization::CSchemeArchiveBaseoperator= (const mrpt::serialization::CSerializable &obj) override
 Writes object to archive, with synxtax out["name"] = obj; More...
 
void readTo (mrpt::serialization::CSerializable &obj) override
 Reads object from the archive. More...
 
mrpt::serialization::CSchemeArchiveBase operator[] (size_t idx) override
 
mrpt::serialization::CSchemeArchiveBase operator[] (std::string str) override
 
std::ostream & writeToStream (std::ostream &out) const override
 Writes the scheme to a plain-text output. More...
 
std::istream & readFromStream (std::istream &in) override
 Reads the scheme from a plain-text input. More...
 
void setParent (CSchemeArchiveBase *parent)
 

Protected Member Functions

void ReadObject (CSchemeArchiveBase &out, const CSerializable &obj)
 
void WriteObject (CSchemeArchiveBase &in, CSerializable &obj)
 

Protected Attributes

CSchemeArchiveBasem_parent
 

Private Attributes

std::optional< SCHEME_CAPABLE > m_own_val
 
SCHEME_CAPABLE & m_val
 

Constructor & Destructor Documentation

◆ CSchemeArchive() [1/2]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::CSchemeArchive ( )
inline

Ctor that creates an own SCHEME_CAPABLE object.

Definition at line 34 of file CSchemeArchive.h.

◆ CSchemeArchive() [2/2]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::CSchemeArchive ( SCHEME_CAPABLE &  val)
inline

Ctor that uses user-providen SCHEME_CAPABLE object.

Definition at line 36 of file CSchemeArchive.h.

Member Function Documentation

◆ operator bool()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator bool ( ) const
inlineexplicitoverridevirtual

◆ operator double()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator double ( ) const
inlineexplicitoverridevirtual

◆ operator float()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator float ( ) const
inlineexplicitoverridevirtual

◆ operator int32_t()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator int32_t ( ) const
inlineexplicitoverridevirtual

◆ operator int64_t()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator int64_t ( ) const
inlineexplicitoverridevirtual

◆ operator std::string()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator std::string ( ) const
inlineexplicitoverridevirtual

◆ operator uint32_t()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator uint32_t ( ) const
inlineexplicitoverridevirtual

◆ operator uint64_t()

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator uint64_t ( ) const
inlineexplicitoverridevirtual

◆ operator=() [1/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const int32_t  val)
inlineoverridevirtual

◆ operator=() [2/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const uint32_t  val)
inlineoverridevirtual

◆ operator=() [3/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const int64_t  val)
inlineoverridevirtual

◆ operator=() [4/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const uint64_t  val)
inlineoverridevirtual

◆ operator=() [5/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const float  val)
inlineoverridevirtual

◆ operator=() [6/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const double  val)
inlineoverridevirtual

◆ operator=() [7/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const std::nullptr_t  val)
inlineoverridevirtual

◆ operator=() [8/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const std::string  val)
inlineoverridevirtual

◆ operator=() [9/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const bool  val)
inlineoverridevirtual

◆ operator=() [10/10]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator= ( const mrpt::serialization::CSerializable )
inlineoverridevirtual

Writes object to archive, with synxtax out["name"] = obj;

Implements mrpt::serialization::CSchemeArchiveBase_impl.

Definition at line 99 of file CSchemeArchive.h.

References mrpt::serialization::CSchemeArchiveBase_impl::m_parent, and mrpt::serialization::CSchemeArchiveBase_impl::ReadObject().

Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator[] ( size_t  idx)
inlineoverridevirtual

◆ operator[]() [2/2]

template<typename SCHEME_CAPABLE >
mrpt::serialization::CSchemeArchiveBase mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator[] ( std::string  str)
inlineoverridevirtual

◆ readFromStream()

template<typename SCHEME_CAPABLE >
std::istream& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::readFromStream ( std::istream &  in)
inlineoverridevirtual

Reads the scheme from a plain-text input.

Implements mrpt::serialization::CSchemeArchiveBase_impl.

Definition at line 128 of file CSchemeArchive.h.

References mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::m_val.

◆ ReadObject()

void CSchemeArchiveBase_impl::ReadObject ( CSchemeArchiveBase out,
const CSerializable obj 
)
protectedinherited

Definition at line 8 of file CSchemeArchiveBase.cpp.

References out, and mrpt::serialization::CSchemeArchiveBase::ReadObject().

Referenced by mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readTo()

template<typename SCHEME_CAPABLE >
void mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::readTo ( mrpt::serialization::CSerializable obj)
inlineoverridevirtual

Reads object from the archive.

Implements mrpt::serialization::CSchemeArchiveBase_impl.

Definition at line 105 of file CSchemeArchive.h.

References mrpt::serialization::CSchemeArchiveBase_impl::m_parent, and mrpt::serialization::CSchemeArchiveBase_impl::WriteObject().

Here is the call graph for this function:

◆ setParent()

void mrpt::serialization::CSchemeArchiveBase_impl::setParent ( CSchemeArchiveBase parent)
inlineinherited

◆ WriteObject()

void CSchemeArchiveBase_impl::WriteObject ( CSchemeArchiveBase in,
CSerializable obj 
)
protectedinherited

Definition at line 13 of file CSchemeArchiveBase.cpp.

References mrpt::serialization::CSchemeArchiveBase::WriteObject().

Referenced by mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::readTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeToStream()

template<typename SCHEME_CAPABLE >
std::ostream& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::writeToStream ( std::ostream &  out) const
inlineoverridevirtual

Writes the scheme to a plain-text output.

Implements mrpt::serialization::CSchemeArchiveBase_impl.

Definition at line 123 of file CSchemeArchive.h.

References mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::m_val, and out.

Member Data Documentation

◆ m_own_val

template<typename SCHEME_CAPABLE >
std::optional<SCHEME_CAPABLE> mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::m_own_val
private

Definition at line 30 of file CSchemeArchive.h.

◆ m_parent

CSchemeArchiveBase* mrpt::serialization::CSchemeArchiveBase_impl::m_parent
protectedinherited

◆ m_val

template<typename SCHEME_CAPABLE >
SCHEME_CAPABLE& mrpt::serialization::CSchemeArchive< SCHEME_CAPABLE >::m_val
private



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020