MRPT  2.0.0
TNodeAnnotations.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/core/exceptions.h>
12 #include <mrpt/graphs/TNodeID.h>
15 #include <cstdint>
16 #include <iostream>
17 #include <string>
18 
19 namespace mrpt::graphs::detail
20 {
21 /**\brief Abstract class from which NodeAnnotations related classes can be
22  * implemented
23  *
24  * \ingroup mrpt_graphs_grp
25  */
27 {
29 
30  /**\brief Constructor */
31  TNodeAnnotations() = default;
32  /**\brief Destructor */
33  virtual ~TNodeAnnotations() = default;
34 
35  virtual void getAnnotsAsString(std::string* s) const { ASSERT_(s); }
36  std::string retAnnotsAsString() const
37  {
38  std::string s;
39  this->getAnnotsAsString(&s);
40  return s;
41  }
42 
43  virtual bool operator==(const TNodeAnnotations& other) const
44  {
45  return true;
46  }
47  virtual bool operator!=(const TNodeAnnotations& other) const
48  {
49  return (!(*this == other));
50  }
51 
52  /**\brief Create and return a copy of the TNodeAnnotations object at hand.
53  *
54  * \warning Caller is responsible of afterwards deleting the object which is
55  * allocaed in heap
56  */
58  /**\brief Set the properties of the current TNodeAnnotations object
59  *
60  * \return True if setting the annotations part is successful.
61  */
62  bool setAnnots(const self_t& other) { return true; }
63  /**\brief Indicates if this is a dummy TNodeAnnotations struct or if it does
64  * contain meaningful data
65  */
66  bool is_node_annots_empty{false};
67 };
68 
69 /////////////////////////////////////////////////////////////////////////////
70 
71 /**\brief Struct to be used as the NODE_ANNOTATIONS template argument in
72  * CNetworkOfPoses class instances for use in multiple-robot SLAM applications
73  *
74  * \ingroup mrpt_graphs_grp
75  */
77 {
80 };
81 } // namespace mrpt::graphs::detail
Abstract class from which NodeAnnotations related classes can be implemented.
TNodeAnnotations()=default
Constructor.
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
Internal functions for MRPT.
virtual ~TNodeAnnotations()=default
Destructor.
#define DECLARE_TTYPENAME_CLASSNAME(_CLASSNAME)
Like DECLARE_CUSTOM_TTYPENAME(), but for use within the class declaration body.
Definition: TTypeName.h:104
bool setAnnots(const self_t &other)
Set the properties of the current TNodeAnnotations object.
virtual bool operator==(const TNodeAnnotations &other) const
bool is_node_annots_empty
Indicates if this is a dummy TNodeAnnotations struct or if it does contain meaningful data...
TNodeAnnotations * getCopyOfAnnots() const
Create and return a copy of the TNodeAnnotations object at hand.
virtual bool operator!=(const TNodeAnnotations &other) const
virtual void getAnnotsAsString(std::string *s) const
Struct to be used as the NODE_ANNOTATIONS template argument in CNetworkOfPoses class instances for us...



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020