rad  3.0.0
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.96
4 // source: /home/eltdev/workspace/ICS/RAD/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/ps/Traceable.hpp>
20 #include <mal/Mal.hpp>
21 #include <mal/IcdTypes.hpp>
22 #include <mal/utility/shared_vector.hpp>
23 
24 
25 namespace hellomalif {
26 
27 // generated
28 class ExceptionErr : public std::exception {
29  public:
30  ExceptionErr(const std::string& _desc):
31  desc(_desc) {}
32 
33  virtual std::string getDesc() const {
34  return desc;
35  }
36 
37 
38  virtual const char* what() const noexcept {
39  return "::hellomalif::ExceptionErr";
40  };
41 
42  virtual ~ExceptionErr() = default;
43 
44  protected:
45  ExceptionErr() = default;
46  std::string desc;
47 };
48 
49 
50 // generated
51 class LogInfo :
52  public ::elt::mal::ps::DataEntity<LogInfo>
53 {
54  public:
55  static constexpr const char* TYPE_ID = "LogInfo";
56 
57 
58 
59  virtual std::string getLevel() const = 0;
60  virtual void setLevel(const std::string& level) = 0;
61 
62  virtual std::string getLogger() const = 0;
63  virtual void setLogger(const std::string& logger) = 0;
64  virtual ~LogInfo() = default;
65 
66  ::hellomalif::LogInfo& operator=(const ::hellomalif::LogInfo& other) {
67  setLevel(other.getLevel());
68  setLogger(other.getLogger());
69  return *this;
70  }
71 };
72 
73 
74 
78 class StdCmds : public virtual ::elt::mal::rr::RrEntity {
79  public:
80  virtual std::string Init() = 0;
81  virtual std::string Reset() = 0;
82  virtual std::string Enable() = 0;
83  virtual std::string Disable() = 0;
84  virtual std::string GetState() = 0;
85  virtual std::string GetStatus() = 0;
86  virtual std::string GetVersion() = 0;
87  virtual std::string Stop() = 0;
88  virtual std::string Exit() = 0;
89  virtual std::string SetLogLevel( const std::shared_ptr<::hellomalif::LogInfo>& info) = 0;
90 
91  static int typeHash() {
92  return -935828682;
93  }
94 
95  virtual ~StdCmds() = default;
96 };
97 
100 class AsyncStdCmds : public virtual ::elt::mal::rr::RrEntity {
101  public:
102  virtual ::elt::mal::future<std::string> Init() = 0;
103  virtual ::elt::mal::future<std::string> Reset() = 0;
104  virtual ::elt::mal::future<std::string> Enable() = 0;
105  virtual ::elt::mal::future<std::string> Disable() = 0;
106  virtual ::elt::mal::future<std::string> GetState() = 0;
107  virtual ::elt::mal::future<std::string> GetStatus() = 0;
108  virtual ::elt::mal::future<std::string> GetVersion() = 0;
109  virtual ::elt::mal::future<std::string> Stop() = 0;
110  virtual ::elt::mal::future<std::string> Exit() = 0;
111  virtual ::elt::mal::future<std::string> SetLogLevel( const std::shared_ptr<::hellomalif::LogInfo>& info) = 0;
112 
113  static int typeHash() {
114  return -935828682;
115  }
116 
117  virtual ~AsyncStdCmds() = default;
118 };
119 
120 class StdCmdsSync :
121  public virtual ::hellomalif::StdCmds,
122  public virtual ::elt::mal::rr::ClientRrEntity {
123  //virtual StdCmdsSync timeout(std::chrono::milliseconds timeoutDuration) = 0;
124 };
125 
127  public virtual AsyncStdCmds,
128  public virtual ::elt::mal::rr::ClientRrEntity {
129 };
130 
132  public virtual AsyncStdCmds {
133  public:
135  const std::shared_ptr<StdCmds> &entity)
136  : m_entity(entity) {}
137 
138  virtual ::elt::mal::future<std::string> Init() {
139  ::elt::mal::promise<std::string> p;
140 
141  try {
142 
143  p.set_value(m_entity->Init());
144 
145  } catch(::hellomalif::ExceptionErr& exceptionerr) {
146  p.set_exception(exceptionerr);
147  } catch(const std::exception& ex) {
148  p.set_exception(ex);
149  }
150 
151  return p.get_future();
152  }
153 
154  virtual ::elt::mal::future<std::string> Reset() {
155  ::elt::mal::promise<std::string> p;
156 
157  try {
158 
159  p.set_value(m_entity->Reset());
160 
161  } catch(::hellomalif::ExceptionErr& exceptionerr) {
162  p.set_exception(exceptionerr);
163  } catch(const std::exception& ex) {
164  p.set_exception(ex);
165  }
166 
167  return p.get_future();
168  }
169 
170  virtual ::elt::mal::future<std::string> Enable() {
171  ::elt::mal::promise<std::string> p;
172 
173  try {
174 
175  p.set_value(m_entity->Enable());
176 
177  } catch(::hellomalif::ExceptionErr& exceptionerr) {
178  p.set_exception(exceptionerr);
179  } catch(const std::exception& ex) {
180  p.set_exception(ex);
181  }
182 
183  return p.get_future();
184  }
185 
186  virtual ::elt::mal::future<std::string> Disable() {
187  ::elt::mal::promise<std::string> p;
188 
189  try {
190 
191  p.set_value(m_entity->Disable());
192 
193  } catch(::hellomalif::ExceptionErr& exceptionerr) {
194  p.set_exception(exceptionerr);
195  } catch(const std::exception& ex) {
196  p.set_exception(ex);
197  }
198 
199  return p.get_future();
200  }
201 
202  virtual ::elt::mal::future<std::string> GetState() {
203  ::elt::mal::promise<std::string> p;
204 
205  try {
206 
207  p.set_value(m_entity->GetState());
208 
209  } catch(::hellomalif::ExceptionErr& exceptionerr) {
210  p.set_exception(exceptionerr);
211  } catch(const std::exception& ex) {
212  p.set_exception(ex);
213  }
214 
215  return p.get_future();
216  }
217 
218  virtual ::elt::mal::future<std::string> GetStatus() {
219  ::elt::mal::promise<std::string> p;
220 
221  try {
222 
223  p.set_value(m_entity->GetStatus());
224 
225  } catch(::hellomalif::ExceptionErr& exceptionerr) {
226  p.set_exception(exceptionerr);
227  } catch(const std::exception& ex) {
228  p.set_exception(ex);
229  }
230 
231  return p.get_future();
232  }
233 
234  virtual ::elt::mal::future<std::string> GetVersion() {
235  ::elt::mal::promise<std::string> p;
236 
237  try {
238 
239  p.set_value(m_entity->GetVersion());
240 
241  } catch(::hellomalif::ExceptionErr& exceptionerr) {
242  p.set_exception(exceptionerr);
243  } catch(const std::exception& ex) {
244  p.set_exception(ex);
245  }
246 
247  return p.get_future();
248  }
249 
250  virtual ::elt::mal::future<std::string> Stop() {
251  ::elt::mal::promise<std::string> p;
252 
253  try {
254 
255  p.set_value(m_entity->Stop());
256 
257  } catch(::hellomalif::ExceptionErr& exceptionerr) {
258  p.set_exception(exceptionerr);
259  } catch(const std::exception& ex) {
260  p.set_exception(ex);
261  }
262 
263  return p.get_future();
264  }
265 
266  virtual ::elt::mal::future<std::string> Exit() {
267  ::elt::mal::promise<std::string> p;
268 
269  try {
270 
271  p.set_value(m_entity->Exit());
272 
273  } catch(::hellomalif::ExceptionErr& exceptionerr) {
274  p.set_exception(exceptionerr);
275  } catch(const std::exception& ex) {
276  p.set_exception(ex);
277  }
278 
279  return p.get_future();
280  }
281 
282  virtual ::elt::mal::future<std::string> SetLogLevel( const std::shared_ptr<::hellomalif::LogInfo>& info) {
283  ::elt::mal::promise<std::string> p;
284 
285  try {
286 
287  p.set_value(m_entity->SetLogLevel(info));
288 
289  } catch(::hellomalif::ExceptionErr& exceptionerr) {
290  p.set_exception(exceptionerr);
291  } catch(const std::exception& ex) {
292  p.set_exception(ex);
293  }
294 
295  return p.get_future();
296  }
297 
298 
299  virtual ~AsyncStdCmdsImplWrapper() = default;
300 
301  private:
302  std::shared_ptr<StdCmds> m_entity;
303 };
304 
305 
306 } // hellomalif
307 
308 namespace elt {
309 namespace mal {
310 
311 template <>
312 struct MalTypeTraits<::hellomalif::LogInfo> {
313  static const char* libraryName;
314  static const char* name;
315 };
316 
317 template <>
318 struct MalTypeTraits<::hellomalif::StdCmds, true> {
319  static const char* libraryName;
320  static const char* name;
321 };
322 
323 template <>
324 struct MalTypeTraits<::hellomalif::StdCmdsSync, true> {
325  static const char* libraryName;
326  static const char* name;
327 };
328 
329 template <>
330 struct MalTypeTraits<::hellomalif::StdCmdsAsync, true> {
331  static const char* libraryName;
332  static const char* name;
333 };
334 
335 template <>
336 struct MalTypeTraits<::hellomalif::AsyncStdCmds, false> {
337  static const char* libraryName;
338  static const char* name;
339 };
340 } // namespace mal
341 } // namespace elt
hellomalif::ExceptionErr::desc
std::string desc
Definition: Hellomalif.hpp:46
hellorad.level
level
Definition: hellorad.py:30
hellomalif::AsyncStdCmds::~AsyncStdCmds
virtual ~AsyncStdCmds()=default
hellomalif::StdCmdsSync
Definition: Hellomalif.hpp:122
hellomalif::AsyncStdCmds
AsyncStdCmds.
Definition: Hellomalif.hpp:100
hellomalif::AsyncStdCmdsImplWrapper::GetStatus
virtual ::elt::mal::future< std::string > GetStatus()
Definition: Hellomalif.hpp:218
hellomalif::ExceptionErr::what
virtual const char * what() const noexcept
Definition: Hellomalif.hpp:38
hellomalif::LogInfo::getLevel
virtual std::string getLevel() const =0
hellomalif::StdCmds::Reset
virtual std::string Reset()=0
hellomalif::StdCmds::Init
virtual std::string Init()=0
elt::mal::MalTypeTraits<::hellomalif::AsyncStdCmds, false >::libraryName
static const char * libraryName
Definition: Hellomalif.hpp:337
hellomalif::ExceptionErr::~ExceptionErr
virtual ~ExceptionErr()=default
hellomalif::LogInfo
Definition: Hellomalif.hpp:53
hellomalif::AsyncStdCmdsImplWrapper::Enable
virtual ::elt::mal::future< std::string > Enable()
Definition: Hellomalif.hpp:170
hellomalif::LogInfo::setLogger
virtual void setLogger(const std::string &logger)=0
hellomalif::LogInfo::getLogger
virtual std::string getLogger() const =0
hellomalif::StdCmds::Stop
virtual std::string Stop()=0
hellomalif::AsyncStdCmdsImplWrapper::SetLogLevel
virtual ::elt::mal::future< std::string > SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo > &info)
Definition: Hellomalif.hpp:282
hellomalif::ExceptionErr::ExceptionErr
ExceptionErr(const std::string &_desc)
Definition: Hellomalif.hpp:30
hellomalif::AsyncStdCmdsImplWrapper::Init
virtual ::elt::mal::future< std::string > Init()
Definition: Hellomalif.hpp:138
elt::mal::MalTypeTraits<::hellomalif::StdCmds, true >::name
static const char * name
Definition: Hellomalif.hpp:320
elt::mal::MalTypeTraits<::hellomalif::LogInfo >::name
static const char * name
Definition: Hellomalif.hpp:314
hellomalif::AsyncStdCmdsImplWrapper::GetState
virtual ::elt::mal::future< std::string > GetState()
Definition: Hellomalif.hpp:202
scxml4py.activity.logger
logger
Definition: activity.py:32
hellomalif::StdCmds::GetVersion
virtual std::string GetVersion()=0
hellomalif::ExceptionErr
Definition: Hellomalif.hpp:28
hellomalif::AsyncStdCmds::SetLogLevel
virtual ::elt::mal::future< std::string > SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo > &info)=0
hellomalif::AsyncStdCmds::Stop
virtual ::elt::mal::future< std::string > Stop()=0
hellomalif::LogInfo::TYPE_ID
static constexpr const char * TYPE_ID
Definition: Hellomalif.hpp:55
hellomalif::ExceptionErr::ExceptionErr
ExceptionErr()=default
hellomalif::AsyncStdCmdsImplWrapper::~AsyncStdCmdsImplWrapper
virtual ~AsyncStdCmdsImplWrapper()=default
elt::mal::MalTypeTraits<::hellomalif::StdCmdsAsync, true >::name
static const char * name
Definition: Hellomalif.hpp:332
hellomalif::AsyncStdCmdsImplWrapper::Disable
virtual ::elt::mal::future< std::string > Disable()
Definition: Hellomalif.hpp:186
hellomalif::StdCmds::GetStatus
virtual std::string GetStatus()=0
hellomalif::ExceptionErr::getDesc
virtual std::string getDesc() const
Definition: Hellomalif.hpp:33
elt::mal::MalTypeTraits<::hellomalif::LogInfo >::libraryName
static const char * libraryName
Definition: Hellomalif.hpp:313
hellomalif::StdCmds::Exit
virtual std::string Exit()=0
hellomalif::AsyncStdCmdsImplWrapper::Stop
virtual ::elt::mal::future< std::string > Stop()
Definition: Hellomalif.hpp:250
elt::mal::MalTypeTraits<::hellomalif::AsyncStdCmds, false >::name
static const char * name
Definition: Hellomalif.hpp:338
hellomalif::StdCmds::~StdCmds
virtual ~StdCmds()=default
hellomalif::StdCmds::Enable
virtual std::string Enable()=0
hellomalif::StdCmds
StdCmds.
Definition: Hellomalif.hpp:78
hellomalif::AsyncStdCmds::Init
virtual ::elt::mal::future< std::string > Init()=0
elt::mal::MalTypeTraits<::hellomalif::StdCmdsSync, true >::name
static const char * name
Definition: Hellomalif.hpp:326
hellomalif::AsyncStdCmds::GetVersion
virtual ::elt::mal::future< std::string > GetVersion()=0
hellomalif::StdCmds::typeHash
static int typeHash()
Definition: Hellomalif.hpp:91
hellomalif::LogInfo::~LogInfo
virtual ~LogInfo()=default
elt
Definition: Exmalif.hpp:418
hellomalif::StdCmds::Disable
virtual std::string Disable()=0
hellomalif::AsyncStdCmds::Disable
virtual ::elt::mal::future< std::string > Disable()=0
hellomalif::AsyncStdCmds::GetState
virtual ::elt::mal::future< std::string > GetState()=0
hellomalif::AsyncStdCmdsImplWrapper::Exit
virtual ::elt::mal::future< std::string > Exit()
Definition: Hellomalif.hpp:266
hellomalif::LogInfo::operator=
::hellomalif::LogInfo & operator=(const ::hellomalif::LogInfo &other)
Definition: Hellomalif.hpp:66
hellomalif::StdCmds::GetState
virtual std::string GetState()=0
elt::mal::MalTypeTraits<::hellomalif::StdCmdsSync, true >::libraryName
static const char * libraryName
Definition: Hellomalif.hpp:325
hellomalif::AsyncStdCmds::Reset
virtual ::elt::mal::future< std::string > Reset()=0
hellomalif::AsyncStdCmdsImplWrapper::Reset
virtual ::elt::mal::future< std::string > Reset()
Definition: Hellomalif.hpp:154
hellomalif::AsyncStdCmds::typeHash
static int typeHash()
Definition: Hellomalif.hpp:113
hellomalif::AsyncStdCmds::Exit
virtual ::elt::mal::future< std::string > Exit()=0
hellomalif::StdCmdsAsync
Definition: Hellomalif.hpp:128
elt::mal::MalTypeTraits<::hellomalif::StdCmds, true >::libraryName
static const char * libraryName
Definition: Hellomalif.hpp:319
hellomalif::AsyncStdCmdsImplWrapper::AsyncStdCmdsImplWrapper
AsyncStdCmdsImplWrapper(const std::shared_ptr< StdCmds > &entity)
Definition: Hellomalif.hpp:134
hellomalif::StdCmds::SetLogLevel
virtual std::string SetLogLevel(const std::shared_ptr<::hellomalif::LogInfo > &info)=0
hellomalif::AsyncStdCmdsImplWrapper::GetVersion
virtual ::elt::mal::future< std::string > GetVersion()
Definition: Hellomalif.hpp:234
hellomalif::AsyncStdCmdsImplWrapper
Definition: Hellomalif.hpp:132
hellomalif
Definition: Hellomalif.hpp:25
hellomalif::LogInfo::setLevel
virtual void setLevel(const std::string &level)=0
hellomalif::AsyncStdCmds::Enable
virtual ::elt::mal::future< std::string > Enable()=0
hellomalif::AsyncStdCmds::GetStatus
virtual ::elt::mal::future< std::string > GetStatus()=0
elt::mal::MalTypeTraits<::hellomalif::StdCmdsAsync, true >::libraryName
static const char * libraryName
Definition: Hellomalif.hpp:331