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

#include <FSMxTransition.hpp>

Inheritance diagram for dunedaq::confmodel::FSMxTransition:
[legend]
Collaboration diagram for dunedaq::confmodel::FSMxTransition:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the FSMxTransition 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_transition () const
 Get "transition" attribute value. The main transition that this pre/post transition applies to.
 
void set_transition (const std::string &value)
 Set "transition" attribute value. The main transition that this pre/post transition applies to.
 
const std::vector< std::string > & get_order () const
 Get "order" attribute value.
 
void set_order (const std::vector< std::string > &value)
 Set "order" attribute value.
 
const std::vector< std::string > & get_mandatory () const
 Get "mandatory" attribute value.
 
void set_mandatory (const std::vector< std::string > &value)
 Set "mandatory" attribute value.
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the FSMxTransition 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_transition () const
 Get "transition" attribute value. The main transition that this pre/post transition applies to.
 
void set_transition (const std::string &value)
 Set "transition" attribute value. The main transition that this pre/post transition applies to.
 
const std::vector< std::string > & get_order () const
 Get "order" attribute value.
 
void set_order (const std::vector< std::string > &value)
 Set "order" attribute value.
 
const std::vector< std::string > & get_mandatory () const
 Get "mandatory" attribute value.
 
void set_mandatory (const std::vector< std::string > &value)
 Set "mandatory" 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_transition_str () noexcept
 
static const std::string & __get_order_str () noexcept
 
static const std::string & __get_mandatory_str () noexcept
 
static const std::string & __get_transition_str () noexcept
 
static const std::string & __get_order_str () noexcept
 
static const std::string & __get_mandatory_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_transition = "transition"
 
static const std::string s_order = "order"
 
static const std::string s_mandatory = "mandatory"
 

Protected Member Functions

 FSMxTransition (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~FSMxTransition () 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
 
 FSMxTransition (conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
 
virtual ~FSMxTransition () 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_transition
 
std::vector< std::string > m_order
 
std::vector< std::string > m_mandatory
 

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

Constructor & Destructor Documentation

◆ FSMxTransition() [1/2]

dunedaq::confmodel::FSMxTransition::FSMxTransition ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 26 of file FSMxTransition.cpp.

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

◆ ~FSMxTransition() [1/2]

dunedaq::confmodel::FSMxTransition::~FSMxTransition ( )
protectedvirtualnoexcept

Definition at line 72 of file FSMxTransition.cpp.

73 {
74 }

◆ FSMxTransition() [2/2]

dunedaq::confmodel::FSMxTransition::FSMxTransition ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~FSMxTransition() [2/2]

virtual dunedaq::confmodel::FSMxTransition::~FSMxTransition ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_mandatory_str() [1/2]

static const std::string & dunedaq::confmodel::FSMxTransition::__get_mandatory_str ( )
inlinestaticnoexcept

Definition at line 86 of file FSMxTransition.hpp.

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

◆ __get_mandatory_str() [2/2]

static const std::string & dunedaq::confmodel::FSMxTransition::__get_mandatory_str ( )
inlinestaticnoexcept

Definition at line 86 of file FSMxTransition.hpp.

86{ return s_mandatory; }

◆ __get_order_str() [1/2]

static const std::string & dunedaq::confmodel::FSMxTransition::__get_order_str ( )
inlinestaticnoexcept

Definition at line 85 of file FSMxTransition.hpp.

85{ return s_order; }
static const std::string s_order

◆ __get_order_str() [2/2]

static const std::string & dunedaq::confmodel::FSMxTransition::__get_order_str ( )
inlinestaticnoexcept

Definition at line 85 of file FSMxTransition.hpp.

85{ return s_order; }

◆ __get_transition_str() [1/2]

static const std::string & dunedaq::confmodel::FSMxTransition::__get_transition_str ( )
inlinestaticnoexcept

Definition at line 84 of file FSMxTransition.hpp.

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

◆ __get_transition_str() [2/2]

static const std::string & dunedaq::confmodel::FSMxTransition::__get_transition_str ( )
inlinestaticnoexcept

Definition at line 84 of file FSMxTransition.hpp.

84{ return s_transition; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::confmodel::FSMxTransition::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 76 of file FSMxTransition.cpp.

77 {
78 std::vector<const dunedaq::conffwk::DalObject *> vec;
79
80 if (!get(name, vec, upcast_unregistered, true))
81 throw_get_ex(name, s_class_name, this);
82
83 return vec;
84 }
static void throw_get_ex(const std::string &what, const std::string &class_name, const DalObject *obj)
throw exception in generated get method (i.e.
Definition DalObject.cpp:82
static const std::string & s_class_name
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...

◆ get() [2/4]

virtual std::vector< const dunedaq::conffwk::DalObject * > dunedaq::confmodel::FSMxTransition::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::confmodel::FSMxTransition::get ( const std::string & name,
std::vector< const dunedaq::conffwk::DalObject * > & vec,
bool upcast_unregistered,
bool first_call ) const
protected

Definition at line 86 of file FSMxTransition.cpp.

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

◆ get_mandatory() [1/2]

const std::vector< std::string > & dunedaq::confmodel::FSMxTransition::get_mandatory ( ) const
inline

Get "mandatory" attribute value.

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

Definition at line 160 of file FSMxTransition.hpp.

161 {
162 std::lock_guard scoped_lock(m_mutex);
163 check();
164 check_init();
165 return m_mandatory;
166 }
std::vector< std::string > m_mandatory

◆ get_mandatory() [2/2]

const std::vector< std::string > & dunedaq::confmodel::FSMxTransition::get_mandatory ( ) const
inline

Get "mandatory" attribute value.

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

Definition at line 160 of file FSMxTransition.hpp.

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

◆ get_order() [1/2]

const std::vector< std::string > & dunedaq::confmodel::FSMxTransition::get_order ( ) const
inline

Get "order" attribute value.

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

Definition at line 129 of file FSMxTransition.hpp.

130 {
131 std::lock_guard scoped_lock(m_mutex);
132 check();
133 check_init();
134 return m_order;
135 }
std::vector< std::string > m_order

◆ get_order() [2/2]

const std::vector< std::string > & dunedaq::confmodel::FSMxTransition::get_order ( ) const
inline

Get "order" attribute value.

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

Definition at line 129 of file FSMxTransition.hpp.

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

◆ get_transition() [1/2]

const std::string & dunedaq::confmodel::FSMxTransition::get_transition ( ) const
inline

Get "transition" attribute value. The main transition that this pre/post transition applies to.

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

Definition at line 97 of file FSMxTransition.hpp.

98 {
99 std::lock_guard scoped_lock(m_mutex);
100 check();
101 check_init();
102 return m_transition;
103 }

◆ get_transition() [2/2]

const std::string & dunedaq::confmodel::FSMxTransition::get_transition ( ) const
inline

Get "transition" attribute value. The main transition that this pre/post transition applies to.

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

Definition at line 97 of file FSMxTransition.hpp.

98 {
99 std::lock_guard scoped_lock(m_mutex);
100 check();
101 check_init();
102 return m_transition;
103 }

◆ init() [1/2]

void dunedaq::confmodel::FSMxTransition::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 56 of file FSMxTransition.cpp.

57 {
58 p_was_read = true;
60 TLOG_DEBUG(5) << "read object " << this << " (class " << s_class_name << ')';
61
62 try {
66 }
67 catch (dunedaq::conffwk::Exception & ex) {
68 throw_init_ex(ex);
69 }
70 }
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
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::confmodel::FSMxTransition::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::confmodel::FSMxTransition::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the FSMxTransition 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 FSMxTransition.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::confmodel");
42
43
44 // print direct attributes
45
49 }
50 catch (dunedaq::conffwk::Exception & ex) {
52 }
53 }
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_attr(std::ostream &s, const std::string &str, const std::string &name, const T &val) noexcept
print multi-value attribute
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::confmodel::FSMxTransition::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

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

void dunedaq::confmodel::FSMxTransition::set_mandatory ( const std::vector< std::string > & value)
inline

Set "mandatory" attribute value.

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

Definition at line 175 of file FSMxTransition.hpp.

176 {
177 std::lock_guard scoped_lock(m_mutex);
178 check();
179 clear();
181 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_mandatory() [2/2]

void dunedaq::confmodel::FSMxTransition::set_mandatory ( const std::vector< std::string > & value)
inline

Set "mandatory" attribute value.

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

Definition at line 175 of file FSMxTransition.hpp.

176 {
177 std::lock_guard scoped_lock(m_mutex);
178 check();
179 clear();
181 }

◆ set_order() [1/2]

void dunedaq::confmodel::FSMxTransition::set_order ( const std::vector< std::string > & value)
inline

Set "order" attribute value.

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

Definition at line 144 of file FSMxTransition.hpp.

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

◆ set_order() [2/2]

void dunedaq::confmodel::FSMxTransition::set_order ( const std::vector< std::string > & value)
inline

Set "order" attribute value.

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

Definition at line 144 of file FSMxTransition.hpp.

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

◆ set_transition() [1/2]

void dunedaq::confmodel::FSMxTransition::set_transition ( const std::string & value)
inline

Set "transition" attribute value. The main transition that this pre/post transition applies to.

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

Definition at line 113 of file FSMxTransition.hpp.

114 {
115 std::lock_guard scoped_lock(m_mutex);
116 check();
117 clear();
119 }
void set_by_ref(const std::string &name, T &value)
Set attribute value.

◆ set_transition() [2/2]

void dunedaq::confmodel::FSMxTransition::set_transition ( const std::string & value)
inline

Set "transition" attribute value. The main transition that this pre/post transition applies to.

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

Definition at line 113 of file FSMxTransition.hpp.

114 {
115 std::lock_guard scoped_lock(m_mutex);
116 check();
117 clear();
119 }

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 22 of file FSMxTransition.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 24 of file FSMxTransition.hpp.

◆ conffwk::DalObject

Definition at line 23 of file FSMxTransition.hpp.

◆ conffwk::DalRegistry

Definition at line 25 of file FSMxTransition.hpp.

Member Data Documentation

◆ m_mandatory

std::vector< std::string > dunedaq::confmodel::FSMxTransition::m_mandatory
private

Definition at line 73 of file FSMxTransition.hpp.

◆ m_order

std::vector< std::string > dunedaq::confmodel::FSMxTransition::m_order
private

Definition at line 72 of file FSMxTransition.hpp.

◆ m_transition

std::string dunedaq::confmodel::FSMxTransition::m_transition
private

Definition at line 71 of file FSMxTransition.hpp.

◆ s_class_name

static const std::string & dunedaq::confmodel::FSMxTransition::s_class_name
static

The name of the configuration class.

Definition at line 37 of file FSMxTransition.hpp.

◆ s_mandatory

static const std::string dunedaq::confmodel::FSMxTransition::s_mandatory = "mandatory"
inlinestatic

Definition at line 82 of file FSMxTransition.hpp.

◆ s_order

static const std::string dunedaq::confmodel::FSMxTransition::s_order = "order"
inlinestatic

Definition at line 81 of file FSMxTransition.hpp.

◆ s_transition

static const std::string dunedaq::confmodel::FSMxTransition::s_transition = "transition"
inlinestatic

Definition at line 80 of file FSMxTransition.hpp.


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