Main MRPT website > C++ reference for MRPT 1.4.0
metaprogramming_serialization.h
Go to the documentation of this file.
1/* +---------------------------------------------------------------------------+
2 | Mobile Robot Programming Toolkit (MRPT) |
3 | http://www.mrpt.org/ |
4 | |
5 | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6 | See: http://www.mrpt.org/Authors - All rights reserved. |
7 | Released under BSD License. See details in http://www.mrpt.org/License |
8 +---------------------------------------------------------------------------+ */
9#pragma once
10
11namespace mrpt
12{
13 namespace utils
14 {
15 class CStream;
16
17 namespace metaprogramming
18 {
19 /** \addtogroup stlext_grp
20 * @{ */
21
22 /** An object for reading objects from a stream, intended for being used in STL algorithms. */
24 {
25 private:
27 public:
29
30 // T can be CSerializablePtr, CSerializable, or any other class implementing ">>"
31 template <typename T>
32 inline void operator()(T &obj) {
33 (*m_stream) >> obj;
34 }
35 };
36
37 /** An object for writing objects to a stream, intended for being used in STL algorithms. */
39 {
40 private:
42 public:
44
45 // T can be CSerializablePtr, CSerializable, or any other class implementing "<<"
46 template <typename T>
47 inline void operator()(const T &ptr) {
48 (*m_stream) << ptr;
49 }
50 };
51
52 /** @} */ // end of grouping
53 }
54 }
55}
56
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:39
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
An object for reading objects from a stream, intended for being used in STL algorithms.
An object for writing objects to a stream, intended for being used in STL algorithms.



Page generated by Doxygen 1.9.5 for MRPT 1.4.0 SVN: at Sun Nov 27 02:56:26 UTC 2022