ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
Namespaces | Classes | Typedefs | Enumerations | Functions
daq Namespace Reference

Namespaces

 alert
 
 config
 
 dpm
 
 error
 
 fits
 
 op
 
 test
 

Classes

struct  ActionEvent
 Event related to an action being requested or performed. More...
 
struct  Alert
 Describes an active Data Acquisition alert. More...
 
struct  AlertId
 Uniquely identfies an alert. More...
 
class  AsyncProcess
 Represents a subprocess as an asynchronous operation. More...
 
class  AsyncProcessIf
 Interface to asynchronous process. More...
 
class  CommonDaqController
 Implements common behaviour of OcmDaqController and DpmDaqController. More...
 
struct  DaqContext
 Structure carrying context needed to start a Data Acquisition and construct a Data Product Specification needed to execute merge. More...
 
class  DaqController
 Controls the execution of single data acquisition that ultimately result in a set of FITS keywords and/or FITS files. More...
 
class  DaqControllerFactory
 Abstract factory for DaqControllers. More...
 
class  DaqControllerFactoryDefault
 Default factory producing "real" implementations. More...
 
struct  DaqControllerFactoryFake
 Factory that creates mock versions. More...
 
struct  DaqControllerMock
 Mock version of daq::DaqController. More...
 
class  DaqOperationAborted
 Started operation was aborted. More...
 
class  DaqOperationTimeout
 Started operation timed out. More...
 
struct  DaqReplyMock
 
class  DaqSourceError
 Represents error in single source. More...
 
class  DaqSourceErrors
 Exception thrown to carry reply errors. More...
 
class  DaqSources
 Data acquisition sources. More...
 
struct  DaqStatusMock
 
struct  DaqStopReplyMock
 
class  DpmClient
 Interface to DPM server. More...
 
class  DpmClientImpl
 
class  DpmClientMock
 Combined mock and fake of interface to DPM server. More...
 
struct  DpmClientParams
 Connection parameters for DPM. More...
 
struct  DpmDaqControlAsyncMock
 
class  DpmDaqController
 Implements behaviour from the state NotScheduled to Completed. More...
 
struct  DpPart
 Provides information of the location and origin of a FITS file or keywords produced by a data acquisition. More...
 
struct  DpSpec
 Close representation of the JSON structure but with stronger types. More...
 
struct  DpSpecError
 
struct  ErrorEvent
 
struct  EventLog
 Represents a collection of events. More...
 
class  EventLogObserverLogger
 A simple daq::ObservableEventLog observer that logs observed events to provided logger. More...
 
struct  GenericEvent
 Represents a generic event if a more specific event is not usable. More...
 
struct  LogLevel
 ly typed log4cplus::LogLevel (which is an alias to int) More...
 
class  Manager
 Manager owns DaqController and FitsController (active data acquisitions) instances and multiplexes requests to them. More...
 
class  ManagerImpl
 Implements daq::Manager. More...
 
struct  ManagerParams
 Configurations parameters directly related to manager. More...
 
struct  MetaDaqAsyncMock
 
class  MetaSource
 Keeps relevant state to be able to communicate with a primary data source. More...
 
struct  MockAsyncProcess
 Combined fake/mock. More...
 
struct  MockRsyncAsyncProcess
 
struct  MockWorkspace
 
class  ObservableEventLog
 Stores data acquisition status and allows subscription to status changes. More...
 
class  ObservableStatus
 Stores data acquisition status and allows subscription to status changes. More...
 
struct  OcmAsyncOperations
 OCM Async operations. More...
 
class  OcmDaqController
 Implements daq::DaqController for states responsible to be executed by OCM. More...
 
struct  Origin
 Describes parsed origin string into its components "host" and "path". More...
 
class  PendingReplies
 Simple class that allows you to keep track of how many replies are pending. More...
 
class  PrimSource
 Keeps relevant state to be able to communicate with a primary data source. More...
 
struct  RecCmdsAsyncMock
 
struct  RecStatusMock
 
class  ReplyToken
 Token representing a not-yet-received reply. More...
 
struct  Result
 Utility class that represents a result and an error. More...
 
struct  Result< void >
 
class  RsyncAsyncProcess
 Represents an rsync process as an asynchronous operation. More...
 
class  RsyncAsyncProcessIf
 More specialized version for rsync which also monitors transfer progress. More...
 
struct  RsyncOptions
 Options controlling rsync invocation. More...
 
struct  RsyncProgress
 Describes file transfer progress,. More...
 
struct  Source
 Simple class that holds the source and associated state. More...
 
struct  Status
 Non observable status object that keeps stores status of data acquisition. More...
 
class  StatusSignal
 Observes any status. More...
 
class  TestDpmDaqController
 Fixture for daq::DaqController life cycle tests. More...
 
class  TestSource
 Test fixture for source tests. More...
 
class  Trim
 Trim string from whitespace (' ', '
') More...
 
struct  UserActionEvent
 Event directly related to user action, such as a command to do something. More...
 
class  Workspace
 Interface to interact with DPM workspace. More...
 
class  WorkspaceImpl
 Implementation of daq::Workspace. More...
 

Typedefs

using DaqReplyPtr = std::shared_ptr< daqif::DaqReply >
 
using DpParts = std::vector< DpPart >
 
using SourceVariant = std::variant< PrimSource, MetaSource >
 
using json = nlohmann::json
 

Enumerations

enum  ErrorPolicy { ErrorPolicy::Strict = 0, ErrorPolicy::Tolerant }
 Error policy supported by certain operations. More...
 
enum  State {
  State::DAQ states handled by OCM., State::NotStarted = 0, State::Starting = 1, State::Acquiring = 2,
  State::Stopping = 3, State::Stopped = 4, State::NotScheduled = 10, State::AbortingAcquiring = 2001,
  State::Scheduled = 11, State::Transferring = 12, State::Merging = 13, State::Releasing = 14,
  State::AbortingMerging = 2010, State::Aborted = 2000, State::Completed = 3000
}
 Observable states of the data acquisition process. More...
 

Functions

daqif::DaqStatus & operator<< (daqif::DaqStatus &status, Status const &rhs)
 Convert daq::Status -> daqif::DaqStatus by populating from rhs. More...
 
Statusoperator<< (Status &status, daqif::DaqStatus const &rhs)
 Convert daqif::DaqStatus -> daq::Status by populating from rhs. More...
 
std::filesystem::space_info & operator<< (std::filesystem::space_info &space, daqif::StorageStatus const &rhs)
 Populate space from rhs. More...
 
daqif::StorageStatus & operator<< (daqif::StorageStatus &storage, std::filesystem::space_info &rhs)
 Populate storage from rhs. More...
 
daqif::FullState MakeState (State state) noexcept
 Converts daq::State to DaqSubstate. More...
 
State MakeState (daqif::FullState state)
 Converts DaqSubstate to daq::State. More...
 
std::string_view ToString (daqif::DaqState state) noexcept
 
std::string_view ToString (daqif::DaqSubState state) noexcept
 
bool operator== (DaqContext const &lhs, DaqContext const &rhs) noexcept
 
bool operator== (DaqContext::Source const &lhs, DaqContext::Source const &rhs) noexcept
 
void UpdateKeywords (DaqContext &ctx, fits::KeywordVector const &keywords)
 Updates (adds or replaces) primary HDU keywords. More...
 
void AddDpParts (DaqContext &ctx, std::vector< DpPart > const &parts)
 
std::ostream & operator<< (std::ostream &os, DaqController const &daq)
 
nlohmann::json CreateDataProductSpecification (DaqContext const &ctx, log4cplus::Logger &logger)
 Creates a Data Product Specification as serialized JSON from the provided DaqContext. More...
 
std::ostream & operator<< (std::ostream &os, DpPart const &part) noexcept
 
std::ostream & operator<< (std::ostream &os, ErrorPolicy policy)
 
std::ostream & operator<< (std::ostream &os, GenericEvent const &s)
 
std::ostream & operator<< (std::ostream &os, ErrorEvent const &s)
 
NLOHMANN_JSON_SERIALIZE_ENUM(State, { {State::NotStarted, "NotStarted"}, {State::Starting, "Starting"}, {State::Acquiring, "Acquiring"}, {State::Stopping, "Stopping"}, {State::Stopped, "Stopped"}, {State::NotScheduled, "NotScheduled"}, {State::Scheduled, "Scheduled"}, {State::Transferring, "Transferring"}, {State::Merging, "Merging"}, {State::Releasing, "Releasing"}, {State::AbortingAcquiring, "AbortingAcquiring"}, {State::AbortingMerging, "AbortingMerging"}, {State::Aborted, "Aborted"}, {State::Completed, "Completed"}, }) void to_json(nlohmann void to_json (nlohmann::json &j, Alert const &p)
 
void to_json (nlohmann::json &j, DaqContext const &p)
 
void to_json (nlohmann::json &j, DaqContext::Source const &p)
 
void to_json (nlohmann::json &j, DpPart const &p)
 
void from_json (nlohmann::json const &j, Status &p)
 
void from_json (nlohmann::json const &j, Alert &p)
 
void from_json (nlohmann::json const &j, DaqContext &p)
 
void from_json (nlohmann::json const &j, DaqContext::Source &p)
 
void from_json (nlohmann::json const &j, DpPart &p)
 
std::istream & operator>> (std::istream &is, LogLevel &level)
 Parse log level from string. More...
 
std::ostream & operator<< (std::ostream &os, LogLevel level)
 Format log level to stream. More...
 
std::string MakeIdCandidate (char const *instrument_id, unsigned jitter=0, std::chrono::system_clock::time_point *out=nullptr)
 Creates a DAQ id candidate that may or may not be unique. More...
 
std::optional< RsyncProgressParseRsyncProgress (std::string const &line) noexcept
 Parse progress update from rsync. More...
 
std::ostream & operator<< (std::ostream &os, State state)
 Prints state string representation to os. More...
 
bool IsFinalState (State state) noexcept
 Query whether state is in a final state. More...
 
bool IsSubsequentState (State state1, State state2) noexcept
 Compares states and returns whether state1 occurs after state2. More...
 
bool operator== (AlertId const &lhs, AlertId const &rhs) noexcept
 
bool operator!= (AlertId const &lhs, AlertId const &rhs) noexcept
 
Alert MakeAlert (std::string_view category, std::string key, std::string description)
 Construct alert. More...
 
Alert MakeAlert (AlertId id, std::string description)
 
AlertId MakeAlertId (std::string_view category, std::string key)
 
bool operator== (Alert const &lhs, Alert const &rhs) noexcept
 Comparison operator for Alert. More...
 
bool operator== (Alert const &lhs, AlertId const &rhs) noexcept
 
bool operator== (AlertId const &lhs, Alert const &rhs) noexcept
 
bool operator!= (Alert const &lhs, Alert const &rhs) noexcept
 
void SetAlert (std::vector< Alert > &alerts, Alert alert)
 Set alert. More...
 
bool ClearAlert (std::vector< Alert > &alerts, AlertId const &alert)
 Clear alert. More...
 
std::ostream & operator<< (std::ostream &os, Status const &s)
 
std::ostream & operator<< (std::ostream &os, ObservableStatus const &s)
 
void to_json (json &j, Status const &p)
 
std::ostream & operator<< (std::ostream &os, Trim const &trim)
 
bool IsStale (ManagerParams const &params, State state, std::chrono::system_clock::time_point creation_time)
 
 TEST (TestDaqContext, Files)
 
 TEST (TestDaqContext, Keywords)
 
 TEST_F (TestDpmDaqController, StatusUpdateInNotScheduledSucceeds)
 
 TEST_F (TestDpmDaqController, StatusOverrideFromOcmAbortedToDpmMergingSucceeds)
 Test that DPM can override status of OCM as it is the authoratitive source of DAQ status. More...
 
 TEST_F (TestDpmDaqController, StartAsyncThrows)
 
 TEST_F (TestDpmDaqController, StopAsyncThrows)
 
 TEST_F (TestDpmDaqController, UpdateKeywordsThrows)
 
 TEST_F (TestDpmDaqController, ScheduleMergeAsyncSucceedsIfDpmSucceeds)
 
 TEST_F (TestDpmDaqController, ScheduleMergeAsyncSucceedsIfDpmSucceedsWithStatusSignalReceivedBeforeReply)
 
 TEST_F (TestDpmDaqController, ScheduleMergeAsyncFailsIfDpmFails)
 
 TEST_F (TestDpmDaqController, ScheduleMergeAsyncFailsIfTimeout)
 
 TEST_F (TestDpmDaqController, ScheduleMergeAsyncFailsIfAlreadyScheduled)
 
 TEST_F (TestDpmDaqController, AbortAsyncAbortImmediatelyIfNoPendingRequestsExist)
 
 TEST_F (TestDpmDaqController, AbortAsyncWithStrictPolicyAbortsIfDpmAborts)
 
 TEST_F (TestDpmDaqController, AbortAsyncWithStrictPolicyDoesNothingIfDpmAbortFails)
 
 TEST (TestJson, SerializeStatus)
 
 TEST (TestJson, DaqContext)
 
 TEST_F (TestSource, Constructors)
 
 TEST_F (TestSource, Accessors)
 
 TEST_F (TestSource, PrimSourceConstructionFailsIfRrClientIsInvalid)
 
 TEST_F (TestSource, PrimSourceConstructionFailsIfNameIsEmpty)
 
 TEST_F (TestSource, MetaSourceConstructionFailsIfRrClientIsInvalid)
 
 TEST_F (TestSource, MetaSourceConstructionFailsIfNameIsEmpty)
 
template<class... Args>
DpSpecError MakeParseException (JsonPointer const &ptr, Args &&... args)
 
template<char const * >
DpSpecError MakeParseException (JsonPointer const &ptr, char const *str)
 
DpSpecError MakeValueMissingException (JsonPointer const &ptr)
 
DpSpecError MakeWrongTypeException (JsonPointer const &ptr, char const *expected_type, char const *actual_type)
 
DpSpecError MakeUnknownVariantException (JsonPointer const &ptr, char const *known_variants, char const *actual_variant)
 
template<class T >
GetMember (Json const &json, char const *name, JsonPointer const &breadcrumb, bool allow_empty=true)
 
template<>
std::string GetMember< std::string > (Json const &json, char const *name, JsonPointer const &breadcrumb, bool allow_empty)
 
void AssertIsObject (Json const &json, JsonPointer const &breadcrumb)
 
void AssertIsArray (Json const &json, JsonPointer const &breadcrumb)
 
std::vector< std::string > ParseArrayOfString (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::Filter ParseFilter (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::Transform ParseTransform (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::KeywordRules ParseKeywordRules (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::SourceFitsKeywords ParseSourceFitsKeywords (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::SourceFitsFile ParseSourceFitsFile (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::Target ParseTarget (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec::SourceTypes ParseSource (Json const &json, JsonPointer const &breadcrumb)
 
DpSpec ParseDpSpec (nlohmann::json const &spec)
 Parse JSON to construct the DpSpec structure. More...
 
Origin ParseSourceOrigin (std::string const &origin)
 Parse origin string from DpSpec into component parts. More...
 

Class Documentation

◆ daq::Alert

struct daq::Alert

Describes an active Data Acquisition alert.

category and key make up the unique identifier of an alert.

Definition at line 71 of file status.hpp.

Class Members
typedef system_clock Clock
typedef time_point TimePoint
Class Members
string description
AlertId id
TimePoint timestamp

◆ daq::AlertId

struct daq::AlertId

Uniquely identfies an alert.

Definition at line 52 of file status.hpp.

Class Members
string category Standardized category.
string key Unique key for each alert.

◆ daq::DpmClientParams

struct daq::DpmClientParams

Connection parameters for DPM.

Definition at line 74 of file dpmClient.hpp.

Class Members
string ps_uri
string rr_uri
seconds timeout

◆ daq::DpSpec

struct daq::DpSpec

Close representation of the JSON structure but with stronger types.

Definition at line 28 of file dpSpec.hpp.

Class Members
typedef variant< Filter, Transform > KeywordRule
typedef vector< KeywordRule > KeywordRules
typedef variant< SourceFitsKeywords, SourceFitsFile > SourceTypes
Class Members
string id
vector< SourceTypes > sources
Target target

◆ daq::LogLevel

struct daq::LogLevel

ly typed log4cplus::LogLevel (which is an alias to int)

Definition at line 22 of file log4cplus.hpp.

Class Members
LogLevel value

◆ daq::ManagerParams

struct daq::ManagerParams

Configurations parameters directly related to manager.

Definition at line 35 of file manager.hpp.

Class Members
hours acquiring_stale_age Age of DAQ in acquiring state after which it is automatically considered abandoned and will be archived without further action at startup.
string instrument_id Instrument identifier.
hours merging_stale_age Age of DAQ in merging state, after which it is automatically considered abandoned and will be archived without further action at startup.
string origin

◆ daq::Result

struct daq::Result

template<class T = void, class ErrorType = bool>
struct daq::Result< T, ErrorType >

Utility class that represents a result and an error.

Definition at line 17 of file utility.hpp.

Class Members
ErrorType error
T result

◆ daq::Result< void >

struct daq::Result< void >

Definition at line 23 of file utility.hpp.

Class Members
bool error

◆ daq::RsyncOptions

struct daq::RsyncOptions

Options controlling rsync invocation.

Definition at line 28 of file rsyncAsyncProcess.hpp.

Class Members
optional< unsigned > bw_limit Enables rate-limiting in kb/s.
optional< bool > inplace –inplace/–no-inplace
optional< string > rsync Binary to use.
optional< seconds > timeout I/O timeout.
optional< bool > whole_file Transfer with/without delta xfer algorithm.

◆ daq::RsyncProgress

struct daq::RsyncProgress

Describes file transfer progress,.

Definition at line 55 of file rsyncAsyncProcess.hpp.

Class Members
float progress Progress as fraction of 1 (complete == 1.0)
seconds remaining Estimated remaining time.
float speed Transfer speed in bytes/sec.
uint64_t transferred Number of transferred bytes.

Typedef Documentation

◆ DaqReplyPtr

using daq::DaqReplyPtr = typedef std::shared_ptr<daqif::DaqReply>

Definition at line 19 of file dpmClient.cpp.

◆ DpParts

using daq::DpParts = typedef std::vector<DpPart>

Definition at line 49 of file dpPart.hpp.

◆ json

using daq::json = typedef nlohmann::json

Definition at line 20 of file json.cpp.

◆ SourceVariant

using daq::SourceVariant = typedef std::variant<PrimSource, MetaSource>

Definition at line 179 of file source.hpp.

Enumeration Type Documentation

◆ ErrorPolicy

enum daq::ErrorPolicy
strong

Error policy supported by certain operations.

Fatal for any policy refers to the operation is aborted and reported as failed (typically using exceptions).

Enumerator
Strict 

Any error is considered fatal and may lead to the operation being aborted.

Tolerant 

Errors that can be ignored with partial completion of a command will be tolerated and is reported as successful.

Definition at line 25 of file error.hpp.

◆ State

enum daq::State
strong

Observable states of the data acquisition process.

Final states are either Completed* or Aborted*.

life-cycle is fully sequential apart from Aborting and Aborted:

The states implemented in OCM are:

NotStarted -> Starting -> Acquiring -> Stopping -> Stopped -> <NotScheduled>

and the remaining in DPM for executing the merging (handover is done in state NotScheduled):

<NotScheduled> -> Scheduled -> Transferring -> Merging -> Releasing -> Completed*

Each state apart from Completed may transition (optionally via Aborting) to Aborted*.

Aborting -> Aborted*.

Where the state

Enumerator
DAQ states handled by OCM. 

Initial state of data acquisition.

NotStarted 

Initial state of data acquisition.

Starting 

Transitional state between NotStarted and Acquiring when sources have not begun acquiring data yet.

Acquiring 

All data sources have reported data acquisition is in progress.

Stopping 

Transitional state between Acquiring and Stopped.

Stopped 

All data sources have reported they have stopped acquiring data.

NotScheduled 

Before daq is acknowledged by dpm it remains in NotScheduled.

OCM may have attempted to schedule merging in this state so no more modifications are allowed from this point (e.g. updating keywords).

AbortingAcquiring 

Transitional state for aborting during acquisition.

Scheduled 

daq is acknowledged by dpm and is scheduled for merging (i.e.

the daq is in the backlog).

Transferring 

Input files are being transferred.

Merging 

DAQ is being merged.

Releasing 

Releasing Data Product to receivers.

AbortingMerging 

Transitional state for aborting during merging.

Aborted 

Data acquisition has been aborted by user.

Completed 

Completed DAQ.

Definition at line 39 of file state.hpp.

Function Documentation

◆ AddDpParts()

void daq::AddDpParts ( DaqContext ctx,
std::vector< DpPart > const &  parts 
)

Definition at line 35 of file daqContext.cpp.

◆ AssertIsArray()

void daq::AssertIsArray ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 84 of file dpSpec.cpp.

◆ AssertIsObject()

void daq::AssertIsObject ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 78 of file dpSpec.cpp.

◆ ClearAlert()

bool daq::ClearAlert ( std::vector< Alert > &  alerts,
AlertId const &  alert 
)

Clear alert.

Parameters
alertsContainer of alert to modify.
alertto set.
Returns
true if there was an alert to clear, false otherwise.

Definition at line 20 of file status.cpp.

◆ CreateDataProductSpecification()

nlohmann::json daq::CreateDataProductSpecification ( DaqContext const &  ctx,
log4cplus::Logger &  logger 
)

Creates a Data Product Specification as serialized JSON from the provided DaqContext.

Definition at line 917 of file daqController.cpp.

◆ from_json() [1/5]

void daq::from_json ( nlohmann::json const &  j,
Alert p 
)

Definition at line 105 of file json.cpp.

◆ from_json() [2/5]

void daq::from_json ( nlohmann::json const &  j,
DaqContext p 
)

Definition at line 115 of file json.cpp.

◆ from_json() [3/5]

void daq::from_json ( nlohmann::json const &  j,
DaqContext::Source p 
)

Definition at line 134 of file json.cpp.

◆ from_json() [4/5]

void daq::from_json ( nlohmann::json const &  j,
DpPart p 
)

Definition at line 140 of file json.cpp.

◆ from_json() [5/5]

void daq::from_json ( nlohmann::json const &  j,
Status p 
)

Definition at line 92 of file json.cpp.

◆ GetMember()

template<class T >
T daq::GetMember ( Json const &  json,
char const *  name,
JsonPointer const &  breadcrumb,
bool  allow_empty = true 
)

◆ GetMember< std::string >()

template<>
std::string daq::GetMember< std::string > ( Json const &  json,
char const *  name,
JsonPointer const &  breadcrumb,
bool  allow_empty 
)

Definition at line 60 of file dpSpec.cpp.

◆ IsFinalState()

bool daq::IsFinalState ( State  state)
noexcept

Query whether state is in a final state.

Returns
true if state is Completed or Aborted.
false otherwise.

Definition at line 15 of file state.cpp.

◆ IsStale()

bool daq::IsStale ( ManagerParams const &  params,
State  state,
std::chrono::system_clock::time_point  creation_time 
)

Definition at line 29 of file manager.cpp.

◆ IsSubsequentState()

bool daq::IsSubsequentState ( State  state1,
State  state2 
)
noexcept

Compares states and returns whether state1 occurs after state2.

If states are the same it returns false.

This is e.g. useful to decide when an await condition is fulfillled or when to reject a wait condition because will never occur.

Returns
true if state1 occurs after state2 in the DAQ life-cycle.

Definition at line 26 of file state.cpp.

◆ MakeAlert() [1/2]

Alert daq::MakeAlert ( AlertId  id,
std::string  description 
)

Definition at line 35 of file status.cpp.

◆ MakeAlert() [2/2]

Alert daq::MakeAlert ( std::string_view  category,
std::string  key,
std::string  description 
)

Construct alert.

Definition at line 29 of file status.cpp.

◆ MakeAlertId()

AlertId daq::MakeAlertId ( std::string_view  category,
std::string  key 
)

Definition at line 39 of file status.cpp.

◆ MakeIdCandidate()

std::string daq::MakeIdCandidate ( char const *  instrument_id,
unsigned  jitter = 0,
std::chrono::system_clock::time_point *  out = nullptr 
)

Creates a DAQ id candidate that may or may not be unique.

Parameters
instrument_idThe instrument ID to use for the id. Only the 5 first characters will be used if the name is longer than 5.
jitterJitter is a millisecond component added to the current time. This is meant to be used to find a unique id by adding jitter until a unique id is found.
Note
The function cannot guarantee unique ID and is the responsibility of the caller.

Definition at line 46 of file manager.cpp.

◆ MakeParseException() [1/2]

template<class... Args>
DpSpecError daq::MakeParseException ( JsonPointer const &  ptr,
Args &&...  args 
)

Definition at line 19 of file dpSpec.cpp.

◆ MakeParseException() [2/2]

template<char const * >
DpSpecError daq::MakeParseException ( JsonPointer const &  ptr,
char const *  str 
)

Definition at line 26 of file dpSpec.cpp.

◆ MakeState() [1/2]

daq::State daq::MakeState ( daqif::FullState  state)

Converts DaqSubstate to daq::State.

This assumes daqif::DaqState is Acquiring.

Exceptions
std::invalid_argumentif state is not convertible.

Definition at line 103 of file conversion.cpp.

◆ MakeState() [2/2]

daqif::FullState daq::MakeState ( State  state)
noexcept

Converts daq::State to DaqSubstate.

Definition at line 63 of file conversion.cpp.

◆ MakeUnknownVariantException()

DpSpecError daq::MakeUnknownVariantException ( JsonPointer const &  ptr,
char const *  known_variants,
char const *  actual_variant 
)

Definition at line 43 of file dpSpec.cpp.

◆ MakeValueMissingException()

DpSpecError daq::MakeValueMissingException ( JsonPointer const &  ptr)

Definition at line 30 of file dpSpec.cpp.

◆ MakeWrongTypeException()

DpSpecError daq::MakeWrongTypeException ( JsonPointer const &  ptr,
char const *  expected_type,
char const *  actual_type 
)

Definition at line 35 of file dpSpec.cpp.

◆ operator!=() [1/2]

bool daq::operator!= ( Alert const &  lhs,
Alert const &  rhs 
)
noexcept

Definition at line 63 of file status.cpp.

◆ operator!=() [2/2]

bool daq::operator!= ( AlertId const &  lhs,
AlertId const &  rhs 
)
noexcept

Definition at line 47 of file status.cpp.

◆ operator<<() [1/14]

daqif::DaqStatus & daq::operator<< ( daqif::DaqStatus &  status,
daq::Status const &  rhs 
)

Convert daq::Status -> daqif::DaqStatus by populating from rhs.

Definition at line 18 of file conversion.cpp.

◆ operator<<() [2/14]

daqif::StorageStatus & daq::operator<< ( daqif::StorageStatus &  storage,
std::filesystem::space_info &  rhs 
)

Populate storage from rhs.

Definition at line 56 of file conversion.cpp.

◆ operator<<() [3/14]

Status & daq::operator<< ( Status status,
daqif::DaqStatus const &  rhs 
)

Convert daqif::DaqStatus -> daq::Status by populating from rhs.

Definition at line 36 of file conversion.cpp.

◆ operator<<() [4/14]

std::filesystem::space_info & daq::operator<< ( std::filesystem::space_info &  space,
daqif::StorageStatus const &  rhs 
)

Populate space from rhs.

Definition at line 48 of file conversion.cpp.

◆ operator<<() [5/14]

std::ostream & daq::operator<< ( std::ostream &  os,
DaqController const &  daq 
)

Definition at line 109 of file daqController.cpp.

◆ operator<<() [6/14]

std::ostream & daq::operator<< ( std::ostream &  os,
DpPart const &  part 
)
noexcept

Definition at line 6 of file dpPart.cpp.

◆ operator<<() [7/14]

std::ostream & daq::operator<< ( std::ostream &  os,
ErrorEvent const &  s 
)

Definition at line 48 of file eventLog.cpp.

◆ operator<<() [8/14]

std::ostream & daq::operator<< ( std::ostream &  os,
ErrorPolicy  policy 
)

Definition at line 18 of file error.cpp.

◆ operator<<() [9/14]

std::ostream & daq::operator<< ( std::ostream &  os,
GenericEvent const &  s 
)

Definition at line 42 of file eventLog.cpp.

◆ operator<<() [10/14]

std::ostream & daq::operator<< ( std::ostream &  os,
LogLevel  level 
)

Format log level to stream.

Definition at line 29 of file log4cplus.cpp.

◆ operator<<() [11/14]

std::ostream & daq::operator<< ( std::ostream &  os,
ObservableStatus const &  s 
)

Definition at line 255 of file status.cpp.

◆ operator<<() [12/14]

std::ostream & daq::operator<< ( std::ostream &  os,
State  state 
)

Prints state string representation to os.

Definition at line 48 of file state.cpp.

◆ operator<<() [13/14]

std::ostream & daq::operator<< ( std::ostream &  os,
Status const &  s 
)

Definition at line 95 of file status.cpp.

◆ operator<<() [14/14]

std::ostream& daq::operator<< ( std::ostream &  os,
Trim const &  trim 
)
Parameters
osoutput stream to output to.
reporterReporter adapter to format.
Returns
os

Definition at line 36 of file log4cplus.cpp.

◆ operator==() [1/6]

bool daq::operator== ( Alert const &  lhs,
Alert const &  rhs 
)
noexcept

Comparison operator for Alert.

Returns
true if category and key both compares equal between lhs and rhs (description .

Definition at line 51 of file status.cpp.

◆ operator==() [2/6]

bool daq::operator== ( Alert const &  lhs,
AlertId const &  rhs 
)
noexcept

Definition at line 55 of file status.cpp.

◆ operator==() [3/6]

bool daq::operator== ( AlertId const &  lhs,
Alert const &  rhs 
)
noexcept

Definition at line 59 of file status.cpp.

◆ operator==() [4/6]

bool daq::operator== ( AlertId const &  lhs,
AlertId const &  rhs 
)
noexcept

Definition at line 43 of file status.cpp.

◆ operator==() [5/6]

bool daq::operator== ( DaqContext const &  lhs,
DaqContext const &  rhs 
)
noexcept

Definition at line 12 of file daqContext.cpp.

◆ operator==() [6/6]

bool daq::operator== ( DaqContext::Source const &  lhs,
DaqContext::Source const &  rhs 
)
noexcept

Definition at line 24 of file daqContext.cpp.

◆ operator>>()

std::istream & daq::operator>> ( std::istream &  is,
LogLevel level 
)

Parse log level from string.

Definition at line 17 of file log4cplus.cpp.

◆ ParseArrayOfString()

std::vector<std::string> daq::ParseArrayOfString ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 90 of file dpSpec.cpp.

◆ ParseDpSpec()

DpSpec daq::ParseDpSpec ( nlohmann::json const &  spec)

Parse JSON to construct the DpSpec structure.

Parameters
specData Product Specification to parse.
Exceptions
DpSpecErrorif JSON structure is invalid. Exception may be nested.

Definition at line 211 of file dpSpec.cpp.

◆ ParseFilter()

DpSpec::Filter daq::ParseFilter ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 108 of file dpSpec.cpp.

◆ ParseKeywordRules()

DpSpec::KeywordRules daq::ParseKeywordRules ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 132 of file dpSpec.cpp.

◆ ParseRsyncProgress()

std::optional< RsyncProgress > daq::ParseRsyncProgress ( std::string const &  line)
noexcept

Parse progress update from rsync.

Parameters
linea single line in the format rsync outputs with option --info=progress2.
Returns
optional with value if parsing suceeds, empty optional otherwise.

Definition at line 60 of file rsyncAsyncProcess.cpp.

◆ ParseSource()

DpSpec::SourceTypes daq::ParseSource ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 198 of file dpSpec.cpp.

◆ ParseSourceFitsFile()

DpSpec::SourceFitsFile daq::ParseSourceFitsFile ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 173 of file dpSpec.cpp.

◆ ParseSourceFitsKeywords()

DpSpec::SourceFitsKeywords daq::ParseSourceFitsKeywords ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 152 of file dpSpec.cpp.

◆ ParseSourceOrigin()

Origin daq::ParseSourceOrigin ( std::string const &  origin)

Parse origin string from DpSpec into component parts.

Origin string use the format host:path, e.g. 10.0.0.1:/path/to/file with host being optional.

Definition at line 251 of file dpSpec.cpp.

◆ ParseTarget()

DpSpec::Target daq::ParseTarget ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 185 of file dpSpec.cpp.

◆ ParseTransform()

DpSpec::Transform daq::ParseTransform ( Json const &  json,
JsonPointer const &  breadcrumb 
)

Definition at line 119 of file dpSpec.cpp.

◆ SetAlert()

void daq::SetAlert ( std::vector< Alert > &  alerts,
Alert  alert 
)

Set alert.

Parameters
alertsContainer of alert to modify.
alertto set.

Definition at line 9 of file status.cpp.

◆ TEST() [1/4]

daq::TEST ( TestDaqContext  ,
Files   
)

Definition at line 16 of file testDaqContext.cpp.

◆ TEST() [2/4]

daq::TEST ( TestDaqContext  ,
Keywords   
)

Definition at line 37 of file testDaqContext.cpp.

◆ TEST() [3/4]

daq::TEST ( TestJson  ,
DaqContext   
)

Definition at line 31 of file testJson.cpp.

◆ TEST() [4/4]

daq::TEST ( TestJson  ,
SerializeStatus   
)

Definition at line 17 of file testJson.cpp.

◆ TEST_F() [1/19]

daq::TEST_F ( TestDpmDaqController  ,
AbortAsyncAbortImmediatelyIfNoPendingRequestsExist   
)

Definition at line 228 of file testDpmDaqController.cpp.

◆ TEST_F() [2/19]

daq::TEST_F ( TestDpmDaqController  ,
AbortAsyncWithStrictPolicyAbortsIfDpmAborts   
)

Definition at line 242 of file testDpmDaqController.cpp.

◆ TEST_F() [3/19]

daq::TEST_F ( TestDpmDaqController  ,
AbortAsyncWithStrictPolicyDoesNothingIfDpmAbortFails   
)

Definition at line 269 of file testDpmDaqController.cpp.

◆ TEST_F() [4/19]

daq::TEST_F ( TestDpmDaqController  ,
ScheduleMergeAsyncFailsIfAlreadyScheduled   
)

Definition at line 213 of file testDpmDaqController.cpp.

◆ TEST_F() [5/19]

daq::TEST_F ( TestDpmDaqController  ,
ScheduleMergeAsyncFailsIfDpmFails   
)

Definition at line 167 of file testDpmDaqController.cpp.

◆ TEST_F() [6/19]

daq::TEST_F ( TestDpmDaqController  ,
ScheduleMergeAsyncFailsIfTimeout   
)

Definition at line 190 of file testDpmDaqController.cpp.

◆ TEST_F() [7/19]

daq::TEST_F ( TestDpmDaqController  ,
ScheduleMergeAsyncSucceedsIfDpmSucceeds   
)

Definition at line 115 of file testDpmDaqController.cpp.

◆ TEST_F() [8/19]

daq::TEST_F ( TestDpmDaqController  ,
ScheduleMergeAsyncSucceedsIfDpmSucceedsWithStatusSignalReceivedBeforeReply   
)

Definition at line 138 of file testDpmDaqController.cpp.

◆ TEST_F() [9/19]

daq::TEST_F ( TestDpmDaqController  ,
StartAsyncThrows   
)

Definition at line 92 of file testDpmDaqController.cpp.

◆ TEST_F() [10/19]

daq::TEST_F ( TestDpmDaqController  ,
StatusOverrideFromOcmAbortedToDpmMergingSucceeds   
)

Test that DPM can override status of OCM as it is the authoratitive source of DAQ status.

Definition at line 76 of file testDpmDaqController.cpp.

◆ TEST_F() [11/19]

daq::TEST_F ( TestDpmDaqController  ,
StatusUpdateInNotScheduledSucceeds   
)

Definition at line 60 of file testDpmDaqController.cpp.

◆ TEST_F() [12/19]

daq::TEST_F ( TestDpmDaqController  ,
StopAsyncThrows   
)

Definition at line 100 of file testDpmDaqController.cpp.

◆ TEST_F() [13/19]

daq::TEST_F ( TestDpmDaqController  ,
UpdateKeywordsThrows   
)

Definition at line 109 of file testDpmDaqController.cpp.

◆ TEST_F() [14/19]

daq::TEST_F ( TestSource  ,
Accessors   
)

Definition at line 51 of file testSource.cpp.

◆ TEST_F() [15/19]

daq::TEST_F ( TestSource  ,
Constructors   
)

Definition at line 34 of file testSource.cpp.

◆ TEST_F() [16/19]

daq::TEST_F ( TestSource  ,
MetaSourceConstructionFailsIfNameIsEmpty   
)

Definition at line 77 of file testSource.cpp.

◆ TEST_F() [17/19]

daq::TEST_F ( TestSource  ,
MetaSourceConstructionFailsIfRrClientIsInvalid   
)

Definition at line 73 of file testSource.cpp.

◆ TEST_F() [18/19]

daq::TEST_F ( TestSource  ,
PrimSourceConstructionFailsIfNameIsEmpty   
)

Definition at line 68 of file testSource.cpp.

◆ TEST_F() [19/19]

daq::TEST_F ( TestSource  ,
PrimSourceConstructionFailsIfRrClientIsInvalid   
)

Definition at line 64 of file testSource.cpp.

◆ to_json() [1/5]

void daq::to_json ( json j,
Status const &  p 
)

Definition at line 39 of file json.cpp.

◆ to_json() [2/5]

void daq::to_json ( nlohmann::json &  j,
Alert const &  p 
)

Definition at line 50 of file json.cpp.

◆ to_json() [3/5]

void daq::to_json ( nlohmann::json &  j,
DaqContext const &  p 
)

Definition at line 58 of file json.cpp.

◆ to_json() [4/5]

void daq::to_json ( nlohmann::json &  j,
DaqContext::Source const &  p 
)

Definition at line 73 of file json.cpp.

◆ to_json() [5/5]

void daq::to_json ( nlohmann::json &  j,
DpPart const &  p 
)

Definition at line 78 of file json.cpp.

◆ ToString() [1/2]

std::string_view daq::ToString ( daqif::DaqState  state)
noexcept
Returns
string representation of enumeration.

Definition at line 142 of file conversion.cpp.

◆ ToString() [2/2]

std::string_view daq::ToString ( daqif::DaqSubState  state)
noexcept
Returns
string representation of enumeration.

Definition at line 158 of file conversion.cpp.

◆ UpdateKeywords()

void daq::UpdateKeywords ( DaqContext ctx,
fits::KeywordVector const &  keywords 
)

Updates (adds or replaces) primary HDU keywords.

Parameters
ctxContext to modify
keywordsKeywords to update with.

Definition at line 28 of file daqContext.cpp.