ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Public Types | Public Member Functions | List of all members
daq::dpm::SchedulerImpl Class Reference

#include <scheduler.hpp>

+ Inheritance diagram for daq::dpm::SchedulerImpl:

Public Types

using DaqControllerFactory = std::function< std::unique_ptr< DaqController >(std::unique_ptr< DaqWorkspace >, Resources &)>
 
- Public Types inherited from daq::dpm::Scheduler
using StatusSignal = boost::signals2::signal< void(Status const &)>
 Signals. More...
 

Public Member Functions

 SchedulerImpl (rad::IoExecutor &executor, Workspace &workspace, DaqControllerFactory daq_controller_factory, SchedulerOptions const &options)
 Constructs a scheduler loading information from workspace ws. More...
 
std::string QueueDaq (std::string const &dp_spec) override
 Queues DAQ for processing. More...
 
void AbortDaq (std::string const &) override
 Abort merging DAQ identified by id. More...
 
bool IsQueued (std::string const &id) const noexcept override
 Queries if DAQ with ID has been queued before in the current workspace. More...
 
Status GetDaqStatus (std::string const &id) const override
 Queries current DAQ status, possibly from last recorded status in workspace. More...
 
std::vector< std::string > GetQueue () const noexcept override
 Queries current DAQ queue. More...
 
void Start () override
 Start/stop operations. More...
 
void Stop () override
 
Signals.
boost::signals2::connection ConnectStatus (StatusSignal::slot_type const &slot) override
 Signals. More...
 
- Public Member Functions inherited from daq::dpm::Scheduler
virtual ~Scheduler ()
 

Detailed Description

Definition at line 346 of file scheduler.hpp.

Member Typedef Documentation

◆ DaqControllerFactory

using daq::dpm::SchedulerImpl::DaqControllerFactory = std::function<std::unique_ptr<DaqController>(std::unique_ptr<DaqWorkspace>, Resources&)>

Definition at line 348 of file scheduler.hpp.

Constructor & Destructor Documentation

◆ SchedulerImpl()

daq::dpm::SchedulerImpl::SchedulerImpl ( rad::IoExecutor executor,
Workspace workspace,
DaqControllerFactory  daq_controller_factory,
SchedulerOptions const &  options 
)

Constructs a scheduler loading information from workspace ws.

The scheduler will load the stored list of queued DAQs and schedule operations to be performed in priority order.

Definition at line 64 of file scheduler.cpp.

Member Function Documentation

◆ AbortDaq()

void daq::dpm::SchedulerImpl::AbortDaq ( std::string const &  id)
overridevirtual

Abort merging DAQ identified by id.

Note
Workspace related to this will be purged.
Parameters
idDAQ id.
Exceptions
std::invalid_argumentif DAQ is unknown.

Implements daq::dpm::Scheduler.

Definition at line 185 of file scheduler.cpp.

◆ ConnectStatus()

boost::signals2::connection daq::dpm::SchedulerImpl::ConnectStatus ( StatusSignal::slot_type const &  slot)
overridevirtual

Signals.

Implements daq::dpm::Scheduler.

Definition at line 243 of file scheduler.cpp.

◆ GetDaqStatus()

Status daq::dpm::SchedulerImpl::GetDaqStatus ( std::string const &  id) const
overridevirtual

Queries current DAQ status, possibly from last recorded status in workspace.

Parameters
idDAQ id.
Returns
Merge status of id.
Exceptions
std::invalid_argumentif DAQ is not known.

Implements daq::dpm::Scheduler.

Definition at line 170 of file scheduler.cpp.

◆ GetQueue()

std::vector< std::string > daq::dpm::SchedulerImpl::GetQueue ( ) const
overridevirtualnoexcept

Queries current DAQ queue.

Returns
list of DAQs pending or already started to be merged.

Implements daq::dpm::Scheduler.

Definition at line 181 of file scheduler.cpp.

◆ IsQueued()

bool daq::dpm::SchedulerImpl::IsQueued ( std::string const &  id) const
overridevirtualnoexcept

Queries if DAQ with ID has been queued before in the current workspace.

Parameters
idDAQ id.
Returns
true if DAQ is in the merge queue, false otherwise.
Exceptions
std::invalid_argumentif DAQ is not known.

Implements daq::dpm::Scheduler.

Definition at line 166 of file scheduler.cpp.

◆ QueueDaq()

std::string daq::dpm::SchedulerImpl::QueueDaq ( std::string const &  dp_spec)
overridevirtual

Queues DAQ for processing.

Note
Scheduler is responsible for creating unique local names for input files.
Parameters
dp_specJSON encoded Data Product Specification. If parsing fails a std::invalid_argument will be thrown.
Returns
DAQ id on success.
Exceptions
std::invalid_argumentif dp_spec is invalid or is already queued.

Implements daq::dpm::Scheduler.

Definition at line 96 of file scheduler.cpp.

◆ Start()

void daq::dpm::SchedulerImpl::Start ( )
overridevirtual

Start/stop operations.

This assumes the implementation has an internal scheduler that it uses.

Implements daq::dpm::Scheduler.

Definition at line 87 of file scheduler.cpp.

◆ Stop()

void daq::dpm::SchedulerImpl::Stop ( )
overridevirtual

Implements daq::dpm::Scheduler.

Definition at line 92 of file scheduler.cpp.


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