Main MRPT website > C++ reference for MRPT 1.5.6
Namespaces | Macros | Functions
stl_serialization.h File Reference
#include <mrpt/utils/TTypeName_impl.h>
#include <mrpt/utils/metaprogramming_serialization.h>
#include <mrpt/utils/CStream.h>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <algorithm>
Include dependency graph for stl_serialization.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.




 Template method to serialize a STL pair. More...
template<class T1 , class T2 >
CStream & mrpt::utils::operator>> (mrpt::utils::CStream &in, std::pair< T1, T2 > &obj)
 Template method to deserialize a STL pair. More...

Macro Definition Documentation

/** Template method to serialize an associative STL container */ \
template <class K,class _Pr,class _Alloc> \
CStream& operator << (mrpt::utils::CStream& out, const CONTAINER<K,_Pr,_Alloc> &obj) \
{ \
out << std::string(#CONTAINER) << TTypeName<K>::get(); \
out << static_cast<uint32_t>(obj.size()); \
for (typename CONTAINER<K,_Pr,_Alloc>::const_iterator it=obj.begin();it!=obj.end();++it) \
out << *it; \
return out; \
} \
/** Template method to deserialize an associative STL container */ \
template <class K,class _Pr,class _Alloc> \
CStream& operator >> (mrpt::utils::CStream& in, CONTAINER<K,_Pr,_Alloc> &obj) \
{ \
obj.clear(); \
std::string pref,stored_K; \
in >> pref; \
if (pref!=#CONTAINER) THROW_EXCEPTION(format("Error: serialized container %s<%s>'s preamble is wrong: '%s'",#CONTAINER, TTypeName<K>::get().c_str(),pref.c_str())) \
in >> stored_K; \
if (stored_K != TTypeName<K>::get()) THROW_EXCEPTION(format("Error: serialized container %s key type %s != %s",#CONTAINER,stored_K.c_str(), TTypeName<K>::get().c_str())) \
uint32_t n; \
in >> n; \
for (uint32_t i=0;i<n;i++) \
{ \
K key_obj; \
in >> key_obj; \
obj.insert(key_obj); \
} \
return in; \
#define THROW_EXCEPTION(msg)
const Scalar * const_iterator
Definition: eigen_plugins.h:24
GLuint in
Definition: glew.h:7146
GLdouble s
Definition: glew.h:1295
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1168
GLhandleARB obj
Definition: glew.h:3276
CStream & operator>>(mrpt::utils::CStream &in, std::pair< T1, T2 > &obj)
Template method to deserialize a STL pair.
GLsizei const GLcharARB ** string
Definition: glew.h:3293

Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018