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

Public Member Functions

 CollectorSink (CollectorSink &other)=delete
 
void operator= (const CollectorSink &)=delete
 
bool is_setup () const
 
std::string current_filename () const
 
size_t user_count () const
 
void setup (const std::string &filename)
 
void teardown ()
 
std::optional< HighFive::Group > getCollector (const std::string &name, const DetectorType &detector, const ReadoutType &readout)
 
std::optional< HighFive::Group > getCollector (const std::string &name, const HighFive::DataType &datatype, const std::optional< DetectorType > &detector=std::nullopt, const std::optional< std::string > &description=std::nullopt)
 Get (or create) a collector group for records of an arbitrary compound datatype.
 
auto removeCollector (const std::string &name)
 
template<class T >
void addParameter (const std::string &name, T value, const std::optional< std::string > &unit=std::nullopt, const std::optional< std::string > &description=std::nullopt)
 

Static Public Member Functions

static const std::string & type_attribute ()
 
static const std::string & collector_group_type ()
 
static const std::string & readout_dataset_name ()
 
static const std::string & cue_dataset_name ()
 
static const std::string & weight_dataset_name ()
 
static const std::string & normalization_dataset_name ()
 
static const std::string & detector_attribute_name ()
 The detector identity is a GROUP attribute, alongside the EFU routing attributes: together they say where — and as what — a group replays. The record layout needs no attribute at all: it is the dataset's own compound datatype, compared against the registry for sendability.
 
static const std::string & efu_address_attribute_name ()
 
static const std::string & efu_port_attribute_name ()
 
static const std::string & parameter_group_type ()
 
static const std::string & parameter_group_name ()
 
static const std::string & parameter_unit_attribute_name ()
 
static const std::string & parameter_description_attribute_name ()
 
static const std::string & program_attribute_name ()
 
static const std::string & version_attribute_name ()
 
static const std::string & revision_attribute_name ()
 
static const std::string & program_attribute_value ()
 
static const std::string & version_attribute_value ()
 
static const std::string & revision_attribute_value ()
 
static RL_API CollectorSinkinstance ()
 
static void destroy ()
 

Protected Attributes

std::set< std::string > users_
 
std::optional< std::string > filename_ {std::nullopt}
 
std::optional< HighFive::File > file_ {std::nullopt}
 
std::optional< HighFive::Group > collector_
 
std::optional< HighFive::Group > parameters_ {std::nullopt}
 

Detailed Description

Definition at line 116 of file CollectorClass.h.

Member Function Documentation

◆ addParameter()

template<class T >
void CollectorSink::addParameter ( const std::string &  name,
value,
const std::optional< std::string > &  unit = std::nullopt,
const std::optional< std::string > &  description = std::nullopt 
)
inline

Definition at line 316 of file CollectorClass.h.

◆ collector_group_type()

static const std::string & CollectorSink::collector_group_type ( )
inlinestatic

Definition at line 130 of file CollectorClass.h.

◆ cue_dataset_name()

static const std::string & CollectorSink::cue_dataset_name ( )
inlinestatic

Definition at line 138 of file CollectorClass.h.

◆ current_filename()

std::string CollectorSink::current_filename ( ) const
inline

Definition at line 221 of file CollectorClass.h.

◆ destroy()

static void CollectorSink::destroy ( )
inlinestatic

Definition at line 216 of file CollectorClass.h.

◆ detector_attribute_name()

static const std::string & CollectorSink::detector_attribute_name ( )
inlinestatic

The detector identity is a GROUP attribute, alongside the EFU routing attributes: together they say where — and as what — a group replays. The record layout needs no attribute at all: it is the dataset's own compound datatype, compared against the registry for sendability.

Definition at line 155 of file CollectorClass.h.

Referenced by getCollector().

◆ efu_address_attribute_name()

static const std::string & CollectorSink::efu_address_attribute_name ( )
inlinestatic

Definition at line 159 of file CollectorClass.h.

◆ efu_port_attribute_name()

static const std::string & CollectorSink::efu_port_attribute_name ( )
inlinestatic

Definition at line 163 of file CollectorClass.h.

◆ getCollector() [1/2]

std::optional< HighFive::Group > CollectorSink::getCollector ( const std::string &  name,
const DetectorType &  detector,
const ReadoutType &  readout 
)
inline

Definition at line 250 of file CollectorClass.h.

◆ getCollector() [2/2]

std::optional< HighFive::Group > CollectorSink::getCollector ( const std::string &  name,
const HighFive::DataType &  datatype,
const std::optional< DetectorType > &  detector = std::nullopt,
const std::optional< std::string > &  description = std::nullopt 
)
inline

Get (or create) a collector group for records of an arbitrary compound datatype.

The typed overload above resolves the registry datatype for its ReadoutType; this overload accepts any compound type so user-described records get the same cue-based layout. The detector identity — the ESS packet-type byte, unrecoverable from the record layout — is written as a group attribute when known; the original type description string (when given) is stored as a dataset attribute.

Definition at line 265 of file CollectorClass.h.

References detector_attribute_name().

◆ is_setup()

bool CollectorSink::is_setup ( ) const
inline

Definition at line 220 of file CollectorClass.h.

◆ normalization_dataset_name()

static const std::string & CollectorSink::normalization_dataset_name ( )
inlinestatic

Definition at line 146 of file CollectorClass.h.

◆ parameter_description_attribute_name()

static const std::string & CollectorSink::parameter_description_attribute_name ( )
inlinestatic

Definition at line 180 of file CollectorClass.h.

◆ parameter_group_name()

static const std::string & CollectorSink::parameter_group_name ( )
inlinestatic

Definition at line 172 of file CollectorClass.h.

◆ parameter_group_type()

static const std::string & CollectorSink::parameter_group_type ( )
inlinestatic

Definition at line 168 of file CollectorClass.h.

◆ parameter_unit_attribute_name()

static const std::string & CollectorSink::parameter_unit_attribute_name ( )
inlinestatic

Definition at line 176 of file CollectorClass.h.

◆ program_attribute_name()

static const std::string & CollectorSink::program_attribute_name ( )
inlinestatic

Definition at line 184 of file CollectorClass.h.

◆ program_attribute_value()

static const std::string & CollectorSink::program_attribute_value ( )
inlinestatic

Definition at line 196 of file CollectorClass.h.

◆ readout_dataset_name()

static const std::string & CollectorSink::readout_dataset_name ( )
inlinestatic

Definition at line 134 of file CollectorClass.h.

◆ removeCollector()

auto CollectorSink::removeCollector ( const std::string &  name)
inline

Definition at line 311 of file CollectorClass.h.

◆ revision_attribute_name()

static const std::string & CollectorSink::revision_attribute_name ( )
inlinestatic

Definition at line 192 of file CollectorClass.h.

◆ revision_attribute_value()

static const std::string & CollectorSink::revision_attribute_value ( )
inlinestatic

Definition at line 204 of file CollectorClass.h.

◆ setup()

void CollectorSink::setup ( const std::string &  filename)
inline

Definition at line 224 of file CollectorClass.h.

◆ teardown()

void CollectorSink::teardown ( )
inline

Definition at line 237 of file CollectorClass.h.

◆ type_attribute()

static const std::string & CollectorSink::type_attribute ( )
inlinestatic

Definition at line 126 of file CollectorClass.h.

◆ user_count()

size_t CollectorSink::user_count ( ) const
inline

Definition at line 222 of file CollectorClass.h.

◆ version_attribute_name()

static const std::string & CollectorSink::version_attribute_name ( )
inlinestatic

Definition at line 188 of file CollectorClass.h.

◆ version_attribute_value()

static const std::string & CollectorSink::version_attribute_value ( )
inlinestatic

Definition at line 200 of file CollectorClass.h.

◆ weight_dataset_name()

static const std::string & CollectorSink::weight_dataset_name ( )
inlinestatic

Definition at line 142 of file CollectorClass.h.

Member Data Documentation

◆ collector_

std::optional<HighFive::Group> CollectorSink::collector_
protected

Definition at line 123 of file CollectorClass.h.

◆ file_

std::optional<HighFive::File> CollectorSink::file_ {std::nullopt}
protected

Definition at line 122 of file CollectorClass.h.

◆ filename_

std::optional<std::string> CollectorSink::filename_ {std::nullopt}
protected

Definition at line 121 of file CollectorClass.h.

◆ parameters_

std::optional<HighFive::Group> CollectorSink::parameters_ {std::nullopt}
protected

Definition at line 123 of file CollectorClass.h.

◆ users_

std::set<std::string> CollectorSink::users_
protected

Definition at line 120 of file CollectorClass.h.


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