MarlinMT  0.1.0
marlinmt::SequenceItem Class Reference

SequenceItem class Handle a processor pointer and call Processor::processEvent in a critical section if configured accordingly. More...

#include <Sequence.h>

Public Member Functions

 ~SequenceItem ()=default
 
 SequenceItem (std::shared_ptr< Processor > proc)
 Constructor. More...
 
 SequenceItem (std::shared_ptr< Processor > proc, std::shared_ptr< std::mutex > lock)
 Constructor. More...
 
void processRunHeader (std::shared_ptr< RunHeader > rhdr)
 Process the run header. More...
 
clock::pair processEvent (std::shared_ptr< EventStore > event)
 Call Processor::processEvent. More...
 
std::shared_ptr< Processorprocessor () const
 Call Processor::modifyEvent. More...
 
const std::string & name () const
 Get the processor name. More...
 

Private Attributes

std::shared_ptr< Processor_processor {nullptr}
 < The processor instance More...
 
std::shared_ptr< std::mutex > _mutex {nullptr}
 

Detailed Description

SequenceItem class Handle a processor pointer and call Processor::processEvent in a critical section if configured accordingly.

Definition at line 34 of file Sequence.h.

Constructor & Destructor Documentation

◆ ~SequenceItem()

marlinmt::SequenceItem::~SequenceItem ( )
default

◆ SequenceItem() [1/2]

marlinmt::SequenceItem::SequenceItem ( std::shared_ptr< Processor proc)

Constructor.

No internal locking

Parameters
proca pointer on a processor

Definition at line 16 of file Sequence.cc.

References _processor.

◆ SequenceItem() [2/2]

marlinmt::SequenceItem::SequenceItem ( std::shared_ptr< Processor proc,
std::shared_ptr< std::mutex >  lock 
)

Constructor.

Parameters
proca pointer on a processor
lockthe mutex instance to use

Definition at line 26 of file Sequence.cc.

References _processor.

Member Function Documentation

◆ name()

const std::string & marlinmt::SequenceItem::name ( ) const

Get the processor name.

Definition at line 77 of file Sequence.cc.

References _processor.

Referenced by marlinmt::SuperSequence::addProcessor().

◆ processEvent()

clock::pair marlinmt::SequenceItem::processEvent ( std::shared_ptr< EventStore event)

Call Processor::processEvent.

Lock if the mutex has been initialized. Call time is returned in a pair as :

  • first : the total time taking into account the mutex waiting time
  • second : the time spent on process event only
Parameters
eventthe event to process

Definition at line 48 of file Sequence.cc.

References _mutex, _processor, and marlinmt::clock::now().

◆ processor()

std::shared_ptr< Processor > marlinmt::SequenceItem::processor ( ) const

Call Processor::modifyEvent.

Lock if the mutex has been initialized Call time is returned in a pair as :

  • first : the total time taking into account the mutex waiting time
  • second : the time spent on process event only
Parameters
eventthe event to modify Get the processor instance

Definition at line 71 of file Sequence.cc.

References _processor.

Referenced by marlinmt::SuperSequence::addProcessor(), and marlinmt::Sequence::createItem().

◆ processRunHeader()

void marlinmt::SequenceItem::processRunHeader ( std::shared_ptr< RunHeader rhdr)

Process the run header.

Parameters
rhdrthe run header to process

Definition at line 36 of file Sequence.cc.

References _mutex, and _processor.

Member Data Documentation

◆ _mutex

std::shared_ptr<std::mutex> marlinmt::SequenceItem::_mutex {nullptr}
private

Definition at line 94 of file Sequence.h.

Referenced by processEvent(), and processRunHeader().

◆ _processor

std::shared_ptr<Processor> marlinmt::SequenceItem::_processor {nullptr}
private

< The processor instance

The mutex instance

Definition at line 92 of file Sequence.h.

Referenced by name(), processEvent(), processor(), processRunHeader(), and SequenceItem().


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