ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Functions
daqif Namespace Reference

Classes

struct  FullState
 Describes the full state and substate. More...
 
struct  Subscription
 Subscription. More...
 
struct  DaqReplyFake
 
struct  DaqStatusFake
 
struct  AwaitDaqReplyFake
 
struct  StorageStatusFake
 
struct  DaqReplyMock
 
struct  DaqStatusMock
 

Functions

template<class To >
To FromString (std::string_view input)
 
template<>
DaqState FromString< DaqState > (std::string_view state)
 Parse state name. More...
 
template<>
DaqSubState FromString< DaqSubState > (std::string_view state)
 Parse sub-state name. More...
 
bool operator== (FullState lhs, FullState rhs) noexcept
 Equality operator for FullState. More...
 
bool IsStateValid (DaqState state, DaqSubState substate)
 Validate state combination. More...
 
bool IsStateValid (FullState state)
 Validate state combination. More...
 
template<class TopicType , class Func >
auto MakeSubscription (elt::mal::Mal &mal, elt::mal::Uri const &uri, Func &&func) -> Subscription< TopicType >
 Builder for Subscription. More...
 
network::uri MakeServerUri (std::string uri)
 Creates a server URI. More...
 
network::uri MakeServiceUri (std::string base_uri, std::string_view service_path)
 Creates a service URI of the form <baseuri>/<service>. More...
 

Class Documentation

◆ daqif::FullState

struct daqif::FullState

Describes the full state and substate.

Definition at line 17 of file state.hpp.

Class Members
DaqState state
DaqSubState substate

◆ daqif::Subscription

struct daqif::Subscription

template<class TopicType>
struct daqif::Subscription< TopicType >

Subscription.

Definition at line 23 of file subscription.hpp.

Class Members
unique_ptr< Subscriber< TopicType > > subscriber
unique_ptr< Subscription > subscription

Function Documentation

◆ FromString()

template<class To >
To daqif::FromString ( std::string_view  input)

◆ FromString< DaqState >()

template<>
DaqState daqif::FromString< DaqState > ( std::string_view  state)

Parse state name.

Returns
State if the case-insensitive name matches a valid state.
Exceptions
std::invalid_argumentif no state matches.

Definition at line 20 of file parsing.cpp.

◆ FromString< DaqSubState >()

template<>
DaqSubState daqif::FromString< DaqSubState > ( std::string_view  state)

Parse sub-state name.

Returns
State if the case-insensitive name matches a valid state.
Exceptions
std::invalid_argumentif no state matches.

Definition at line 34 of file parsing.cpp.

◆ IsStateValid() [1/2]

bool daqif::IsStateValid ( DaqState  state,
DaqSubState  substate 
)

Validate state combination.

Returns
true if the combination of state and substate describes a valid combination.

Definition at line 16 of file state.cpp.

◆ IsStateValid() [2/2]

bool daqif::IsStateValid ( FullState  state)

Validate state combination.

Returns
true if the combination of state and substate describes a valid combination.

Definition at line 55 of file state.cpp.

◆ MakeServerUri()

network::uri daqif::MakeServerUri ( std::string  uri)

Creates a server URI.

Parameters
uriBase URI in the expected form e.g. "<URI>" or "<URI>/".
Returns
URI with single trailing slash.

Definition at line 13 of file uri.cpp.

◆ MakeServiceUri()

network::uri daqif::MakeServiceUri ( std::string  base_uri,
std::string_view  service_path 
)

Creates a service URI of the form <baseuri>/<service>.

Parameters
base_uriBase URI in the expected form e.g. "<URI>" or "<URI>/".
service_pathURI path element in the form "<path>" or "/<path>".
Returns
<base_uri>/<service_path> URI with any extra slashes stripped when joining the paths.

Definition at line 19 of file uri.cpp.

◆ MakeSubscription()

template<class TopicType , class Func >
auto daqif::MakeSubscription ( elt::mal::Mal &  mal,
elt::mal::Uri const &  uri,
Func &&  func 
) -> Subscription<TopicType>

Builder for Subscription.

Definition at line 32 of file subscription.hpp.

◆ operator==()

bool daqif::operator== ( FullState  lhs,
FullState  rhs 
)
noexcept

Equality operator for FullState.

Definition at line 12 of file state.cpp.