\
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()); \
out << *it; \
return out; \
} \
\
template <class K,class _Pr,class _Alloc> \
{ \
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
GLsizei GLsizei GLuint * obj
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
CStream & operator>>(mrpt::utils::CStream &in, std::pair< T1, T2 > &obj)
Template method to deserialize a STL pair.
GLsizei const GLchar ** string
GLenum GLsizei GLenum format
GLuint GLuint GLsizei GLenum type