YARP
Yet Another Robot Platform
Map2DPath.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 #ifndef YARP_DEV_MAP2DPATH_H
7 #define YARP_DEV_MAP2DPATH_H
8 
9 #include <vector>
10 #include <yarp/dev/MapGrid2D.h>
11 #include <yarp/dev/Map2DLocation.h>
12 #include <yarp/dev/Map2DPathData.h>
13 
17 namespace yarp
18 {
19  namespace dev
20  {
21  namespace Nav2D
22  {
24  {
25  public:
30  Map2DPath(const std::vector<yarp::dev::Nav2D::Map2DLocation> map_waypoints);
31 
35  Map2DPath();
36 
41  std::string toString() const;
42 
47  bool operator!=(const Map2DPath& r) const;
48 
53  bool operator==(const Map2DPath& r) const;
54 
60  yarp::dev::Nav2D::Map2DLocation& operator[](size_t index);
61 
66  size_t size() const;
67 
72  double getLength() const;
73 
78  bool isOnSingleMap() const;
79 
80  public:
81  bool read(yarp::os::idl::WireReader& reader) override { return Map2DPathData::read(reader); }
82  bool write(const yarp::os::idl::WireWriter& writer) const override { return Map2DPathData::write(writer); }
83  bool read(yarp::os::ConnectionReader& reader) override { return Map2DPathData::read(reader); }
84  bool write(yarp::os::ConnectionWriter& writer) const override { return Map2DPathData::write(writer); }
85 
86  public:
90  void clear();
91 
92  using iterator = std::vector<Map2DLocation>::iterator;
93  using const_iterator = std::vector<Map2DLocation>::const_iterator;
94 
98  iterator begin() noexcept;
99 
103  iterator end() noexcept;
104 
108  const_iterator cbegin() const noexcept;
109 
113  const_iterator cend() const noexcept;
114 
119  void push_back(yarp::dev::Nav2D::Map2DLocation loc);
120  };
121  }
122  }
123 }
124 
125 #endif
contains the definition of a Map2DLocation type
contains the definition of a map type
bool write(const yarp::os::idl::WireWriter &writer) const override
bool read(yarp::os::idl::WireReader &reader) override
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition: Map2DPath.h:84
std::vector< Map2DLocation >::const_iterator const_iterator
Definition: Map2DPath.h:93
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: Map2DPath.h:82
bool read(yarp::os::idl::WireReader &reader) override
Definition: Map2DPath.h:81
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition: Map2DPath.h:83
std::vector< Map2DLocation >::iterator iterator
Definition: Map2DPath.h:92
An interface for reading from a network connection.
An interface for writing to a network connection.
IDL-friendly connection reader.
Definition: WireReader.h:30
IDL-friendly connection writer.
Definition: WireWriter.h:30
std::string toString(const T &value)
convert an arbitrary type to string.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18