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

#include <CTBPulser.hpp>

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

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the CTBPulser 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_enable () const
 Get "enable" attribute value.
 
void set_enable (bool value)
 Set "enable" attribute value.
 
uint64_t get_frequency () const
 Get "frequency" attribute value.
 
void set_frequency (uint64_t value)
 Set "frequency" attribute value.
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the CTBPulser 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_enable () const
 Get "enable" attribute value.
 
void set_enable (bool value)
 Set "enable" attribute value.
 
uint64_t get_frequency () const
 Get "frequency" attribute value.
 
void set_frequency (uint64_t value)
 Set "frequency" attribute value.
 
- Public Member Functions inherited from dunedaq::confmodel::Jsonable
nlohmann::json to_json (bool direct=false, bool skip_name=false) const
 
nlohmann::json to_json (bool direct=false, bool skip_name=false) const
 
- Public Member Functions inherited from dunedaq::conffwk::DalObject
const std::string & UID () const noexcept
 
const std::string & class_name () const noexcept
 
bool castable (const std::string &target) const noexcept
 
bool castable (const std::string *target) const noexcept
 
template<class TARGET >
const TARGET * cast () const noexcept
 Casts object to different class.
 
std::string full_name () const noexcept
 
const ConfigObjectconfig_object () const
 
DalRegistryregistry () const noexcept
 
Configurationconfiguration () const noexcept
 
void unread ()
 
void set (const ConfigObject &o) noexcept
 
void move (const std::string &at)
 
void rename (const std::string &new_id)
 
void p_hdr (std::ostream &s, unsigned int indent, const std::string &cl, const char *nm=nullptr) const
 print object headers
 
std::ostream & print_object (std::ostream &s) const
 print object details
 
void throw_init_ex (dunedaq::conffwk::Exception &ex)
 throw object initialisation exception (i.e.
 

Static Public Member Functions

static const std::string & __get_enable_str () noexcept
 
static const std::string & __get_frequency_str () noexcept
 
static const std::string & __get_enable_str () noexcept
 
static const std::string & __get_frequency_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_enable = "enable"
 
static const std::string s_frequency = "frequency"
 
- Static Public Attributes inherited from dunedaq::confmodel::Jsonable
static const std::string & s_class_name
 

Protected Member Functions

 CTBPulser (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~CTBPulser () 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
 
 CTBPulser (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~CTBPulser () noexcept
 
virtual void init (bool init_children)
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
- Protected Member Functions inherited from dunedaq::confmodel::Jsonable
 Jsonable (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Jsonable () noexcept
 
bool get (const std::string &name, std::vector< const dunedaq::conffwk::DalObject * > &vec, bool upcast_unregistered, bool first_call) const
 
 Jsonable (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~Jsonable () 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_enable
 
uint64_t m_frequency
 

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

Test pulser that is routed to the fiber and one of the NIM outputs (back panel)

Definition at line 27 of file CTBPulser.hpp.

Constructor & Destructor Documentation

◆ CTBPulser() [1/2]

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

Definition at line 26 of file CTBPulser.cpp.

26 :
29
30 {
31 ;
32 }
The base class for any generated DAL object.
Definition DalObject.hpp:45

◆ ~CTBPulser() [1/2]

dunedaq::appmodel::CTBPulser::~CTBPulser ( )
protectedvirtualnoexcept

Definition at line 77 of file CTBPulser.cpp.

78 {
79 }

◆ CTBPulser() [2/2]

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

◆ ~CTBPulser() [2/2]

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

Member Function Documentation

◆ __get_enable_str() [1/2]

static const std::string & dunedaq::appmodel::CTBPulser::__get_enable_str ( )
inlinestaticnoexcept

Definition at line 89 of file CTBPulser.hpp.

89{ return s_enable; }
static const std::string s_enable
Definition CTBPulser.hpp:86

◆ __get_enable_str() [2/2]

static const std::string & dunedaq::appmodel::CTBPulser::__get_enable_str ( )
inlinestaticnoexcept

Definition at line 89 of file CTBPulser.hpp.

89{ return s_enable; }

◆ __get_frequency_str() [1/2]

static const std::string & dunedaq::appmodel::CTBPulser::__get_frequency_str ( )
inlinestaticnoexcept

Definition at line 90 of file CTBPulser.hpp.

90{ return s_frequency; }
static const std::string s_frequency
Definition CTBPulser.hpp:87

◆ __get_frequency_str() [2/2]

static const std::string & dunedaq::appmodel::CTBPulser::__get_frequency_str ( )
inlinestaticnoexcept

Definition at line 90 of file CTBPulser.hpp.

90{ return s_frequency; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::CTBPulser::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Reimplemented from dunedaq::confmodel::Jsonable.

Definition at line 81 of file CTBPulser.cpp.

82 {
83 std::vector<const dunedaq::conffwk::DalObject *> vec;
84
85 if (!get(name, vec, upcast_unregistered, true))
86 throw_get_ex(name, s_class_name, this);
87
88 return vec;
89 }
static const std::string & s_class_name
Definition CTBPulser.hpp:44
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...
Definition CTBPulser.cpp:81
static void throw_get_ex(const std::string &what, const std::string &class_name, const DalObject *obj)
throw exception in generated get method (i.e.
Definition DalObject.cpp:82

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::appmodel::CTBPulser::get ( const std::string & name,
bool upcast_unregistered = true ) const
virtual

Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject pointers.

Parameters are:

Parameters
namename of the relationship or algorithm
Returns
value of relationship or result of algorithm
Exceptions
std::exceptionif there is no relationship or algorithm with such name in this and base classes

Reimplemented from dunedaq::confmodel::Jsonable.

◆ get() [3/4]

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

Definition at line 91 of file CTBPulser.cpp.

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

◆ get_enable() [1/2]

bool dunedaq::appmodel::CTBPulser::get_enable ( ) const
inline

Get "enable" attribute value.

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

Definition at line 100 of file CTBPulser.hpp.

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

◆ get_enable() [2/2]

bool dunedaq::appmodel::CTBPulser::get_enable ( ) const
inline

Get "enable" attribute value.

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

Definition at line 100 of file CTBPulser.hpp.

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

◆ get_frequency() [1/2]

uint64_t dunedaq::appmodel::CTBPulser::get_frequency ( ) const
inline

Get "frequency" attribute value.

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

Definition at line 131 of file CTBPulser.hpp.

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

◆ get_frequency() [2/2]

uint64_t dunedaq::appmodel::CTBPulser::get_frequency ( ) const
inline

Get "frequency" attribute value.

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

Definition at line 131 of file CTBPulser.hpp.

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

◆ init() [1/2]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::confmodel::Jsonable.

Definition at line 62 of file CTBPulser.cpp.

63 {
64 Jsonable::init(init_children);
65
66 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
67
68 try {
71 }
72 catch (dunedaq::conffwk::Exception & ex) {
73 throw_init_ex(ex);
74 }
75 }
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.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112

◆ init() [2/2]

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

Initialize object (method generated by genconffwk)

Parameters
init_childrenif true, initialize referenced objects

Reimplemented from dunedaq::confmodel::Jsonable.

◆ print() [1/2]

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

Print details of the CTBPulser object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Reimplemented from dunedaq::confmodel::Jsonable.

Definition at line 35 of file CTBPulser.cpp.

36 {
37 check_init();
38
39 try {
40 const std::string str(indent+2, ' ');
41
42 if (print_header)
43 p_hdr(s, indent, s_class_name, "dunedaq::appmodel");
44
45
46 // print direct super-classes
47
49
50
51 // print direct attributes
52
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 Jsonable object.
Definition Jsonable.cpp:22
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::CTBPulser::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the CTBPulser object.

Parameters are:

Parameters
offsetnumber of spaces to shift object right (useful to print nested objects)
print_headerif false, do not print object header (to print attributes of base classes)
soutput stream

Reimplemented from dunedaq::confmodel::Jsonable.

◆ set_enable() [1/2]

void dunedaq::appmodel::CTBPulser::set_enable ( bool value)
inline

Set "enable" attribute value.

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

Definition at line 115 of file CTBPulser.hpp.

116 {
117 std::lock_guard scoped_lock(m_mutex);
118 check();
119 clear();
120 p_obj.set_by_val(s_enable, value);
121 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_enable() [2/2]

void dunedaq::appmodel::CTBPulser::set_enable ( bool value)
inline

Set "enable" attribute value.

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

Definition at line 115 of file CTBPulser.hpp.

116 {
117 std::lock_guard scoped_lock(m_mutex);
118 check();
119 clear();
120 p_obj.set_by_val(s_enable, value);
121 }

◆ set_frequency() [1/2]

void dunedaq::appmodel::CTBPulser::set_frequency ( uint64_t value)
inline

Set "frequency" attribute value.

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

Definition at line 146 of file CTBPulser.hpp.

147 {
148 std::lock_guard scoped_lock(m_mutex);
149 check();
150 clear();
152 }

◆ set_frequency() [2/2]

void dunedaq::appmodel::CTBPulser::set_frequency ( uint64_t value)
inline

Set "frequency" attribute value.

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

Definition at line 146 of file CTBPulser.hpp.

147 {
148 std::lock_guard scoped_lock(m_mutex);
149 check();
150 clear();
152 }

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 29 of file CTBPulser.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 31 of file CTBPulser.hpp.

◆ conffwk::DalObject

Definition at line 30 of file CTBPulser.hpp.

◆ conffwk::DalRegistry

Definition at line 32 of file CTBPulser.hpp.

Member Data Documentation

◆ m_enable

bool dunedaq::appmodel::CTBPulser::m_enable
private

Definition at line 78 of file CTBPulser.hpp.

◆ m_frequency

uint64_t dunedaq::appmodel::CTBPulser::m_frequency
private

Definition at line 79 of file CTBPulser.hpp.

◆ s_class_name

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

The name of the configuration class.

Definition at line 44 of file CTBPulser.hpp.

◆ s_enable

static const std::string dunedaq::appmodel::CTBPulser::s_enable = "enable"
inlinestatic

Definition at line 86 of file CTBPulser.hpp.

◆ s_frequency

static const std::string dunedaq::appmodel::CTBPulser::s_frequency = "frequency"
inlinestatic

Definition at line 87 of file CTBPulser.hpp.


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