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

#include <TADataProcessor.hpp>

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

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the TADataProcessor 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.
bool get_print_ta_info () const
 Get "print_ta_info" attribute value. Whether to print TP information in the TA processor.
void set_print_ta_info (bool value)
 Set "print_ta_info" attribute value. Whether to print TP information in the TA processor.
const std::vector< const dunedaq::appmodel::TCAlgorithm * > & get_algorithms () const
 Get "algorithms" relationship value.
void set_algorithms (const std::vector< const dunedaq::appmodel::TCAlgorithm * > &value)
 Set "algorithms" relationship value.
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the TADataProcessor 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.
bool get_print_ta_info () const
 Get "print_ta_info" attribute value. Whether to print TP information in the TA processor.
void set_print_ta_info (bool value)
 Set "print_ta_info" attribute value. Whether to print TP information in the TA processor.
const std::vector< const dunedaq::appmodel::TCAlgorithm * > & get_algorithms () const
 Get "algorithms" relationship value.
void set_algorithms (const std::vector< const dunedaq::appmodel::TCAlgorithm * > &value)
 Set "algorithms" relationship value.
Public Member Functions inherited from dunedaq::appmodel::DataProcessor
uint32_t get_queue_sizes () const
 Get "queue_sizes" attribute value.
void set_queue_sizes (uint32_t value)
 Set "queue_sizes" attribute value.
const std::string & get_thread_names_prefix () const
 Get "thread_names_prefix" attribute value.
void set_thread_names_prefix (const std::string &value)
 Set "thread_names_prefix" attribute value.
bool get_latency_monitoring () const
 Get "latency_monitoring" attribute value.
void set_latency_monitoring (bool value)
 Set "latency_monitoring" attribute value.
uint32_t get_queue_sizes () const
 Get "queue_sizes" attribute value.
void set_queue_sizes (uint32_t value)
 Set "queue_sizes" attribute value.
const std::string & get_thread_names_prefix () const
 Get "thread_names_prefix" attribute value.
void set_thread_names_prefix (const std::string &value)
 Set "thread_names_prefix" attribute value.
bool get_latency_monitoring () const
 Get "latency_monitoring" attribute value.
void set_latency_monitoring (bool value)
 Set "latency_monitoring" attribute 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_print_ta_info_str () noexcept
static const std::string & __get_algorithms_str () noexcept
static const std::string & __get_print_ta_info_str () noexcept
static const std::string & __get_algorithms_str () noexcept
Static Public Member Functions inherited from dunedaq::appmodel::DataProcessor
static const std::string & __get_queue_sizes_str () noexcept
static const std::string & __get_thread_names_prefix_str () noexcept
static const std::string & __get_latency_monitoring_str () noexcept
static const std::string & __get_queue_sizes_str () noexcept
static const std::string & __get_thread_names_prefix_str () noexcept
static const std::string & __get_latency_monitoring_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_print_ta_info = "print_ta_info"
static const std::string s_algorithms = "algorithms"
Static Public Attributes inherited from dunedaq::appmodel::DataProcessor
static const std::string & s_class_name
static const std::string s_queue_sizes = "queue_sizes"
static const std::string s_thread_names_prefix = "thread_names_prefix"
static const std::string s_latency_monitoring = "latency_monitoring"

Protected Member Functions

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

bool m_print_ta_info
std::vector< const dunedaq::appmodel::TCAlgorithm * > m_algorithms

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 TADataProcessor.hpp.

Constructor & Destructor Documentation

◆ TADataProcessor() [1/2]

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

Definition at line 31 of file TADataProcessor.cpp.

31 :
32 dunedaq::conffwk::DalObject(db, o),
33 DataProcessor(db, o)
34
35 {
36 ;
37 }
DataProcessor(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept

◆ ~TADataProcessor() [1/2]

dunedaq::appmodel::TADataProcessor::~TADataProcessor ( )
protectedvirtualnoexcept

Definition at line 86 of file TADataProcessor.cpp.

87 {
88 }

◆ TADataProcessor() [2/2]

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

◆ ~TADataProcessor() [2/2]

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

Member Function Documentation

◆ __get_algorithms_str() [1/2]

const std::string & dunedaq::appmodel::TADataProcessor::__get_algorithms_str ( )
inlinestaticnoexcept

Definition at line 133 of file TADataProcessor.hpp.

133{ return s_algorithms; }
static const std::string s_algorithms

◆ __get_algorithms_str() [2/2]

const std::string & dunedaq::appmodel::TADataProcessor::__get_algorithms_str ( )
inlinestaticnoexcept

Definition at line 133 of file TADataProcessor.hpp.

133{ return s_algorithms; }

◆ __get_print_ta_info_str() [1/2]

const std::string & dunedaq::appmodel::TADataProcessor::__get_print_ta_info_str ( )
inlinestaticnoexcept

Definition at line 93 of file TADataProcessor.hpp.

93{ return s_print_ta_info; }
static const std::string s_print_ta_info

◆ __get_print_ta_info_str() [2/2]

const std::string & dunedaq::appmodel::TADataProcessor::__get_print_ta_info_str ( )
inlinestaticnoexcept

Definition at line 93 of file TADataProcessor.hpp.

93{ return s_print_ta_info; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::TADataProcessor::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::DataProcessor.

Definition at line 90 of file TADataProcessor.cpp.

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

◆ get() [3/4]

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

Definition at line 100 of file TADataProcessor.cpp.

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

◆ get_algorithms() [1/2]

const std::vector< const dunedaq::appmodel::TCAlgorithm * > & dunedaq::appmodel::TADataProcessor::get_algorithms ( ) const
inline

Get "algorithms" relationship value.

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

Definition at line 143 of file TADataProcessor.hpp.

144 {
145 std::lock_guard scoped_lock(m_mutex);
146 check();
147 check_init();
148 if (m_algorithms.empty())
149 {
150 std::ostringstream text;
151 text << "relationship \"" << s_algorithms << "\" of object " << this << " is empty";
152 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
153 }
154 return m_algorithms;
155 }
#define ERS_HERE
std::vector< const dunedaq::appmodel::TCAlgorithm * > m_algorithms

◆ get_algorithms() [2/2]

const std::vector< const dunedaq::appmodel::TCAlgorithm * > & dunedaq::appmodel::TADataProcessor::get_algorithms ( ) const
inline

Get "algorithms" relationship value.

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

Definition at line 143 of file TADataProcessor.hpp.

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

◆ get_print_ta_info() [1/2]

bool dunedaq::appmodel::TADataProcessor::get_print_ta_info ( ) const
inline

Get "print_ta_info" attribute value. Whether to print TP information in the TA processor.

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

Definition at line 104 of file TADataProcessor.hpp.

105 {
106 std::lock_guard scoped_lock(m_mutex);
107 check();
108 check_init();
109 return m_print_ta_info;
110 }

◆ get_print_ta_info() [2/2]

bool dunedaq::appmodel::TADataProcessor::get_print_ta_info ( ) const
inline

Get "print_ta_info" attribute value. Whether to print TP information in the TA processor.

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

Definition at line 104 of file TADataProcessor.hpp.

105 {
106 std::lock_guard scoped_lock(m_mutex);
107 check();
108 check_init();
109 return m_print_ta_info;
110 }

◆ init() [1/2]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::appmodel::DataProcessor.

Definition at line 71 of file TADataProcessor.cpp.

72 {
73 DataProcessor::init(init_children);
74
75 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
76
77 try {
79 p_registry._ref<dunedaq::appmodel::TCAlgorithm>(p_obj, s_algorithms, m_algorithms, init_children);
80 }
81 catch (dunedaq::conffwk::Exception & ex) {
82 throw_init_ex(ex);
83 }
84 }
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.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112

◆ init() [2/2]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::appmodel::DataProcessor.

◆ print() [1/2]

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

Print details of the TADataProcessor 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::DataProcessor.

Definition at line 40 of file TADataProcessor.cpp.

41 {
42 check_init();
43
44 try {
45 const std::string str(indent+2, ' ');
46
47 if (print_header)
48 p_hdr(s, indent, s_class_name, "dunedaq::appmodel");
49
50
51 // print direct super-classes
52
54
55
56 // print direct attributes
57
59
60
61 // print direct relationships
62
64 }
65 catch (dunedaq::conffwk::Exception & ex) {
67 }
68 }
virtual void print(unsigned int offset, bool print_header, std::ostream &s) const
Print details of the DataProcessor 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
void p_mv_rel(std::ostream &s, const std::string &str, const std::string &name, const T &objs) noexcept
print weak multi-value relationship
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::appmodel::TADataProcessor::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the TADataProcessor 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::DataProcessor.

◆ set_algorithms() [1/2]

void dunedaq::appmodel::TADataProcessor::set_algorithms ( const std::vector< const dunedaq::appmodel::TCAlgorithm * > & value)

Set "algorithms" relationship value.

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

Definition at line 121 of file TADataProcessor.cpp.

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

◆ set_algorithms() [2/2]

void dunedaq::appmodel::TADataProcessor::set_algorithms ( const std::vector< const dunedaq::appmodel::TCAlgorithm * > & value)

Set "algorithms" relationship value.

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

◆ set_print_ta_info() [1/2]

void dunedaq::appmodel::TADataProcessor::set_print_ta_info ( bool value)
inline

Set "print_ta_info" attribute value. Whether to print TP information in the TA processor.

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

Definition at line 120 of file TADataProcessor.hpp.

121 {
122 std::lock_guard scoped_lock(m_mutex);
123 check();
124 clear();
125 p_obj.set_by_val(s_print_ta_info, value);
126 }

◆ set_print_ta_info() [2/2]

void dunedaq::appmodel::TADataProcessor::set_print_ta_info ( bool value)
inline

Set "print_ta_info" attribute value. Whether to print TP information in the TA processor.

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

Definition at line 120 of file TADataProcessor.hpp.

121 {
122 std::lock_guard scoped_lock(m_mutex);
123 check();
124 clear();
125 p_obj.set_by_val(s_print_ta_info, value);
126 }

◆ conffwk::Configuration

Definition at line 34 of file TADataProcessor.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 36 of file TADataProcessor.hpp.

◆ conffwk::DalObject

Definition at line 35 of file TADataProcessor.hpp.

◆ conffwk::DalRegistry

Definition at line 37 of file TADataProcessor.hpp.

Member Data Documentation

◆ m_algorithms

std::vector< const dunedaq::appmodel::TCAlgorithm * > dunedaq::appmodel::TADataProcessor::m_algorithms
private

Definition at line 84 of file TADataProcessor.hpp.

◆ m_print_ta_info

bool dunedaq::appmodel::TADataProcessor::m_print_ta_info
private

Definition at line 83 of file TADataProcessor.hpp.

◆ s_algorithms

const std::string dunedaq::appmodel::TADataProcessor::s_algorithms = "algorithms"
inlinestatic

Definition at line 131 of file TADataProcessor.hpp.

◆ s_class_name

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

The name of the configuration class.

Definition at line 49 of file TADataProcessor.hpp.

◆ s_print_ta_info

const std::string dunedaq::appmodel::TADataProcessor::s_print_ta_info = "print_ta_info"
inlinestatic

Definition at line 91 of file TADataProcessor.hpp.


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