29 size_t Read(
void* Buffer,
size_t Count)
override;
30 size_t Write(
const void* Buffer,
size_t Count)
override;
40 void resize(uint64_t newSize);
TSeekOrigin
Used in CStream::Seek.
bool loadBufferFromFile(const std::string &file_name)
Loads the entire buffer from a file *.
void free_fn_for_zmq(void *data, void *hint)
Used in mrpt_send_to_zmq().
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
uint64_t getTotalBytesCount() const override
Returns the total size of the internal buffer.
bool saveBufferToFile(const std::string &file_name)
Saves the entire buffer to a file.
#define ASSERT_(f)
Defines an assertion mechanism.
void * getRawBufferData()
Method for getting a pointer to the raw stored data.
This CStream derived class allow using a memory buffer as a CStream.
void assignMemoryNotOwn(const void *data, const uint64_t nBytesInData)
Initilize the data in the stream from a block of memory which is NEITHER OWNED NOR COPIED by the obje...
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
uint64_t getPosition() const override
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
CMemoryStream()=default
Default constructor.
~CMemoryStream() override
Destructor.
TFreeFnDataForZMQ()=default
uint64_t m_alloc_block_size
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void setAllocBlockSize(uint64_t alloc_block_size)
Change the size of the additional memory block that is reserved whenever the current block runs too s...
size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
void_ptr_noncopy m_memory
Internal data.
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
void resize(uint64_t newSize)
Resizes the internal buffer size.
void clear()
Clears the memory buffer.
bool m_read_only
If the memory block does not belong to the object.
static struct FontData data