|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
47 bool ok = connection.
expectBlock((
char*)&header,
sizeof(header));
48 if (!ok)
return false;
69 bool ok = connection.
expectBlock((
char*)&header,
sizeof(header));
70 if (!ok)
return false;
91 bool ok = connection.
expectBlock((
char*)&header,
sizeof(header));
92 if (!ok)
return false;
115 connection.
appendBlock((
char*)&header,
sizeof(header));
133 connection.
appendBlock((
char*)&header,
sizeof(header));
151 connection.
appendBlock((
char*)&header,
sizeof(header));
165 template <
typename T>
168 std::ostringstream stringStream;
169 stringStream.precision(precision);
170 stringStream.width(width);
171 stringStream << std::string(
"x:") << x << std::string(
" y:") << y;
172 return stringStream.str();
175 template <
typename T>
178 return T(sqrt(x*x + y*y));
182 template <
typename T>
187 template <
typename T>
195 template <
typename T>
202 template <
typename T>
206 T x = rhs.
x; T y = rhs.
y;
207 rhs.
x = T(lhs[0][0] * x + lhs[0][1] * y);
208 rhs.
y = T(lhs[1][0] * x + lhs[1][1] * y);
212 template <
typename T>
219 template <
typename T>
226 template <
typename T>
234 template <
typename T>
242 template <
typename T>
245 if (this->x == rhs.
x &&
246 this->y == rhs.
y)
return true;
250 template <
typename T>
253 if (this->x == rhs.
x &&
254 this->y == rhs.
y)
return false;
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
#define YARP_END_PACK
Ends 1 byte packing for structs/classes.
virtual void appendFloat64(yarp::conf::float64_t data)=0
Send a representation of a 64-bit floating point number to the network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write vector to a connection.
#define YARP_LOG_COMPONENT(name,...)
#define YARP_BEGIN_PACK
Starts 1 byte packing for structs/classes.
size_t rows() const
Return number of rows.
yarp::math::Vec2D< T > operator+(yarp::math::Vec2D< T > lhs, const yarp::math::Vec2D< T > &rhs)
bool operator!=(const yarp::math::Vec2D< T > &rhs) const
std::string toString(int precision=-1, int width=-1) const
Creates a string object containing a text representation of the object.
virtual yarp::conf::float64_t expectFloat64()=0
Read a 64-bit floating point number from the network connection.
virtual bool isError() const =0
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual std::int64_t expectInt64()=0
Read a 64-bit integer from the network connection.
yarp::math::Vec2D< T > & operator-=(const yarp::math::Vec2D< T > &rhs)
An interface for writing to a network connection.
virtual bool isError() const =0
yarp::math::Vec2D< T > operator*(const yarp::sig::Matrix &lhs, yarp::math::Vec2D< T > rhs)
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
size_t cols() const
Return number of columns.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
#define yCAssert(component, x)
bool operator==(const yarp::math::Vec2D< T > &rhs) const
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
An interface for reading from a network connection.
virtual void appendInt64(std::int64_t data)=0
Send a representation of a 64-bit integer to the network connection.
#define BOTTLE_TAG_FLOAT64
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
T norm() const
Returns the Euclidean norm of the Vec2D, i.e.
The main, catch-all namespace for YARP.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
yarp::math::Vec2D< T > & operator+=(const yarp::math::Vec2D< T > &rhs)
yarp::math::Vec2D< T > operator-(yarp::math::Vec2D< T > lhs, const yarp::math::Vec2D< T > &rhs)
std::int32_t NetInt32
Definition of the NetInt32 type.