64 ros_seq_stamp({0,0,0}),
69 const std::string& frame) {
80 std::string encoding =
103 char is_bigendian = 0;
111 ros_const_header.
copy();
118 ros_seq_stamp.
seq = seq;
119 ros_seq_stamp.
sec = (int)(
t);
120 ros_seq_stamp.
nsec = (int)((
t-(
int)
t)*1e9);
123 size_t length()
const override {
return 3; }
127 size_t length(
size_t index)
const override {
131 result =
sizeof(ros_seq_stamp);
134 result = ros_const_header.
length();
146 const char *
data(
size_t index)
const override {
147 const char *result = 0 ;
150 result = (
const char *)(&ros_seq_stamp);
153 result = ros_const_header.
get();
A simple abstraction for a block of bytes.
An interface for writing to a network connection.
static ConnectionWriter * createBufferedConnectionWriter()
Create a connection writer implementation that stores to a buffer which can be read later using getBu...
virtual SizedWriter * getBuffer()=0
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
void appendString(const std::string &str)
Send a string to the network connection.
An abstraction for a block of bytes, with optional responsibility for allocating/destroying that bloc...
void copy()
Makes sure data block is owned, making a copy if necessary.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
This is a base class for objects that can be both read from and be written to the YARP network.
Minimal requirements for an efficient Writer.
virtual void write(OutputStream &os)
An OutputStream that produces a string.
std::string toString() const
Image class with user control of representation details.
size_t width() const
Gets width of image in pixels.
size_t getPadding() const
Returns the number of padding bytes.
unsigned char * getRawImage() const
Access to the internal image buffer.
virtual size_t getPixelSize() const
Gets pixel size in memory in bytes.
size_t getRawImageSize() const
Access to the internal buffer size information (this is how much memory has been allocated for the im...
size_t height() const
Gets height of image in pixels.
virtual int getPixelCode() const
Gets pixel type identifier.
As far as YARP is concerned, on the wire to/from ROS a raw image has:
const char * data(size_t index) const override
void stopWrite() const override
Call when all writing is finished.
void init(const yarp::sig::FlexImage &img, const std::string &frame)
yarp::os::PortReader * getReplyHandler() override
bool dropRequested() override
void update(const yarp::sig::FlexImage *img, int seq, double t)
size_t length(size_t index) const override
yarp::os::Portable * getReference() override
size_t headerLength() const override
void startWrite() const override
Call when writing is about to begin.
size_t length() const override
std::string decode(NetInt32 code)
Convert a vocabulary identifier into a string.
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.
#define YARP_wire_rep_utils_API