DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::appmodel::WIECApplication Class Reference

#include <WIECApplication.hpp>

Inheritance diagram for dunedaq::appmodel::WIECApplication:
[legend]
Collaboration diagram for dunedaq::appmodel::WIECApplication:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the WIECApplication object.
 
virtual std::vector< const dunedaq::conffwk::DalObject * > get (const std::string &name, bool upcast_unregistered=true) const
 Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.
 
const dunedaq::appmodel::WIBModuleConfget_wib_module_conf () const
 Get "wib_module_conf" relationship value.
 
void set_wib_module_conf (const dunedaq::appmodel::WIBModuleConf *value)
 Set "wib_module_conf" relationship value.
 
const dunedaq::appmodel::HermesModuleConfget_hermes_module_conf () const
 Get "hermes_module_conf" relationship value.
 
void set_hermes_module_conf (const dunedaq::appmodel::HermesModuleConf *value)
 Set "hermes_module_conf" relationship value.
 
const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & get_detector_connections () const
 Get "detector_connections" relationship value.
 
void set_detector_connections (const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > &value)
 Set "detector_connections" relationship value.
 
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules (const confmodel::Session *) const override
 
virtual std::vector< const Resource * > contained_resources () const override
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the WIECApplication object.
 
virtual std::vector< const dunedaq::conffwk::DalObject * > get (const std::string &name, bool upcast_unregistered=true) const
 Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.
 
const dunedaq::appmodel::WIBModuleConfget_wib_module_conf () const
 Get "wib_module_conf" relationship value.
 
void set_wib_module_conf (const dunedaq::appmodel::WIBModuleConf *value)
 Set "wib_module_conf" relationship value.
 
const dunedaq::appmodel::HermesModuleConfget_hermes_module_conf () const
 Get "hermes_module_conf" relationship value.
 
void set_hermes_module_conf (const dunedaq::appmodel::HermesModuleConf *value)
 Set "hermes_module_conf" relationship value.
 
const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & get_detector_connections () const
 Get "detector_connections" relationship value.
 
void set_detector_connections (const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > &value)
 Set "detector_connections" relationship value.
 
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules (const confmodel::Session *) const override
 
virtual std::vector< const Resource * > contained_resources () const override
 
- Public Member Functions inherited from dunedaq::appmodel::SmartDaqApplication
const dunedaq::appmodel::SourceIDConfget_source_id () const
 Get "source_id" relationship value.
 
void set_source_id (const dunedaq::appmodel::SourceIDConf *value)
 Set "source_id" relationship value.
 
const std::vector< const dunedaq::appmodel::QueueConnectionRule * > & get_queue_rules () const
 Get "queue_rules" relationship value.
 
void set_queue_rules (const std::vector< const dunedaq::appmodel::QueueConnectionRule * > &value)
 Set "queue_rules" relationship value.
 
const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > & get_network_rules () const
 Get "network_rules" relationship value.
 
void set_network_rules (const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > &value)
 Set "network_rules" relationship value.
 
const std::vector< const dunedaq::confmodel::ActionPlan * > & get_action_plans () const
 Get "action_plans" relationship value.
 
void set_action_plans (const std::vector< const dunedaq::confmodel::ActionPlan * > &value)
 Set "action_plans" relationship value.
 
const std::vector< std::string > construct_commandline_parameters (const conffwk::Configuration &confdb, const dunedaq::confmodel::Session *session) const
 
const dunedaq::appmodel::SourceIDConfget_source_id () const
 Get "source_id" relationship value.
 
void set_source_id (const dunedaq::appmodel::SourceIDConf *value)
 Set "source_id" relationship value.
 
const std::vector< const dunedaq::appmodel::QueueConnectionRule * > & get_queue_rules () const
 Get "queue_rules" relationship value.
 
void set_queue_rules (const std::vector< const dunedaq::appmodel::QueueConnectionRule * > &value)
 Set "queue_rules" relationship value.
 
const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > & get_network_rules () const
 Get "network_rules" relationship value.
 
void set_network_rules (const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > &value)
 Set "network_rules" relationship value.
 
const std::vector< const dunedaq::confmodel::ActionPlan * > & get_action_plans () const
 Get "action_plans" relationship value.
 
void set_action_plans (const std::vector< const dunedaq::confmodel::ActionPlan * > &value)
 Set "action_plans" relationship value.
 
const std::vector< std::string > construct_commandline_parameters (const conffwk::Configuration &confdb, const dunedaq::confmodel::Session *session) const
 
- Public Member Functions inherited from dunedaq::confmodel::Application
const std::string & get_application_name () const
 Get "application_name" attribute value. Name of the application binary to run.
 
void set_application_name (const std::string &value)
 Set "application_name" attribute value. Name of the application binary to run.
 
const std::vector< std::string > & get_commandline_parameters () const
 Get "commandline_parameters" attribute value. command line parameters to add when starting the application.
 
void set_commandline_parameters (const std::vector< std::string > &value)
 Set "commandline_parameters" attribute value. command line parameters to add when starting the application.
 
const std::string & get_log_path () const
 Get "log_path" attribute value. Where the applications, controllers and infrastructure applications stdout/err go. This take precedence over the Session's log_path. If none of them is set, PWD is used.
 
void set_log_path (const std::string &value)
 Set "log_path" attribute value. Where the applications, controllers and infrastructure applications stdout/err go. This take precedence over the Session's log_path. If none of them is set, PWD is used.
 
const std::vector< const dunedaq::confmodel::VariableBase * > & get_application_environment () const
 Get "application_environment" relationship value. Define process environment for this application.
 
void set_application_environment (const std::vector< const dunedaq::confmodel::VariableBase * > &value)
 Set "application_environment" relationship value. Define process environment for this application.
 
const dunedaq::confmodel::VirtualHostget_runs_on () const
 Get "runs_on" relationship value. VirtualHost to run this application on.
 
void set_runs_on (const dunedaq::confmodel::VirtualHost *value)
 Set "runs_on" relationship value. VirtualHost to run this application on.
 
const std::vector< const dunedaq::confmodel::Service * > & get_exposes_service () const
 Get "exposes_service" relationship value. Services exposed i.e. provided by this application.
 
void set_exposes_service (const std::vector< const dunedaq::confmodel::Service * > &value)
 Set "exposes_service" relationship value. Services exposed i.e. provided by this application.
 
const dunedaq::confmodel::OpMonConfget_opmon_conf () const
 Get "opmon_conf" relationship value. description of the monitoring behaviour in the application.
 
void set_opmon_conf (const dunedaq::confmodel::OpMonConf *value)
 Set "opmon_conf" relationship value. description of the monitoring behaviour in the application.
 
const std::vector< std::string > parse_commandline_parameters () const
 
const std::string & get_application_name () const
 Get "application_name" attribute value. Name of the application binary to run.
 
void set_application_name (const std::string &value)
 Set "application_name" attribute value. Name of the application binary to run.
 
const std::vector< std::string > & get_commandline_parameters () const
 Get "commandline_parameters" attribute value. command line parameters to add when starting the application.
 
void set_commandline_parameters (const std::vector< std::string > &value)
 Set "commandline_parameters" attribute value. command line parameters to add when starting the application.
 
const std::string & get_log_path () const
 Get "log_path" attribute value. Where the applications, controllers and infrastructure applications stdout/err go. This take precedence over the Session's log_path. If none of them is set, PWD is used.
 
void set_log_path (const std::string &value)
 Set "log_path" attribute value. Where the applications, controllers and infrastructure applications stdout/err go. This take precedence over the Session's log_path. If none of them is set, PWD is used.
 
const std::vector< const dunedaq::confmodel::VariableBase * > & get_application_environment () const
 Get "application_environment" relationship value. Define process environment for this application.
 
void set_application_environment (const std::vector< const dunedaq::confmodel::VariableBase * > &value)
 Set "application_environment" relationship value. Define process environment for this application.
 
const dunedaq::confmodel::VirtualHostget_runs_on () const
 Get "runs_on" relationship value. VirtualHost to run this application on.
 
void set_runs_on (const dunedaq::confmodel::VirtualHost *value)
 Set "runs_on" relationship value. VirtualHost to run this application on.
 
const std::vector< const dunedaq::confmodel::Service * > & get_exposes_service () const
 Get "exposes_service" relationship value. Services exposed i.e. provided by this application.
 
void set_exposes_service (const std::vector< const dunedaq::confmodel::Service * > &value)
 Set "exposes_service" relationship value. Services exposed i.e. provided by this application.
 
const dunedaq::confmodel::OpMonConfget_opmon_conf () const
 Get "opmon_conf" relationship value. description of the monitoring behaviour in the application.
 
void set_opmon_conf (const dunedaq::confmodel::OpMonConf *value)
 Set "opmon_conf" relationship value. description of the monitoring behaviour in the application.
 
const std::vector< std::string > parse_commandline_parameters () const
 
- Public Member Functions inherited from dunedaq::conffwk::DalObject
const std::string & UID () const noexcept
 
const std::string & class_name () const noexcept
 
bool castable (const std::string &target) const noexcept
 
bool castable (const std::string *target) const noexcept
 
template<class TARGET >
const TARGET * cast () const noexcept
 Casts object to different class.
 
std::string full_name () const noexcept
 
const ConfigObjectconfig_object () const
 
DalRegistryregistry () const noexcept
 
Configurationconfiguration () const noexcept
 
void unread ()
 
void set (const ConfigObject &o) noexcept
 
void move (const std::string &at)
 
void rename (const std::string &new_id)
 
void p_hdr (std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
 print object headers
 
std::ostream & print_object (std::ostream &s) const
 print object details
 
void throw_init_ex (dunedaq::conffwk::Exception &ex)
 throw object initialisation exception (i.e.
 
- Public Member Functions inherited from dunedaq::confmodel::ResourceSetDisableAND
bool compute_disabled_state (const std::set< std::string > &disabled) const final
 
bool compute_disabled_state (const std::set< std::string > &disabled) const final
 
- Public Member Functions inherited from dunedaq::confmodel::ResourceSet
- Public Member Functions inherited from dunedaq::confmodel::Resource
void parents (const dunedaq::confmodel::Session &session, std::list< std::vector< const dunedaq::confmodel::Resource * > > &parents) const
 
bool is_disabled (const dunedaq::confmodel::ResourceTree &session) const
 
void parents (const dunedaq::confmodel::Session &session, std::list< std::vector< const dunedaq::confmodel::Resource * > > &parents) const
 
bool is_disabled (const dunedaq::confmodel::ResourceTree &session) const
 

Static Public Member Functions

static const std::string & __get_wib_module_conf_str () noexcept
 
static const std::string & __get_hermes_module_conf_str () noexcept
 
static const std::string & __get_detector_connections_str () noexcept
 
static const std::string & __get_wib_module_conf_str () noexcept
 
static const std::string & __get_hermes_module_conf_str () noexcept
 
static const std::string & __get_detector_connections_str () noexcept
 
- Static Public Member Functions inherited from dunedaq::appmodel::SmartDaqApplication
static const std::string & __get_source_id_str () noexcept
 
static const std::string & __get_queue_rules_str () noexcept
 
static const std::string & __get_network_rules_str () noexcept
 
static const std::string & __get_action_plans_str () noexcept
 
static const std::string & __get_source_id_str () noexcept
 
static const std::string & __get_queue_rules_str () noexcept
 
static const std::string & __get_network_rules_str () noexcept
 
static const std::string & __get_action_plans_str () noexcept
 
- Static Public Member Functions inherited from dunedaq::confmodel::Application
static const std::string & __get_application_name_str () noexcept
 
static const std::string & __get_commandline_parameters_str () noexcept
 
static const std::string & __get_log_path_str () noexcept
 
static const std::string & __get_application_environment_str () noexcept
 
static const std::string & __get_runs_on_str () noexcept
 
static const std::string & __get_exposes_service_str () noexcept
 
static const std::string & __get_opmon_conf_str () noexcept
 
static const std::string & __get_application_name_str () noexcept
 
static const std::string & __get_commandline_parameters_str () noexcept
 
static const std::string & __get_log_path_str () noexcept
 
static const std::string & __get_application_environment_str () noexcept
 
static const std::string & __get_runs_on_str () noexcept
 
static const std::string & __get_exposes_service_str () noexcept
 
static const std::string & __get_opmon_conf_str () noexcept
 
- Static Public Member Functions inherited from dunedaq::conffwk::DalObject
static void p_null (std::ostream &s)
 print "(null)"
 
static void p_rm (std::ostream &s)
 print "(deleted object)"
 
static void p_error (std::ostream &s, dunedaq::conffwk::Exception &ex)
 print error text
 
static void throw_get_ex (const std::string &what, const std::string &class_name, const DalObject *obj)
 throw exception in generated get method (i.e.
 
static bool is_null (const DalObject *ref) noexcept
 check a pointer on DAL object is null
 

Static Public Attributes

static const std::string & s_class_name
 
static const std::string s_wib_module_conf = "wib_module_conf"
 
static const std::string s_hermes_module_conf = "hermes_module_conf"
 
static const std::string s_detector_connections = "detector_connections"
 
- Static Public Attributes inherited from dunedaq::appmodel::SmartDaqApplication
static const std::string & s_class_name
 
static const std::string s_source_id = "source_id"
 
static const std::string s_queue_rules = "queue_rules"
 
static const std::string s_network_rules = "network_rules"
 
static const std::string s_action_plans = "action_plans"
 
- Static Public Attributes inherited from dunedaq::confmodel::Application
static const std::string & s_class_name
 
static const std::string s_application_name = "application_name"
 
static const std::string s_commandline_parameters = "commandline_parameters"
 
static const std::string s_log_path = "log_path"
 
static const std::string s_application_environment = "application_environment"
 
static const std::string s_runs_on = "runs_on"
 
static const std::string s_exposes_service = "exposes_service"
 
static const std::string s_opmon_conf = "opmon_conf"
 
- Static Public Attributes inherited from dunedaq::confmodel::ResourceSetDisableAND
static const std::string & s_class_name
 
- Static Public Attributes inherited from dunedaq::confmodel::ResourceSet
static const std::string & s_class_name
 
- Static Public Attributes inherited from dunedaq::confmodel::Resource
static const std::string & s_class_name
 

Protected Member Functions

 WIECApplication (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~WIECApplication () noexcept
 
virtual void init (bool init_children)
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 WIECApplication (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~WIECApplication () noexcept
 
virtual void init (bool init_children)
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::appmodel::SmartDaqApplication
 SmartDaqApplication (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~SmartDaqApplication () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 SmartDaqApplication (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~SmartDaqApplication () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::confmodel::Application
 Application (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Application () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 Application (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Application () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::conffwk::DalObject
 DalObject (DalRegistry &db, const ConfigObject &o) noexcept
 
virtual ~DalObject ()
 
void clear () noexcept
 
void check () const
 
bool is_deleted () const
 
void increment_created () noexcept
 
void increment_read () noexcept
 
void check_init () const
 Check and initialize object if necessary.
 
template<typename T >
void _set_object (const std::string &name, const T *value)
 Helper method for generated set single-value relationship methods.
 
template<typename T >
void _set_objects (const std::string &name, const std::vector< const T * > &value)
 Helper method for generated set multi-value relationship methods.
 
bool get_rel_objects (const std::string &name, bool upcast_unregistered, std::vector< const DalObject * > &objs) const
 Read relationship values as DAL objects using DAL factory.
 
bool get_algo_objects (const std::string &name, std::vector< const DalObject * > &objs) const
 Run algorithm and return result as DAL objects using DAL factory.
 
- Protected Member Functions inherited from dunedaq::confmodel::ResourceSetDisableAND
 ResourceSetDisableAND (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ResourceSetDisableAND () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 ResourceSetDisableAND (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ResourceSetDisableAND () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::confmodel::ResourceSet
 ResourceSet (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ResourceSet () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 ResourceSet (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ResourceSet () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::confmodel::Resource
 Resource (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Resource () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 Resource (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Resource () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 

Private Attributes

const dunedaq::appmodel::WIBModuleConfm_wib_module_conf
 
const dunedaq::appmodel::HermesModuleConfm_hermes_module_conf
 
std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > m_detector_connections
 

Friends

class conffwk::Configuration
 
class conffwk::DalObject
 
class conffwk::DalFactory
 
class conffwk::DalRegistry
 

Additional Inherited Members

- Protected Attributes inherited from dunedaq::conffwk::DalObject
std::mutex m_mutex
 Used to protect changes of DAL object.
 
bool p_was_read
 is true, if the object was read
 
DalRegistryp_registry
 Configuration object.
 
ConfigObject p_obj
 Config object used by given template object.
 
std::string p_UID
 Is used for template objects (see dqm_conffwk)
 

Detailed Description

Application describing the controller of a detector unit using WIBs inside a WIEC.

Definition at line 43 of file WIECApplication.hpp.

Constructor & Destructor Documentation

◆ WIECApplication() [1/2]

dunedaq::appmodel::WIECApplication::WIECApplication ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 33 of file WIECApplication.cpp.

33 :
37 m_wib_module_conf (nullptr),
38 m_hermes_module_conf (nullptr)
39
40 {
41 ;
42 }
SmartDaqApplication(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
const dunedaq::appmodel::HermesModuleConf * m_hermes_module_conf
const dunedaq::appmodel::WIBModuleConf * m_wib_module_conf
The base class for any generated DAL object.
Definition DalObject.hpp:45

◆ ~WIECApplication() [1/2]

dunedaq::appmodel::WIECApplication::~WIECApplication ( )
protectedvirtualnoexcept

Definition at line 91 of file WIECApplication.cpp.

92 {
93 }

◆ WIECApplication() [2/2]

dunedaq::appmodel::WIECApplication::WIECApplication ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~WIECApplication() [2/2]

virtual dunedaq::appmodel::WIECApplication::~WIECApplication ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_detector_connections_str() [1/2]

static const std::string & dunedaq::appmodel::WIECApplication::__get_detector_connections_str ( )
inlinestaticnoexcept

Definition at line 109 of file WIECApplication.hpp.

109{ return s_detector_connections; }
static const std::string s_detector_connections

◆ __get_detector_connections_str() [2/2]

static const std::string & dunedaq::appmodel::WIECApplication::__get_detector_connections_str ( )
inlinestaticnoexcept

Definition at line 109 of file WIECApplication.hpp.

109{ return s_detector_connections; }

◆ __get_hermes_module_conf_str() [1/2]

static const std::string & dunedaq::appmodel::WIECApplication::__get_hermes_module_conf_str ( )
inlinestaticnoexcept

Definition at line 108 of file WIECApplication.hpp.

108{ return s_hermes_module_conf; }
static const std::string s_hermes_module_conf

◆ __get_hermes_module_conf_str() [2/2]

static const std::string & dunedaq::appmodel::WIECApplication::__get_hermes_module_conf_str ( )
inlinestaticnoexcept

Definition at line 108 of file WIECApplication.hpp.

108{ return s_hermes_module_conf; }

◆ __get_wib_module_conf_str() [1/2]

static const std::string & dunedaq::appmodel::WIECApplication::__get_wib_module_conf_str ( )
inlinestaticnoexcept

Definition at line 107 of file WIECApplication.hpp.

107{ return s_wib_module_conf; }
static const std::string s_wib_module_conf

◆ __get_wib_module_conf_str() [2/2]

static const std::string & dunedaq::appmodel::WIECApplication::__get_wib_module_conf_str ( )
inlinestaticnoexcept

Definition at line 107 of file WIECApplication.hpp.

107{ return s_wib_module_conf; }

◆ contained_resources() [1/2]

std::vector< const confmodel::Resource * > dunedaq::appmodel::WIECApplication::contained_resources ( ) const
overridevirtual

Virtual method to obtain the list of all contained Resources. Used internally by the core disabled logic. Not intended to be used in application code as that should be using individual relationships of the derived classes.

Implements dunedaq::confmodel::ResourceSet.

Definition at line 46 of file WIECApplication.cpp.

46 {
48}
const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & get_detector_connections() const
Get "detector_connections" relationship value.
std::vector< const dunedaq::confmodel::Resource * > to_resources(const std::vector< T * > &vector_of_children)

◆ contained_resources() [2/2]

virtual std::vector< const Resource * > dunedaq::appmodel::WIECApplication::contained_resources ( ) const
overridevirtual

Virtual method to obtain the list of all contained Resources. Used internally by the core disabled logic. Not intended to be used in application code as that should be using individual relationships of the derived classes.

Implements dunedaq::confmodel::ResourceSet.

◆ generate_modules() [1/2]

std::vector< const confmodel::DaqModule * > dunedaq::appmodel::WIECApplication::generate_modules ( const confmodel::Session * session) const
overridevirtual

Generate DaqModule dal objects for streams of the application on the fly

Implements dunedaq::appmodel::SmartDaqApplication.

Definition at line 52 of file WIECApplication.cpp.

53{
54 ConfigObjectFactory obj_fac(this);
55 conffwk::Configuration* config = &this->configuration();
56 const std::string& dbfile = this->config_object().contained_in();
57
58 std::vector<const confmodel::DaqModule*> modules;
59
60 std::map<std::string, std::vector<const appmodel::HermesDataSender*>> ctrlhost_sender_map;
61
62
63 // uint16_t conn_idx = 0;
64 for (auto d2d_conn : get_detector_connections()) {
65
66 // Are we sure?
67 if (d2d_conn->is_disabled(*session)) {
68 TLOG_DEBUG(7) << "Ignoring disabled DetectorToDaqConnection " << d2d_conn->UID();
69 continue;
70 }
71
72 TLOG_DEBUG(6) << "Processing DetectorToDaqConnection " << d2d_conn->UID();
73
74 // Is this check necessary?
75 if (d2d_conn->contained_resources().empty()) {
76 throw(BadConf(ERS_HERE, "DetectorToDaqConnection does not contain senders or receivers"));
77 }
78
79 auto det_senders = d2d_conn->senders();
80 auto det_receiver = d2d_conn->receiver();
81
82 // Ensure that receiver is a nw_receiver
83 const auto* nw_receiver = det_receiver->cast<appmodel::NWDetDataReceiver>();
84
85 if ( !nw_receiver ) {
86 throw(BadConf(ERS_HERE, fmt::format("WEICApplication requires NWDetDataReceiver, found {} of class {}", det_receiver->UID(), det_receiver->class_name())));
87 }
88
89 // Loop over senders
90 for (const auto* sender : det_senders) {
91
92 if ( sender->is_disabled(*session) ) {
93 TLOG() << "Skipping disabled sender: " << sender->UID();
94 continue;
95 }
96
97 // Check the sender type, must me a HermesSender
98 const auto* hrms_sender = sender->cast<appmodel::HermesDataSender>();
99 if (!hrms_sender ) {
100 throw(BadConf(ERS_HERE, fmt::format("DataSender {} is not a appmodel::HermesDataSender", sender->UID())));
101 }
102
103 ctrlhost_sender_map[hrms_sender->get_control_host()].push_back(hrms_sender);
104 }
105
106
107 for( const auto& [ctrlhost, senders] : ctrlhost_sender_map ) {
108
109 // Create WIBModule
110 if ( this->get_wib_module_conf() ) {
111
112 bool enable_fembs[4] = {false, false, false, false};
113
114 for ( const auto* sender : senders ){
115 for ( const auto* det_stream : sender->get_streams() ) {
116 // Loop over streams for this sender
117 // Retrieve stream_id and calculate the femb_id
118 uint32_t stream_id = det_stream->get_geo_id()->get_stream_id();
119 uint32_t femb_id = (stream_id & 0xf) / 2 + 2*((stream_id >> 6) & 0xf);
120
121 // std::cout << std::format("stream {} -> femb {}", stream_id, femb_id) << std::endl;
122
123 // Enable the femb if any of the associated streams is enabld
124 // Senders in this senders list should be enabled, but better safe than sorry.
125 enable_fembs[femb_id] |= !det_stream->is_disabled(*session);
126 }
127 }
128 std::string wib_uid = fmt::format("wib-ctrl-{}-{}", this->UID(), ctrlhost);
129 conffwk::ConfigObject wib_obj = obj_fac.create("WIBModule", wib_uid);
130 wib_obj.set_by_val<std::string>("wib_addr", fmt::format("{}://{}:{}", this->get_wib_module_conf()->get_communication_type(), ctrlhost, this->get_wib_module_conf()->get_communication_port()));
131 wib_obj.set_by_val<bool>("enabled_femb0", enable_fembs[0]);
132 wib_obj.set_by_val<bool>("enabled_femb1", enable_fembs[1]);
133 wib_obj.set_by_val<bool>("enabled_femb2", enable_fembs[2]);
134 wib_obj.set_by_val<bool>("enabled_femb3", enable_fembs[3]);
135 wib_obj.set_obj("conf", &this->get_wib_module_conf()->get_settings()->config_object());
136 modules.push_back(config->get<appmodel::WIBModule>(wib_obj));
137 }
138
139 // Create Hermes Modules
140 if (this->get_hermes_module_conf()) {
141 std::string hermes_uid = fmt::format("hermes-ctrl-{}-{}", this->UID(), ctrlhost);
142 conffwk::ConfigObject hermes_obj = obj_fac.create("HermesModule", hermes_uid);
143 hermes_obj.set_obj("address_table", &this->get_hermes_module_conf()->get_address_table()->config_object());
144 hermes_obj.set_by_val<std::string>("uri", fmt::format("{}://{}:{}", this->get_hermes_module_conf()->get_ipbus_type(), ctrlhost, this->get_hermes_module_conf()->get_ipbus_port()));
145 hermes_obj.set_by_val<uint32_t>("timeout_ms", this->get_hermes_module_conf()->get_ipbus_timeout_ms());
146 hermes_obj.set_obj("destination", &nw_receiver->get_uses()->config_object());
147
148 std::vector< const conffwk::ConfigObject * > links_obj;
149 for ( const auto* sndr : senders ){
150 links_obj.push_back(&sndr->config_object());
151 }
152 hermes_obj.set_objs("links", links_obj);
153
154 modules.push_back(config->get<appmodel::HermesModule>(hermes_obj));
155 }
156
157
158 }
159
160 }
161
162 return modules;
163}
#define ERS_HERE
uint32_t get_ipbus_timeout_ms() const
Get "ipbus_timeout_ms" attribute value.
const dunedaq::appmodel::WIBModuleConf * get_wib_module_conf() const
Get "wib_module_conf" relationship value.
const dunedaq::appmodel::HermesModuleConf * get_hermes_module_conf() const
Get "hermes_module_conf" relationship value.
const std::string contained_in() const
Return the name of the database file this object belongs to.
Configuration & configuration() const noexcept
const ConfigObject & config_object() const
const std::string & UID() const noexcept
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
#define TLOG(...)
Definition macro.hpp:22

◆ generate_modules() [2/2]

std::vector< const dunedaq::confmodel::DaqModule * > dunedaq::appmodel::WIECApplication::generate_modules ( const confmodel::Session * ) const
overridevirtual

Generate DaqModule dal objects for streams of the application on the fly

Implements dunedaq::appmodel::SmartDaqApplication.

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::WIECApplication::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

Definition at line 95 of file WIECApplication.cpp.

96 {
97 std::vector<const dunedaq::conffwk::DalObject *> vec;
98
99 if (!get(name, vec, upcast_unregistered, true))
100 throw_get_ex(name, s_class_name, this);
101
102 return vec;
103 }
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...
static const std::string & s_class_name
static void throw_get_ex(const std::string &what, const std::string &class_name, const DalObject *obj)
throw exception in generated get method (i.e.
Definition DalObject.cpp:82

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::WIECApplication::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

◆ get() [3/4]

bool dunedaq::appmodel::WIECApplication::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

Definition at line 105 of file WIECApplication.cpp.

106 {
107 if (first_call)
108 {
109 std::lock_guard scoped_lock(m_mutex);
110
111 check();
112 check_init();
113
114 if (get_rel_objects(name, upcast_unregistered, vec))
115 return true;
116 }
117
118 if (SmartDaqApplication::get(name, vec, upcast_unregistered, false)) return true;
119 if (ResourceSetDisableAND::get(name, vec, upcast_unregistered, false)) return true;
120
121 if (first_call)
122 return get_algo_objects(name, vec);
123
124 return false;
125 }
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...
bool get_rel_objects(const std::string &name, bool upcast_unregistered, std::vector< const DalObject * > &objs) const
Read relationship values as DAL objects using DAL factory.
Definition DalObject.cpp:8
std::mutex m_mutex
Used to protect changes of DAL object.
bool get_algo_objects(const std::string &name, std::vector< const DalObject * > &objs) const
Run algorithm and return result as DAL objects using DAL factory.
Definition DalObject.cpp:25
void check_init() const
Check and initialize object if necessary.

◆ get() [4/4]

bool dunedaq::appmodel::WIECApplication::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

◆ get_detector_connections() [1/2]

const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & dunedaq::appmodel::WIECApplication::get_detector_connections ( ) const
inline

Get "detector_connections" relationship value.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 169 of file WIECApplication.hpp.

170 {
171 std::lock_guard scoped_lock(m_mutex);
172 check();
173 check_init();
175 }
std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > m_detector_connections

◆ get_detector_connections() [2/2]

const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & dunedaq::appmodel::WIECApplication::get_detector_connections ( ) const
inline

Get "detector_connections" relationship value.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 169 of file WIECApplication.hpp.

170 {
171 std::lock_guard scoped_lock(m_mutex);
172 check();
173 check_init();
175 }

◆ get_hermes_module_conf() [1/2]

const dunedaq::appmodel::HermesModuleConf * dunedaq::appmodel::WIECApplication::get_hermes_module_conf ( ) const
inline

Get "hermes_module_conf" relationship value.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 144 of file WIECApplication.hpp.

145 {
146 std::lock_guard scoped_lock(m_mutex);
147 check();
148 check_init();
150 }

◆ get_hermes_module_conf() [2/2]

const dunedaq::appmodel::HermesModuleConf * dunedaq::appmodel::WIECApplication::get_hermes_module_conf ( ) const
inline

Get "hermes_module_conf" relationship value.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 144 of file WIECApplication.hpp.

145 {
146 std::lock_guard scoped_lock(m_mutex);
147 check();
148 check_init();
150 }

◆ get_wib_module_conf() [1/2]

const dunedaq::appmodel::WIBModuleConf * dunedaq::appmodel::WIECApplication::get_wib_module_conf ( ) const
inline

Get "wib_module_conf" relationship value.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 119 of file WIECApplication.hpp.

120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 check_init();
124 return m_wib_module_conf;
125 }

◆ get_wib_module_conf() [2/2]

const dunedaq::appmodel::WIBModuleConf * dunedaq::appmodel::WIECApplication::get_wib_module_conf ( ) const
inline

Get "wib_module_conf" relationship value.

Returns
the relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 119 of file WIECApplication.hpp.

120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 check_init();
124 return m_wib_module_conf;
125 }

◆ init() [1/2]

void dunedaq::appmodel::WIECApplication::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

Definition at line 74 of file WIECApplication.cpp.

75 {
76 SmartDaqApplication::init(init_children);
77 ResourceSetDisableAND::init(init_children);
78
79 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
80
81 try {
85 }
86 catch (dunedaq::conffwk::Exception & ex) {
87 throw_init_ex(ex);
88 }
89 }
virtual void init(bool init_children)
void throw_init_ex(dunedaq::conffwk::Exception &ex)
throw object initialisation exception (i.e.
Definition DalObject.cpp:74
DalRegistry & p_registry
Configuration object.
ConfigObject p_obj
Config object used by given template object.
const T * _ref(ConfigObject &obj, const std::string &name, bool read_children)
Get signle value of object's relation and instantiate result with it (multi-thread safe).

◆ init() [2/2]

virtual void dunedaq::appmodel::WIECApplication::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

◆ print() [1/2]

void dunedaq::appmodel::WIECApplication::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the WIECApplication object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

Definition at line 45 of file WIECApplication.cpp.

46 {
47 check_init();
48
49 try {
50 const std::string str(indent+2, ' ');
51
52 if (print_header)
53 p_hdr(s, indent, s_class_name, "dunedaq::appmodel");
54
55
56 // print direct super-classes
57
60
61
62 // print direct relationships
63
67 }
68 catch (dunedaq::conffwk::Exception & ex) {
70 }
71 }
virtual void print(unsigned int offset, bool print_header, std::ostream &s) const
Print details of the SmartDaqApplication object.
void p_hdr(std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
print object headers
Definition DalObject.cpp:65
static void p_error(std::ostream &s, dunedaq::conffwk::Exception &ex)
print error text
Definition DalObject.cpp:59
virtual void print(unsigned int offset, bool print_header, std::ostream &s) const
Print details of the ResourceSetDisableAND object.
void p_sv_rel(std::ostream &s, const std::string &str, const std::string &name, const DalObject *obj)
print weak single-value relationship
void p_mv_rel(std::ostream &s, const std::string &str, const std::string &name, const T &objs) noexcept
print weak multi-value relationship

◆ print() [2/2]

virtual void dunedaq::appmodel::WIECApplication::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the WIECApplication object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

◆ set_detector_connections() [1/2]

void dunedaq::appmodel::WIECApplication::set_detector_connections ( const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & value)

Set "detector_connections" relationship value.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 137 of file WIECApplication.cpp.

138 {
140 }
void _set_objects(const std::string &name, const std::vector< const T * > &value)
Helper method for generated set multi-value relationship methods.

◆ set_detector_connections() [2/2]

void dunedaq::appmodel::WIECApplication::set_detector_connections ( const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & value)

Set "detector_connections" relationship value.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

◆ set_hermes_module_conf() [1/2]

void dunedaq::appmodel::WIECApplication::set_hermes_module_conf ( const dunedaq::appmodel::HermesModuleConf * value)

Set "hermes_module_conf" relationship value.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 132 of file WIECApplication.cpp.

133 {
135 }
void _set_object(const std::string &name, const T *value)
Helper method for generated set single-value relationship methods.

◆ set_hermes_module_conf() [2/2]

void dunedaq::appmodel::WIECApplication::set_hermes_module_conf ( const dunedaq::appmodel::HermesModuleConf * value)

Set "hermes_module_conf" relationship value.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

◆ set_wib_module_conf() [1/2]

void dunedaq::appmodel::WIECApplication::set_wib_module_conf ( const dunedaq::appmodel::WIBModuleConf * value)

Set "wib_module_conf" relationship value.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Definition at line 127 of file WIECApplication.cpp.

128 {
130 }

◆ set_wib_module_conf() [2/2]

void dunedaq::appmodel::WIECApplication::set_wib_module_conf ( const dunedaq::appmodel::WIBModuleConf * value)

Set "wib_module_conf" relationship value.

Parameters
valuenew relationship value
Exceptions
dunedaq::conffwk::Generic,dunedaq::conffwk::DeletedObject

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 45 of file WIECApplication.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 47 of file WIECApplication.hpp.

◆ conffwk::DalObject

Definition at line 46 of file WIECApplication.hpp.

◆ conffwk::DalRegistry

Definition at line 48 of file WIECApplication.hpp.

Member Data Documentation

◆ m_detector_connections

std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > dunedaq::appmodel::WIECApplication::m_detector_connections
private

Definition at line 96 of file WIECApplication.hpp.

◆ m_hermes_module_conf

const dunedaq::appmodel::HermesModuleConf * dunedaq::appmodel::WIECApplication::m_hermes_module_conf
private

Definition at line 95 of file WIECApplication.hpp.

◆ m_wib_module_conf

const dunedaq::appmodel::WIBModuleConf * dunedaq::appmodel::WIECApplication::m_wib_module_conf
private

Definition at line 94 of file WIECApplication.hpp.

◆ s_class_name

static const std::string & dunedaq::appmodel::WIECApplication::s_class_name
static

The name of the configuration class.

Definition at line 60 of file WIECApplication.hpp.

◆ s_detector_connections

static const std::string dunedaq::appmodel::WIECApplication::s_detector_connections = "detector_connections"
inlinestatic

Definition at line 105 of file WIECApplication.hpp.

◆ s_hermes_module_conf

static const std::string dunedaq::appmodel::WIECApplication::s_hermes_module_conf = "hermes_module_conf"
inlinestatic

Definition at line 104 of file WIECApplication.hpp.

◆ s_wib_module_conf

static const std::string dunedaq::appmodel::WIECApplication::s_wib_module_conf = "wib_module_conf"
inlinestatic

Definition at line 103 of file WIECApplication.hpp.


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