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