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 130 of file config_api_info.cpp.

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

◆ has_obj()

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

Definition at line 99 of file config_api_info.cpp.

100{
101 try
102 {
103 return not inner::dbcontroller::get (
104 { object_uid, classname} ).is_null();
105 }
106 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
107 {
108 return false;
109 }
110
111 return true;
112}
static configobject::tref get(dbe::cokey const &desc)

◆ 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 158 of file config_api_info.cpp.

161{
162 dunedaq::conffwk::class_t const & aninfo_for_class =
164 std::vector<dunedaq::conffwk::relationship_t> const relations =
165 aninfo_for_class.p_relationships;
166
167 for ( auto & r : relations )
168 {
169 if ( r.p_name == arelation )
170 {
171 return r;
172 }
173 }
175}
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:171