AmpTools
DataReader Class Referenceabstract

#include <DataReader.h>

Inheritance diagram for DataReader:

Public Member Functions

 DataReader ()
 
 DataReader (const vector< string > &args)
 
virtual ~DataReader ()
 
virtual KinematicsgetEvent ()=0
 
virtual void resetSource ()=0
 
virtual unsigned int numEvents () const =0
 
virtual string name () const =0
 
virtual DataReadernewDataReader (const vector< string > &args) const =0
 
virtual DataReaderclone () const =0
 
virtual vector< string > arguments () const
 
virtual bool isDefault () const
 

Detailed Description

This base class provides an interface to data.

It is intended that the user writes a functional data reader that inherits indirectly from this class (through the UserDataReader class) and defines the necessary virtual member functions for accessing data.

Definition at line 57 of file DataReader.h.

Constructor & Destructor Documentation

◆ DataReader() [1/2]

DataReader::DataReader ( )
inline

This is the default constructor.

Definition at line 65 of file DataReader.h.

◆ DataReader() [2/2]

DataReader::DataReader ( const vector< string > &  args)
inline

This constructor takes a list of arguments and stores them.

Definition at line 71 of file DataReader.h.

◆ ~DataReader()

virtual DataReader::~DataReader ( )
inlinevirtual

This is the destructor.

Definition at line 78 of file DataReader.h.

Member Function Documentation

◆ arguments()

virtual vector<string> DataReader::arguments ( ) const
inlinevirtual

Returns the list of arguments that was passed to the constructor.

Definition at line 146 of file DataReader.h.

◆ clone()

virtual DataReader* DataReader::clone ( ) const
pure virtual

This method is overridden by the UserDataReader class and does not need to be defined (or used) by the user.

See also
UserDataReader

Implemented in UserDataReader< T >.

Here is the caller graph for this function:

◆ getEvent()

virtual Kinematics* DataReader::getEvent ( )
pure virtual

The user should override this function with one that provides a pointer to a Kinematics object. When the end of a source is reached, a null pointer should be returned.

Return of a pointer is done to save memory copy and allocation time. The class the receives the pointer is responsible for deleting memory when it is finished with it.

This method should be virtual in the user's class if the DataReaderMPI template is to be used.

See also
Kinematics
DataReaderMPI
Here is the caller graph for this function:

◆ isDefault()

virtual bool DataReader::isDefault ( ) const
inlinevirtual

Returns true if this instance was created using the default constructor and returns false otherwise.

Definition at line 152 of file DataReader.h.

◆ name()

virtual string DataReader::name ( ) const
pure virtual

The user should override this function with one that returns the class name of the derived data reader.

◆ newDataReader()

virtual DataReader* DataReader::newDataReader ( const vector< string > &  args) const
pure virtual

This method is overridden by the UserDataReader class and does not need to be defined (or used) by the user.

See also
UserDataReader

Implemented in UserDataReader< T >.

◆ numEvents()

virtual unsigned int DataReader::numEvents ( ) const
pure virtual

The user should override this function with one that returns the number of events in the source. This is used for allocating memory to store the data and amplitudes.

This method should be virtual in the user's class if the DataReaderMPI template is to be used.

See also
DataReaderMPI
Here is the caller graph for this function:

◆ resetSource()

virtual void DataReader::resetSource ( )
pure virtual

The user should override this function with one that resets the source so that the next call to getEvent() begins reading from the first event in the source.

This method should be virtual in the user's class if the DataReaderMPI template is to be used.

See also
DataReaderMPI
Here is the caller graph for this function:

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