DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::config::api::info Namespace Reference

Namespaces

namespace  relation
 

Classes

class  onclass
 

Functions

bool has_obj (std::string const &classname, std::string const &object_uid)
 
dunedaq::conffwk::attribute_t attributematch (QString const &, QString const &)
 
template<>
dunedaq::conffwk::relationship_t info::relation::match< std::string > (std::string const &arelation, std::string const &aclass)
 

Function Documentation

◆ attributematch()

dunedaq::conffwk::attribute_t dbe::config::api::info::attributematch ( QString const & AttributeName,
QString const & ClassName )

Retrieve attribute information for a given attribute name of a class

Parameters
Attributename
Classname
Returns
the attribute information

Definition at line 125 of file config_api_info.cpp.

127{
129 ClassName.toStdString(), false );
130 const std::vector<dunedaq::conffwk::attribute_t> AttributeList = ClassInfo.p_attributes;
131
132 for ( auto & Attribute : AttributeList )
133 {
134 if ( Attribute.p_name == AttributeName.toStdString() )
135 {
136 return Attribute;
137 }
138 }
139
141}
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:163

◆ has_obj()

bool dbe::config::api::info::has_obj ( std::string const & classname,
std::string const & object_uid )

Definition at line 94 of file config_api_info.cpp.

95{
96 try
97 {
98 return not inner::dbcontroller::get (
99 { object_uid, classname} ).is_null();
100 }
101 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
102 {
103 return false;
104 }
105
106 return true;
107}

◆ info::relation::match< std::string >()

template<>
dunedaq::conffwk::relationship_t dbe::config::api::info::info::relation::match< std::string > ( std::string const & arelation,
std::string const & aclass )

Definition at line 153 of file config_api_info.cpp.

156{
157 dunedaq::conffwk::class_t const & aninfo_for_class =
159 std::vector<dunedaq::conffwk::relationship_t> const relations =
160 aninfo_for_class.p_relationships;
161
162 for ( auto & r : relations )
163 {
164 if ( r.p_name == arelation )
165 {
166 return r;
167 }
168 }
170}
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:164