a in memory buffer that can be read and write as stream interface
More...
#include <io.h>
|
| MemoryBufferStream (std::string *p_buffer) |
|
size_t | Read (void *ptr, size_t size) override |
| reads data from a stream
|
|
void | Write (const void *ptr, size_t size) override |
| writes data to a stream
|
|
void | Seek (size_t pos) override |
| seek to certain position of the file
|
|
size_t | Tell () override |
| tell the position of the stream
|
|
virtual bool | AtEnd () const |
|
virtual | ~Stream (void) |
| virtual destructor
|
|
template<typename T > |
void | Write (const T &data) |
| writes a data to stream.
|
|
template<typename T > |
bool | Read (T *out_data) |
| loads a data from stream.
|
|
template<typename T > |
void | WriteArray (const T *data, size_t num_elems) |
| Endian aware write array of data.
|
|
template<typename T > |
bool | ReadArray (T *data, size_t num_elems) |
| Endian aware read array of data.
|
|
|
static SeekStream * | CreateForRead (const char *uri, bool allow_null=false) |
| generic factory function create an SeekStream for read only, the stream will close the underlying files upon deletion error will be reported and the system will exit when create failed
|
|
static Stream * | Create (const char *uri, const char *const flag, bool allow_null=false) |
| generic factory function create an stream, the stream will close the underlying files upon deletion
|
|
a in memory buffer that can be read and write as stream interface
◆ Read()
size_t rabit::utils::MemoryBufferStream::Read |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
reads data from a stream
- Parameters
-
ptr | pointer to a memory buffer |
size | block size |
- Returns
- the size of data read
Implements dmlc::Stream.
◆ Seek()
void rabit::utils::MemoryBufferStream::Seek |
( |
size_t |
pos | ) |
|
|
inlineoverridevirtual |
◆ Tell()
size_t rabit::utils::MemoryBufferStream::Tell |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Write()
void rabit::utils::MemoryBufferStream::Write |
( |
const void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
writes data to a stream
- Parameters
-
ptr | pointer to a memory buffer |
size | block size |
Implements dmlc::Stream.
The documentation for this struct was generated from the following file:
- External/xgboost/rabit/include/rabit/internal/io.h