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

#include <SSPRegister.hpp>

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

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the SSPRegister 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::string & get_name () const
 Get "name" attribute value.
void set_name (const std::string &value)
 Set "name" attribute value.
uint32_t get_address () const
 Get "address" attribute value.
void set_address (uint32_t value)
 Set "address" attribute value.
uint32_t get_value () const
 Get "value" attribute value.
void set_value (uint32_t value)
 Set "value" attribute value.
uint32_t get_mask () const
 Get "mask" attribute value.
void set_mask (uint32_t value)
 Set "mask" attribute value.
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the SSPRegister 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::string & get_name () const
 Get "name" attribute value.
void set_name (const std::string &value)
 Set "name" attribute value.
uint32_t get_address () const
 Get "address" attribute value.
void set_address (uint32_t value)
 Set "address" attribute value.
uint32_t get_value () const
 Get "value" attribute value.
void set_value (uint32_t value)
 Set "value" attribute value.
uint32_t get_mask () const
 Get "mask" attribute value.
void set_mask (uint32_t value)
 Set "mask" 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_name_str () noexcept
static const std::string & __get_address_str () noexcept
static const std::string & __get_value_str () noexcept
static const std::string & __get_mask_str () noexcept
static const std::string & __get_name_str () noexcept
static const std::string & __get_address_str () noexcept
static const std::string & __get_value_str () noexcept
static const std::string & __get_mask_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_name = "name"
static const std::string s_address = "address"
static const std::string s_value = "value"
static const std::string s_mask = "mask"

Protected Member Functions

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

std::string m_name
uint32_t m_address
uint32_t m_value
uint32_t m_mask

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 20 of file SSPRegister.hpp.

Constructor & Destructor Documentation

◆ SSPRegister() [1/2]

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

Definition at line 26 of file SSPRegister.cpp.

26 :
27 dunedaq::conffwk::DalObject(db, o)
28 {
29 ;
30 }

◆ ~SSPRegister() [1/2]

dunedaq::appmodel::SSPRegister::~SSPRegister ( )
protectedvirtualnoexcept

Definition at line 74 of file SSPRegister.cpp.

75 {
76 }

◆ SSPRegister() [2/2]

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

◆ ~SSPRegister() [2/2]

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

Member Function Documentation

◆ __get_address_str() [1/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_address_str ( )
inlinestaticnoexcept

Definition at line 87 of file SSPRegister.hpp.

87{ return s_address; }
static const std::string s_address

◆ __get_address_str() [2/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_address_str ( )
inlinestaticnoexcept

Definition at line 87 of file SSPRegister.hpp.

87{ return s_address; }

◆ __get_mask_str() [1/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_mask_str ( )
inlinestaticnoexcept

Definition at line 89 of file SSPRegister.hpp.

89{ return s_mask; }
static const std::string s_mask

◆ __get_mask_str() [2/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_mask_str ( )
inlinestaticnoexcept

Definition at line 89 of file SSPRegister.hpp.

89{ return s_mask; }

◆ __get_name_str() [1/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_name_str ( )
inlinestaticnoexcept

Definition at line 86 of file SSPRegister.hpp.

86{ return s_name; }
static const std::string s_name

◆ __get_name_str() [2/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_name_str ( )
inlinestaticnoexcept

Definition at line 86 of file SSPRegister.hpp.

86{ return s_name; }

◆ __get_value_str() [1/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_value_str ( )
inlinestaticnoexcept

Definition at line 88 of file SSPRegister.hpp.

88{ return s_value; }
static const std::string s_value

◆ __get_value_str() [2/2]

const std::string & dunedaq::appmodel::SSPRegister::__get_value_str ( )
inlinestaticnoexcept

Definition at line 88 of file SSPRegister.hpp.

88{ return s_value; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::SSPRegister::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 78 of file SSPRegister.cpp.

79 {
80 std::vector<const dunedaq::conffwk::DalObject *> vec;
81
82 if (!get(name, vec, upcast_unregistered, true))
83 throw_get_ex(name, s_class_name, this);
84
85 return vec;
86 }
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::SSPRegister::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::SSPRegister::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

Definition at line 88 of file SSPRegister.cpp.

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

◆ get_address() [1/2]

uint32_t dunedaq::appmodel::SSPRegister::get_address ( ) const
inline

Get "address" attribute value.

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

Definition at line 130 of file SSPRegister.hpp.

131 {
132 std::lock_guard scoped_lock(m_mutex);
133 check();
134 check_init();
135 return m_address;
136 }

◆ get_address() [2/2]

uint32_t dunedaq::appmodel::SSPRegister::get_address ( ) const
inline

Get "address" attribute value.

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

Definition at line 130 of file SSPRegister.hpp.

131 {
132 std::lock_guard scoped_lock(m_mutex);
133 check();
134 check_init();
135 return m_address;
136 }

◆ get_mask() [1/2]

uint32_t dunedaq::appmodel::SSPRegister::get_mask ( ) const
inline

Get "mask" attribute value.

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

Definition at line 192 of file SSPRegister.hpp.

193 {
194 std::lock_guard scoped_lock(m_mutex);
195 check();
196 check_init();
197 return m_mask;
198 }

◆ get_mask() [2/2]

uint32_t dunedaq::appmodel::SSPRegister::get_mask ( ) const
inline

Get "mask" attribute value.

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

Definition at line 192 of file SSPRegister.hpp.

193 {
194 std::lock_guard scoped_lock(m_mutex);
195 check();
196 check_init();
197 return m_mask;
198 }

◆ get_name() [1/2]

const std::string & dunedaq::appmodel::SSPRegister::get_name ( ) const
inline

Get "name" attribute value.

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

Definition at line 99 of file SSPRegister.hpp.

100 {
101 std::lock_guard scoped_lock(m_mutex);
102 check();
103 check_init();
104 return m_name;
105 }

◆ get_name() [2/2]

const std::string & dunedaq::appmodel::SSPRegister::get_name ( ) const
inline

Get "name" attribute value.

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

Definition at line 99 of file SSPRegister.hpp.

100 {
101 std::lock_guard scoped_lock(m_mutex);
102 check();
103 check_init();
104 return m_name;
105 }

◆ get_value() [1/2]

uint32_t dunedaq::appmodel::SSPRegister::get_value ( ) const
inline

Get "value" attribute value.

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

Definition at line 161 of file SSPRegister.hpp.

162 {
163 std::lock_guard scoped_lock(m_mutex);
164 check();
165 check_init();
166 return m_value;
167 }

◆ get_value() [2/2]

uint32_t dunedaq::appmodel::SSPRegister::get_value ( ) const
inline

Get "value" attribute value.

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

Definition at line 161 of file SSPRegister.hpp.

162 {
163 std::lock_guard scoped_lock(m_mutex);
164 check();
165 check_init();
166 return m_value;
167 }

◆ init() [1/2]

void dunedaq::appmodel::SSPRegister::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 57 of file SSPRegister.cpp.

58 {
59 p_was_read = true;
61 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
62
63 try {
64 p_obj.get(s_name, m_name);
66 p_obj.get(s_value, m_value);
67 p_obj.get(s_mask, m_mask);
68 }
69 catch (dunedaq::conffwk::Exception & ex) {
70 throw_init_ex(ex);
71 }
72 }
void throw_init_ex(dunedaq::conffwk::Exception &ex)
throw object initialisation exception (i.e.
Definition DalObject.cpp:74
void increment_read() noexcept
bool p_was_read
is true, if the object was read
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::SSPRegister::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::SSPRegister::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the SSPRegister 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 33 of file SSPRegister.cpp.

34 {
35 check_init();
36
37 try {
38 const std::string str(indent+2, ' ');
39
40 if (print_header)
41 p_hdr(s, indent, s_class_name, "dunedaq::appmodel");
42
43
44 // print direct attributes
45
50 }
51 catch (dunedaq::conffwk::Exception & ex) {
53 }
54 }
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_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::SSPRegister::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the SSPRegister 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_address() [1/2]

void dunedaq::appmodel::SSPRegister::set_address ( uint32_t value)
inline

Set "address" attribute value.

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

Definition at line 145 of file SSPRegister.hpp.

146 {
147 std::lock_guard scoped_lock(m_mutex);
148 check();
149 clear();
150 p_obj.set_by_val(s_address, value);
151 }

◆ set_address() [2/2]

void dunedaq::appmodel::SSPRegister::set_address ( uint32_t value)
inline

Set "address" attribute value.

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

Definition at line 145 of file SSPRegister.hpp.

146 {
147 std::lock_guard scoped_lock(m_mutex);
148 check();
149 clear();
150 p_obj.set_by_val(s_address, value);
151 }

◆ set_mask() [1/2]

void dunedaq::appmodel::SSPRegister::set_mask ( uint32_t value)
inline

Set "mask" attribute value.

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

Definition at line 207 of file SSPRegister.hpp.

208 {
209 std::lock_guard scoped_lock(m_mutex);
210 check();
211 clear();
212 p_obj.set_by_val(s_mask, value);
213 }

◆ set_mask() [2/2]

void dunedaq::appmodel::SSPRegister::set_mask ( uint32_t value)
inline

Set "mask" attribute value.

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

Definition at line 207 of file SSPRegister.hpp.

208 {
209 std::lock_guard scoped_lock(m_mutex);
210 check();
211 clear();
212 p_obj.set_by_val(s_mask, value);
213 }

◆ set_name() [1/2]

void dunedaq::appmodel::SSPRegister::set_name ( const std::string & value)
inline

Set "name" attribute value.

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

Definition at line 114 of file SSPRegister.hpp.

115 {
116 std::lock_guard scoped_lock(m_mutex);
117 check();
118 clear();
119 p_obj.set_by_ref(s_name, value);
120 }

◆ set_name() [2/2]

void dunedaq::appmodel::SSPRegister::set_name ( const std::string & value)
inline

Set "name" attribute value.

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

Definition at line 114 of file SSPRegister.hpp.

115 {
116 std::lock_guard scoped_lock(m_mutex);
117 check();
118 clear();
119 p_obj.set_by_ref(s_name, value);
120 }

◆ set_value() [1/2]

void dunedaq::appmodel::SSPRegister::set_value ( uint32_t value)
inline

Set "value" attribute value.

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

Definition at line 176 of file SSPRegister.hpp.

177 {
178 std::lock_guard scoped_lock(m_mutex);
179 check();
180 clear();
181 p_obj.set_by_val(s_value, value);
182 }

◆ set_value() [2/2]

void dunedaq::appmodel::SSPRegister::set_value ( uint32_t value)
inline

Set "value" attribute value.

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

Definition at line 176 of file SSPRegister.hpp.

177 {
178 std::lock_guard scoped_lock(m_mutex);
179 check();
180 clear();
181 p_obj.set_by_val(s_value, value);
182 }

◆ conffwk::Configuration

Definition at line 22 of file SSPRegister.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 24 of file SSPRegister.hpp.

◆ conffwk::DalObject

Definition at line 23 of file SSPRegister.hpp.

◆ conffwk::DalRegistry

Definition at line 25 of file SSPRegister.hpp.

Member Data Documentation

◆ m_address

uint32_t dunedaq::appmodel::SSPRegister::m_address
private

Definition at line 72 of file SSPRegister.hpp.

◆ m_mask

uint32_t dunedaq::appmodel::SSPRegister::m_mask
private

Definition at line 74 of file SSPRegister.hpp.

◆ m_name

std::string dunedaq::appmodel::SSPRegister::m_name
private

Definition at line 71 of file SSPRegister.hpp.

◆ m_value

uint32_t dunedaq::appmodel::SSPRegister::m_value
private

Definition at line 73 of file SSPRegister.hpp.

◆ s_address

const std::string dunedaq::appmodel::SSPRegister::s_address = "address"
inlinestatic

Definition at line 82 of file SSPRegister.hpp.

◆ s_class_name

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

The name of the configuration class.

Definition at line 37 of file SSPRegister.hpp.

◆ s_mask

const std::string dunedaq::appmodel::SSPRegister::s_mask = "mask"
inlinestatic

Definition at line 84 of file SSPRegister.hpp.

◆ s_name

const std::string dunedaq::appmodel::SSPRegister::s_name = "name"
inlinestatic

Definition at line 81 of file SSPRegister.hpp.

◆ s_value

const std::string dunedaq::appmodel::SSPRegister::s_value = "value"
inlinestatic

Definition at line 83 of file SSPRegister.hpp.


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