30 m_alloc_block_size(0x1000),
45 m_alloc_block_size(0x1000),
91 THROW_EXCEPTION(
"[CMemoryStream::resize] Cannot change memory block size since it was set with 'assign'")
122 size_t nToRead = (size_t)
min(((
long)Count),maxAvail);
void BASE_IMPEXP memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) MRPT_NO_THROWS
An OS and compiler independent version of "memcpy".
size_t ReadBuffer(void *Buffer, size_t Count)
Reads a block of bytes from the stream into Buffer.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
TSeekOrigin
Used in CStream::Seek.
#define THROW_EXCEPTION(msg)
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
uint64_t m_alloc_block_size
void resize(uint64_t newSize)
Resizes the internal buffer size.
virtual ~CMemoryStream()
Destructor.
void Clear()
Clears the memory buffer.
This CStream derived class allow using a file as a write-only, binary stream.
bool saveBufferToFile(const std::string &file_name)
Saves the entire buffer to a file.
uint64_t getPosition() MRPT_OVERRIDE
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
GLsizei const GLchar ** string
size_t m_size
Number of elements accessed with write access so far.
void BASE_IMPEXP free_fn_for_zmq(void *data, void *hint)
Used in mrpt_send_to_zmq(). hint points to a TFreeFnDataForZMQ struct, to be freed here...
bool m_read_only
If the memory block does not belong to the object.
void * getRawBufferData()
Method for getting a pointer to the raw stored data.
unsigned __int64 uint64_t
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...
size_t Write(const void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for writing to the stream.
CMemoryStream()
Default constructor.
void changeSize(uint64_t newSize)
Change size. This would be rarely used. Use ">>" operators for writing to stream. ...
uint64_t getTotalBytesCount() MRPT_OVERRIDE
Returns the total size of the internal buffer.
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
Introduces a pure virtual method for moving to a specified position in the streamed resource...
void set(const T *p)
This method can change the pointer, since the change is made explicitly, not through copy operators t...
void_ptr_noncopy m_memory
Internal data.
size_t Read(void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for reading from the stream.
bool loadBufferFromFile(const std::string &file_name)
Loads the entire buffer from a file *.
GLsizei GLsizei GLenum GLenum const GLvoid * data