YARP
Yet Another Robot Platform
Map2DPathData.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 // Autogenerated by Thrift Compiler (0.14.1-yarped)
7 //
8 // This is an automatically generated file.
9 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10 
11 #ifndef YARP_THRIFT_GENERATOR_STRUCT_MAP2DPATHDATA_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_MAP2DPATHDATA_H
13 
14 #include <yarp/dev/api.h>
15 
16 #include <yarp/os/Wire.h>
17 #include <yarp/os/idl/WireTypes.h>
18 #include <yarp/dev/Map2DLocation.h>
19 
20 namespace yarp {
21 namespace dev {
22 
25 {
26 public:
27  // Fields
28  std::vector<yarp::dev::Nav2D::Map2DLocation> waypoints;
29 
30  // Default constructor
31  Map2DPathData();
32 
33  // Constructor with field values
34  Map2DPathData(const std::vector<yarp::dev::Nav2D::Map2DLocation>& waypoints);
35 
36  // Read structure on a Wire
37  bool read(yarp::os::idl::WireReader& reader) override;
38 
39  // Read structure on a Connection
40  bool read(yarp::os::ConnectionReader& connection) override;
41 
42  // Write structure on a Wire
43  bool write(const yarp::os::idl::WireWriter& writer) const override;
44 
45  // Write structure on a Connection
46  bool write(yarp::os::ConnectionWriter& connection) const override;
47 
48  // Convert to a printable string
49  std::string toString() const;
50 
51  // If you want to serialize this class without nesting, use this helper
53 
54  class Editor :
55  public yarp::os::Wire,
57  {
58  public:
59  // Editor: default constructor
60  Editor();
61 
62  // Editor: constructor with base class
63  Editor(Map2DPathData& obj);
64 
65  // Editor: destructor
66  ~Editor() override;
67 
68  // Editor: Deleted constructors and operator=
69  Editor(const Editor& rhs) = delete;
70  Editor(Editor&& rhs) = delete;
71  Editor& operator=(const Editor& rhs) = delete;
72  Editor& operator=(Editor&& rhs) = delete;
73 
74  // Editor: edit
75  bool edit(Map2DPathData& obj, bool dirty = true);
76 
77  // Editor: validity check
78  bool isValid() const;
79 
80  // Editor: state
81  Map2DPathData& state();
82 
83  // Editor: start editing
84  void start_editing();
85 
86 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
87  YARP_DEPRECATED_MSG("Use start_editing() instead")
88  void begin()
89  {
90  start_editing();
91  }
92 #endif // YARP_NO_DEPRECATED
93 
94  // Editor: stop editing
95  void stop_editing();
96 
97 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
98  YARP_DEPRECATED_MSG("Use stop_editing() instead")
99  void end()
100  {
101  stop_editing();
102  }
103 #endif // YARP_NO_DEPRECATED
104 
105  // Editor: waypoints field
106  void set_waypoints(const std::vector<yarp::dev::Nav2D::Map2DLocation>& waypoints);
107  void set_waypoints(size_t index, const yarp::dev::Nav2D::Map2DLocation& elem);
108  const std::vector<yarp::dev::Nav2D::Map2DLocation>& get_waypoints() const;
109  virtual bool will_set_waypoints();
110  virtual bool did_set_waypoints();
111 
112  // Editor: clean
113  void clean();
114 
115  // Editor: read
116  bool read(yarp::os::ConnectionReader& connection) override;
117 
118  // Editor: write
119  bool write(yarp::os::ConnectionWriter& connection) const override;
120 
121  private:
122  // Editor: state
123  Map2DPathData* obj;
124  bool obj_owned;
125  int group;
126 
127  // Editor: dirty variables
128  bool is_dirty;
129  bool is_dirty_waypoints;
130  int dirty_count;
131 
132  // Editor: send if possible
133  void communicate();
134 
135  // Editor: mark dirty overall
136  void mark_dirty();
137 
138  // Editor: mark dirty single fields
139  void mark_dirty_waypoints();
140 
141  // Editor: dirty_flags
142  void dirty_flags(bool flag);
143  };
144 
145 private:
146  // read/write waypoints field
147  bool read_waypoints(yarp::os::idl::WireReader& reader);
148  bool write_waypoints(const yarp::os::idl::WireWriter& writer) const;
149  bool nested_read_waypoints(yarp::os::idl::WireReader& reader);
150  bool nested_write_waypoints(const yarp::os::idl::WireWriter& writer) const;
151 };
152 
153 } // namespace yarp
154 } // namespace dev
155 
156 #endif // YARP_THRIFT_GENERATOR_STRUCT_MAP2DPATHDATA_H
contains the definition of a Map2DLocation type
Editor(Editor &&rhs)=delete
Editor & operator=(Editor &&rhs)=delete
Editor(const Editor &rhs)=delete
Editor & operator=(const Editor &rhs)=delete
std::vector< yarp::dev::Nav2D::Map2DLocation > waypoints
Definition: Map2DPathData.h:28
yarp::os::idl::Unwrapped< Map2DPathData > unwrapped
Definition: Map2DPathData.h:52
An interface for reading from a network connection.
An interface for writing to a network connection.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
Base class for IDL client/server.
Definition: Wire.h:19
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:23
IDL-friendly connection reader.
Definition: WireReader.h:30
IDL-friendly connection writer.
Definition: WireWriter.h:30
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2885
std::string toString(const T &value)
convert an arbitrary type to string.
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:923
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1099
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18