YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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>
13
17namespace yarp::dev::Nav2D {
19{
20public:
25 Map2DPath(const std::vector<yarp::dev::Nav2D::Map2DLocation>& map_waypoints, const std::string& desc = "");
26
30 Map2DPath();
31
36 std::string toString() const;
37
42 bool operator!=(const Map2DPath& r) const;
43
48 bool operator==(const Map2DPath& r) const;
49
55 yarp::dev::Nav2D::Map2DLocation& operator[](size_t index);
56
61 size_t size() const;
62
67 double getLength() const;
68
73 bool isOnSingleMap() const;
74
75public:
76 bool read(yarp::os::idl::WireReader& reader) override
77 {
78 return Map2DPathData::read(reader);
79 }
80 bool write(const yarp::os::idl::WireWriter& writer) const override
81 {
82 return Map2DPathData::write(writer);
83 }
84 bool read(yarp::os::ConnectionReader& reader) override
85 {
86 return Map2DPathData::read(reader);
87 }
88 bool write(yarp::os::ConnectionWriter& writer) const override
89 {
90 return Map2DPathData::write(writer);
91 }
92
93public:
97 void clear();
98
99 using iterator = std::vector<Map2DLocation>::iterator;
100 using const_iterator = std::vector<Map2DLocation>::const_iterator;
101
105 iterator begin() noexcept;
106
110 iterator end() noexcept;
111
115 const_iterator cbegin() const noexcept;
116
120 const_iterator cend() const noexcept;
121
126 void push_back(yarp::dev::Nav2D::Map2DLocation loc);
127};
128} // namespace yarp::dev::Nav2D
129
130#endif
bool operator==(const struct v4l2_control &left, const struct v4l2_control &right)
Definition CApiMock.h:65
std::string toString(const T &value)
convert an arbitrary type to string.
contains the definition of a Map2DLocation type
contains the definition of a map type
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
Definition Map2DPath.h:88
std::vector< Map2DLocation >::const_iterator const_iterator
Definition Map2DPath.h:100
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition Map2DPath.h:80
bool read(yarp::os::idl::WireReader &reader) override
Definition Map2DPath.h:76
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
Definition Map2DPath.h:84
std::vector< Map2DLocation >::iterator iterator
Definition Map2DPath.h:99
An interface for reading from a network connection.
An interface for writing to a network connection.
IDL-friendly connection reader.
Definition WireReader.h:27
IDL-friendly connection writer.
Definition WireWriter.h:28
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18