29 m_alloc_block_size(0x1000),
42 m_alloc_block_size(0x1000),
90 "[CMemoryStream::resize] Cannot change memory block size since it " 91 "was set with 'assign'")
121 size_t nToRead = (size_t)
min(((
long)Count), maxAvail);
141 if (requiredSize >=
m_size)
size_t ReadBuffer(void *Buffer, size_t Count)
Reads a block of bytes from the stream into Buffer.
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
TSeekOrigin
Used in CStream::Seek.
uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
#define THROW_EXCEPTION(msg)
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
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.
uint64_t getPosition() override
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
bool saveBufferToFile(const std::string &file_name)
Saves the entire buffer to a file.
GLsizei const GLchar ** string
size_t m_size
Number of elements accessed with write access so far.
void free_fn_for_zmq(void *data, void *hint)
Used in mrpt_send_to_zmq().
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...
CMemoryStream()
Default constructor.
void changeSize(uint64_t newSize)
Change size.
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.
uint64_t getTotalBytesCount() override
Returns the total size of the internal buffer.
bool loadBufferFromFile(const std::string &file_name)
Loads the entire buffer from a file *.
GLsizei GLsizei GLenum GLenum const GLvoid * data
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".