Avro C++
Public Member Functions | List of all members
avro::DataFileReaderBase Class Reference

The type independent portion of rader. More...

#include <DataFile.hh>

Inheritance diagram for avro::DataFileReaderBase:

Public Member Functions

Decoderdecoder ()
 Returns the current decoder for this reader.
 
bool hasMore ()
 Returns true if and only if there is more to read.
 
void decr ()
 Decrements the number of objects yet to read.
 
 DataFileReaderBase (const char *filename)
 Constructs the reader for the given file and the reader is expected to use the schema that is used with data. More...
 
 DataFileReaderBase (std::unique_ptr< InputStream > inputStream)
 
void init ()
 Initializes the reader so that the reader and writer schemas are the same.
 
void init (const ValidSchema &readerSchema)
 Initializes the reader to read objects according to the given schema. More...
 
const ValidSchemareaderSchema ()
 Returns the schema for this object.
 
const ValidSchemadataSchema ()
 Returns the schema stored with the data file.
 
void close ()
 Closes the reader. More...
 
void seek (int64_t position)
 Move to a specific, known synchronization point, for example one returned from tell() after sync().
 
void sync (int64_t position)
 Move to the next synchronization point after a position. More...
 
bool pastSync (int64_t position)
 Return true if past the next synchronization point after a position.
 
int64_t previousSync ()
 Return the last synchronization point before our current position.
 

Detailed Description

The type independent portion of rader.

Constructor & Destructor Documentation

◆ DataFileReaderBase()

avro::DataFileReaderBase::DataFileReaderBase ( const char *  filename)

Constructs the reader for the given file and the reader is expected to use the schema that is used with data.

This function should be called exactly once after constructing the DataFileReaderBase object.

Member Function Documentation

◆ close()

void avro::DataFileReaderBase::close ( )

Closes the reader.

No further operation is possible on this reader.

◆ init()

void avro::DataFileReaderBase::init ( const ValidSchema readerSchema)

Initializes the reader to read objects according to the given schema.

This gives an opportinity for the reader to see the schema in the data file before deciding the right schema to use for reading. This must be called exactly once after constructing the DataFileReaderBase object.

◆ sync()

void avro::DataFileReaderBase::sync ( int64_t  position)

Move to the next synchronization point after a position.

To process a range of file entires, call this with the starting position, then check pastSync() with the end point before each use of decoder().


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