DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::listrev::dal::ListReverser Class Reference

#include <ListReverser.hpp>

Inheritance diagram for dunedaq::listrev::dal::ListReverser:
[legend]
Collaboration diagram for dunedaq::listrev::dal::ListReverser:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the ListReverser 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.
 
uint32_t get_reverser_id () const
 Get "reverser_id" attribute value.
 
void set_reverser_id (uint32_t value)
 Set "reverser_id" attribute value.
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the ListReverser 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.
 
uint32_t get_reverser_id () const
 Get "reverser_id" attribute value.
 
void set_reverser_id (uint32_t value)
 Set "reverser_id" attribute value.
 
- Public Member Functions inherited from dunedaq::listrev::dal::ListRevModule
uint32_t get_request_timeout_ms () const
 Get "request_timeout_ms" attribute value.
 
void set_request_timeout_ms (uint32_t value)
 Set "request_timeout_ms" attribute value.
 
uint32_t get_send_timeout_ms () const
 Get "send_timeout_ms" attribute value.
 
void set_send_timeout_ms (uint32_t value)
 Set "send_timeout_ms" attribute value.
 
uint32_t get_request_timeout_ms () const
 Get "request_timeout_ms" attribute value.
 
void set_request_timeout_ms (uint32_t value)
 Set "request_timeout_ms" attribute value.
 
uint32_t get_send_timeout_ms () const
 Get "send_timeout_ms" attribute value.
 
void set_send_timeout_ms (uint32_t value)
 Set "send_timeout_ms" attribute value.
 
- Public Member Functions inherited from dunedaq::confmodel::DaqModule
const std::vector< const dunedaq::confmodel::Connection * > & get_inputs () const
 Get "inputs" relationship value. List of connections to/from this module.
 
void set_inputs (const std::vector< const dunedaq::confmodel::Connection * > &value)
 Set "inputs" relationship value. List of connections to/from this module.
 
const std::vector< const dunedaq::confmodel::Connection * > & get_outputs () const
 Get "outputs" relationship value. Output connections from this module.
 
void set_outputs (const std::vector< const dunedaq::confmodel::Connection * > &value)
 Set "outputs" relationship value. Output connections from this module.
 
const std::vector< const dunedaq::confmodel::HostComponent * > & get_used_resources () const
 Get "used_resources" relationship value.
 
void set_used_resources (const std::vector< const dunedaq::confmodel::HostComponent * > &value)
 Set "used_resources" relationship value.
 
const std::vector< const dunedaq::confmodel::Connection * > & get_inputs () const
 Get "inputs" relationship value. List of connections to/from this module.
 
void set_inputs (const std::vector< const dunedaq::confmodel::Connection * > &value)
 Set "inputs" relationship value. List of connections to/from this module.
 
const std::vector< const dunedaq::confmodel::Connection * > & get_outputs () const
 Get "outputs" relationship value. Output connections from this module.
 
void set_outputs (const std::vector< const dunedaq::confmodel::Connection * > &value)
 Set "outputs" relationship value. Output connections from this module.
 
const std::vector< const dunedaq::confmodel::HostComponent * > & get_used_resources () const
 Get "used_resources" relationship value.
 
void set_used_resources (const std::vector< const dunedaq::confmodel::HostComponent * > &value)
 Set "used_resources" relationship value.
 
- 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_reverser_id_str () noexcept
 
static const std::string & __get_reverser_id_str () noexcept
 
- Static Public Member Functions inherited from dunedaq::listrev::dal::ListRevModule
static const std::string & __get_request_timeout_ms_str () noexcept
 
static const std::string & __get_send_timeout_ms_str () noexcept
 
static const std::string & __get_request_timeout_ms_str () noexcept
 
static const std::string & __get_send_timeout_ms_str () noexcept
 
- Static Public Member Functions inherited from dunedaq::confmodel::DaqModule
static const std::string & __get_inputs_str () noexcept
 
static const std::string & __get_outputs_str () noexcept
 
static const std::string & __get_used_resources_str () noexcept
 
static const std::string & __get_inputs_str () noexcept
 
static const std::string & __get_outputs_str () noexcept
 
static const std::string & __get_used_resources_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_reverser_id = "reverser_id"
 
- Static Public Attributes inherited from dunedaq::listrev::dal::ListRevModule
static const std::string & s_class_name
 
static const std::string s_request_timeout_ms = "request_timeout_ms"
 
static const std::string s_send_timeout_ms = "send_timeout_ms"
 
- Static Public Attributes inherited from dunedaq::confmodel::DaqModule
static const std::string & s_class_name
 
static const std::string s_inputs = "inputs"
 
static const std::string s_outputs = "outputs"
 
static const std::string s_used_resources = "used_resources"
 

Protected Member Functions

 ListReverser (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ListReverser () 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
 
 ListReverser (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ListReverser () 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::listrev::dal::ListRevModule
 ListRevModule (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ListRevModule () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 ListRevModule (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~ListRevModule () 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::DaqModule
 DaqModule (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~DaqModule () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 DaqModule (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~DaqModule () 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

uint32_t m_reverser_id
 

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 24 of file ListReverser.hpp.

Constructor & Destructor Documentation

◆ ListReverser() [1/2]

dunedaq::listrev::dal::ListReverser::ListReverser ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 27 of file ListReverser.cpp.

27 :
29 ListRevModule(db, o)
30
31 {
32 ;
33 }
The base class for any generated DAL object.
Definition DalObject.hpp:45
ListRevModule(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept

◆ ~ListReverser() [1/2]

dunedaq::listrev::dal::ListReverser::~ListReverser ( )
protectedvirtualnoexcept

Definition at line 76 of file ListReverser.cpp.

77 {
78 }

◆ ListReverser() [2/2]

dunedaq::listrev::dal::ListReverser::ListReverser ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~ListReverser() [2/2]

virtual dunedaq::listrev::dal::ListReverser::~ListReverser ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_reverser_id_str() [1/2]

static const std::string & dunedaq::listrev::dal::ListReverser::__get_reverser_id_str ( )
inlinestaticnoexcept

Definition at line 84 of file ListReverser.hpp.

84{ return s_reverser_id; }
static const std::string s_reverser_id

◆ __get_reverser_id_str() [2/2]

static const std::string & dunedaq::listrev::dal::ListReverser::__get_reverser_id_str ( )
inlinestaticnoexcept

Definition at line 84 of file ListReverser.hpp.

84{ return s_reverser_id; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::listrev::dal::ListReverser::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::listrev::dal::ListRevModule.

Definition at line 80 of file ListReverser.cpp.

81 {
82 std::vector<const dunedaq::conffwk::DalObject *> vec;
83
84 if (!get(name, vec, upcast_unregistered, true))
85 throw_get_ex(name, s_class_name, this);
86
87 return vec;
88 }
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
static const std::string & s_class_name
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() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::listrev::dal::ListReverser::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::listrev::dal::ListRevModule.

◆ get() [3/4]

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

Definition at line 90 of file ListReverser.cpp.

91 {
92 if (first_call)
93 {
94 std::lock_guard scoped_lock(m_mutex);
95
96 check();
97 check_init();
98
99 if (get_rel_objects(name, upcast_unregistered, vec))
100 return true;
101 }
102
103 if (ListRevModule::get(name, vec, upcast_unregistered, false)) return true;
104
105 if (first_call)
106 return get_algo_objects(name, vec);
107
108 return false;
109 }
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::listrev::dal::ListReverser::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

◆ get_reverser_id() [1/2]

uint32_t dunedaq::listrev::dal::ListReverser::get_reverser_id ( ) const
inline

Get "reverser_id" attribute value.

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

Definition at line 94 of file ListReverser.hpp.

95 {
96 std::lock_guard scoped_lock(m_mutex);
97 check();
98 check_init();
99 return m_reverser_id;
100 }

◆ get_reverser_id() [2/2]

uint32_t dunedaq::listrev::dal::ListReverser::get_reverser_id ( ) const
inline

Get "reverser_id" attribute value.

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

Definition at line 94 of file ListReverser.hpp.

95 {
96 std::lock_guard scoped_lock(m_mutex);
97 check();
98 check_init();
99 return m_reverser_id;
100 }

◆ init() [1/2]

void dunedaq::listrev::dal::ListReverser::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::listrev::dal::ListRevModule.

Definition at line 62 of file ListReverser.cpp.

63 {
64 ListRevModule::init(init_children);
65
66 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
67
68 try {
70 }
71 catch (dunedaq::conffwk::Exception & ex) {
72 throw_init_ex(ex);
73 }
74 }
void get(const std::string &name, T &value)
Get value of object's attribute or relationship.
void throw_init_ex(dunedaq::conffwk::Exception &ex)
throw object initialisation exception (i.e.
Definition DalObject.cpp:74
ConfigObject p_obj
Config object used by given template object.
virtual void init(bool init_children)
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112

◆ init() [2/2]

virtual void dunedaq::listrev::dal::ListReverser::init ( bool init_children)
protectedvirtual

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::listrev::dal::ListRevModule.

◆ print() [1/2]

void dunedaq::listrev::dal::ListReverser::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the ListReverser 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::listrev::dal::ListRevModule.

Definition at line 36 of file ListReverser.cpp.

37 {
38 check_init();
39
40 try {
41 const std::string str(indent+2, ' ');
42
43 if (print_header)
44 p_hdr(s, indent, s_class_name, "dunedaq::listrev::dal");
45
46
47 // print direct super-classes
48
50
51
52 // print direct attributes
53
55 }
56 catch (dunedaq::conffwk::Exception & ex) {
58 }
59 }
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 ListRevModule object.
void p_sv_attr(std::ostream &s, const std::string &str, const std::string &name, const T &val) noexcept
print single-value attribute

◆ print() [2/2]

virtual void dunedaq::listrev::dal::ListReverser::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the ListReverser 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::listrev::dal::ListRevModule.

◆ set_reverser_id() [1/2]

void dunedaq::listrev::dal::ListReverser::set_reverser_id ( uint32_t value)
inline

Set "reverser_id" attribute value.

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

Definition at line 109 of file ListReverser.hpp.

110 {
111 std::lock_guard scoped_lock(m_mutex);
112 check();
113 clear();
115 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_reverser_id() [2/2]

void dunedaq::listrev::dal::ListReverser::set_reverser_id ( uint32_t value)
inline

Set "reverser_id" attribute value.

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

Definition at line 109 of file ListReverser.hpp.

110 {
111 std::lock_guard scoped_lock(m_mutex);
112 check();
113 clear();
115 }

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 26 of file ListReverser.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 28 of file ListReverser.hpp.

◆ conffwk::DalObject

Definition at line 27 of file ListReverser.hpp.

◆ conffwk::DalRegistry

Definition at line 29 of file ListReverser.hpp.

Member Data Documentation

◆ m_reverser_id

uint32_t dunedaq::listrev::dal::ListReverser::m_reverser_id
private

Definition at line 75 of file ListReverser.hpp.

◆ s_class_name

static const std::string & dunedaq::listrev::dal::ListReverser::s_class_name
static

The name of the configuration class.

Definition at line 41 of file ListReverser.hpp.

◆ s_reverser_id

static const std::string dunedaq::listrev::dal::ListReverser::s_reverser_id = "reverser_id"
inlinestatic

Definition at line 82 of file ListReverser.hpp.


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