ATLAS Offline Software
Public Member Functions | List of all members
EL::Detail::IInputModuleActions Class Referenceabstract

the actions that Module::processInputs can perform More...

#include <IInputModuleActions.h>

Inheritance diagram for EL::Detail::IInputModuleActions:
Collaboration diagram for EL::Detail::IInputModuleActions:

Public Member Functions

virtual ~IInputModuleActions () noexcept=default
 standard virtual destructor More...
 
virtual ::StatusCode processEvents (EventRange &eventRange)=0
 process the given event range More...
 
virtual ::StatusCode openInputFile (const std::string &inputFileUrl)=0
 open the given input file without processing it More...
 
virtual Long64_t inputFileNumEntries () const =0
 the number of events in the input file More...
 

Detailed Description

the actions that Module::processInputs can perform

The main reason to have this interface is that it is much easier to write an input module if it can call functions to perform actions directly (as opposed to e.g. returning which file to open next, etc.).

There is a canonical implementation of this interface that is used in the worker, but I'm using an abstract interface to decouple the input modules from the actual worker implementation. In addition, this makes it easier to write tests for input modules, or to employ a decorator pattern, should the need arise.

This interface is not frozen, but reflects the need of the input modules I have defined.

Definition at line 41 of file IInputModuleActions.h.

Constructor & Destructor Documentation

◆ ~IInputModuleActions()

virtual EL::Detail::IInputModuleActions::~IInputModuleActions ( )
virtualdefaultnoexcept

standard virtual destructor

Member Function Documentation

◆ inputFileNumEntries()

virtual Long64_t EL::Detail::IInputModuleActions::inputFileNumEntries ( ) const
pure virtual

the number of events in the input file

Precondition
inputFile() != 0

Implemented in EL::Worker.

◆ openInputFile()

virtual ::StatusCode EL::Detail::IInputModuleActions::openInputFile ( const std::string &  inputFileUrl)
pure virtual

open the given input file without processing it

This is mostly to allow the driver to query the number of events in the input file without processing it, usually to determine the range of events to process.

Guarantee
basic
Failures
file can't be opened

Implemented in EL::Worker.

◆ processEvents()

virtual ::StatusCode EL::Detail::IInputModuleActions::processEvents ( EventRange eventRange)
pure virtual

process the given event range

This will update eventRange if the end is set to eof

Guarantee
basic
Failures
file can't be opened
event range exceeds length of file
processing failures

Implemented in EL::Worker.


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