Go to the documentation of this file.
9 #ifndef CMEMORYSTREAM_H
10 #define CMEMORYSTREAM_H
37 uint64_t
m_size, m_position, m_bytesWritten;
67 void* getRawBufferData();
70 bool saveBufferToFile( const std::
string &file_name );
73 bool loadBufferFromFile( const std::
string &file_name );
76 void setAllocBlockSize( uint64_t alloc_block_size )
79 m_alloc_block_size = alloc_block_size;
CMemoryStream(const void *data, const uint64_t nBytesInData)
Constructor to initilize the data in the stream from a block of memory (which is copied),...
void Clear()
Clears the memory buffer.
void resize(uint64_t newSize)
Resizes the internal buffer size.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
size_t Write(const void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for writing to the stream.
uint64_t getTotalBytesCount() MRPT_OVERRIDE
Returns the total size of the internal buffer
bool m_read_only
If the memory block does not belong to the object.
void_ptr_noncopy m_memory
Internal data.
uint64_t m_alloc_block_size
uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
Introduces a pure virtual method for moving to a specified position in the streamed resource.
TSeekOrigin
Used in CStream::Seek.
size_t Read(void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for reading from the stream.
CMemoryStream()
Default constructor.
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...
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This CStream derived class allow using a memory buffer as a CStream.
void changeSize(uint64_t newSize)
Change size. This would be rarely used. Use ">>" operators for writing to stream.
virtual ~CMemoryStream()
Destructor.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |