DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::conffwk::class_t Struct Reference

#include <Schema.hpp>

Public Member Functions

 class_t (const std::string &name, const std::string &description, const std::string &schema_path, bool is_abstract)
 class_t ()
void print (std::ostream &out, const std::string &prefix="") const

Public Attributes

std::string p_name
std::string p_description
std::string p_schema_path
bool p_abstract
const std::vector< std::string > p_superclasses
const std::vector< std::string > p_subclasses
const std::vector< attribute_t > p_attributes
const std::vector< relationship_t > p_relationships

Detailed Description

The description of class.

Definition at line 152 of file Schema.hpp.

Constructor & Destructor Documentation

◆ class_t() [1/2]

dunedaq::conffwk::class_t::class_t ( const std::string & name,
const std::string & description,
const std::string & schema_path,
bool is_abstract )

Create class description

Definition at line 216 of file ConfigurationImpl.cpp.

220 : p_name(name)
221 , p_description(description)
222 , p_schema_path(schema_path)
223 , p_abstract(is_abstract)
224{
225 ;
226}
std::string p_description
Definition Schema.hpp:156
std::string p_schema_path
Definition Schema.hpp:157

◆ class_t() [2/2]

dunedaq::conffwk::class_t::class_t ( )
inline

Default constructor for Python binding

Definition at line 170 of file Schema.hpp.

170{ ; }

Member Function Documentation

◆ print()

void dunedaq::conffwk::class_t::print ( std::ostream & out,
const std::string & prefix = "" ) const

Print description of class to stream.

Parameters
outthe output stream
prefixoptional shift output using prefix

Definition at line 229 of file ConfigurationImpl.cpp.

230{
231 out << prefix << "class \'" << p_name << "\'\n"
232 << prefix << " is abstract: \'" << bool2str(p_abstract) << "\'\n"
233 << prefix << " description: \'" << p_description << "\'\n"
234 << prefix << " path: \'" << p_schema_path << "\'\n";
235
236 if (p_superclasses.empty()) {
237 out << prefix << " there are no superclasses\n";
238 } else {
239 out << prefix << " " << p_superclasses.size() << " superclass(es):\n";
240 for (std::vector<std::string>::const_iterator i = p_superclasses.begin(); i != p_superclasses.end(); ++i) {
241 out << prefix << " \'" << *i << "\'\n";
242 }
243 }
244
245 if (p_subclasses.empty()) {
246 out << prefix << " there are no subclasses\n";
247 } else {
248 out << prefix << " " << p_subclasses.size() << " subclass(es):\n";
249 for (std::vector<std::string>::const_iterator i = p_subclasses.begin(); i != p_subclasses.end(); ++i) {
250 out << prefix << " \'" << *i << "\'\n";
251 }
252 }
253
254 std::string new_prefix(prefix);
255 new_prefix += " ";
256
257 if (p_attributes.empty()) {
258 out << prefix << " there are no attributes\n";
259 } else {
260 out << prefix << " " << p_attributes.size() << " attribute(s):\n";
261 for (std::vector<attribute_t>::const_iterator i = p_attributes.begin(); i != p_attributes.end(); ++i) {
262 (*i).print(out, new_prefix.c_str());
263 out << std::endl;
264 }
265 }
266
267 if (p_relationships.empty()) {
268 out << prefix << " there are no relationships\n";
269 } else {
270 out << prefix << " " << p_relationships.size() << " relationship(s):\n";
271 for (std::vector<relationship_t>::const_iterator i = p_relationships.begin(); i != p_relationships.end(); ++i) {
272 (*i).print(out, new_prefix.c_str());
273 out << std::endl;
274 }
275 }
276}
const char * bool2str(bool value)
FELIX Initialization std::string initerror FELIX queue timed out
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:161
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:162
const std::vector< std::string > p_subclasses
Definition Schema.hpp:160
const std::vector< std::string > p_superclasses
Definition Schema.hpp:159

Member Data Documentation

◆ p_abstract

bool dunedaq::conffwk::class_t::p_abstract

if true, the class is abstract and has no objects

Definition at line 158 of file Schema.hpp.

◆ p_attributes

const std::vector<attribute_t> dunedaq::conffwk::class_t::p_attributes

the all attributes of the class

Definition at line 161 of file Schema.hpp.

◆ p_description

std::string dunedaq::conffwk::class_t::p_description

the description text of class

Definition at line 156 of file Schema.hpp.

◆ p_name

std::string dunedaq::conffwk::class_t::p_name

the class name

Definition at line 155 of file Schema.hpp.

◆ p_relationships

const std::vector<relationship_t> dunedaq::conffwk::class_t::p_relationships

the all relationships of the class

Definition at line 162 of file Schema.hpp.

◆ p_schema_path

std::string dunedaq::conffwk::class_t::p_schema_path

the path to the schema_file

Definition at line 157 of file Schema.hpp.

◆ p_subclasses

const std::vector<std::string> dunedaq::conffwk::class_t::p_subclasses

the names of direct subclasses

Definition at line 160 of file Schema.hpp.

◆ p_superclasses

const std::vector<std::string> dunedaq::conffwk::class_t::p_superclasses

the names of direct superclasses

Definition at line 159 of file Schema.hpp.


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