Main MRPT website > C++ reference for MRPT 1.9.9
THypothesisIDSet.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, 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 
10 #include "hmtslam-precomp.h" // Precomp header
11 
12 using namespace mrpt::hmtslam;
13 using namespace mrpt::utils;
14 
16 
17 /*---------------------------------------------------------------
18  writeToStream
19  Implements the writing to a CStream capability of
20  CSerializable objects
21  ---------------------------------------------------------------*/
22 void THypothesisIDSet::writeToStream(
23  mrpt::utils::CStream& out, int* version) const
24 {
25  if (version)
26  *version = 0;
27  else
28  {
29  uint32_t N = (uint32_t)size();
30  out << N;
31  for (const_iterator it = begin(); it != end(); ++it) out << *it;
32  }
33 }
34 
35 /*---------------------------------------------------------------
36  readFromStream
37  Implements the reading from a CStream capability of
38  CSerializable objects
39  ---------------------------------------------------------------*/
41 {
42  switch (version)
43  {
44  case 0:
45  {
46  uint32_t i, N;
47  in >> N;
48 
49  clear();
50  for (i = 0; i < N; i++)
51  {
52  THypothesisID tmp;
53  in >> tmp;
54  insert(tmp);
55  }
56  }
57  break;
58  default:
60  };
61 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
Classes related to the implementation of Hybrid Metric Topological (HMT) SLAM.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
EIGEN_STRONG_INLINE iterator begin()
Definition: eigen_plugins.h:29
const Scalar * const_iterator
Definition: eigen_plugins.h:27
void clear()
Clear the contents of this container.
Definition: ts_hash_map.h:189
int64_t THypothesisID
An integer number uniquely identifying each of the concurrent hypotheses for the robot topological pa...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
A set of hypothesis IDs, used for arcs and nodes in multi-hypothesis hybrid maps. ...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
GLuint GLuint end
Definition: glext.h:3528
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLuint in
Definition: glext.h:7274
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLsizeiptr size
Definition: glext.h:3923
unsigned __int32 uint32_t
Definition: rptypes.h:47



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019