37 throw Exception(
"DataSourcePlugin::processRunHeader: no callback function available" ) ;
46 throw Exception(
"DataSourcePlugin::processEvent: no callback function available" ) ;
55 if( config.hasSection(
"datasource") ) {
std::function< void(std::shared_ptr< EventStore >)> EventFunction
void processRunHeader(std::shared_ptr< RunHeader > rhdr)
Must be called by daughter classes in readStream() to process an event in the framework.
void processEvent(std::shared_ptr< EventStore > event)
Must be called by daughter classes in readStream() to process an event in the framework.
void setParameters(const ConfigSection §ion, bool throwIfNotFound=false)
Set the parameters from the configuration section.
void onEventRead(EventFunction func)
Set the callback function to process on event read.
DataSourcePlugin(const std::string &dstype)
Constructor.
RunHeaderFunction _onRunHeaderRead
virtual void readAll()
Read the full stream until the end See readOne() for details.
virtual void initialize() override
Init data source.
const Application & application() const
Get the application in which the component is registered.
std::function< void(std::shared_ptr< RunHeader >)> RunHeaderFunction
void onRunHeaderRead(RunHeaderFunction func)
Set the callback function to process on run header read.
virtual bool readOne()=0
Read one record from the input stream.
EventFunction _onEventRead
< The callback function on event read
const Configuration & configuration() const
Get the main application configuration object.