Main MRPT website > C++ reference for MRPT 1.5.9
CObservationComment.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 "obs-precomp.h" // Precompiled headers
11 
13 #include <mrpt/utils/CStream.h>
14 
15 using namespace mrpt::obs;
16 using namespace mrpt::utils;
17 using namespace mrpt::poses;
18 
19 // This must be added to any CSerializable class implementation file.
21 
22 /*---------------------------------------------------------------
23  Implements the writing to a CStream capability of CSerializable objects
24  ---------------------------------------------------------------*/
25 void CObservationComment::writeToStream(mrpt::utils::CStream &out, int *version) const
26 {
27  if (version)
28  *version = 0;
29  else
30  {
31  out << text
32  << timestamp;
33  }
34 }
35 
36 /*---------------------------------------------------------------
37  Implements the reading from a CStream capability of CSerializable objects
38  ---------------------------------------------------------------*/
40 {
41  switch(version)
42  {
43  case 0:
44  in >> text
45  >> timestamp;
46  break;
47  default:
49  };
50 }
51 
52 void CObservationComment::getDescriptionAsText(std::ostream &o) const
53 {
55 
56  o << "Comment content:\n'" << text << "'\n";
57 }
58 
This "observation" is actually a placeholder for a text block with comments or additional parameters ...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
IMPLEMENTS_SERIALIZABLE(CLogFileRecord_FullEval, CHolonomicLogFileRecord, mrpt::nav) IMPLEMENTS_SERIALIZABLE(CHolonomicFullEval
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
int version
Definition: mrpt_jpeglib.h:898
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...
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Declares a class that represents any robot&#39;s observation.
GLuint in
Definition: glext.h:6301
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020