mxnet
Public Member Functions | List of all members
dmlc::MemoryFixedSizeStream Struct Reference

A Stream that operates on fixed region of memory This class allows us to read/write from/to a fixed memory region. More...

#include <memory_io.h>

Inheritance diagram for dmlc::MemoryFixedSizeStream:
Inheritance graph
Collaboration diagram for dmlc::MemoryFixedSizeStream:
Collaboration graph

Public Member Functions

 MemoryFixedSizeStream (void *p_buffer, size_t buffer_size)
 constructor More...
 
virtual size_t Read (void *ptr, size_t size)
 reads data from a stream More...
 
virtual void Write (const void *ptr, size_t size)
 writes data to a stream More...
 
virtual void Seek (size_t pos)
 seek to certain position of the file More...
 
virtual size_t Tell (void)
 tell the position of the stream More...
 
- Public Member Functions inherited from dmlc::SeekStream
virtual ~SeekStream (void)
 
- Public Member Functions inherited from dmlc::Stream
virtual ~Stream (void)
 virtual destructor More...
 
template<typename T >
void Write (const T &data)
 writes a data to stream. More...
 
template<typename T >
bool Read (T *out_data)
 loads a data from stream. More...
 
template<typename T >
void WriteArray (const T *data, size_t num_elems)
 Endian aware write array of data. More...
 
template<typename T >
bool ReadArray (T *data, size_t num_elems)
 Endian aware read array of data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from dmlc::SeekStream
static SeekStreamCreateForRead (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 More...
 
- Static Public Member Functions inherited from dmlc::Stream
static StreamCreate (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 More...
 

Detailed Description

A Stream that operates on fixed region of memory This class allows us to read/write from/to a fixed memory region.

Constructor & Destructor Documentation

dmlc::MemoryFixedSizeStream::MemoryFixedSizeStream ( void *  p_buffer,
size_t  buffer_size 
)
inline

constructor

Parameters
p_bufferthe head pointer of the memory region.
buffer_sizethe size of the memorybuffer

Member Function Documentation

virtual size_t dmlc::MemoryFixedSizeStream::Read ( void *  ptr,
size_t  size 
)
inlinevirtual

reads data from a stream

Parameters
ptrpointer to a memory buffer
sizeblock size
Returns
the size of data read

Implements dmlc::Stream.

virtual void dmlc::MemoryFixedSizeStream::Seek ( size_t  pos)
inlinevirtual

seek to certain position of the file

Implements dmlc::SeekStream.

virtual size_t dmlc::MemoryFixedSizeStream::Tell ( void  )
inlinevirtual

tell the position of the stream

Implements dmlc::SeekStream.

virtual void dmlc::MemoryFixedSizeStream::Write ( const void *  ptr,
size_t  size 
)
inlinevirtual

writes data to a stream

Parameters
ptrpointer to a memory buffer
sizeblock size

Implements dmlc::Stream.


The documentation for this struct was generated from the following file: