#include <mrpt/utils/CSerializable.h>#include <mrpt/utils/CStream.h>#include <mrpt/utils/metaprogramming.h>#include <set>#include <map>#include <list>#include <cctype>#include <mrpt/utils/circular_buffer.h>#include <mrpt/utils/list_searchable.h>#include <mrpt/utils/bimap.h>

Go to the source code of this file.
Classes | |
| struct | mrpt::utils::ci_less |
| A case-insensitive comparator struct for usage within STL containers, eg: map<string,string,ci_less>. More... | |
| struct | mrpt::utils::ci_less::nocase_compare |
Namespaces | |
| namespace | mrpt |
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. | |
| namespace | mrpt::utils |
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL. | |
Defines | |
| #define | MRPTSTL_SERIALIZABLE_SEQ_CONTAINER(CONTAINER) |
| #define | MRPTSTL_SERIALIZABLE_ASSOC_CONTAINER(CONTAINER) |
| Template method to serialize a sequential STL container. | |
| #define | MRPTSTL_SERIALIZABLE_SIMPLE_ASSOC_CONTAINER(CONTAINER) |
Functions | |
| mrpt::utils::MRPTSTL_SERIALIZABLE_SEQ_CONTAINER (std::vector) MRPTSTL_SERIALIZABLE_SEQ_CONTAINER(std | |
| Template method to serialize an associative STL container. | |
| template<class T1 , class T2 > | |
| CStream & | mrpt::utils::operator>> (CStream &in, std::pair< T1, T2 > &obj) |
| Template method to deserialize a STL pair. | |
| template<class T , class CONTAINER > | |
| size_t | mrpt::utils::find_in_vector (const T &value, const CONTAINER &vect) |
| Returns the index of the value "T" in the container "vect" (std::vector,std::deque,etc), or string::npos if not found. | |
| template<class CONTAINER > | |
| CONTAINER::iterator | mrpt::utils::erase_return_next (CONTAINER &cont, typename CONTAINER::iterator &it) |
| Calls the standard "erase" method of a STL container, but also returns an iterator to the next element in the container (or end if none). | |
| template<typename T > | |
| std::string | mrpt::utils::sprintf_vector (const char *fmt, const std::vector< T > &V) |
| Generates a string for a vector in the format [A,B,C,. | |
| template<typename T > | |
| void | mrpt::utils::printf_vector (const char *fmt, const std::vector< T > &V) |
| Prints a vector in the format [A,B,C,. | |
| #define MRPTSTL_SERIALIZABLE_ASSOC_CONTAINER | ( | CONTAINER | ) |
Template method to serialize a sequential STL container.
Template method to deserialize a sequential STL container
Definition at line 83 of file stl_extensions.h.
| #define MRPTSTL_SERIALIZABLE_SEQ_CONTAINER | ( | CONTAINER | ) |
\
template <class T> \
CStream& operator << (CStream& out, const CONTAINER<T> &obj) \
{ \
out << string(#CONTAINER) << TTypeName<T>::get(); \
out << static_cast<uint32_t>(obj.size()); \
for_each( obj.begin(), obj.end(), ObjectWriteToStream(&out) ); \
return out; \
} \
\
template <class T> \
CStream& operator >> (CStream& in, CONTAINER<T> &obj) \
{ \
obj.clear(); \
string pref,stored_T; \
in >> pref; \
if (pref!=#CONTAINER) THROW_EXCEPTION(format("Error: serialized container %s<%s>'s preambles is wrong: '%s'",#CONTAINER,TTypeName<T>::get().c_str(),pref.c_str() )) \
in >> stored_T; \
if (stored_T != TTypeName<T>::get() ) THROW_EXCEPTION(format("Error: serialized container %s< %s != %s >",#CONTAINER,stored_T.c_str(),TTypeName<T>::get().c_str() )) \
uint32_t n; \
in >> n; \
obj.resize(n); \
for_each( obj.begin(), obj.end(), ObjectReadFromStream(&in) ); \
return in; \
}
Definition at line 55 of file stl_extensions.h.
| #define MRPTSTL_SERIALIZABLE_SIMPLE_ASSOC_CONTAINER | ( | CONTAINER | ) |
\
template <class K> \
CStream& operator << (CStream& out, const CONTAINER<K> &obj) \
{ \
out << string(#CONTAINER) << TTypeName<K>::get(); \
out << static_cast<uint32_t>(obj.size()); \
for (typename CONTAINER<K>::const_iterator it=obj.begin();it!=obj.end();++it) \
out << *it; \
return out; \
} \
\
template <class K> \
CStream& operator >> (CStream& in, CONTAINER<K> &obj) \
{ \
obj.clear(); \
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; \
}
Referenced by mrpt::utils::MRPTSTL_SERIALIZABLE_SEQ_CONTAINER().
| Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010 |