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

#include <RequestHandler.hpp>

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

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the RequestHandler 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.
 
uint16_t get_handler_threads () const
 Get "handler_threads" attribute value. Number of threads tohandle this link.
 
void set_handler_threads (uint16_t value)
 Set "handler_threads" attribute value. Number of threads tohandle this link.
 
uint32_t get_request_timeout () const
 Get "request_timeout" attribute value. Request timeout in milliseconds.
 
void set_request_timeout (uint32_t value)
 Set "request_timeout" attribute value. Request timeout in milliseconds.
 
float get_pop_limit_pct () const
 Get "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.
 
void set_pop_limit_pct (float value)
 Set "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.
 
float get_pop_size_pct () const
 Get "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.
 
void set_pop_size_pct (float value)
 Set "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.
 
bool get_warn_on_timeout () const
 Get "warn_on_timeout" attribute value.
 
void set_warn_on_timeout (bool value)
 Set "warn_on_timeout" attribute value.
 
bool get_warn_on_empty_buffer () const
 Get "warn_on_empty_buffer" attribute value.
 
void set_warn_on_empty_buffer (bool value)
 Set "warn_on_empty_buffer" attribute value.
 
uint32_t get_periodic_data_transmission_ms () const
 Get "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.
 
void set_periodic_data_transmission_ms (uint32_t value)
 Set "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.
 
const dunedaq::appmodel::DataRecorderConfget_data_recorder () const
 Get "data_recorder" relationship value.
 
void set_data_recorder (const dunedaq::appmodel::DataRecorderConf *value)
 Set "data_recorder" relationship value.
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the RequestHandler 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.
 
uint16_t get_handler_threads () const
 Get "handler_threads" attribute value. Number of threads tohandle this link.
 
void set_handler_threads (uint16_t value)
 Set "handler_threads" attribute value. Number of threads tohandle this link.
 
uint32_t get_request_timeout () const
 Get "request_timeout" attribute value. Request timeout in milliseconds.
 
void set_request_timeout (uint32_t value)
 Set "request_timeout" attribute value. Request timeout in milliseconds.
 
float get_pop_limit_pct () const
 Get "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.
 
void set_pop_limit_pct (float value)
 Set "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.
 
float get_pop_size_pct () const
 Get "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.
 
void set_pop_size_pct (float value)
 Set "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.
 
bool get_warn_on_timeout () const
 Get "warn_on_timeout" attribute value.
 
void set_warn_on_timeout (bool value)
 Set "warn_on_timeout" attribute value.
 
bool get_warn_on_empty_buffer () const
 Get "warn_on_empty_buffer" attribute value.
 
void set_warn_on_empty_buffer (bool value)
 Set "warn_on_empty_buffer" attribute value.
 
uint32_t get_periodic_data_transmission_ms () const
 Get "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.
 
void set_periodic_data_transmission_ms (uint32_t value)
 Set "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.
 
const dunedaq::appmodel::DataRecorderConfget_data_recorder () const
 Get "data_recorder" relationship value.
 
void set_data_recorder (const dunedaq::appmodel::DataRecorderConf *value)
 Set "data_recorder" 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_handler_threads_str () noexcept
 
static const std::string & __get_request_timeout_str () noexcept
 
static const std::string & __get_pop_limit_pct_str () noexcept
 
static const std::string & __get_pop_size_pct_str () noexcept
 
static const std::string & __get_warn_on_timeout_str () noexcept
 
static const std::string & __get_warn_on_empty_buffer_str () noexcept
 
static const std::string & __get_periodic_data_transmission_ms_str () noexcept
 
static const std::string & __get_data_recorder_str () noexcept
 
static const std::string & __get_handler_threads_str () noexcept
 
static const std::string & __get_request_timeout_str () noexcept
 
static const std::string & __get_pop_limit_pct_str () noexcept
 
static const std::string & __get_pop_size_pct_str () noexcept
 
static const std::string & __get_warn_on_timeout_str () noexcept
 
static const std::string & __get_warn_on_empty_buffer_str () noexcept
 
static const std::string & __get_periodic_data_transmission_ms_str () noexcept
 
static const std::string & __get_data_recorder_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_handler_threads = "handler_threads"
 
static const std::string s_request_timeout = "request_timeout"
 
static const std::string s_pop_limit_pct = "pop_limit_pct"
 
static const std::string s_pop_size_pct = "pop_size_pct"
 
static const std::string s_warn_on_timeout = "warn_on_timeout"
 
static const std::string s_warn_on_empty_buffer = "warn_on_empty_buffer"
 
static const std::string s_periodic_data_transmission_ms = "periodic_data_transmission_ms"
 
static const std::string s_data_recorder = "data_recorder"
 

Protected Member Functions

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

uint16_t m_handler_threads
 
uint32_t m_request_timeout
 
float m_pop_limit_pct
 
float m_pop_size_pct
 
bool m_warn_on_timeout
 
bool m_warn_on_empty_buffer
 
uint32_t m_periodic_data_transmission_ms
 
const dunedaq::appmodel::DataRecorderConfm_data_recorder
 

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 29 of file RequestHandler.hpp.

Constructor & Destructor Documentation

◆ RequestHandler() [1/2]

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

Definition at line 31 of file RequestHandler.cpp.

31 :
33 m_data_recorder (nullptr)
34
35 {
36 ;
37 }
const dunedaq::appmodel::DataRecorderConf * m_data_recorder
The base class for any generated DAL object.
Definition DalObject.hpp:45

◆ ~RequestHandler() [1/2]

dunedaq::appmodel::RequestHandler::~RequestHandler ( )
protectedvirtualnoexcept

Definition at line 93 of file RequestHandler.cpp.

94 {
95 }

◆ RequestHandler() [2/2]

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

◆ ~RequestHandler() [2/2]

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

Member Function Documentation

◆ __get_data_recorder_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_data_recorder_str ( )
inlinestaticnoexcept

Definition at line 342 of file RequestHandler.hpp.

342{ return s_data_recorder; }
static const std::string s_data_recorder

◆ __get_data_recorder_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_data_recorder_str ( )
inlinestaticnoexcept

Definition at line 342 of file RequestHandler.hpp.

342{ return s_data_recorder; }

◆ __get_handler_threads_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_handler_threads_str ( )
inlinestaticnoexcept

Definition at line 102 of file RequestHandler.hpp.

102{ return s_handler_threads; }
static const std::string s_handler_threads

◆ __get_handler_threads_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_handler_threads_str ( )
inlinestaticnoexcept

Definition at line 102 of file RequestHandler.hpp.

102{ return s_handler_threads; }

◆ __get_periodic_data_transmission_ms_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_periodic_data_transmission_ms_str ( )
inlinestaticnoexcept

Definition at line 108 of file RequestHandler.hpp.

static const std::string s_periodic_data_transmission_ms

◆ __get_periodic_data_transmission_ms_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_periodic_data_transmission_ms_str ( )
inlinestaticnoexcept

Definition at line 108 of file RequestHandler.hpp.

◆ __get_pop_limit_pct_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_pop_limit_pct_str ( )
inlinestaticnoexcept

Definition at line 104 of file RequestHandler.hpp.

104{ return s_pop_limit_pct; }
static const std::string s_pop_limit_pct

◆ __get_pop_limit_pct_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_pop_limit_pct_str ( )
inlinestaticnoexcept

Definition at line 104 of file RequestHandler.hpp.

104{ return s_pop_limit_pct; }

◆ __get_pop_size_pct_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_pop_size_pct_str ( )
inlinestaticnoexcept

Definition at line 105 of file RequestHandler.hpp.

105{ return s_pop_size_pct; }
static const std::string s_pop_size_pct

◆ __get_pop_size_pct_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_pop_size_pct_str ( )
inlinestaticnoexcept

Definition at line 105 of file RequestHandler.hpp.

105{ return s_pop_size_pct; }

◆ __get_request_timeout_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_request_timeout_str ( )
inlinestaticnoexcept

Definition at line 103 of file RequestHandler.hpp.

103{ return s_request_timeout; }
static const std::string s_request_timeout

◆ __get_request_timeout_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_request_timeout_str ( )
inlinestaticnoexcept

Definition at line 103 of file RequestHandler.hpp.

103{ return s_request_timeout; }

◆ __get_warn_on_empty_buffer_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_warn_on_empty_buffer_str ( )
inlinestaticnoexcept

Definition at line 107 of file RequestHandler.hpp.

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

◆ __get_warn_on_empty_buffer_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_warn_on_empty_buffer_str ( )
inlinestaticnoexcept

Definition at line 107 of file RequestHandler.hpp.

107{ return s_warn_on_empty_buffer; }

◆ __get_warn_on_timeout_str() [1/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_warn_on_timeout_str ( )
inlinestaticnoexcept

Definition at line 106 of file RequestHandler.hpp.

106{ return s_warn_on_timeout; }
static const std::string s_warn_on_timeout

◆ __get_warn_on_timeout_str() [2/2]

static const std::string & dunedaq::appmodel::RequestHandler::__get_warn_on_timeout_str ( )
inlinestaticnoexcept

Definition at line 106 of file RequestHandler.hpp.

106{ return s_warn_on_timeout; }

◆ get() [1/4]

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

Implements dunedaq::conffwk::DalObject.

Definition at line 97 of file RequestHandler.cpp.

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

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::RequestHandler::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

Implements dunedaq::conffwk::DalObject.

◆ get() [3/4]

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

Definition at line 107 of file RequestHandler.cpp.

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

◆ get_data_recorder() [1/2]

const dunedaq::appmodel::DataRecorderConf * dunedaq::appmodel::RequestHandler::get_data_recorder ( ) const
inline

Get "data_recorder" relationship value.

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

Definition at line 352 of file RequestHandler.hpp.

353 {
354 std::lock_guard scoped_lock(m_mutex);
355 check();
356 check_init();
357 return m_data_recorder;
358 }

◆ get_data_recorder() [2/2]

const dunedaq::appmodel::DataRecorderConf * dunedaq::appmodel::RequestHandler::get_data_recorder ( ) const
inline

Get "data_recorder" relationship value.

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

Definition at line 352 of file RequestHandler.hpp.

353 {
354 std::lock_guard scoped_lock(m_mutex);
355 check();
356 check_init();
357 return m_data_recorder;
358 }

◆ get_handler_threads() [1/2]

uint16_t dunedaq::appmodel::RequestHandler::get_handler_threads ( ) const
inline

Get "handler_threads" attribute value. Number of threads tohandle this link.

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

Definition at line 119 of file RequestHandler.hpp.

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

◆ get_handler_threads() [2/2]

uint16_t dunedaq::appmodel::RequestHandler::get_handler_threads ( ) const
inline

Get "handler_threads" attribute value. Number of threads tohandle this link.

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

Definition at line 119 of file RequestHandler.hpp.

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

◆ get_periodic_data_transmission_ms() [1/2]

uint32_t dunedaq::appmodel::RequestHandler::get_periodic_data_transmission_ms ( ) const
inline

Get "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.

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

Definition at line 313 of file RequestHandler.hpp.

314 {
315 std::lock_guard scoped_lock(m_mutex);
316 check();
317 check_init();
319 }

◆ get_periodic_data_transmission_ms() [2/2]

uint32_t dunedaq::appmodel::RequestHandler::get_periodic_data_transmission_ms ( ) const
inline

Get "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.

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

Definition at line 313 of file RequestHandler.hpp.

314 {
315 std::lock_guard scoped_lock(m_mutex);
316 check();
317 check_init();
319 }

◆ get_pop_limit_pct() [1/2]

float dunedaq::appmodel::RequestHandler::get_pop_limit_pct ( ) const
inline

Get "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.

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

Definition at line 185 of file RequestHandler.hpp.

186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 check_init();
190 return m_pop_limit_pct;
191 }

◆ get_pop_limit_pct() [2/2]

float dunedaq::appmodel::RequestHandler::get_pop_limit_pct ( ) const
inline

Get "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.

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

Definition at line 185 of file RequestHandler.hpp.

186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 check_init();
190 return m_pop_limit_pct;
191 }

◆ get_pop_size_pct() [1/2]

float dunedaq::appmodel::RequestHandler::get_pop_size_pct ( ) const
inline

Get "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.

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

Definition at line 218 of file RequestHandler.hpp.

219 {
220 std::lock_guard scoped_lock(m_mutex);
221 check();
222 check_init();
223 return m_pop_size_pct;
224 }

◆ get_pop_size_pct() [2/2]

float dunedaq::appmodel::RequestHandler::get_pop_size_pct ( ) const
inline

Get "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.

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

Definition at line 218 of file RequestHandler.hpp.

219 {
220 std::lock_guard scoped_lock(m_mutex);
221 check();
222 check_init();
223 return m_pop_size_pct;
224 }

◆ get_request_timeout() [1/2]

uint32_t dunedaq::appmodel::RequestHandler::get_request_timeout ( ) const
inline

Get "request_timeout" attribute value. Request timeout in milliseconds.

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

Definition at line 152 of file RequestHandler.hpp.

153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 check_init();
157 return m_request_timeout;
158 }

◆ get_request_timeout() [2/2]

uint32_t dunedaq::appmodel::RequestHandler::get_request_timeout ( ) const
inline

Get "request_timeout" attribute value. Request timeout in milliseconds.

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

Definition at line 152 of file RequestHandler.hpp.

153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 check_init();
157 return m_request_timeout;
158 }

◆ get_warn_on_empty_buffer() [1/2]

bool dunedaq::appmodel::RequestHandler::get_warn_on_empty_buffer ( ) const
inline

Get "warn_on_empty_buffer" attribute value.

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

Definition at line 281 of file RequestHandler.hpp.

282 {
283 std::lock_guard scoped_lock(m_mutex);
284 check();
285 check_init();
287 }

◆ get_warn_on_empty_buffer() [2/2]

bool dunedaq::appmodel::RequestHandler::get_warn_on_empty_buffer ( ) const
inline

Get "warn_on_empty_buffer" attribute value.

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

Definition at line 281 of file RequestHandler.hpp.

282 {
283 std::lock_guard scoped_lock(m_mutex);
284 check();
285 check_init();
287 }

◆ get_warn_on_timeout() [1/2]

bool dunedaq::appmodel::RequestHandler::get_warn_on_timeout ( ) const
inline

Get "warn_on_timeout" attribute value.

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

Definition at line 250 of file RequestHandler.hpp.

251 {
252 std::lock_guard scoped_lock(m_mutex);
253 check();
254 check_init();
255 return m_warn_on_timeout;
256 }

◆ get_warn_on_timeout() [2/2]

bool dunedaq::appmodel::RequestHandler::get_warn_on_timeout ( ) const
inline

Get "warn_on_timeout" attribute value.

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

Definition at line 250 of file RequestHandler.hpp.

251 {
252 std::lock_guard scoped_lock(m_mutex);
253 check();
254 check_init();
255 return m_warn_on_timeout;
256 }

◆ init() [1/2]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Implements dunedaq::conffwk::DalObject.

Definition at line 72 of file RequestHandler.cpp.

73 {
74 p_was_read = true;
76 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
77
78 try {
87 }
88 catch (dunedaq::conffwk::Exception & ex) {
89 throw_init_ex(ex);
90 }
91 }
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
void increment_read() noexcept
DalRegistry & p_registry
Configuration object.
bool p_was_read
is true, if the object was read
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]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Implements dunedaq::conffwk::DalObject.

◆ print() [1/2]

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

Print details of the RequestHandler 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

Implements dunedaq::conffwk::DalObject.

Definition at line 40 of file RequestHandler.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 attributes
52
60
61
62 // print direct relationships
63
65 }
66 catch (dunedaq::conffwk::Exception & ex) {
68 }
69 }
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_sv_rel(std::ostream &s, const std::string &str, const std::string &name, const DalObject *obj)
print weak single-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::RequestHandler::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the RequestHandler 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

Implements dunedaq::conffwk::DalObject.

◆ set_data_recorder() [1/2]

void dunedaq::appmodel::RequestHandler::set_data_recorder ( const dunedaq::appmodel::DataRecorderConf * value)

Set "data_recorder" relationship value.

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

Definition at line 126 of file RequestHandler.cpp.

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

◆ set_data_recorder() [2/2]

void dunedaq::appmodel::RequestHandler::set_data_recorder ( const dunedaq::appmodel::DataRecorderConf * value)

Set "data_recorder" relationship value.

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

◆ set_handler_threads() [1/2]

void dunedaq::appmodel::RequestHandler::set_handler_threads ( uint16_t value)
inline

Set "handler_threads" attribute value. Number of threads tohandle this link.

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

Definition at line 135 of file RequestHandler.hpp.

136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 clear();
141 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_handler_threads() [2/2]

void dunedaq::appmodel::RequestHandler::set_handler_threads ( uint16_t value)
inline

Set "handler_threads" attribute value. Number of threads tohandle this link.

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

Definition at line 135 of file RequestHandler.hpp.

136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 clear();
141 }

◆ set_periodic_data_transmission_ms() [1/2]

void dunedaq::appmodel::RequestHandler::set_periodic_data_transmission_ms ( uint32_t value)
inline

Set "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.

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

Definition at line 329 of file RequestHandler.hpp.

330 {
331 std::lock_guard scoped_lock(m_mutex);
332 check();
333 clear();
335 }

◆ set_periodic_data_transmission_ms() [2/2]

void dunedaq::appmodel::RequestHandler::set_periodic_data_transmission_ms ( uint32_t value)
inline

Set "periodic_data_transmission_ms" attribute value. Period at which data are sent out, optionally. 0 means never.

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

Definition at line 329 of file RequestHandler.hpp.

330 {
331 std::lock_guard scoped_lock(m_mutex);
332 check();
333 clear();
335 }

◆ set_pop_limit_pct() [1/2]

void dunedaq::appmodel::RequestHandler::set_pop_limit_pct ( float value)
inline

Set "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.

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

Definition at line 201 of file RequestHandler.hpp.

202 {
203 std::lock_guard scoped_lock(m_mutex);
204 check();
205 clear();
207 }

◆ set_pop_limit_pct() [2/2]

void dunedaq::appmodel::RequestHandler::set_pop_limit_pct ( float value)
inline

Set "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.

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

Definition at line 201 of file RequestHandler.hpp.

202 {
203 std::lock_guard scoped_lock(m_mutex);
204 check();
205 clear();
207 }

◆ set_pop_size_pct() [1/2]

void dunedaq::appmodel::RequestHandler::set_pop_size_pct ( float value)
inline

Set "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.

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

Definition at line 234 of file RequestHandler.hpp.

235 {
236 std::lock_guard scoped_lock(m_mutex);
237 check();
238 clear();
240 }

◆ set_pop_size_pct() [2/2]

void dunedaq::appmodel::RequestHandler::set_pop_size_pct ( float value)
inline

Set "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.

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

Definition at line 234 of file RequestHandler.hpp.

235 {
236 std::lock_guard scoped_lock(m_mutex);
237 check();
238 clear();
240 }

◆ set_request_timeout() [1/2]

void dunedaq::appmodel::RequestHandler::set_request_timeout ( uint32_t value)
inline

Set "request_timeout" attribute value. Request timeout in milliseconds.

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

Definition at line 168 of file RequestHandler.hpp.

169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 clear();
174 }

◆ set_request_timeout() [2/2]

void dunedaq::appmodel::RequestHandler::set_request_timeout ( uint32_t value)
inline

Set "request_timeout" attribute value. Request timeout in milliseconds.

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

Definition at line 168 of file RequestHandler.hpp.

169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 clear();
174 }

◆ set_warn_on_empty_buffer() [1/2]

void dunedaq::appmodel::RequestHandler::set_warn_on_empty_buffer ( bool value)
inline

Set "warn_on_empty_buffer" attribute value.

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

Definition at line 296 of file RequestHandler.hpp.

297 {
298 std::lock_guard scoped_lock(m_mutex);
299 check();
300 clear();
302 }

◆ set_warn_on_empty_buffer() [2/2]

void dunedaq::appmodel::RequestHandler::set_warn_on_empty_buffer ( bool value)
inline

Set "warn_on_empty_buffer" attribute value.

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

Definition at line 296 of file RequestHandler.hpp.

297 {
298 std::lock_guard scoped_lock(m_mutex);
299 check();
300 clear();
302 }

◆ set_warn_on_timeout() [1/2]

void dunedaq::appmodel::RequestHandler::set_warn_on_timeout ( bool value)
inline

Set "warn_on_timeout" attribute value.

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

Definition at line 265 of file RequestHandler.hpp.

266 {
267 std::lock_guard scoped_lock(m_mutex);
268 check();
269 clear();
271 }

◆ set_warn_on_timeout() [2/2]

void dunedaq::appmodel::RequestHandler::set_warn_on_timeout ( bool value)
inline

Set "warn_on_timeout" attribute value.

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

Definition at line 265 of file RequestHandler.hpp.

266 {
267 std::lock_guard scoped_lock(m_mutex);
268 check();
269 clear();
271 }

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 31 of file RequestHandler.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 33 of file RequestHandler.hpp.

◆ conffwk::DalObject

Definition at line 32 of file RequestHandler.hpp.

◆ conffwk::DalRegistry

Definition at line 34 of file RequestHandler.hpp.

Member Data Documentation

◆ m_data_recorder

const dunedaq::appmodel::DataRecorderConf * dunedaq::appmodel::RequestHandler::m_data_recorder
private

Definition at line 87 of file RequestHandler.hpp.

◆ m_handler_threads

uint16_t dunedaq::appmodel::RequestHandler::m_handler_threads
private

Definition at line 80 of file RequestHandler.hpp.

◆ m_periodic_data_transmission_ms

uint32_t dunedaq::appmodel::RequestHandler::m_periodic_data_transmission_ms
private

Definition at line 86 of file RequestHandler.hpp.

◆ m_pop_limit_pct

float dunedaq::appmodel::RequestHandler::m_pop_limit_pct
private

Definition at line 82 of file RequestHandler.hpp.

◆ m_pop_size_pct

float dunedaq::appmodel::RequestHandler::m_pop_size_pct
private

Definition at line 83 of file RequestHandler.hpp.

◆ m_request_timeout

uint32_t dunedaq::appmodel::RequestHandler::m_request_timeout
private

Definition at line 81 of file RequestHandler.hpp.

◆ m_warn_on_empty_buffer

bool dunedaq::appmodel::RequestHandler::m_warn_on_empty_buffer
private

Definition at line 85 of file RequestHandler.hpp.

◆ m_warn_on_timeout

bool dunedaq::appmodel::RequestHandler::m_warn_on_timeout
private

Definition at line 84 of file RequestHandler.hpp.

◆ s_class_name

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

The name of the configuration class.

Definition at line 46 of file RequestHandler.hpp.

◆ s_data_recorder

static const std::string dunedaq::appmodel::RequestHandler::s_data_recorder = "data_recorder"
inlinestatic

Definition at line 340 of file RequestHandler.hpp.

◆ s_handler_threads

static const std::string dunedaq::appmodel::RequestHandler::s_handler_threads = "handler_threads"
inlinestatic

Definition at line 94 of file RequestHandler.hpp.

◆ s_periodic_data_transmission_ms

static const std::string dunedaq::appmodel::RequestHandler::s_periodic_data_transmission_ms = "periodic_data_transmission_ms"
inlinestatic

Definition at line 100 of file RequestHandler.hpp.

◆ s_pop_limit_pct

static const std::string dunedaq::appmodel::RequestHandler::s_pop_limit_pct = "pop_limit_pct"
inlinestatic

Definition at line 96 of file RequestHandler.hpp.

◆ s_pop_size_pct

static const std::string dunedaq::appmodel::RequestHandler::s_pop_size_pct = "pop_size_pct"
inlinestatic

Definition at line 97 of file RequestHandler.hpp.

◆ s_request_timeout

static const std::string dunedaq::appmodel::RequestHandler::s_request_timeout = "request_timeout"
inlinestatic

Definition at line 95 of file RequestHandler.hpp.

◆ s_warn_on_empty_buffer

static const std::string dunedaq::appmodel::RequestHandler::s_warn_on_empty_buffer = "warn_on_empty_buffer"
inlinestatic

Definition at line 99 of file RequestHandler.hpp.

◆ s_warn_on_timeout

static const std::string dunedaq::appmodel::RequestHandler::s_warn_on_timeout = "warn_on_timeout"
inlinestatic

Definition at line 98 of file RequestHandler.hpp.


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