HerdSoftware  0.1.1
Public Member Functions | List of all members
Herd::DataReader Class Referenceabstract

Base class for DataReaders. More...

#include <dataproviders/readers/DataReader.h>

Inheritance diagram for Herd::DataReader:
Herd::GGSSimReader Herd::ParametricGeoReader

Public Member Functions

virtual bool SetCurrentEvent (unsigned int event)=0
 Sets the current event. More...
 
virtual bool IsObjectAvailable (const std::string &name)=0
 Check if an object is available. More...
 
virtual bool IsObjectKnown (const std::string &name)=0
 Check if an object is known. More...
 
virtual RetrievalResult GetObject (const std::string &name, ObjectCategory category, ObjectWrapper &wrapper, std::string &actualName)=0
 Provides an object. More...
 
virtual std::vector< std::string > FreeObjects (const std::vector< std::string > &objs, Memory::Status memStatus)=0
 Free the memory of unneeded objects. More...
 

Detailed Description

Base class for DataReaders.

Base class for DataReaders. Implements the minimal interface for derived classes. Readers are supposed to encapsulate the I/O read for similar kind of objects (e.g. geometry parameters, event hits, etc..) Readers are not supposed to publish objects, but only to retrieve them when their parent DataProvider asks.

Member Function Documentation

◆ FreeObjects()

virtual std::vector<std::string> Herd::DataReader::FreeObjects ( const std::vector< std::string > &  objs,
Memory::Status  memStatus 
)
pure virtual

Free the memory of unneeded objects.

This method should free the memory of the provided objects if memStatus is EXHAUSTED. However implementation is delegated to derived class.

Parameters
objsThe list of objects to be freed.
memStatusThe current memory occupation status.
Returns
a list of freed objects.

Implemented in Herd::GGSSimReader, and Herd::ParametricGeoReader.

◆ GetObject()

virtual RetrievalResult Herd::DataReader::GetObject ( const std::string &  name,
ObjectCategory  category,
ObjectWrapper &  wrapper,
std::string &  actualName 
)
pure virtual

Provides an object.

See the description of the class for more information about the provided objects.

Parameters
nameThe name or alias of the requested object.
categoryThe category of the requested object.
wrapperWrapper for return value.
actualNameThe name of the object in case we're asking for an alias
Returns
A RetrievalResult code with the result of the retrieval operation

Implemented in Herd::GGSSimReader, and Herd::ParametricGeoReader.

◆ IsObjectAvailable()

virtual bool Herd::DataReader::IsObjectAvailable ( const std::string &  name)
pure virtual

Check if an object is available.

Check in list of known providable objects if it is available or not.

Parameters
nameThe name or alias of the requested object.
Returns
true if the object can be retrieved, false otherwise.

Implemented in Herd::GGSSimReader, and Herd::ParametricGeoReader.

◆ IsObjectKnown()

virtual bool Herd::DataReader::IsObjectKnown ( const std::string &  name)
pure virtual

Check if an object is known.

Check in list of known providable objects if it is there or not.

Parameters
nameThe name or alias of the requested object.
Returns
true if the object is a known one, false otherwise.

Implemented in Herd::GGSSimReader, and Herd::ParametricGeoReader.

◆ SetCurrentEvent()

virtual bool Herd::DataReader::SetCurrentEvent ( unsigned int  event)
pure virtual

Sets the current event.

Parameters
eventThe index of the event to be set as current.
Returns
true if the event number is a valid value, false otherwise.

Implemented in Herd::GGSSimReader, and Herd::ParametricGeoReader.


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