proio
Public Member Functions | List of all members
proio::Reader Class Reference

#include <reader.h>

Inheritance diagram for proio::Reader:

Public Member Functions

 Reader (int fd)
 
 Reader (std::string filename)
 
EventNext (Event *recycledEvent=NULL, bool metadataOnly=false)
 
bool Next (std::string *data)
 
uint64_t Skip (uint64_t nEvents)
 
void SeekToStart ()
 
const google::protobuf::DescriptorPool * DescriptorPool ()
 

Detailed Description

Reader for proio files

Definition at line 38 of file reader.h.

Constructor & Destructor Documentation

Reader::Reader ( int  fd)

Constructor for providing a file descriptor

Definition at line 13 of file reader.cc.

Reader::Reader ( std::string  filename)

Constructor that creates a file descriptor from the path of an existing file.

Definition at line 21 of file reader.cc.

Member Function Documentation

const google::protobuf::DescriptorPool* proio::Reader::DescriptorPool ( )
inline

DescriptorPool returns a pointer to a protobuf descriptor pool that has been built from information included in the stream or file. This can be passed to Events in order to dynamically read entries of types that are not known at compile time.

Definition at line 73 of file reader.h.

Event * Reader::Next ( Event recycledEvent = NULL,
bool  metadataOnly = false 
)

Next returns the next available Event. This function takes two important optional arguments. The first argument is a pointer to a recycled Event to be cleared and filled by the Reader. The second argument is an option for filling only metadata; this is useful for scanning a file on disk, since only bucket headers need to be read for this.

Definition at line 39 of file reader.cc.

bool Reader::Next ( std::string *  data)

Next copies the next event data in protobuf wire format into the given string.

Definition at line 59 of file reader.cc.

void Reader::SeekToStart ( )

SeekToStart sends the reader to the beginning of the stream if it is seekable.

Definition at line 96 of file reader.cc.

uint64_t Reader::Skip ( uint64_t  nEvents)

Skip skips the next nEvents events.

Definition at line 74 of file reader.cc.


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