1 #ifndef MARLINMT_DATASOURCEPLUGIN_h 2 #define MARLINMT_DATASOURCEPLUGIN_h 1 26 using EventFunction = std::function<void(std::shared_ptr<EventStore>)> ;
42 const std::string &
type()
const ;
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 onEventRead(EventFunction func)
Set the callback function to process on event read.
DataSourcePlugin class Responsible for reading/getting LCEvent and LCRunHeader in the framework for f...
DataSourcePlugin(const std::string &dstype)
Constructor.
RunHeaderFunction _onRunHeaderRead
std::string _description
< The data source description
virtual void readAll()
Read the full stream until the end See readOne() for details.
virtual void initialize() override
Init data source.
virtual ~DataSourcePlugin()=default
std::function< void(std::shared_ptr< RunHeader >)> RunHeaderFunction
void onRunHeaderRead(RunHeaderFunction func)
Set the callback function to process on run header read.
const std::string & description() const
Get the data source description.
virtual bool readOne()=0
Read one record from the input stream.
const std::string & type() const
Get the data source type.
EventFunction _onEventRead
< The callback function on event read