YARP
Yet Another Robot Platform
yarp::math::Vec2D< T > Class Template Reference

#include <yarp/math/Vec2D.h>

+ Inheritance diagram for yarp::math::Vec2D< T >:

Public Member Functions

 Vec2D ()
 
 Vec2D (const T &x_value, const T &y_value)
 
 Vec2D (const yarp::sig::Vector &v)
 
 operator yarp::sig::Vector () const
 
norm () const
 Returns the Euclidean norm of the Vec2D, i.e. More...
 
std::string toString (int precision=-1, int width=-1) const
 Creates a string object containing a text representation of the object. More...
 
bool read (yarp::os::ConnectionReader &connection) override
 Read this object from a network connection. More...
 
bool write (yarp::os::ConnectionWriter &connection) const override
 Write vector to a connection. More...
 
yarp::os::Type getType () const override
 
yarp::math::Vec2D< T > & operator+= (const yarp::math::Vec2D< T > &rhs)
 
yarp::math::Vec2D< T > & operator-= (const yarp::math::Vec2D< T > &rhs)
 
bool operator== (const yarp::math::Vec2D< T > &rhs) const
 
bool operator!= (const yarp::math::Vec2D< T > &rhs) const
 
bool read (yarp::os::ConnectionReader &connection)
 Read this object from a network connection. More...
 
bool read (yarp::os::ConnectionReader &connection)
 Read this object from a network connection. More...
 
bool read (yarp::os::ConnectionReader &connection)
 Read this object from a network connection. More...
 
bool write (yarp::os::ConnectionWriter &connection) const
 Write this object to a network connection. More...
 
bool write (yarp::os::ConnectionWriter &connection) const
 Write this object to a network connection. More...
 
bool write (yarp::os::ConnectionWriter &connection) const
 Write this object to a network connection. More...
 
- 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
 

Public Attributes

x
 
y
 

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...
 

Detailed Description

template<typename T>
class yarp::math::Vec2D< T >

Definition at line 25 of file Vec2D.h.

Constructor & Destructor Documentation

◆ Vec2D() [1/3]

template<typename T >
yarp::math::Vec2D< T >::Vec2D

Definition at line 183 of file Vec2D.cpp.

◆ Vec2D() [2/3]

template<typename T >
yarp::math::Vec2D< T >::Vec2D ( const T &  x_value,
const T &  y_value 
)

Definition at line 196 of file Vec2D.cpp.

◆ Vec2D() [3/3]

template<typename T >
yarp::math::Vec2D< T >::Vec2D ( const yarp::sig::Vector v)

Definition at line 188 of file Vec2D.cpp.

Member Function Documentation

◆ getType()

template<typename T >
yarp::os::Type yarp::math::Vec2D< T >::getType ( ) const
inlineoverridevirtual

Reimplemented from yarp::os::Portable.

Definition at line 70 of file Vec2D.h.

◆ norm()

template<typename T >
T yarp::math::Vec2D< T >::norm

Returns the Euclidean norm of the Vec2D, i.e.

sqrt(x^2+y^2)

Returns
the computed Euclidean norm.

Definition at line 176 of file Vec2D.cpp.

◆ operator yarp::sig::Vector()

template<typename T >
yarp::math::Vec2D< T >::operator yarp::sig::Vector ( ) const
inlineexplicit

Definition at line 37 of file Vec2D.h.

◆ operator!=()

template<typename T >
bool yarp::math::Vec2D< T >::operator!= ( const yarp::math::Vec2D< T > &  rhs) const

Definition at line 251 of file Vec2D.cpp.

◆ operator+=()

template<typename T >
yarp::math::Vec2D< T > & yarp::math::Vec2D< T >::operator+= ( const yarp::math::Vec2D< T > &  rhs)

Definition at line 227 of file Vec2D.cpp.

◆ operator-=()

template<typename T >
yarp::math::Vec2D< T > & yarp::math::Vec2D< T >::operator-= ( const yarp::math::Vec2D< T > &  rhs)

Definition at line 235 of file Vec2D.cpp.

◆ operator==()

template<typename T >
bool yarp::math::Vec2D< T >::operator== ( const yarp::math::Vec2D< T > &  rhs) const

Definition at line 243 of file Vec2D.cpp.

◆ read() [1/4]

bool yarp::math::Vec2D< double >::read ( yarp::os::ConnectionReader reader)
virtual

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

Implements yarp::os::Portable.

Definition at line 42 of file Vec2D.cpp.

◆ read() [2/4]

bool yarp::math::Vec2D< int >::read ( yarp::os::ConnectionReader reader)
virtual

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

Implements yarp::os::Portable.

Definition at line 64 of file Vec2D.cpp.

◆ read() [3/4]

bool yarp::math::Vec2D< size_t >::read ( yarp::os::ConnectionReader reader)
virtual

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

Implements yarp::os::Portable.

Definition at line 86 of file Vec2D.cpp.

◆ read() [4/4]

template<typename T >
bool yarp::math::Vec2D< T >::read ( yarp::os::ConnectionReader reader)
overridevirtual

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

Implements yarp::os::Portable.

◆ toString()

template<typename T >
std::string yarp::math::Vec2D< T >::toString ( int  precision = -1,
int  width = -1 
) const

Creates a string object containing a text representation of the object.

Useful for printing.

Returns
the generated string

Definition at line 166 of file Vec2D.cpp.

◆ write() [1/4]

bool yarp::math::Vec2D< double >::write ( yarp::os::ConnectionWriter writer) const
virtual

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

Implements yarp::os::Portable.

Definition at line 108 of file Vec2D.cpp.

◆ write() [2/4]

bool yarp::math::Vec2D< int >::write ( yarp::os::ConnectionWriter writer) const
virtual

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

Implements yarp::os::Portable.

Definition at line 126 of file Vec2D.cpp.

◆ write() [3/4]

bool yarp::math::Vec2D< size_t >::write ( yarp::os::ConnectionWriter writer) const
virtual

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

Implements yarp::os::Portable.

Definition at line 144 of file Vec2D.cpp.

◆ write() [4/4]

template<typename T >
bool yarp::math::Vec2D< T >::write ( yarp::os::ConnectionWriter connection) const
overridevirtual

Write vector to a connection.

return true if a Vec2D was written correctly

Implements yarp::os::Portable.

Member Data Documentation

◆ x

template<typename T >
T yarp::math::Vec2D< T >::x

Definition at line 30 of file Vec2D.h.

◆ y

template<typename T >
T yarp::math::Vec2D< T >::y

Definition at line 31 of file Vec2D.h.


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