DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Jsonable.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _Jsonable_0_dunedaq__confmodel_0_confmodel_H_
4#define _Jsonable_0_dunedaq__confmodel_0_confmodel_H_
5
6#include <stdint.h> // to define 64 bits types
7#include <iostream>
8#include <sstream>
9#include <string>
10#include <map>
11#include <vector>
12
14#include "conffwk/DalObject.hpp"
15
16
17 // prologue of method Jsonable::to_json()
18
19#include "nlohmann/json.hpp"
20
21namespace dunedaq {
22 namespace confmodel {
23
24 class Jsonable : public virtual dunedaq::conffwk::DalObject {
25
27 friend class conffwk::DalObject;
28 friend class conffwk::DalFactory;
30
31 protected:
32
33 Jsonable(conffwk::DalRegistry& db, const conffwk::ConfigObject& obj) noexcept;
34 virtual ~Jsonable() noexcept;
35 virtual void init(bool init_children);
36
37 public:
38
41 static const std::string& s_class_name;
42
43
53 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
54
55
65 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
66
67
68 protected:
69
70 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
71
72
73 private:
74
75
76
77 public:
78
79
80 public:
81
82 // user-defined algorithms
83
84 nlohmann::json to_json(bool direct=false, bool skip_name=false) const;
85 };
86
87 // out stream operator
88
89 inline std::ostream& operator<<(std::ostream& s, const Jsonable& obj)
90 {
91 return obj.print_object(s);
92 }
93
94 typedef std::vector<const Jsonable*>::const_iterator JsonableIterator;
95
96 }
97}
98
99#endif
The base class for any generated DAL object.
Definition DalObject.hpp:45
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
static const std::string & s_class_name
Definition Jsonable.hpp:41
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...
Definition Jsonable.cpp:48
virtual void init(bool init_children)
Definition Jsonable.cpp:37
virtual ~Jsonable() noexcept
Definition Jsonable.cpp:44
nlohmann::json to_json(bool direct=false, bool skip_name=false) const
Jsonable(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
Definition Jsonable.cpp:15
friend class conffwk::DalFactory
Definition Jsonable.hpp:28
friend class conffwk::DalObject
Definition Jsonable.hpp:27
conffwk entry point
double offset
std::vector< constJsonable * >::const_iterator JsonableIterator
Definition Jsonable.hpp:94
Including Qt Headers.