GRUTinizer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
TRawEventSource Class Reference

#include <TRawEventSource.h>

Inheritance diagram for TRawEventSource:
TMultiRawFile TOrderedRawFile TRawEventByteSource TRawFile TSequentialRawFile TRawEventFileSource TRawEventGZipSource TRawEventOnlineFileSource TRawEventPipeSource TRawFileIn TRawEventBZipSource TRawEventRingSource

Public Member Functions

 TRawEventSource ()
virtual ~TRawEventSource ()
int Read (TRawEvent &event)
 Reads the next event.
int Read (TRawEvent *event)
virtual std::string SourceDescription () const =0
virtual std::string Status () const =0
virtual int GetLastErrno () const
virtual std::string GetLastError () const
bool IsFinished () const
size_t GetBytesGiven () const
double GetAverageRate () const

Static Public Member Functions

static TRawEventSourceEventSource (const char *filename, bool is_online=false, bool is_ring=false, kFileType file_type=DefaultFileType())

Protected Member Functions

void SetLastErrno (int error)
void SetLastError (std::string error)

Private Member Functions

virtual int GetEvent (TRawEvent &event)=0
 Given a pointer to a TRawEvent, read the next event.
void UpdateByteThroughput (int bytes)
 ClassDef (TRawEventSource, 0)

Static Private Member Functions

static kFileType DefaultFileType ()

Private Attributes

size_t fBytesGiven
int fLastErrno
bool fIsFinished
std::string fLastError
std::deque< size_t > fBytesPerSecond
time_t current_time
int seconds_to_average

Constructor & Destructor Documentation

TRawEventSource::TRawEventSource ( )
inline
virtual TRawEventSource::~TRawEventSource ( )
inlinevirtual

Member Function Documentation

TRawEventSource::ClassDef ( TRawEventSource  ,
 
)
private
kFileType TRawEventSource::DefaultFileType ( )
staticprivate
TRawEventSource * TRawEventSource::EventSource ( const char *  filename,
bool  is_online = false,
bool  is_ring = false,
kFileType  file_type = DefaultFileType() 
)
static
double TRawEventSource::GetAverageRate ( ) const
size_t TRawEventSource::GetBytesGiven ( ) const
inline
virtual int TRawEventSource::GetEvent ( TRawEvent event)
privatepure virtual

Given a pointer to a TRawEvent, read the next event.

Parameters
eventThe event to be filled.
Returns
The number of bytes that are read. Should return negative if there are no more events to be read.
virtual int TRawEventSource::GetLastErrno ( ) const
inlinevirtual
virtual std::string TRawEventSource::GetLastError ( ) const
inlinevirtual
bool TRawEventSource::IsFinished ( ) const
inline
int TRawEventSource::Read ( TRawEvent event)

Reads the next event.

Parameters
eventThe location of the event to be written.
Returns
The number of bytes read. If 0 is returned, no event has been read, but the source may provide an event later. This is useful for online data analysis. If a negative number is returned, there was an error while reading, possibly the end of file.
int TRawEventSource::Read ( TRawEvent event)
void TRawEventSource::SetLastErrno ( int  error)
inlineprotected
void TRawEventSource::SetLastError ( std::string  error)
inlineprotected
virtual std::string TRawEventSource::SourceDescription ( ) const
pure virtual
virtual std::string TRawEventSource::Status ( ) const
pure virtual
void TRawEventSource::UpdateByteThroughput ( int  bytes)
private

Member Data Documentation

time_t TRawEventSource::current_time
private
size_t TRawEventSource::fBytesGiven
private
std::deque<size_t> TRawEventSource::fBytesPerSecond
private
bool TRawEventSource::fIsFinished
private
int TRawEventSource::fLastErrno
private
std::string TRawEventSource::fLastError
private
int TRawEventSource::seconds_to_average
private

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