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

#include <FakeHSIApplication.hpp>

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

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the FakeHSIApplication 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::DataHandlerConfget_link_handler () const
 Get "link_handler" relationship value.
 
void set_link_handler (const dunedaq::appmodel::DataHandlerConf *value)
 Set "link_handler" relationship value.
 
const dunedaq::appmodel::FakeHSIEventGeneratorConfget_generator () const
 Get "generator" relationship value.
 
void set_generator (const dunedaq::appmodel::FakeHSIEventGeneratorConf *value)
 Set "generator" relationship value.
 
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules (const confmodel::Session *) const override
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the FakeHSIApplication 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::DataHandlerConfget_link_handler () const
 Get "link_handler" relationship value.
 
void set_link_handler (const dunedaq::appmodel::DataHandlerConf *value)
 Set "link_handler" relationship value.
 
const dunedaq::appmodel::FakeHSIEventGeneratorConfget_generator () const
 Get "generator" relationship value.
 
void set_generator (const dunedaq::appmodel::FakeHSIEventGeneratorConf *value)
 Set "generator" relationship value.
 
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules (const confmodel::Session *) const override
 
- Public Member Functions inherited from dunedaq::confmodel::Resource
- Public Member Functions inherited from dunedaq::confmodel::ResourceBase
- Public Member Functions inherited from dunedaq::confmodel::Component
void get_parents (const dunedaq::confmodel::Session &session, std::list< std::vector< const dunedaq::confmodel::Component * > > &parents) const
 
bool disabled (const dunedaq::confmodel::Session &session) const
 
void get_parents (const dunedaq::confmodel::Session &session, std::list< std::vector< const dunedaq::confmodel::Component * > > &parents) const
 
bool disabled (const dunedaq::confmodel::Session &session) 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::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
 

Static Public Member Functions

static const std::string & __get_link_handler_str () noexcept
 
static const std::string & __get_generator_str () noexcept
 
static const std::string & __get_link_handler_str () noexcept
 
static const std::string & __get_generator_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 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 Attributes

static const std::string & s_class_name
 
static const std::string s_link_handler = "link_handler"
 
static const std::string s_generator = "generator"
 
- Static Public Attributes inherited from dunedaq::confmodel::Resource
static const std::string & s_class_name
 
- Static Public Attributes inherited from dunedaq::confmodel::ResourceBase
static const std::string & s_class_name
 
- Static Public Attributes inherited from dunedaq::confmodel::Component
static const std::string & s_class_name
 
- 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"
 

Protected Member Functions

 FakeHSIApplication (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~FakeHSIApplication () 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
 
 FakeHSIApplication (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~FakeHSIApplication () 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::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
 
- Protected Member Functions inherited from dunedaq::confmodel::ResourceBase
 ResourceBase (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ResourceBase () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 ResourceBase (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ResourceBase () 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::Component
 Component (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Component () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 Component (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Component () 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::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
 

Private Attributes

const dunedaq::appmodel::DataHandlerConfm_link_handler
 
const dunedaq::appmodel::FakeHSIEventGeneratorConfm_generator
 

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

Definition at line 38 of file FakeHSIApplication.hpp.

Constructor & Destructor Documentation

◆ FakeHSIApplication() [1/2]

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

Definition at line 32 of file FakeHSIApplication.cpp.

32 :
36 m_link_handler (nullptr),
37 m_generator (nullptr)
38
39 {
40 ;
41 }
const dunedaq::appmodel::FakeHSIEventGeneratorConf * m_generator
const dunedaq::appmodel::DataHandlerConf * m_link_handler
SmartDaqApplication(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
The base class for any generated DAL object.
Definition DalObject.hpp:45

◆ ~FakeHSIApplication() [1/2]

dunedaq::appmodel::FakeHSIApplication::~FakeHSIApplication ( )
protectedvirtualnoexcept

Definition at line 88 of file FakeHSIApplication.cpp.

89 {
90 }

◆ FakeHSIApplication() [2/2]

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

◆ ~FakeHSIApplication() [2/2]

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

Member Function Documentation

◆ __get_generator_str() [1/2]

static const std::string & dunedaq::appmodel::FakeHSIApplication::__get_generator_str ( )
inlinestaticnoexcept

Definition at line 101 of file FakeHSIApplication.hpp.

101{ return s_generator; }

◆ __get_generator_str() [2/2]

static const std::string & dunedaq::appmodel::FakeHSIApplication::__get_generator_str ( )
inlinestaticnoexcept

Definition at line 101 of file FakeHSIApplication.hpp.

101{ return s_generator; }

◆ __get_link_handler_str() [1/2]

static const std::string & dunedaq::appmodel::FakeHSIApplication::__get_link_handler_str ( )
inlinestaticnoexcept

Definition at line 100 of file FakeHSIApplication.hpp.

100{ return s_link_handler; }

◆ __get_link_handler_str() [2/2]

static const std::string & dunedaq::appmodel::FakeHSIApplication::__get_link_handler_str ( )
inlinestaticnoexcept

Definition at line 100 of file FakeHSIApplication.hpp.

100{ return s_link_handler; }

◆ generate_modules() [1/2]

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

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

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

Definition at line 43 of file FakeHSIApplication.cpp.

44{
45 std::vector<const confmodel::DaqModule*> modules;
46
47 ConfigObjectFactory obj_fac(this);
48
49
50 auto dlhConf = get_link_handler();
51 auto dlhClass = dlhConf->get_template_for();
52
53 const QueueDescriptor* dlhInputQDesc = nullptr;
54
55 for (auto rule : get_queue_rules()) {
56 auto destination_class = rule->get_destination_class();
57 auto data_type = rule->get_descriptor()->get_data_type();
58 if (destination_class == "DataHandlerModule" || destination_class == dlhClass) {
59 dlhInputQDesc = rule->get_descriptor();
60 }
61 }
62
63 const NetworkConnectionDescriptor* dlhReqInputNetDesc = nullptr;
64 const NetworkConnectionDescriptor* tsNetDesc = nullptr;
65 const NetworkConnectionDescriptor* hsiNetDesc = nullptr;
66
67 for (auto rule : get_network_rules()) {
68 auto endpoint_class = rule->get_endpoint_class();
69 auto data_type = rule->get_descriptor()->get_data_type();
70
71 if (endpoint_class == "DataHandlerModule" || endpoint_class == dlhClass) {
72 if (data_type == "TimeSync") {
73 tsNetDesc = rule->get_descriptor();
74 }
75 if (data_type == "DataRequest") {
76 dlhReqInputNetDesc = rule->get_descriptor();
77 }
78 }
79 if (data_type == "HSIEvent") {
80 hsiNetDesc = rule->get_descriptor();
81 }
82 }
83
84 auto rdrConf = get_generator();
85 if (rdrConf == 0) {
86 throw(BadConf(ERS_HERE, "No FakeHSIEventGeneratorModule configuration given"));
87 }
88 if (dlhInputQDesc == nullptr) {
89 throw(BadConf(ERS_HERE, "No DLH data input queue descriptor given"));
90 }
91 if (dlhReqInputNetDesc == nullptr) {
92 throw(BadConf(ERS_HERE, "No DLH request input network descriptor given"));
93 }
94 if (hsiNetDesc == nullptr) {
95 throw(BadConf(ERS_HERE, "No HSIEvent output network descriptor given"));
96 }
97
98 auto idconf = get_source_id();
99 if (idconf == nullptr) {
100 throw(BadConf(ERS_HERE, "No SourceIDConf given"));
101 }
102 auto id = idconf->get_sid();
103
104 auto det_id = 1; // TODO Eric Flumerfelt <eflumerf@fnal.gov>, 08-Feb-2024: This is a magic number corresponding to kDAQ
105 std::string uid("DLH-" + std::to_string(id));
106 TLOG_DEBUG(7) << "creating OKS configuration object for Data Link Handler class " << dlhClass << ", id " << id;
107 conffwk::ConfigObject dlhObj = obj_fac.create(dlhClass, uid);
108 dlhObj.set_by_val<uint32_t>("source_id", id);
109 dlhObj.set_by_val<uint32_t>("detector_id", det_id);
110 dlhObj.set_by_val<bool>("post_processing_enabled", false);
111 dlhObj.set_obj("module_configuration", &dlhConf->config_object());
112
113 // Process special Network rules!
114 // Looking for Fragment rules from DFAppplications in current Session
115 auto sessionApps = session->get_enabled_applications();
116 std::vector<conffwk::ConfigObject> fragOutObjs;
117 for (auto app : sessionApps) {
118 auto dfapp = app->cast<appmodel::DFApplication>();
119 if (dfapp == nullptr)
120 continue;
121
122 auto dfNRules = dfapp->get_network_rules();
123 for (auto rule : dfNRules) {
124 auto descriptor = rule->get_descriptor();
125 auto data_type = descriptor->get_data_type();
126 if (data_type == "Fragment") {
127 conffwk::ConfigObject frag_conn =
128 obj_fac.create_net_obj(descriptor, dfapp->UID());
129 fragOutObjs.push_back(frag_conn);
130 } // If network rule has TriggerDecision type of data
131 } // Loop over Apps network rules
132 } // loop over Session specific Apps
133
134 // start building the list of outputs
135 std::vector<const conffwk::ConfigObject*> fh_output_objs;
136 for (auto& fNet : fragOutObjs) {
137 fh_output_objs.push_back(&fNet);
138 }
139
140 // Time Sync network connection
141 if (dlhConf->get_generate_timesync()) {
142 conffwk::ConfigObject tsNetObj = obj_fac.create_net_obj(tsNetDesc, std::to_string(id));
143 fh_output_objs.push_back(&tsNetObj);
144 }
145 dlhObj.set_objs("outputs", fh_output_objs);
146
147 conffwk::ConfigObject queueObj = obj_fac.create_queue_sid_obj(dlhInputQDesc, id);
148 conffwk::ConfigObject faNetObj = obj_fac.create_net_obj(dlhReqInputNetDesc, UID());
149
150 dlhObj.set_objs("inputs", { &queueObj, &faNetObj });
151
152 modules.push_back(obj_fac.get_dal<DataHandlerModule>(uid));
153
154 auto hsiServiceObj = hsiNetDesc->get_associated_service()->config_object();
155 conffwk::ConfigObject hsiNetObj = obj_fac.create_net_obj(hsiNetDesc, "");
156
157 std::string genuid("FakeHSI-" + std::to_string(id));
158 conffwk::ConfigObject fakehsiObj =
159 obj_fac.create("FakeHSIEventGeneratorModule", genuid);
160 fakehsiObj.set_obj("configuration", &rdrConf->config_object());
161 fakehsiObj.set_objs("outputs", { &queueObj, &hsiNetObj });
162
163 modules.push_back(obj_fac.get_dal<FakeHSIEventGeneratorModule>(genuid));
164
165 return modules;
166}
#define ERS_HERE
const dunedaq::appmodel::DataHandlerConf * get_link_handler() const
Get "link_handler" relationship value.
const dunedaq::appmodel::FakeHSIEventGeneratorConf * get_generator() const
Get "generator" relationship value.
const dunedaq::confmodel::Service * get_associated_service() const
Get "associated_service" relationship value. Service provided by this connection.
const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > & get_network_rules() const
Get "network_rules" relationship value.
const std::vector< const dunedaq::appmodel::QueueConnectionRule * > & get_queue_rules() const
Get "queue_rules" relationship value.
const dunedaq::appmodel::SourceIDConf * get_source_id() const
Get "source_id" relationship value.
const ConfigObject & config_object() const
const std::string & UID() const noexcept
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112

◆ generate_modules() [2/2]

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

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

Reimplemented from dunedaq::appmodel::SmartDaqApplication.

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::FakeHSIApplication::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::confmodel::Resource.

Definition at line 92 of file FakeHSIApplication.cpp.

93 {
94 std::vector<const dunedaq::conffwk::DalObject *> vec;
95
96 if (!get(name, vec, upcast_unregistered, true))
97 throw_get_ex(name, s_class_name, this);
98
99 return vec;
100 }
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 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::FakeHSIApplication::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::confmodel::Resource.

◆ get() [3/4]

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

Definition at line 102 of file FakeHSIApplication.cpp.

103 {
104 if (first_call)
105 {
106 std::lock_guard scoped_lock(m_mutex);
107
108 check();
109 check_init();
110
111 if (get_rel_objects(name, upcast_unregistered, vec))
112 return true;
113 }
114
115 if (Resource::get(name, vec, upcast_unregistered, false)) return true;
116 if (SmartDaqApplication::get(name, vec, upcast_unregistered, false)) return true;
117
118 if (first_call)
119 return get_algo_objects(name, vec);
120
121 return false;
122 }
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::FakeHSIApplication::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

◆ get_generator() [1/2]

const dunedaq::appmodel::FakeHSIEventGeneratorConf * dunedaq::appmodel::FakeHSIApplication::get_generator ( ) const
inline

Get "generator" relationship value.

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

Definition at line 142 of file FakeHSIApplication.hpp.

143 {
144 std::lock_guard scoped_lock(m_mutex);
145 check();
146 check_init();
147 if (!m_generator)
148 {
149 std::ostringstream text;
150 text << "relationship \"" << s_generator << "\" of object " << this << " is not set";
151 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
152 }
153 return m_generator;
154 }
Generic configuration exception.

◆ get_generator() [2/2]

const dunedaq::appmodel::FakeHSIEventGeneratorConf * dunedaq::appmodel::FakeHSIApplication::get_generator ( ) const
inline

Get "generator" relationship value.

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

Definition at line 142 of file FakeHSIApplication.hpp.

143 {
144 std::lock_guard scoped_lock(m_mutex);
145 check();
146 check_init();
147 if (!m_generator)
148 {
149 std::ostringstream text;
150 text << "relationship \"" << s_generator << "\" of object " << this << " is not set";
151 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
152 }
153 return m_generator;
154 }

◆ get_link_handler() [1/2]

const dunedaq::appmodel::DataHandlerConf * dunedaq::appmodel::FakeHSIApplication::get_link_handler ( ) const
inline

Get "link_handler" relationship value.

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

Definition at line 111 of file FakeHSIApplication.hpp.

112 {
113 std::lock_guard scoped_lock(m_mutex);
114 check();
115 check_init();
116 if (!m_link_handler)
117 {
118 std::ostringstream text;
119 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
120 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
121 }
122 return m_link_handler;
123 }

◆ get_link_handler() [2/2]

const dunedaq::appmodel::DataHandlerConf * dunedaq::appmodel::FakeHSIApplication::get_link_handler ( ) const
inline

Get "link_handler" relationship value.

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

Definition at line 111 of file FakeHSIApplication.hpp.

112 {
113 std::lock_guard scoped_lock(m_mutex);
114 check();
115 check_init();
116 if (!m_link_handler)
117 {
118 std::ostringstream text;
119 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
120 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
121 }
122 return m_link_handler;
123 }

◆ init() [1/2]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::confmodel::Resource.

Definition at line 72 of file FakeHSIApplication.cpp.

73 {
74 Resource::init(init_children);
75 SmartDaqApplication::init(init_children);
76
77 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
78
79 try {
82 }
83 catch (dunedaq::conffwk::Exception & ex) {
84 throw_init_ex(ex);
85 }
86 }
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::FakeHSIApplication::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::confmodel::Resource.

◆ print() [1/2]

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

Print details of the FakeHSIApplication 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::confmodel::Resource.

Definition at line 44 of file FakeHSIApplication.cpp.

45 {
46 check_init();
47
48 try {
49 const std::string str(indent+2, ' ');
50
51 if (print_header)
52 p_hdr(s, indent, s_class_name, "dunedaq::appmodel");
53
54
55 // print direct super-classes
56
59
60
61 // print direct relationships
62
65 }
66 catch (dunedaq::conffwk::Exception & ex) {
68 }
69 }
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 Resource object.
Definition Resource.cpp:35
void p_sv_rel(std::ostream &s, const std::string &str, const std::string &name, const DalObject *obj)
print weak single-value relationship

◆ print() [2/2]

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

Print details of the FakeHSIApplication 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::confmodel::Resource.

◆ set_generator() [1/2]

void dunedaq::appmodel::FakeHSIApplication::set_generator ( const dunedaq::appmodel::FakeHSIEventGeneratorConf * value)

Set "generator" relationship value.

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

Definition at line 129 of file FakeHSIApplication.cpp.

130 {
131 _set_object(s_generator, value);
132 }
void _set_object(const std::string &name, const T *value)
Helper method for generated set single-value relationship methods.

◆ set_generator() [2/2]

void dunedaq::appmodel::FakeHSIApplication::set_generator ( const dunedaq::appmodel::FakeHSIEventGeneratorConf * value)

Set "generator" relationship value.

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

◆ set_link_handler() [1/2]

void dunedaq::appmodel::FakeHSIApplication::set_link_handler ( const dunedaq::appmodel::DataHandlerConf * value)

Set "link_handler" relationship value.

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

Definition at line 124 of file FakeHSIApplication.cpp.

125 {
127 }

◆ set_link_handler() [2/2]

void dunedaq::appmodel::FakeHSIApplication::set_link_handler ( const dunedaq::appmodel::DataHandlerConf * value)

Set "link_handler" relationship value.

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

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 40 of file FakeHSIApplication.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 42 of file FakeHSIApplication.hpp.

◆ conffwk::DalObject

Definition at line 41 of file FakeHSIApplication.hpp.

◆ conffwk::DalRegistry

Definition at line 43 of file FakeHSIApplication.hpp.

Member Data Documentation

◆ m_generator

const dunedaq::appmodel::FakeHSIEventGeneratorConf * dunedaq::appmodel::FakeHSIApplication::m_generator
private

Definition at line 90 of file FakeHSIApplication.hpp.

◆ m_link_handler

const dunedaq::appmodel::DataHandlerConf * dunedaq::appmodel::FakeHSIApplication::m_link_handler
private

Definition at line 89 of file FakeHSIApplication.hpp.

◆ s_class_name

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

The name of the configuration class.

Definition at line 55 of file FakeHSIApplication.hpp.

◆ s_generator

static const std::string dunedaq::appmodel::FakeHSIApplication::s_generator = "generator"
inlinestatic

Definition at line 98 of file FakeHSIApplication.hpp.

◆ s_link_handler

static const std::string dunedaq::appmodel::FakeHSIApplication::s_link_handler = "link_handler"
inlinestatic

Definition at line 97 of file FakeHSIApplication.hpp.


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