YARP
Yet Another Robot Platform
yarp::dev::Nav2D::Map2DPath Class Reference

#include <yarp/dev/Map2DPath.h>

+ Inheritance diagram for yarp::dev::Nav2D::Map2DPath:

Public Types

using iterator = std::vector< Map2DLocation >::iterator
 
using const_iterator = std::vector< Map2DLocation >::const_iterator
 
- Public Types inherited from yarp::dev::Map2DPathData
typedef yarp::os::idl::Unwrapped< Map2DPathDataunwrapped
 

Public Member Functions

 Map2DPath (const std::vector< yarp::dev::Nav2D::Map2DLocation > map_waypoints)
 Constructor. More...
 
 Map2DPath ()
 Default constructor: the map name is empty, coordinates are set to zero. More...
 
std::string toString () const
 Returns text representation of the path. More...
 
bool operator!= (const Map2DPath &r) const
 Compares two Map2DPath. More...
 
bool operator== (const Map2DPath &r) const
 Compares two Map2DArea. More...
 
yarp::dev::Nav2D::Map2DLocationoperator[] (size_t index)
 Returns a waypoint in the path. More...
 
size_t size () const
 Returns the size of the path. More...
 
double getLength () const
 Returns the length of the path. More...
 
bool isOnSingleMap () const
 Checks if all the waypoints of the path belong to the same map return true if the test is successful. More...
 
bool read (yarp::os::idl::WireReader &reader) override
 
bool write (const yarp::os::idl::WireWriter &writer) const override
 
bool read (yarp::os::ConnectionReader &reader) override
 Read this object from a network connection. More...
 
bool write (yarp::os::ConnectionWriter &writer) const override
 Write this object to a network connection. More...
 
void clear ()
 Remove all elements from the path. More...
 
iterator begin () noexcept
 Returns an iterator to the begin of the Path. More...
 
iterator end () noexcept
 Returns an iterator to the end of the Path. More...
 
const_iterator cbegin () const noexcept
 Returns a const iterator to the begin of the Path. More...
 
const_iterator cend () const noexcept
 Returns a const iterator to the end of the Path. More...
 
void push_back (yarp::dev::Nav2D::Map2DLocation loc)
 Inserts a new location into the path @loc the location to be inserted. More...
 
- Public Member Functions inherited from yarp::dev::Map2DPathData
 Map2DPathData ()
 
 Map2DPathData (const std::vector< yarp::dev::Nav2D::Map2DLocation > &waypoints)
 
std::string toString () const
 
- Public Member Functions inherited from yarp::os::idl::WirePortable
virtual bool readBare (yarp::os::ConnectionReader &reader)
 
virtual bool writeBare (yarp::os::ConnectionWriter &writer) const
 
virtual bool readBottle (yarp::os::ConnectionReader &reader)
 
virtual bool writeBottle (yarp::os::ConnectionWriter &writer) const
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType () const
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor. More...
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations. More...
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations. More...
 
virtual yarp::os::Type getWriteType () const
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (const PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading. More...
 
- Public Attributes inherited from yarp::dev::Map2DPathData
std::vector< yarp::dev::Nav2D::Map2DLocationwaypoints
 

Detailed Description

Definition at line 23 of file Map2DPath.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 93 of file Map2DPath.h.

◆ iterator

Definition at line 92 of file Map2DPath.h.

Constructor & Destructor Documentation

◆ Map2DPath() [1/2]

Map2DPath::Map2DPath ( const std::vector< yarp::dev::Nav2D::Map2DLocation map_waypoints)

Constructor.

Parameters
area_pointsa set of Map2DLocations defining the path.

Definition at line 60 of file Map2DPath.cpp.

◆ Map2DPath() [2/2]

Map2DPath::Map2DPath ( )

Default constructor: the map name is empty, coordinates are set to zero.

Definition at line 68 of file Map2DPath.cpp.

Member Function Documentation

◆ begin()

Map2DPath::iterator Map2DPath::begin ( )
noexcept

Returns an iterator to the begin of the Path.

Definition at line 107 of file Map2DPath.cpp.

◆ cbegin()

Map2DPath::const_iterator Map2DPath::cbegin ( ) const
noexcept

Returns a const iterator to the begin of the Path.

Definition at line 118 of file Map2DPath.cpp.

◆ cend()

Map2DPath::const_iterator Map2DPath::cend ( ) const
noexcept

Returns a const iterator to the end of the Path.

Definition at line 123 of file Map2DPath.cpp.

◆ clear()

void Map2DPath::clear ( )

Remove all elements from the path.

Definition at line 55 of file Map2DPath.cpp.

◆ end()

Map2DPath::iterator Map2DPath::end ( )
noexcept

Returns an iterator to the end of the Path.

Definition at line 113 of file Map2DPath.cpp.

◆ getLength()

double Map2DPath::getLength ( ) const

Returns the length of the path.

Returns
the size of the path

Definition at line 82 of file Map2DPath.cpp.

◆ isOnSingleMap()

bool Map2DPath::isOnSingleMap ( ) const

Checks if all the waypoints of the path belong to the same map return true if the test is successful.

Definition at line 92 of file Map2DPath.cpp.

◆ operator!=()

bool Map2DPath::operator!= ( const Map2DPath r) const

Compares two Map2DPath.

Returns
true if the two paths are different.

Definition at line 23 of file Map2DPath.cpp.

◆ operator==()

bool Map2DPath::operator== ( const Map2DPath r) const

Compares two Map2DArea.

Returns
true if the two areas are identical.

Definition at line 33 of file Map2DPath.cpp.

◆ operator[]()

Map2DLocation & Map2DPath::operator[] ( size_t  index)

Returns a waypoint in the path.

Parameters
indexthe waypoint index
Returns
the waypoint

Definition at line 72 of file Map2DPath.cpp.

◆ push_back()

void Map2DPath::push_back ( yarp::dev::Nav2D::Map2DLocation  loc)

Inserts a new location into the path @loc the location to be inserted.

Definition at line 128 of file Map2DPath.cpp.

◆ read() [1/2]

bool yarp::dev::Nav2D::Map2DPath::read ( yarp::os::ConnectionReader reader)
inlineoverridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Reimplemented from yarp::dev::Map2DPathData.

Definition at line 83 of file Map2DPath.h.

◆ read() [2/2]

bool yarp::dev::Nav2D::Map2DPath::read ( yarp::os::idl::WireReader reader)
inlineoverridevirtual

Reimplemented from yarp::dev::Map2DPathData.

Definition at line 81 of file Map2DPath.h.

◆ size()

size_t Map2DPath::size ( ) const

Returns the size of the path.

Returns
the size of the path

Definition at line 77 of file Map2DPath.cpp.

◆ toString()

std::string Map2DPath::toString ( ) const

Returns text representation of the path.

Returns
a human readable string containing the path infos.

Definition at line 43 of file Map2DPath.cpp.

◆ write() [1/2]

bool yarp::dev::Nav2D::Map2DPath::write ( const yarp::os::idl::WireWriter writer) const
inlineoverridevirtual

Reimplemented from yarp::dev::Map2DPathData.

Definition at line 82 of file Map2DPath.h.

◆ write() [2/2]

bool yarp::dev::Nav2D::Map2DPath::write ( yarp::os::ConnectionWriter writer) const
inlineoverridevirtual

Write this object to a network connection.

Override this for your particular class. Be aware that depending on the nature of the connections a port has, and what protocol they use, and how efficient the YARP implementation is, this method may be called once, twice, or many times, as the result of a single call to Port::write

Parameters
writeran interface to the network connection for writing
Returns
true iff the object is successfully written

Reimplemented from yarp::dev::Map2DPathData.

Definition at line 84 of file Map2DPath.h.


The documentation for this class was generated from the following files: