43 bool ok = connection.
expectBlock(
reinterpret_cast<char*
>(&header),
sizeof(header));
67 bool ok = connection.
expectBlock(
reinterpret_cast<char*
>(&header),
sizeof(header));
91 bool ok = connection.
expectBlock(
reinterpret_cast<char*
>(&header),
sizeof(header));
117 connection.
appendBlock(
reinterpret_cast<char*
>(&header),
sizeof(header));
135 connection.
appendBlock(
reinterpret_cast<char*
>(&header),
sizeof(header));
153 connection.
appendBlock(
reinterpret_cast<char*
>(&header),
sizeof(header));
169 std::ostringstream stringStream;
170 stringStream.precision(precision);
171 stringStream.width(width);
172 stringStream << std::string(
"x:") << x << std::string(
" y:") << y;
173 return stringStream.str();
179 return T(sqrt(x*x + y*y));
207 T x = rhs.
x; T y = rhs.
y;
208 rhs.
x = T(lhs[0][0] * x + lhs[0][1] * y);
209 rhs.
y = T(lhs[1][0] * x + lhs[1][1] * y);
246 if (this->x == rhs.
x &&
256 if (this->x == rhs.
x &&
#define BOTTLE_TAG_FLOAT64
std::string toString(int precision=-1, int width=-1) const
Creates a string object containing a text representation of the object.
yarp::math::Vec2D< T > & operator-=(const yarp::math::Vec2D< T > &rhs)
bool operator==(const yarp::math::Vec2D< T > &rhs) const
T norm() const
Returns the Euclidean norm of the Vec2D, i.e.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write vector to a connection.
bool operator!=(const yarp::math::Vec2D< T > &rhs) const
yarp::math::Vec2D< T > & operator+=(const yarp::math::Vec2D< T > &rhs)
An interface for reading from a network connection.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual std::int64_t expectInt64()=0
Read a 64-bit integer from the network connection.
virtual bool isError() const =0
virtual yarp::conf::float64_t expectFloat64()=0
Read a 64-bit floating point number from the network connection.
An interface for writing to a network connection.
virtual bool isError() const =0
virtual void appendInt64(std::int64_t data)=0
Send a representation of a 64-bit integer to the network connection.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
virtual void appendFloat64(yarp::conf::float64_t data)=0
Send a representation of a 64-bit floating point number to the network connection.
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
size_t cols() const
Return number of columns.
size_t rows() const
Return number of rows.
#define yCAssert(component, x)
#define YARP_LOG_COMPONENT(name,...)
Vector operator+(const Vector &a, const double &s)
Mathematical operations.
Vector operator-(const Vector &a, const double &s)
Subtraction operator between a vector and a scalar (defined in Math.h).
Vector operator*(double k, const Vector &b)
Scalar-vector product operator (defined in Math.h).
std::int32_t NetInt32
Definition of the NetInt32 type.
#define YARP_END_PACK
Ends 1 byte packing for structs/classes.
#define YARP_BEGIN_PACK
Starts 1 byte packing for structs/classes.