Main MRPT website > C++ reference for MRPT 1.5.6
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 
15 
17 
18 
19 /*---------------------------------------------------------------
20  writeToStream
21  Implements the writing to a CStream capability of
22  CSerializable objects
23  ---------------------------------------------------------------*/
24 void THypothesisIDSet::writeToStream(mrpt::utils::CStream &out, int *version) const
25 {
26  if (version)
27  *version = 0;
28  else
29  {
30  uint32_t N = (uint32_t) size();
31  out << N;
32  for (const_iterator it=begin();it!=end();++it)
33  out << *it;
34  }
35 }
36 
37 /*---------------------------------------------------------------
38  readFromStream
39  Implements the reading from a CStream capability of
40  CSerializable objects
41  ---------------------------------------------------------------*/
43 {
44  switch(version)
45  {
46  case 0:
47  {
48  uint32_t i,N;
49  in >> N;
50 
51  clear();
52  for (i=0;i<N;i++)
53  {
54  THypothesisID tmp;
55  in >> tmp;
56  insert(tmp);
57  }
58 
59  } break;
60  default:
62 
63  };
64 
65 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
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.
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
EIGEN_STRONG_INLINE iterator begin()
Definition: eigen_plugins.h:26
const Scalar * const_iterator
Definition: eigen_plugins.h:24
void clear()
Clear the contents of this container.
Definition: ts_hash_map.h:113
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:38
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:3512
int version
Definition: mrpt_jpeglib.h:898
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLuint in
Definition: glext.h:6301
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLsizeiptr size
Definition: glext.h:3779
unsigned __int32 uint32_t
Definition: rptypes.h:49



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019