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

#include <DetDataSender.hpp>

Inheritance diagram for dunedaq::confmodel::DetDataSender:
[legend]
Collaboration diagram for dunedaq::confmodel::DetDataSender:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the DetDataSender 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 std::vector< const dunedaq::confmodel::DetectorStream * > & get_streams () const
 Get "streams" relationship value.
 
void set_streams (const std::vector< const dunedaq::confmodel::DetectorStream * > &value)
 Set "streams" relationship value.
 
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 DetDataSender 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 std::vector< const dunedaq::confmodel::DetectorStream * > & get_streams () const
 Get "streams" relationship value.
 
void set_streams (const std::vector< const dunedaq::confmodel::DetectorStream * > &value)
 Set "streams" relationship value.
 
virtual std::vector< const Resource * > contained_resources () const override
 
- 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
 
- 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.
 

Static Public Member Functions

static const std::string & __get_streams_str () noexcept
 
static const std::string & __get_streams_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_streams = "streams"
 
- 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

 DetDataSender (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~DetDataSender () 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
 
 DetDataSender (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~DetDataSender () 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::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
 
- 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.
 

Private Attributes

std::vector< const dunedaq::confmodel::DetectorStream * > m_streams
 

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 32 of file DetDataSender.hpp.

Constructor & Destructor Documentation

◆ DetDataSender() [1/2]

dunedaq::confmodel::DetDataSender::DetDataSender ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 20 of file DetDataSender.cpp.

20 :
23
24 {
25 ;
26 }
The base class for any generated DAL object.
Definition DalObject.hpp:45
ResourceSetDisableAND(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept

◆ ~DetDataSender() [1/2]

dunedaq::confmodel::DetDataSender::~DetDataSender ( )
protectedvirtualnoexcept

Definition at line 69 of file DetDataSender.cpp.

70 {
71 }

◆ DetDataSender() [2/2]

dunedaq::confmodel::DetDataSender::DetDataSender ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~DetDataSender() [2/2]

virtual dunedaq::confmodel::DetDataSender::~DetDataSender ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_streams_str() [1/2]

static const std::string & dunedaq::confmodel::DetDataSender::__get_streams_str ( )
inlinestaticnoexcept

Definition at line 92 of file DetDataSender.hpp.

92{ return s_streams; }
static const std::string s_streams

◆ __get_streams_str() [2/2]

static const std::string & dunedaq::confmodel::DetDataSender::__get_streams_str ( )
inlinestaticnoexcept

Definition at line 92 of file DetDataSender.hpp.

92{ return s_streams; }

◆ contained_resources() [1/2]

std::vector< const Resource * > dunedaq::confmodel::DetDataSender::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 406 of file dalMethods.cpp.

406 {
407 return to_resources(get_streams());
408}
const std::vector< const dunedaq::confmodel::DetectorStream * > & get_streams() const
Get "streams" 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::confmodel::DetDataSender::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.

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::confmodel::DetDataSender::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::ResourceSetDisableAND.

Reimplemented in dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::confmodel::DummySender, and dunedaq::confmodel::DummySender.

Definition at line 73 of file DetDataSender.cpp.

74 {
75 std::vector<const dunedaq::conffwk::DalObject *> vec;
76
77 if (!get(name, vec, upcast_unregistered, true))
78 throw_get_ex(name, s_class_name, this);
79
80 return vec;
81 }
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
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

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::confmodel::DetDataSender::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::ResourceSetDisableAND.

Reimplemented in dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::confmodel::DummySender, and dunedaq::confmodel::DummySender.

◆ get() [3/4]

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

Definition at line 83 of file DetDataSender.cpp.

84 {
85 if (first_call)
86 {
87 std::lock_guard scoped_lock(m_mutex);
88
89 check();
90 check_init();
91
92 if (get_rel_objects(name, upcast_unregistered, vec))
93 return true;
94 }
95
96 if (ResourceSetDisableAND::get(name, vec, upcast_unregistered, false)) return true;
97
98 if (first_call)
99 return get_algo_objects(name, vec);
100
101 return false;
102 }
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.
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...

◆ get() [4/4]

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

◆ get_streams() [1/2]

const std::vector< const dunedaq::confmodel::DetectorStream * > & dunedaq::confmodel::DetDataSender::get_streams ( ) const
inline

Get "streams" relationship value.

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

Definition at line 102 of file DetDataSender.hpp.

103 {
104 std::lock_guard scoped_lock(m_mutex);
105 check();
106 check_init();
107 if (m_streams.empty())
108 {
109 std::ostringstream text;
110 text << "relationship \"" << s_streams << "\" of object " << this << " is empty";
111 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
112 }
113 return m_streams;
114 }
#define ERS_HERE
Generic configuration exception.
std::vector< const dunedaq::confmodel::DetectorStream * > m_streams

◆ get_streams() [2/2]

const std::vector< const dunedaq::confmodel::DetectorStream * > & dunedaq::confmodel::DetDataSender::get_streams ( ) const
inline

Get "streams" relationship value.

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

Definition at line 102 of file DetDataSender.hpp.

103 {
104 std::lock_guard scoped_lock(m_mutex);
105 check();
106 check_init();
107 if (m_streams.empty())
108 {
109 std::ostringstream text;
110 text << "relationship \"" << s_streams << "\" of object " << this << " is empty";
111 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
112 }
113 return m_streams;
114 }

◆ init() [1/2]

void dunedaq::confmodel::DetDataSender::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::confmodel::ResourceSetDisableAND.

Reimplemented in dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::confmodel::DummySender, and dunedaq::confmodel::DummySender.

Definition at line 55 of file DetDataSender.cpp.

56 {
57 ResourceSetDisableAND::init(init_children);
58
59 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
60
61 try {
63 }
64 catch (dunedaq::conffwk::Exception & ex) {
65 throw_init_ex(ex);
66 }
67 }
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).
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112

◆ init() [2/2]

◆ print() [1/2]

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

Print details of the DetDataSender 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::ResourceSetDisableAND.

Reimplemented in dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FakeDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::FelixDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::HermesDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::NWDetDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::SocketDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::appmodel::TdeAmcDetDataSender, dunedaq::confmodel::DummySender, and dunedaq::confmodel::DummySender.

Definition at line 29 of file DetDataSender.cpp.

30 {
31 check_init();
32
33 try {
34 const std::string str(indent+2, ' ');
35
36 if (print_header)
37 p_hdr(s, indent, s_class_name, "dunedaq::confmodel");
38
39
40 // print direct super-classes
41
43
44
45 // print direct relationships
46
48 }
49 catch (dunedaq::conffwk::Exception & ex) {
51 }
52 }
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_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::confmodel::DetDataSender::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

◆ set_streams() [1/2]

void dunedaq::confmodel::DetDataSender::set_streams ( const std::vector< const dunedaq::confmodel::DetectorStream * > & value)

Set "streams" relationship value.

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

Definition at line 104 of file DetDataSender.cpp.

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

◆ set_streams() [2/2]

void dunedaq::confmodel::DetDataSender::set_streams ( const std::vector< const dunedaq::confmodel::DetectorStream * > & value)

Set "streams" relationship value.

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

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 34 of file DetDataSender.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 36 of file DetDataSender.hpp.

◆ conffwk::DalObject

Definition at line 35 of file DetDataSender.hpp.

◆ conffwk::DalRegistry

Definition at line 37 of file DetDataSender.hpp.

Member Data Documentation

◆ m_streams

std::vector< const dunedaq::confmodel::DetectorStream * > dunedaq::confmodel::DetDataSender::m_streams
private

Definition at line 83 of file DetDataSender.hpp.

◆ s_class_name

static const std::string & dunedaq::confmodel::DetDataSender::s_class_name
static

The name of the configuration class.

Definition at line 49 of file DetDataSender.hpp.

◆ s_streams

static const std::string dunedaq::confmodel::DetDataSender::s_streams = "streams"
inlinestatic

Definition at line 90 of file DetDataSender.hpp.


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