DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::config_object_extractor< C > Class Template Reference

#include <confobject_extra.hpp>

Public Types

typedef C::t_confobjects t_confobjects
 
typedef C::t_attrmap t_attrmap
 
typedef C::t_relmap t_relmap
 

Static Public Member Functions

static t_attrmap getattr (typename C::t_confobject const &obj)
 
static t_relmap getrel (typename C::t_confobject const &obj)
 

Detailed Description

template<typename C>
class dbe::config_object_extractor< C >

Definition at line 24 of file confobject_extra.hpp.

Member Typedef Documentation

◆ t_attrmap

template<typename C >
C::t_attrmap dbe::config_object_extractor< C >::t_attrmap

Definition at line 28 of file confobject_extra.hpp.

◆ t_confobjects

template<typename C >
C::t_confobjects dbe::config_object_extractor< C >::t_confobjects

Definition at line 27 of file confobject_extra.hpp.

◆ t_relmap

template<typename C >
C::t_relmap dbe::config_object_extractor< C >::t_relmap

Definition at line 29 of file confobject_extra.hpp.

Member Function Documentation

◆ getattr()

template<typename C >
static t_attrmap dbe::config_object_extractor< C >::getattr ( typename C::t_confobject const & obj)
inlinestatic

Get attributes defined for an object

Parameters
objthe object to parse
Returns
the relational map of attribute names and value lists

Definition at line 36 of file confobject_extra.hpp.

37 {
39 obj.class_name(), false );
41
42 for ( dunedaq::conffwk::attribute_t const & attr : classt.p_attributes )
43 {
44 typename t_attrmap::mapped_type values
45 {
47 attr ) };
48 attributes[attr.p_name] = values;
49 }
50
51 return attributes;
52 }
static T list(dbe::inner::configobject::tref obj, dunedaq::conffwk::attribute_t const &attr)
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
std::vector< T > attributes(tref const &item)
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:163

◆ getrel()

template<typename C >
static t_relmap dbe::config_object_extractor< C >::getrel ( typename C::t_confobject const & obj)
inlinestatic

Get relations for an object

Relations can be filtered depending on the filter function defined in base class C

Parameters
objthe object to lookup relations for
Returns
the relational map of relations name and linked objects

Definition at line 62 of file confobject_extra.hpp.

63 {
65 obj.class_name(), false );
67
68 for ( dunedaq::conffwk::relationship_t const & link : classt.p_relationships )
69 {
70 if ( C::filter ( link ) )
71 {
72 t_confobjects linked
73 {
75 link ) };
76
77 if ( not linked.empty() )
78 {
79 relations[link.p_name] = linked;
80 }
81 }
82 }
83
84 return relations;
85 }
T relation(tref item, dunedaq::conffwk::relationship_t const &relation)
std::vector< T > relations(tref const &item)
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:164

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