50 ByteArray() : _data(0), _len(0), _owned(
false) {}
52 ByteArray(
char* data_,
size_t len_,
bool owned_)
53 : _data(data_), _len(len_), _owned(owned_) {}
55 ByteArray(
const ByteArray& rhs_) : _data(rhs_._data), _len(rhs_._len)
58 const_cast<ByteArray&
>(rhs_)._owned =
false;
69 ByteArray& operator=(
const ByteArray& rhs_)
74 const_cast<ByteArray&
>(rhs_)._owned =
false;
84 virtual size_t getSize()
const = 0;
89 virtual void setSize(
size_t newSize_) = 0;
104 virtual void putByte(
char byte_) = 0;
115 virtual void putUint32(amps_uint32_t i_) = 0;
126 virtual void putInt32(amps_int32_t i_) = 0;
132 virtual amps_int32_t
getInt32() = 0;
138 virtual void putSizet(
size_t s_) = 0;
149 virtual void putUint64(amps_uint64_t ui_) = 0;
161 virtual void putInt64(amps_int64_t i_) = 0;
167 virtual amps_int64_t
getInt64() = 0;
174 virtual void putBytes(
const char* data_,
size_t dataLength_) = 0;
180 virtual void putBytes(
const ByteArray& bytes_) = 0;
186 virtual ByteArray
getBytes(
size_t numBytes_) = 0;
192 virtual void copyBytes(
char* buffer_,
size_t numBytes_) = 0;
199 virtual void zero(
size_t offset_,
size_t length_) = 0;
207 virtual void copyBytes(
size_t destination_,
size_t source_,
virtual void putUint64(amps_uint64_t ui_)=0
Put an amps_uint64_t value into the buffer at the current position and advance past it...
virtual void putByte(char byte_)=0
Put a byte into the buffer at the current position and advance.
virtual amps_int32_t getInt32()=0
Get the 32-bit int value at the current buffer position and advance past it.
virtual void putSizet(size_t s_)=0
Put a size_t value into the buffer at the current position and advance past it.
virtual void zero(size_t offset_, size_t length_)=0
Set the given number of bytes in the buffer to zero starting at the given position.
virtual void setPosition(size_t position_)=0
Set the buffer postion to a location.
virtual void putInt32(amps_int32_t i_)=0
Put a 32-bit int value into the buffer and advance past it.
virtual size_t getSize() const =0
Get the current size of the Buffer in bytes.
virtual void putBytes(const char *data_, size_t dataLength_)=0
Put the given length of bytes in data into the buffer at the current position and advance past them...
virtual void putInt64(amps_int64_t i_)=0
Put an amps_int64_t value into the buffer at the current position and advance past it...
virtual void setSize(size_t newSize_)=0
Set the size for the buffer.
Core type, function, and class declarations for the AMPS C++ client.
virtual void putUint32(amps_uint32_t i_)=0
Put an unsigned 32-bit int value into the buffer at the current position and advance past the end of ...
Abstract base class for implementing a buffer to be used by a StoreImpl for storage of publish messag...
Definition: Buffer.hpp:40
virtual amps_uint64_t getUint64()=0
Get an unsigned 64-bit int value at the current buffer position and advance past it.
virtual amps_int64_t getInt64()=0
Get a 64-bit int value at the current buffer position and advance past it.
virtual amps_uint32_t getUint32()=0
Get the unsigned 32-bit int value at the current buffer position and advance past it...
virtual char getByte()=0
Get the next byte from the buffer and advance.
Definition: ampsplusplus.hpp:102
virtual size_t getSizet()=0
Get a size_t value at the current buffer position and advance past it.
virtual void copyBytes(char *buffer_, size_t numBytes_)=0
Copy the given number of bytes from this buffer to the given buffer.
virtual size_t getPosition() const =0
Get the current position in the buffer.
virtual ByteArray getBytes(size_t numBytes_)=0
Get the given number of bytes from the buffer.