mxnet
Public Member Functions | Static Public Member Functions | List of all members
dmlc::SeekStream Class Referenceabstract

interface of i/o stream that support seek More...

#include <io.h>

Inheritance diagram for dmlc::SeekStream:
Inheritance graph
Collaboration diagram for dmlc::SeekStream:
Collaboration graph

Public Member Functions

virtual ~SeekStream (void)
 
virtual void Seek (size_t pos)=0
 seek to certain position of the file More...
 
virtual size_t Tell (void)=0
 tell the position of the stream More...
 
- Public Member Functions inherited from dmlc::Stream
virtual size_t Read (void *ptr, size_t size)=0
 reads data from a stream More...
 
virtual void Write (const void *ptr, size_t size)=0
 writes data to a stream More...
 
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...
 

Static Public Member Functions

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

interface of i/o stream that support seek

Constructor & Destructor Documentation

virtual dmlc::SeekStream::~SeekStream ( void  )
inlinevirtual

Member Function Documentation

static SeekStream* dmlc::SeekStream::CreateForRead ( const char *  uri,
bool  allow_null = false 
)
static

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

Parameters
urithe uri of the input currently we support hdfs://, s3://, and file:// by default file:// will be used
allow_nullwhether NULL can be returned, or directly report error
Returns
the created stream, can be NULL when allow_null == true and file do not exist
virtual void dmlc::SeekStream::Seek ( size_t  pos)
pure virtual

seek to certain position of the file

Implemented in dmlc::MemoryStringStream, and dmlc::MemoryFixedSizeStream.

virtual size_t dmlc::SeekStream::Tell ( void  )
pure virtual

tell the position of the stream

Implemented in dmlc::MemoryStringStream, and dmlc::MemoryFixedSizeStream.


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