MRPT  2.0.1
Classes | Namespaces | Macros | Typedefs | Functions
CArchive.h File Reference
#include <mrpt/config.h>
#include <mrpt/core/Clock.h>
#include <mrpt/core/is_shared_ptr.h>
#include <mrpt/core/reverse_bytes.h>
#include <mrpt/serialization/CSerializable.h>
#include <mrpt/typemeta/TTypeName.h>
#include <cstdint>
#include <cstring>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <variant>
#include <vector>
Include dependency graph for CArchive.h:

Go to the source code of this file.

Classes

class  mrpt::serialization::CExceptionEOF
 Used in mrpt::serialization::CArchive. More...
 
class  mrpt::serialization::CArchive
 Virtual base class for "archives": classes abstracting I/O streams. More...
 
class  mrpt::serialization::CArchiveStreamBase< STREAM >
 CArchive for mrpt::io::CStream classes (use as template argument). More...
 
struct  mrpt::rtti::CLASS_ID_impl< std::monostate >
 

Namespaces

 mrpt::serialization
 
 mrpt::rtti
 

Macros

#define MRPT_READ_POD(_STREAM, _VARIABLE)
 

Typedefs

template<class T , class... Ts>
using mrpt::serialization::is_any = std::disjunction< std::is_same< T, Ts >... >
 
template<typename T >
using mrpt::serialization::is_simple_type = is_any< T, bool, uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double >
 

Functions

template<typename T , std::enable_if_t< is_simple_type< T >::value, int > = 0>
CArchive & mrpt::serialization::operator<< (CArchive &out, const T &obj)
 Template method to serialize an associative STL container. More...
 
template<typename T , std::enable_if_t< is_simple_type< T >::value, int > = 0>
CArchive & mrpt::serialization::operator>> (CArchive &in, T &obj)
 Template method to deserialize an associative STL container. More...
 
CArchivemrpt::serialization::operator<< (CArchive &out, const mrpt::Clock::time_point &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, mrpt::Clock::time_point &a)
 
CArchivemrpt::serialization::operator<< (CArchive &s, const std::string &str)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< int32_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< uint32_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< uint16_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< int16_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< int64_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< uint8_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< int8_t > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< bool > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< std::string > &)
 
CArchivemrpt::serialization::operator<< (CArchive &, const std::vector< size_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::string &str)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< int32_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< uint32_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< uint16_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< int16_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< int64_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< uint8_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< int8_t > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< bool > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &in, std::vector< std::string > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &s, std::vector< float > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &s, std::vector< double > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &s, const std::vector< float > &a)
 
CArchivemrpt::serialization::operator<< (CArchive &s, const std::vector< double > &a)
 
CArchivemrpt::serialization::operator>> (CArchive &s, std::vector< size_t > &a)
 
template<typename T , std::enable_if_t< std::is_base_of_v< mrpt::serialization::CSerializable, T >> * = nullptr>
CArchive & mrpt::serialization::operator>> (CArchive &in, std::shared_ptr< T > &pObj)
 Read a smart pointer to a non-CSerializable (POD,...) data type. More...
 
template<typename... T>
CArchive & mrpt::serialization::operator>> (CArchive &in, typename std::variant< T... > &pObj)
 
template<typename... T>
CArchive & mrpt::serialization::operator<< (CArchive &out, const typename std::variant< T... > &pObj)
 
template<class T , std::enable_if_t<!std::is_base_of_v< mrpt::serialization::CSerializable, T >> * = nullptr>
CArchive & mrpt::serialization::operator<< (CArchive &out, const std::shared_ptr< T > &pObj)
 Write a shared_ptr to a non-CSerializable object. More...
 
template<class STREAM >
CArchiveStreamBase< STREAM > mrpt::serialization::archiveFrom (STREAM &s)
 Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream. More...
 
template<class STREAM >
CArchive::Ptr mrpt::serialization::archivePtrFrom (STREAM &s)
 Like archiveFrom(), returning a shared_ptr<>. More...
 
template<class STREAM >
CArchive::UniquePtr mrpt::serialization::archiveUniquePtrFrom (STREAM &s)
 Like archiveFrom(), returning a unique_ptr<>. More...
 

Macro Definition Documentation

◆ MRPT_READ_POD

#define MRPT_READ_POD (   _STREAM,
  _VARIABLE 
)
Value:
do \
{ \
const std::remove_cv_t<std::remove_reference_t<decltype(_VARIABLE)>> \
val = _STREAM.ReadPOD<std::remove_cv_t< \
std::remove_reference_t<decltype(_VARIABLE)>>>(); \
std::memcpy(&_VARIABLE, &val, sizeof(val)); \
} while (0)
int val
Definition: mrpt_jpeglib.h:957
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".

Definition at line 445 of file CArchive.h.

Referenced by mrpt::obs::CObservationGPS::serializeFrom().




Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020