ifw-daq  1.0.0
IFW Data Acquisition modules
Files | Classes

OCM Server application. More...

Files

file  ocmDaqService.cpp
 Declaration of OcmDaqService.
 

Classes

class  OcmDaqService
 Implements the MAL interface ocmif::OcmDaq (async version). More...
 

Detailed Description

OCM Server application.


Class Documentation

◆ OcmDaqService

class OcmDaqService

Implements the MAL interface ocmif::OcmDaq (async version).

The server is only safe to use as a shared pointer, as weak pointers to this object is stored in asynchronous continuations, apart from the initiating operation. Provided boost::asio::io_context must outlive object and any pending operations.

This object can be deleted while there are operations that have not complete yet. In that case, when the operation finally completes, an exception is sent as reply, even if the requested operation would have succeeded otherwise. The io_context must stay alive however, as it will be used as an executor when asynchonous operation is continued.

A note on thread safety:

The public (asynchronous) interface will immediately defer the execution to the provided executor, so depending on the executor this can provide thread safety.

Definition at line 87 of file ocmDaqService.hpp.

+ Inheritance diagram for OcmDaqService:

Public Member Functions

 OcmDaqService (boost::asio::io_context &io_ctx, mal::Mal &mal, daq::Manager &mgr, std::string output_path)
 
 ~OcmDaqService ()
 
boost::future< std::shared_ptr<::ocmif::DaqReply > > StartDaq (const std::string &id, const std::string &file_prefix, const std::string &primary_sources, const std::string &metadata_sources, const std::string &properties) override
 
boost::future< std::shared_ptr<::ocmif::DaqReply > > StopDaq (const std::string &id) override
 
boost::future< std::shared_ptr<::ocmif::DaqReply > > ForceStopDaq (const std::string &id) override
 
boost::future< std::shared_ptr<::ocmif::DaqReply > > AbortDaq (const std::string &id) override
 
boost::future< std::shared_ptr<::ocmif::DaqReply > > ForceAbortDaq (const std::string &id) override
 
boost::future< std::shared_ptr<::ocmif::DaqReply > > UpdateKeywords (const std::string &id, const std::string &keywords) override
 
boost::future< std::shared_ptr<::ocmif::AwaitDaqReply > > AwaitDaqState (const std::string &id, ocmif::DaqState state, ocmif::DaqSubState substate, double timeout) override
 
boost::future< std::shared_ptr<::ocmif::DaqStatus > > GetStatus (const std::string &id) override
 
boost::future< std::vector< std::shared_ptr<::ocmif::DaqStatus > > > GetActiveList () override
 

Static Public Attributes

static constexpr char const * LOGGER_NAME = "ocm.service.daq"
 

Constructor & Destructor Documentation

◆ OcmDaqService()

OcmDaqService::OcmDaqService ( boost::asio::io_context &  io_ctx,
mal::Mal &  mal,
daq::Manager mgr,
std::string  output_path 
)
Parameters
io_ctxASIO io context to use as an executor. This object must outlive OcmDaqService. The io context will be progated to any created daq::DaqController instances as well.
malThe mal instance to use to create instances. This object must outlive OcmDaqService.
mgrThe data acquisition manager to use. This object must outlive OcmDaqService.

Definition at line 179 of file ocmDaqService.cpp.

◆ ~OcmDaqService()

OcmDaqService::~OcmDaqService ( )

Definition at line 194 of file ocmDaqService.cpp.

Member Function Documentation

◆ AbortDaq()

boost::future< std::shared_ptr<::ocmif::DaqReply > > OcmDaqService::AbortDaq ( const std::string &  id)
override

Definition at line 405 of file ocmDaqService.cpp.

◆ AwaitDaqState()

boost::future< std::shared_ptr<::ocmif::AwaitDaqReply > > OcmDaqService::AwaitDaqState ( const std::string &  id,
ocmif::DaqState  state,
ocmif::DaqSubState  substate,
double  timeout 
)
override

Definition at line 621 of file ocmDaqService.cpp.

◆ ForceAbortDaq()

boost::future< std::shared_ptr<::ocmif::DaqReply > > OcmDaqService::ForceAbortDaq ( const std::string &  id)
override

Definition at line 419 of file ocmDaqService.cpp.

◆ ForceStopDaq()

boost::future< std::shared_ptr<::ocmif::DaqReply > > OcmDaqService::ForceStopDaq ( const std::string &  id)
override

Definition at line 353 of file ocmDaqService.cpp.

◆ GetActiveList()

boost::future< std::vector< std::shared_ptr<::ocmif::DaqStatus > > > OcmDaqService::GetActiveList ( )
override

Definition at line 593 of file ocmDaqService.cpp.

◆ GetStatus()

boost::future< std::shared_ptr<::ocmif::DaqStatus > > OcmDaqService::GetStatus ( const std::string &  id)
override

Definition at line 558 of file ocmDaqService.cpp.

◆ StartDaq()

boost::future< std::shared_ptr<::ocmif::DaqReply > > OcmDaqService::StartDaq ( const std::string &  id,
const std::string &  file_prefix,
const std::string &  primary_sources,
const std::string &  metadata_sources,
const std::string &  properties 
)
override

Definition at line 199 of file ocmDaqService.cpp.

◆ StopDaq()

boost::future< std::shared_ptr<::ocmif::DaqReply > > OcmDaqService::StopDaq ( const std::string &  id)
override

Definition at line 339 of file ocmDaqService.cpp.

◆ UpdateKeywords()

boost::future< std::shared_ptr<::ocmif::DaqReply > > OcmDaqService::UpdateKeywords ( const std::string &  id,
const std::string &  keywords 
)
override

Definition at line 491 of file ocmDaqService.cpp.

Member Data Documentation

◆ LOGGER_NAME

constexpr char const* OcmDaqService::LOGGER_NAME = "ocm.service.daq"
staticconstexpr

Definition at line 90 of file ocmDaqService.hpp.