DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CTBSocket.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CTBSocket_0_dunedaq__appmodel_0_appmodel_H_
4#define _CTBSocket_0_dunedaq__appmodel_0_appmodel_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 // include files for classes used in inheritance hierarchy
17
19
20 // prologue of method CTBSocket::get_ctb_json()
21
22#include "nlohmann/json.hpp"
23#include <optional>
24
25namespace dunedaq {
26 namespace appmodel {
27
29
30 friend class conffwk::Configuration;
31 friend class conffwk::DalObject;
32 friend class conffwk::DalFactory;
33 friend class conffwk::DalRegistry;
34
35 protected:
36
38 virtual ~CTBSocket() noexcept;
39 virtual void init(bool init_children);
40
41 public:
42
45 static const std::string& s_class_name;
46
47
57 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
58
59
69 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
70
71
72 protected:
73
74 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
75
76
77 private:
78
79 std::string m_host;
80
81
82 public:
83
84 // attribute names
85
86 inline static const std::string s_host = "host";
87
88 static const std::string& __get_host_str() noexcept { return s_host; }
89
90
97 const std::string&
98 get_host() const
99 {
100 std::lock_guard scoped_lock(m_mutex);
101 check();
102 check_init();
103 return m_host;
104 }
105
112 void
113 set_host(const std::string& value)
114 {
115 std::lock_guard scoped_lock(m_mutex);
116 check();
117 clear();
118 p_obj.set_by_ref(s_host, value);
119 }
120
121
122
123 public:
124
125 // user-defined algorithms
126
127 nlohmann::json get_ctb_json( std::optional<std::string> socket_host = std::nullopt ) const;
128 };
129
130 // out stream operator
131
132 inline std::ostream& operator<<(std::ostream& s, const CTBSocket& obj)
133 {
134 return obj.print_object(s);
135 }
136
137 typedef std::vector<const CTBSocket*>::const_iterator CTBSocketIterator;
138
139 }
140}
141
142#endif
void set_host(const std::string &value)
Set "host" attribute value.
static const std::string & __get_host_str() noexcept
Definition CTBSocket.hpp:88
static const std::string & s_class_name
Definition CTBSocket.hpp:45
nlohmann::json get_ctb_json(std::optional< std::string > socket_host=std::nullopt) const
const std::string & get_host() const
Get "host" attribute value.
Definition CTBSocket.hpp:98
friend class conffwk::DalFactory
Definition CTBSocket.hpp:32
virtual ~CTBSocket() noexcept
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 CTBSocket.cpp:79
friend class conffwk::DalObject
Definition CTBSocket.hpp:31
static const std::string s_host
Definition CTBSocket.hpp:86
virtual void init(bool init_children)
Definition CTBSocket.cpp:61
CTBSocket(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
void set_by_ref(const std::string &name, T &value)
Set attribute value.
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL object.
ConfigObject p_obj
Config object used by given template object.
void check_init() const
Check and initialize object if necessary.
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constCTBSocket * >::const_iterator CTBSocketIterator
Including Qt Headers.