62 use_set = other.use_set;
87 use_set =
alt.use_set;
105 char* buf =
new char[len];
133 char* buf =
new char[len];
148 return use_set ? use :
length();
164 if (
get() !=
nullptr) {
169 b =
Bytes(
nullptr, 0);
207 std::int32_t listTag;
208 std::int32_t listLen;
209 std::int32_t blobLen;
220 if (
get() ==
nullptr) {
A mini-server for performing network communication in the background.
A simple abstraction for a block of bytes.
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.
An interface for writing to a network connection.
virtual bool isError() const =0
virtual void appendExternalBlock(const char *data, size_t len)=0
Send a block of data to the network connection, without making a copy.
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.
An abstraction for a block of bytes, with optional responsibility for allocating/destroying that bloc...
void clear()
Disassociate object with any data block (deleting block if appropriate).
const Bytes & bytes() const
bool allocateOnNeed(size_t neededLen, size_t allocateLen)
void allocate(size_t len)
Makes a data block of the specified length that will be deleted if this object is destroyed.
bool write(ConnectionWriter &writer) const override
Write this object to a network connection.
size_t setUsed(size_t used)
explicitly declare how many of the bytes are in use.
bool read(ConnectionReader &reader) override
Read this object from a network connection.
ManagedBytes & operator=(ManagedBytes &&other) noexcept
Move assignment operator.
void copy()
Makes sure data block is owned, making a copy if necessary.
virtual ~ManagedBytes()
Destructor.
ManagedBytes()
Constructor.
static void assertion(bool shouldBeTrue)
An assertion.
This is a base class for objects that can be both read from and be written to the YARP network.
An interface to the operating system, including Port based communication.