Fixed size memory buffer as a stream.
More...
#include <io.h>
|
| | MemoryFixSizeBuffer (void *p_buffer, std::size_t buffer_size) |
| | Ctor.
|
| |
|
std::size_t | Read (void *ptr, std::size_t size) override |
| |
|
void | Write (const void *ptr, std::size_t size) override |
| |
|
void | Seek (std::size_t pos) override |
| |
| std::size_t | Tell () override |
| | Current position in the buffer (stream).
|
| |
|
virtual bool | AtEnd () const |
| |
| virtual void | Seek (size_t pos)=0 |
| | seek to certain position of the file
|
| |
| virtual size_t | Read (void *ptr, size_t size)=0 |
| | reads data from a stream
|
| |
| virtual void | Write (const void *ptr, size_t size)=0 |
| | writes data to a stream
|
| |
|
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 std::size_t constexpr | kSeekEnd = std::numeric_limits<std::size_t>::max() |
| |
|
|
char * | p_buffer_ {nullptr} |
| | in memory buffer
|
| |
|
std::size_t | buffer_size_ {0} |
| | current pointer
|
| |
|
std::size_t | curr_ptr_ {0} |
| | current pointer
|
| |
|
| 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
|
| |
Fixed size memory buffer as a stream.
◆ MemoryFixSizeBuffer()
| rabit::utils::MemoryFixSizeBuffer::MemoryFixSizeBuffer |
( |
void * |
p_buffer, |
|
|
std::size_t |
buffer_size |
|
) |
| |
|
inline |
Ctor.
- Parameters
-
| p_buffer | Pointer to the source buffer with size buffer_size. |
| buffer_size | Size of the source buffer |
◆ Tell()
| std::size_t rabit::utils::MemoryFixSizeBuffer::Tell |
( |
void |
| ) |
|
|
inlineoverridevirtual |
The documentation for this struct was generated from the following file:
- External/xgboost/rabit/include/rabit/internal/io.h