McStas Readout Master 0.3.3
Loading...
Searching...
No Matches
SenderConfigs Class Reference

Explicit EFU endpoint configuration for replay, parsed from JSON. More...

#include <SenderConfigs.h>

Public Member Functions

 SenderConfigs (const std::string &json_text)
 Equivalent to from_json().
 
void parse (const std::string &json_text)
 Replace the held configurations with those parsed from json_text.
 
bool empty () const noexcept
 
std::size_t size () const noexcept
 
bool contains (DetectorType detector_type, ReadoutType readout_type) const
 True when an endpoint is configured for the pair.
 
std::optional< SenderConfigfind (DetectorType detector_type, ReadoutType readout_type) const
 The endpoint for the pair, or std::nullopt when not configured.
 
const SenderConfigat (DetectorType detector_type, ReadoutType readout_type) const
 The endpoint for the pair; throws std::out_of_range when not configured.
 

Static Public Member Functions

static SenderConfigs from_json (const std::string &json_text)
 Parse a JSON document; throws std::runtime_error describing the first invalid entry.
 
static SenderConfigs from_file (const std::filesystem::path &path)
 Read and parse a JSON file; throws std::runtime_error if unreadable or invalid.
 

Detailed Description

Explicit EFU endpoint configuration for replay, parsed from JSON.

Replay resolves the EFU for each collector group from, in precedence order: this explicit configuration, attributes embedded in the collector file, then command-line defaults. The JSON layout is an object with one senders array; each entry requires detector_type and readout_type (bare or qualified enum names), ip_address, udp_port, and tcp_port. Entries whose detector and readout do not belong together, and duplicate (detector, readout) pairs, are rejected.

Definition at line 35 of file SenderConfigs.h.

Member Function Documentation

◆ empty()

bool SenderConfigs::empty ( ) const
inlinenoexcept

Definition at line 49 of file SenderConfigs.h.

◆ size()

std::size_t SenderConfigs::size ( ) const
inlinenoexcept

Definition at line 50 of file SenderConfigs.h.


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