ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
Public Member Functions | Public Attributes | List of all members
DaqControllerFake Struct Reference

#include <managerMock.hpp>

+ Inheritance diagram for DaqControllerFake:

Public Member Functions

 DaqControllerFake (std::shared_ptr< daq::ObservableStatus > status_arg)
 
boost::future< daq::StateStartAsync () override
 Starts the data acquisition. More...
 
boost::future< daq::StatusStopAsync (daq::ErrorPolicy policy) override
 Stops the data acquisition. More...
 
boost::future< daq::StatusAbortAsync (daq::ErrorPolicy policy) override
 Aborts the data acquisition. More...
 
boost::future< daq::StateScheduleMergeAsync () override
 Schedules DAQ for merging by sending request to DPM. More...
 
void UpdateKeywords (daq::fits::KeywordVector const &keywords) override
 Updates (replace or add) list of keywords. More...
 
boost::future< daq::StateAwaitAsync (std::vector< std::string > sources, std::chrono::milliseconds timeout) override
 Awaits that data acquisition stops or aborts. More...
 
daq::State GetState () const DAQ_NOEXCEPT override
 
std::shared_ptr< daq::ObservableStatusGetStatus () DAQ_NOEXCEPT override
 
std::shared_ptr< daq::ObservableStatus const > GetStatus () const DAQ_NOEXCEPT override
 
std::shared_ptr< daq::ObservableEventLogGetEventLog () DAQ_NOEXCEPT override
 
std::string const & GetId () const DAQ_NOEXCEPT override
 
bool GetErrorFlag () const DAQ_NOEXCEPT override
 
daq::DaqContext const & GetContext () const DAQ_NOEXCEPT override
 
boost::signals2::connection ConnectContext (ContextSignal::slot_type const &slot) override
 Connect observer that is invoked when context is modified. More...
 
- Public Member Functions inherited from daq::DaqController
 DaqController ()=default
 
virtual ~DaqController ()=default
 

Public Attributes

ContextSignal signal
 
std::shared_ptr< daq::ObservableStatusstatus
 
daq::DaqContext ctx
 

Additional Inherited Members

- Public Types inherited from daq::DaqController
using ContextSignal = boost::signals2::signal< void(DaqContext const &)>
 

Detailed Description

Definition at line 27 of file managerMock.hpp.

Constructor & Destructor Documentation

◆ DaqControllerFake()

DaqControllerFake::DaqControllerFake ( std::shared_ptr< daq::ObservableStatus status_arg)
inline

Definition at line 28 of file managerMock.hpp.

Member Function Documentation

◆ AbortAsync()

boost::future<daq::Status> DaqControllerFake::AbortAsync ( daq::ErrorPolicy  policy)
inlineoverridevirtual

Aborts the data acquisition.

Parameters
policyError policy determining if errors are tolerated or not.

It is possible to issue this request more than once, to e.g. retry a failed abort attempt.

Precondition
GetState() not in (State::Aborted, State::Stopped)
Postcondition
GetState() == State::Aborting if a data acquisition was ongoing otherwise GetState() == State::Aborted.

Implements daq::DaqController.

Definition at line 38 of file managerMock.hpp.

◆ AwaitAsync()

boost::future<daq::State> DaqControllerFake::AwaitAsync ( std::vector< std::string >  sources,
std::chrono::milliseconds  timeout 
)
inlineoverridevirtual

Awaits that data acquisition stops or aborts.

It is possible to await only only a subset of data sources by specifying their ids in sources.

Parameters
sourcesAn optional vector of source-ids to await, if empty all primary sources are awaited on.
Returns
future set with std::invalid_argument if source-id is not recognized.
future set with boost::broken_promise if DaqController is destroyed before operation completes.

Implements daq::DaqController.

Definition at line 48 of file managerMock.hpp.

◆ ConnectContext()

boost::signals2::connection DaqControllerFake::ConnectContext ( ContextSignal::slot_type const &  slot)
inlineoverridevirtual

Connect observer that is invoked when context is modified.

Parameters
oObserver callable invoked on context changes.
Returns
signal connection object that can be used to disconnect observer:

Implements daq::DaqController.

Definition at line 74 of file managerMock.hpp.

◆ GetContext()

daq::DaqContext const& DaqControllerFake::GetContext ( ) const
inlineoverridevirtual

Implements daq::DaqController.

Definition at line 69 of file managerMock.hpp.

◆ GetErrorFlag()

bool DaqControllerFake::GetErrorFlag ( ) const
inlineoverridevirtual
Returns
Error flag.

Implements daq::DaqController.

Definition at line 66 of file managerMock.hpp.

◆ GetEventLog()

std::shared_ptr<daq::ObservableEventLog> DaqControllerFake::GetEventLog ( )
inlineoverridevirtual
Returns
event log associated with this daq.

Implements daq::DaqController.

Definition at line 60 of file managerMock.hpp.

◆ GetId()

std::string const& DaqControllerFake::GetId ( ) const
inlineoverridevirtual
Returns
data acquisition identifier.

Implements daq::DaqController.

Definition at line 63 of file managerMock.hpp.

◆ GetState()

daq::State DaqControllerFake::GetState ( ) const
inlineoverridevirtual
Returns
state of data acquisition.

Implements daq::DaqController.

Definition at line 51 of file managerMock.hpp.

◆ GetStatus() [1/2]

std::shared_ptr<daq::ObservableStatus const> DaqControllerFake::GetStatus ( ) const
inlineoverridevirtual

Implements daq::DaqController.

Definition at line 57 of file managerMock.hpp.

◆ GetStatus() [2/2]

std::shared_ptr<daq::ObservableStatus> DaqControllerFake::GetStatus ( )
inlineoverridevirtual
Returns
status object associated with this daq.

Implements daq::DaqController.

Definition at line 54 of file managerMock.hpp.

◆ ScheduleMergeAsync()

boost::future<daq::State> DaqControllerFake::ScheduleMergeAsync ( )
inlineoverridevirtual

Schedules DAQ for merging by sending request to DPM.

Returns
future containing exception:
  • std::logic_error if DAQ has already been scheduled
  • mal::TimeoutException if DPM is offline (timeout).
  • unspecified DPM fails

Implements daq::DaqController.

Definition at line 41 of file managerMock.hpp.

◆ StartAsync()

boost::future<daq::State> DaqControllerFake::StartAsync ( )
inlineoverridevirtual

Starts the data acquisition.

Returns
A future that will be Set once data acquisition has started or or fails.
Exceptions
std::exception-derivedexception if internal error occurs.
Returns
Future that is ready once all sources are started or failed.
Precondition
GetState() == State::Notstarted
Postcondition
GetState() == State::Starting on success GetState() == State::Error on error

Implements daq::DaqController.

Definition at line 32 of file managerMock.hpp.

◆ StopAsync()

boost::future<daq::Status> DaqControllerFake::StopAsync ( daq::ErrorPolicy  policy)
inlineoverridevirtual

Stops the data acquisition.

Precondition
GetState() not in (State::Stopped or State::Aborted)
Postcondition
GetState() == State::Stopping

Implements daq::DaqController.

Definition at line 35 of file managerMock.hpp.

◆ UpdateKeywords()

void DaqControllerFake::UpdateKeywords ( daq::fits::KeywordVector const &  keywords)
inlineoverridevirtual

Updates (replace or add) list of keywords.

Parameters
keywordsKeywords to add.

Implements daq::DaqController.

Definition at line 44 of file managerMock.hpp.

Member Data Documentation

◆ ctx

daq::DaqContext DaqControllerFake::ctx

Definition at line 81 of file managerMock.hpp.

◆ signal

ContextSignal DaqControllerFake::signal

Definition at line 78 of file managerMock.hpp.

◆ status

std::shared_ptr<daq::ObservableStatus> DaqControllerFake::status

Definition at line 80 of file managerMock.hpp.


The documentation for this struct was generated from the following file: