DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::timinglibs::dal::EndpointLocation Class Reference

#include <EndpointLocation.hpp>

Inheritance diagram for dunedaq::timinglibs::dal::EndpointLocation:
[legend]
Collaboration diagram for dunedaq::timinglibs::dal::EndpointLocation:
[legend]

Public Member Functions

virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the EndpointLocation 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.
 
int32_t get_fanout_slot () const
 Get "fanout_slot" attribute value. Fanout slot of the endpoint.
 
void set_fanout_slot (int32_t value)
 Set "fanout_slot" attribute value. Fanout slot of the endpoint.
 
int32_t get_sfp_slot () const
 Get "sfp_slot" attribute value. SFP slot of the endpoint.
 
void set_sfp_slot (int32_t value)
 Set "sfp_slot" attribute value. SFP slot of the endpoint.
 
uint32_t get_address () const
 Get "address" attribute value. Address of the endpoint.
 
void set_address (uint32_t value)
 Set "address" attribute value. Address of the endpoint.
 
virtual void print (unsigned int offset, bool print_header, std::ostream &s) const
 Print details of the EndpointLocation 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.
 
int32_t get_fanout_slot () const
 Get "fanout_slot" attribute value. Fanout slot of the endpoint.
 
void set_fanout_slot (int32_t value)
 Set "fanout_slot" attribute value. Fanout slot of the endpoint.
 
int32_t get_sfp_slot () const
 Get "sfp_slot" attribute value. SFP slot of the endpoint.
 
void set_sfp_slot (int32_t value)
 Set "sfp_slot" attribute value. SFP slot of the endpoint.
 
uint32_t get_address () const
 Get "address" attribute value. Address of the endpoint.
 
void set_address (uint32_t value)
 Set "address" attribute value. Address of the endpoint.
 
- 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_fanout_slot_str () noexcept
 
static const std::string & __get_sfp_slot_str () noexcept
 
static const std::string & __get_address_str () noexcept
 
static const std::string & __get_fanout_slot_str () noexcept
 
static const std::string & __get_sfp_slot_str () noexcept
 
static const std::string & __get_address_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_fanout_slot = "fanout_slot"
 
static const std::string s_sfp_slot = "sfp_slot"
 
static const std::string s_address = "address"
 

Protected Member Functions

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

int32_t m_fanout_slot
 
int32_t m_sfp_slot
 
uint32_t m_address
 

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

Endpoint location data

Definition at line 25 of file EndpointLocation.hpp.

Constructor & Destructor Documentation

◆ EndpointLocation() [1/2]

dunedaq::timinglibs::dal::EndpointLocation::EndpointLocation ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

Definition at line 27 of file EndpointLocation.cpp.

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

◆ ~EndpointLocation() [1/2]

dunedaq::timinglibs::dal::EndpointLocation::~EndpointLocation ( )
protectedvirtualnoexcept

Definition at line 73 of file EndpointLocation.cpp.

74 {
75 }

◆ EndpointLocation() [2/2]

dunedaq::timinglibs::dal::EndpointLocation::EndpointLocation ( conffwk::DalRegistry & db,
const conffwk::ConfigObject & obj )
protectednoexcept

◆ ~EndpointLocation() [2/2]

virtual dunedaq::timinglibs::dal::EndpointLocation::~EndpointLocation ( )
protectedvirtualnoexcept

Member Function Documentation

◆ __get_address_str() [1/2]

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::__get_address_str ( )
inlinestaticnoexcept

Definition at line 91 of file EndpointLocation.hpp.

91{ return s_address; }

◆ __get_address_str() [2/2]

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::__get_address_str ( )
inlinestaticnoexcept

Definition at line 91 of file EndpointLocation.hpp.

91{ return s_address; }

◆ __get_fanout_slot_str() [1/2]

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::__get_fanout_slot_str ( )
inlinestaticnoexcept

Definition at line 89 of file EndpointLocation.hpp.

89{ return s_fanout_slot; }

◆ __get_fanout_slot_str() [2/2]

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::__get_fanout_slot_str ( )
inlinestaticnoexcept

Definition at line 89 of file EndpointLocation.hpp.

89{ return s_fanout_slot; }

◆ __get_sfp_slot_str() [1/2]

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::__get_sfp_slot_str ( )
inlinestaticnoexcept

Definition at line 90 of file EndpointLocation.hpp.

90{ return s_sfp_slot; }

◆ __get_sfp_slot_str() [2/2]

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::__get_sfp_slot_str ( )
inlinestaticnoexcept

Definition at line 90 of file EndpointLocation.hpp.

90{ return s_sfp_slot; }

◆ get() [1/4]

std::vector< const dunedaq::conffwk::DalObject * > dunedaq::timinglibs::dal::EndpointLocation::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 77 of file EndpointLocation.cpp.

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

Definition at line 87 of file EndpointLocation.cpp.

88 {
89 if (first_call)
90 {
91 std::lock_guard scoped_lock(m_mutex);
92
93 check();
94 check_init();
95
96 if (get_rel_objects(name, upcast_unregistered, vec))
97 return true;
98 }
99
100 if (first_call)
101 return get_algo_objects(name, vec);
102
103 return false;
104 }
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::timinglibs::dal::EndpointLocation::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::timinglibs::dal::EndpointLocation::get_address ( ) const
inline

Get "address" attribute value. Address of the endpoint.

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

Definition at line 168 of file EndpointLocation.hpp.

169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 check_init();
173 return m_address;
174 }

◆ get_address() [2/2]

uint32_t dunedaq::timinglibs::dal::EndpointLocation::get_address ( ) const
inline

Get "address" attribute value. Address of the endpoint.

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

Definition at line 168 of file EndpointLocation.hpp.

169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 check_init();
173 return m_address;
174 }

◆ get_fanout_slot() [1/2]

int32_t dunedaq::timinglibs::dal::EndpointLocation::get_fanout_slot ( ) const
inline

Get "fanout_slot" attribute value. Fanout slot of the endpoint.

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

Definition at line 102 of file EndpointLocation.hpp.

103 {
104 std::lock_guard scoped_lock(m_mutex);
105 check();
106 check_init();
107 return m_fanout_slot;
108 }

◆ get_fanout_slot() [2/2]

int32_t dunedaq::timinglibs::dal::EndpointLocation::get_fanout_slot ( ) const
inline

Get "fanout_slot" attribute value. Fanout slot of the endpoint.

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

Definition at line 102 of file EndpointLocation.hpp.

103 {
104 std::lock_guard scoped_lock(m_mutex);
105 check();
106 check_init();
107 return m_fanout_slot;
108 }

◆ get_sfp_slot() [1/2]

int32_t dunedaq::timinglibs::dal::EndpointLocation::get_sfp_slot ( ) const
inline

Get "sfp_slot" attribute value. SFP slot of the endpoint.

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

Definition at line 135 of file EndpointLocation.hpp.

136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 check_init();
140 return m_sfp_slot;
141 }

◆ get_sfp_slot() [2/2]

int32_t dunedaq::timinglibs::dal::EndpointLocation::get_sfp_slot ( ) const
inline

Get "sfp_slot" attribute value. SFP slot of the endpoint.

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

Definition at line 135 of file EndpointLocation.hpp.

136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 check_init();
140 return m_sfp_slot;
141 }

◆ init() [1/2]

void dunedaq::timinglibs::dal::EndpointLocation::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 EndpointLocation.cpp.

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

Print details of the EndpointLocation 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 34 of file EndpointLocation.cpp.

35 {
36 check_init();
37
38 try {
39 const std::string str(indent+2, ' ');
40
41 if (print_header)
42 p_hdr(s, indent, s_class_name, "dunedaq::timinglibs::dal");
43
44
45 // print direct attributes
46
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::timinglibs::dal::EndpointLocation::print ( unsigned int offset,
bool print_header,
std::ostream & s ) const
virtual

Print details of the EndpointLocation 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::timinglibs::dal::EndpointLocation::set_address ( uint32_t value)
inline

Set "address" attribute value. Address of the endpoint.

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

Definition at line 184 of file EndpointLocation.hpp.

185 {
186 std::lock_guard scoped_lock(m_mutex);
187 check();
188 clear();
189 p_obj.set_by_val(s_address, value);
190 }
void set_by_val(const std::string &name, T value)
Set attribute value.

◆ set_address() [2/2]

void dunedaq::timinglibs::dal::EndpointLocation::set_address ( uint32_t value)
inline

Set "address" attribute value. Address of the endpoint.

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

Definition at line 184 of file EndpointLocation.hpp.

185 {
186 std::lock_guard scoped_lock(m_mutex);
187 check();
188 clear();
189 p_obj.set_by_val(s_address, value);
190 }

◆ set_fanout_slot() [1/2]

void dunedaq::timinglibs::dal::EndpointLocation::set_fanout_slot ( int32_t value)
inline

Set "fanout_slot" attribute value. Fanout slot of the endpoint.

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

Definition at line 118 of file EndpointLocation.hpp.

119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 clear();
124 }

◆ set_fanout_slot() [2/2]

void dunedaq::timinglibs::dal::EndpointLocation::set_fanout_slot ( int32_t value)
inline

Set "fanout_slot" attribute value. Fanout slot of the endpoint.

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

Definition at line 118 of file EndpointLocation.hpp.

119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 clear();
124 }

◆ set_sfp_slot() [1/2]

void dunedaq::timinglibs::dal::EndpointLocation::set_sfp_slot ( int32_t value)
inline

Set "sfp_slot" attribute value. SFP slot of the endpoint.

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

Definition at line 151 of file EndpointLocation.hpp.

152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 clear();
157 }

◆ set_sfp_slot() [2/2]

void dunedaq::timinglibs::dal::EndpointLocation::set_sfp_slot ( int32_t value)
inline

Set "sfp_slot" attribute value. SFP slot of the endpoint.

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

Definition at line 151 of file EndpointLocation.hpp.

152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 clear();
157 }

Friends And Related Symbol Documentation

◆ conffwk::Configuration

Definition at line 27 of file EndpointLocation.hpp.

◆ conffwk::DalFactory

conffwk::DalFactory
friend

Definition at line 29 of file EndpointLocation.hpp.

◆ conffwk::DalObject

Definition at line 28 of file EndpointLocation.hpp.

◆ conffwk::DalRegistry

Definition at line 30 of file EndpointLocation.hpp.

Member Data Documentation

◆ m_address

uint32_t dunedaq::timinglibs::dal::EndpointLocation::m_address
private

Definition at line 78 of file EndpointLocation.hpp.

◆ m_fanout_slot

int32_t dunedaq::timinglibs::dal::EndpointLocation::m_fanout_slot
private

Definition at line 76 of file EndpointLocation.hpp.

◆ m_sfp_slot

int32_t dunedaq::timinglibs::dal::EndpointLocation::m_sfp_slot
private

Definition at line 77 of file EndpointLocation.hpp.

◆ s_address

static const std::string dunedaq::timinglibs::dal::EndpointLocation::s_address = "address"
inlinestatic

Definition at line 87 of file EndpointLocation.hpp.

◆ s_class_name

static const std::string & dunedaq::timinglibs::dal::EndpointLocation::s_class_name
static

The name of the configuration class.

Definition at line 42 of file EndpointLocation.hpp.

◆ s_fanout_slot

static const std::string dunedaq::timinglibs::dal::EndpointLocation::s_fanout_slot = "fanout_slot"
inlinestatic

Definition at line 85 of file EndpointLocation.hpp.

◆ s_sfp_slot

static const std::string dunedaq::timinglibs::dal::EndpointLocation::s_sfp_slot = "sfp_slot"
inlinestatic

Definition at line 86 of file EndpointLocation.hpp.


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