OpenJAUS SAE SDK
6.0.0
|
#include <Buffer.h>
Inherits openjaus::system::Transportable.
Inherited by openjaus::system::Packet, and openjaus::transport::AS5669::JtcpStream.
Classes | |
class | ReaderImpl |
class | WriterImpl |
Public Member Functions | |
Buffer (uint64 size) | |
Creates a Buffer of size bytes. More... | |
Buffer (const Buffer &other) | |
Copies the incoming Buffer into a new a Buffer. More... | |
virtual | ~Buffer () |
BufferReader & | getReader () |
Get a reference to the BufferReader. More... | |
BufferWriter & | getWriter () |
Get a reference to the BufferWriter. More... | |
uint64 | getMaxSize () const |
uint64 | setMaxSize (uint64 size) |
uint64 | bytesContained () const |
virtual uint64 | to (BufferWriter &dst) const |
Copy data from this Buffer starting at the current position 0 to the Buffer connected to the provided BufferWriter. More... | |
virtual uint64 | from (BufferReader &src) |
Copy data from the Buffer connected to the provided BufferReader into this Buffer. More... | |
virtual uint64 | length () const |
Gets the serialized length of this object. More... | |
virtual uint64 | to (BufferWriter &dst, uint64 length) const |
Copy data from this Buffer starting at the current position 0 to the Buffer connected to the provided BufferWriter. More... | |
virtual uint64 | from (BufferReader &src, uint64 length) |
Copy data from the Buffer connected to the provided BufferReader into this Buffer. More... | |
virtual std::string | toString () const |
std::string | toString (int byteCount) const |
Buffer & | operator= (const Buffer &rhs) |
bool | operator== (const Buffer &other) const |
Public Member Functions inherited from openjaus::system::Transportable | |
Transportable () | |
virtual | ~Transportable () |
Private Attributes | |
RandomAccessBuffer | bufferInternal |
ReaderImpl | reader |
WriterImpl | writer |
Friends | |
OPENJAUS_EXPORT friend std::ostream & | operator<< (std::ostream &output, Buffer &object) |
OPENJAUS_EXPORT friend std::ostream & | operator<< (std::ostream &output, Buffer *object) |
openjaus::system::Buffer::Buffer | ( | uint64 | size | ) |
openjaus::system::Buffer::Buffer | ( | const Buffer & | other | ) |
|
virtual |
uint64 openjaus::system::Buffer::bytesContained | ( | ) | const |
|
virtual |
The source BufferReader position will be advanced inside this method such that calling from() again will copy the next set of data from the source Buffer. The data will be placed into this Buffer starting at position 0 and getMaxSize() bytes will be copied.
src | The BufferReader of the Buffer from which the data should be copied |
Implements openjaus::system::Transportable.
|
virtual |
The source BufferReader position will be advanced inside this method such that calling from() again will copy the next set of data from the source Buffer. The data will be placed into this Buffer starting at position 0 and length bytes will be copied.
src | The BufferReader of the Buffer from which the data should be copied |
length | The number of bytes to copy |
uint64 openjaus::system::Buffer::getMaxSize | ( | ) | const |
BufferReader & openjaus::system::Buffer::getReader | ( | ) |
The same reader is returned on every get call to this method and the read position is not reset between calls. Call BufferReader::reset() to ensure that you're reading from the start of the Buffer.
BufferWriter & openjaus::system::Buffer::getWriter | ( | ) |
The same writer is returned on every get call to this method and the write position is not reset between calls. Call BufferReader::clear() to ensure that you're writing to the start of the Buffer.
|
virtual |
Implements openjaus::system::Transportable.
bool openjaus::system::Buffer::operator== | ( | const Buffer & | other | ) | const |
|
virtual |
The data will be copied from this Buffer starting at position 0 and getMaxSize() bytes will be copied. The destination BufferWriter position will be advanced inside this method such that calling to() again will copy data into the the next space available in the destination Buffer.
dst | The BufferWriter of the Buffer into which the data should be copied |
length | The number of bytes to copy |
Implements openjaus::system::Transportable.
|
virtual |
The data will be copied from this Buffer starting at position 0 and length bytes will be copied. The destination BufferWriter position will be advanced inside this method such that calling to() again will copy data into the the next space available in the destination Buffer.
dst | The BufferWriter of the Buffer into which the data should be copied |
length | The number of bytes to copy |
|
virtual |
std::string openjaus::system::Buffer::toString | ( | int | byteCount | ) | const |
|
friend |
|
friend |
|
private |
|
private |
|
private |