rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hellomalif.hpp
Go to the documentation of this file.
1 // GENERATED, DO NOT MANUALLY MODIFY
2 // generator core v1.10
3 // specific generator: C++ Agnostic Interface .hpp Generator v0.92
4 // source: /home/jenkins/workspace/ICS-daily-and-weekly/ifw-rad-daily/test/templates/genMalSm/hello/hellomalif/src/hellomalif.xml
5 
6 #pragma once
7 
8 #include <chrono>
9 #include <memory>
10 #include <stdexcept>
11 #include <string>
12 
13 
14 #include <mal/utility/future.hpp>
15 #include <mal/rr/RrEntity.hpp>
16 #include <mal/rr/Ami.hpp>
17 #include <mal/rr/ClientRrEntity.hpp>
18 #include <mal/ps/DataEntity.hpp>
19 #include <mal/Mal.hpp>
20 #include <mal/IcdTypes.hpp>
21 #include <mal/utility/shared_vector.hpp>
22 
23 
24 namespace hellomalif {
25 
26 // generated
27 class ExceptionErr : public std::exception {
28  public:
29  ExceptionErr(const std::string& _desc):
30  desc(_desc) {}
31 
32  virtual std::string getDesc() const {
33  return desc;
34  }
35 
36 
37  virtual const char* what() const noexcept {
38  return "::hellomalif::ExceptionErr";
39  };
40 
41  virtual ~ExceptionErr() = default;
42 
43  protected:
44  ExceptionErr() = default;
45  std::string desc;
46 };
47 
48 
49 // generated
50 class LogInfo : public ::elt::mal::ps::DataEntity<LogInfo> {
51  public:
52  static constexpr const char* TYPE_ID = "LogInfo";
53 
54 
55  virtual std::string getLevel() const = 0;
56  virtual void setLevel(const std::string& level) = 0;
57 
58  virtual std::string getLogger() const = 0;
59  virtual void setLogger(const std::string& logger) = 0;
60  virtual ~LogInfo() = default;
61 
63  setLevel(other.getLevel());
64  setLogger(other.getLogger());
65  return *this;
66  }
67 };
68 
69 
70 
71 class StdCmds : public virtual ::elt::mal::rr::RrEntity {
72  public:
73  virtual std::string Init() = 0;
74  virtual std::string Reset() = 0;
75  virtual std::string Enable() = 0;
76  virtual std::string Disable() = 0;
77  virtual std::string Status() = 0;
78  virtual std::string Config() = 0;
79  virtual std::string Stop() = 0;
80  virtual std::string Exit() = 0;
81  virtual std::string SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo>& info) = 0;
82 
83  static int typeHash() {
84  return -1766698911;
85  }
86 
87  virtual ~StdCmds() = default;
88 };
89 
90 class AsyncStdCmds : public virtual ::elt::mal::rr::RrEntity {
91  public:
92  virtual ::elt::mal::future<std::string> Init() = 0;
93  virtual ::elt::mal::future<std::string> Reset() = 0;
94  virtual ::elt::mal::future<std::string> Enable() = 0;
95  virtual ::elt::mal::future<std::string> Disable() = 0;
96  virtual ::elt::mal::future<std::string> Status() = 0;
97  virtual ::elt::mal::future<std::string> Config() = 0;
98  virtual ::elt::mal::future<std::string> Stop() = 0;
99  virtual ::elt::mal::future<std::string> Exit() = 0;
100  virtual ::elt::mal::future<std::string> SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo>& info) = 0;
101 
102  static int typeHash() {
103  return -1766698911;
104  }
105 
106  virtual ~AsyncStdCmds() = default;
107 };
108 
109 class StdCmdsSync :
110  public virtual ::hellomalif::StdCmds,
111  public virtual ::elt::mal::rr::ClientRrEntity {
112  //virtual StdCmdsSync timeout(std::chrono::milliseconds timeoutDuration) = 0;
113 };
114 
115 class StdCmdsAsync :
116  public virtual AsyncStdCmds,
117  public virtual ::elt::mal::rr::ClientRrEntity {
118 };
119 
120 class AsyncStdCmdsImplWrapper :
121  public virtual AsyncStdCmds {
122  public:
124  const std::shared_ptr<StdCmds> &entity)
125  : m_entity(entity) {}
126 
127  virtual ::elt::mal::future<std::string> Init() {
128  ::elt::mal::promise<std::string> p;
129 
130 
131  p.set_value(m_entity->Init());
132 
133 
134  return p.get_future();
135  }
136 
137  virtual ::elt::mal::future<std::string> Reset() {
138  ::elt::mal::promise<std::string> p;
139 
140 
141  p.set_value(m_entity->Reset());
142 
143 
144  return p.get_future();
145  }
146 
147  virtual ::elt::mal::future<std::string> Enable() {
148  ::elt::mal::promise<std::string> p;
149 
150 
151  p.set_value(m_entity->Enable());
152 
153 
154  return p.get_future();
155  }
156 
157  virtual ::elt::mal::future<std::string> Disable() {
158  ::elt::mal::promise<std::string> p;
159 
160 
161  p.set_value(m_entity->Disable());
162 
163 
164  return p.get_future();
165  }
166 
167  virtual ::elt::mal::future<std::string> Status() {
168  ::elt::mal::promise<std::string> p;
169 
170 
171  p.set_value(m_entity->Status());
172 
173 
174  return p.get_future();
175  }
176 
177  virtual ::elt::mal::future<std::string> Config() {
178  ::elt::mal::promise<std::string> p;
179 
180 
181  p.set_value(m_entity->Config());
182 
183 
184  return p.get_future();
185  }
186 
187  virtual ::elt::mal::future<std::string> Stop() {
188  ::elt::mal::promise<std::string> p;
189 
190 
191  p.set_value(m_entity->Stop());
192 
193 
194  return p.get_future();
195  }
196 
197  virtual ::elt::mal::future<std::string> Exit() {
198  ::elt::mal::promise<std::string> p;
199 
200 
201  p.set_value(m_entity->Exit());
202 
203 
204  return p.get_future();
205  }
206 
207  virtual ::elt::mal::future<std::string> SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo>& info) {
208  ::elt::mal::promise<std::string> p;
209 
210  try {
211 
212  p.set_value(m_entity->SetLogLevel(info));
213 
214  } catch(::hellomalif::ExceptionErr& exceptionerr) {
215  p.set_exception(exceptionerr);
216  }
217 
218  return p.get_future();
219  }
220 
221 
222  virtual ~AsyncStdCmdsImplWrapper() = default;
223 
224  private:
225  std::shared_ptr<StdCmds> m_entity;
226 };
227 
228 
229 } // hellomalif
230 
231 namespace elt {
232 namespace mal {
233 
234 template <>
235 struct MalTypeTraits<::hellomalif::LogInfo> {
236  static const char* libraryName;
237  static const char* name;
238 };
239 
240 template <>
241 struct MalTypeTraits<::hellomalif::StdCmds, true> {
242  static const char* libraryName;
243  static const char* name;
244 };
245 
246 template <>
247 struct MalTypeTraits<::hellomalif::StdCmdsSync, true> {
248  static const char* libraryName;
249  static const char* name;
250 };
251 
252 template <>
253 struct MalTypeTraits<::hellomalif::StdCmdsAsync, true> {
254  static const char* libraryName;
255  static const char* name;
256 };
257 
258 template <>
259 struct MalTypeTraits<::hellomalif::AsyncStdCmds, false> {
260  static const char* libraryName;
261  static const char* name;
262 };
263 } // namespace mal
264 } // namespace elt
virtual std::string Disable()=0
virtual const char * what() const noexcept
Definition: Hellomalif.hpp:37
required string logger
Definition: exmalif.proto:25
Definition: Hellomalif.hpp:115
virtual ::elt::mal::future< std::string > SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo > &info)
Definition: Hellomalif.hpp:207
virtual ::elt::mal::future< std::string > Status()
Definition: Hellomalif.hpp:167
virtual ::elt::mal::future< std::string > Exit()
Definition: Hellomalif.hpp:197
virtual ~LogInfo()=default
ExceptionErr(const std::string &_desc)
Definition: Hellomalif.hpp:29
Definition: Hellomalif.hpp:109
virtual std::string getDesc() const
Definition: Hellomalif.hpp:32
virtual ::elt::mal::future< std::string > Config()
Definition: Hellomalif.hpp:177
virtual std::string getLevel() const =0
std::string desc
Definition: Hellomalif.hpp:45
virtual std::string Config()=0
virtual ::elt::mal::future< std::string > Stop()=0
virtual ::elt::mal::future< std::string > Init()
Definition: Hellomalif.hpp:127
virtual ::elt::mal::future< std::string > Exit()=0
Definition: Hellomalif.hpp:71
virtual std::string Init()=0
virtual std::string SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo > &info)=0
Definition: Hellomalif.hpp:27
static constexpr const char * TYPE_ID
Definition: Hellomalif.hpp:52
virtual ::elt::mal::future< std::string > Stop()
Definition: Hellomalif.hpp:187
virtual ~AsyncStdCmdsImplWrapper()=default
virtual ::elt::mal::future< std::string > Disable()
Definition: Hellomalif.hpp:157
virtual ::elt::mal::future< std::string > Enable()=0
virtual void setLevel(const std::string &level)=0
static int typeHash()
Definition: Hellomalif.hpp:83
virtual ::elt::mal::future< std::string > SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo > &info)=0
virtual void setLogger(const std::string &logger)=0
virtual ::elt::mal::future< std::string > Init()=0
virtual ~ExceptionErr()=default
virtual std::string Stop()=0
package generated zpb hellomalif
Definition: hellomalif.proto:11
virtual std::string Reset()=0
AsyncStdCmdsImplWrapper(const std::shared_ptr< StdCmds > &entity)
Definition: Hellomalif.hpp:123
virtual ~StdCmds()=default
virtual ::elt::mal::future< std::string > Config()=0
static int typeHash()
Definition: Hellomalif.hpp:102
virtual ::elt::mal::future< std::string > Disable()=0
message LogInfo
Definition: exmalif.proto:23
virtual ~AsyncStdCmds()=default
virtual ::elt::mal::future< std::string > Status()=0
virtual ::elt::mal::future< std::string > Reset()=0
virtual ::elt::mal::future< std::string > Reset()
Definition: Hellomalif.hpp:137
Definition: Hellomalif.hpp:90
message ExceptionErr
Definition: exmalif.proto:28
::hellomalif::LogInfo & operator=(const ::hellomalif::LogInfo &other)
Definition: Hellomalif.hpp:62
virtual std::string Enable()=0
Definition: Hellomalif.hpp:50
virtual std::string Status()=0
virtual std::string getLogger() const =0
virtual std::string Exit()=0
virtual ::elt::mal::future< std::string > Enable()
Definition: Hellomalif.hpp:147