rad  3.0.0
ZpbExmalifImpl.hpp
Go to the documentation of this file.
1 // GENERATED, DO NOT MANUALLY MODIFY
2 // generator core v1.10
3 // specific generator: C++ ZPB .hpp Generator v0.94
4 // source: /home/eltdev/workspace/ICS/RAD/ifw-rad-daily/rad/cpp/_examples/exmalif/src/exmalif.xml
5 
6 #pragma once
7 
8 #include <opentracing/ext/tags.h>
9 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
10 
11 #include <memory>
12 #include <vector>
13 #include <string>
14 #include <algorithm>
15 #include <utility>
16 
17 #include <boost/functional/hash.hpp>
18 
19 #include <mal/Mal.hpp>
20 #include <mal/util/MalTracingUtil.hpp>
21 #include <mal/utility/future.hpp>
22 #include <mal/rr/ClientAsync.hpp>
23 #include <mal/rr/AmiZpb.hpp>
24 #include <mal/ps/ZpbDataEntity.hpp>
25 #include <mal/utility/Uri.hpp>
26 #include <mal/util/ZpbList.hpp>
27 #include <mal/types/ZpbMalTypes.hpp>
28 #include <mal/rr/ServerContextZpb.hpp>
29 #include <mal/rr/ServerContextZpbAmi.hpp>
30 #include <mal/rr/ServerContextProvider.hpp>
31 
32 
33 
34 
35 namespace exmalif {
36 namespace zpb {
37 
38 // generated
39 class TelPositionImpl : public virtual ::exmalif::TelPosition,
40  public virtual ::elt::mal::ps::ZpbDataEntity<::exmalif::TelPosition> {
41  public:
42  typedef ::generated::zpb::exmalif::TelPosition ZpbType;
43 
44  TelPositionImpl(): m_zpbObj(new ::generated::zpb::exmalif::TelPosition())
45  {}
46 
48  m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<ZpbType*>())
49  {}
50 
51 
52  explicit TelPositionImpl(const ::generated::zpb::exmalif::TelPosition& inner):
53  TelPositionImpl() {
54  *m_zpbObj = inner;
55  }
56 
57  TelPositionImpl( float ra, float dec ): TelPositionImpl() {
58  setRa(ra);
59  setDec(dec);
60  }
61 
62 
63  TelPositionImpl(const TelPositionImpl &rhs): m_zpbObj(rhs.m_zpbObj) {}
64 
65  TelPositionImpl(TelPositionImpl &&rhs): m_zpbObj(std::move(rhs.m_zpbObj)) {}
66 
68  copy(that);
69  return *this;
70  }
71 
72  float getRa() const override {
73  return m_zpbObj->ra();
74  }
75 
76  void setRa(float ra) override {
77  m_zpbObj->set_ra(ra);
78  }
79  float getDec() const override {
80  return m_zpbObj->dec();
81  }
82 
83  void setDec(float dec) override {
84  m_zpbObj->set_dec(dec);
85  }
86 
87  std::unique_ptr<::exmalif::TelPosition> clone() const override {
88  auto cloned = std::unique_ptr<::exmalif::TelPosition>(new TelPositionImpl(getRa(),getDec()));
89 
90  auto const* traceableDataEntity = dynamic_cast<const ::elt::mal::ps::Traceable*>(this);
91  if (traceableDataEntity) {
92  auto *clonedTraceable = dynamic_cast<::elt::mal::ps::Traceable*>(cloned.get());
93  if (clonedTraceable) {
94  clonedTraceable->setTrace(traceableDataEntity->getTrace());
95  }
96  }
97  return cloned;
98  }
99 
100  bool keyEquals(const ::exmalif::TelPosition& other) const override {
101  return false;
102  }
103 
104  std::size_t keyHash() const {
105  std::size_t seed = 0;
106  return seed;
107  }
108 
109  std::unique_ptr<::exmalif::TelPosition> cloneKey() const override {
110  std::unique_ptr<::exmalif::TelPosition> entity(new TelPositionImpl());
111  return entity;
112  };
113 
114  bool hasKey() const override {
115  return false;
116  }
117 
118  bool toByteArray(zmq::message_t& msg) const override {
119  msg.rebuild(m_zpbObj->ByteSizeLong());
120  return m_zpbObj->SerializeToArray(msg.data(), msg.size());
121  }
122 
123  bool toByteArray(std::string &output) const override {
124  return m_zpbObj->SerializeToString(&output);
125  }
126 
127  bool fromByteArray(const std::string &data) override {
128  return m_zpbObj->ParseFromString(data);
129  }
130 
131  bool fromByteArray(const void * data, std::size_t size) override {
132  google::protobuf::io::ArrayInputStream ais(data, size);
133  return m_zpbObj->ParseFromZeroCopyStream(&ais);
134  }
135 
136  void copy(const ::exmalif::TelPosition &from) override {
137  setRa(from.getRa());
138  setDec(from.getDec());
139 
140  auto const* traceableFrom = dynamic_cast<const ::elt::mal::ps::Traceable*>(&from);
141  if (traceableFrom) {
142  auto* traceableTo = dynamic_cast<::elt::mal::ps::Traceable*>(this);
143  if (traceableTo) {
144  traceableTo->setTrace(traceableFrom->getTrace());
145  }
146  }
147  }
148 
149  operator ZpbType*() const {
150  return &*m_zpbObj;
151  }
152 
153  static int32_t typeHash() {
154  return -1632905179;
155  }
156 
157 
158  private:
159 
160  std::shared_ptr<ZpbType> m_zpbObj;
161 
162  };
163 
164 } // namespace zpb
165 } // namespace exmalif
166 
167 
168 
169 
170 
171 
172 
173 
174 namespace exmalif {
175 namespace zpb {
176 
177 // generated
179  public virtual ::elt::mal::ps::ZpbDataEntity<::exmalif::AxesPosition> {
180  public:
181  typedef ::generated::zpb::exmalif::AxesPosition ZpbType;
182 
183  AxesPositionImpl(): m_zpbObj(new ::generated::zpb::exmalif::AxesPosition())
184  {}
185 
187  m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<ZpbType*>())
188  {}
189 
190 
191  explicit AxesPositionImpl(const ::generated::zpb::exmalif::AxesPosition& inner):
192  AxesPositionImpl() {
193  *m_zpbObj = inner;
194  }
195 
196  AxesPositionImpl( float alt, float az ): AxesPositionImpl() {
197  setAlt(alt);
198  setAz(az);
199  }
200 
201 
202  AxesPositionImpl(const AxesPositionImpl &rhs): m_zpbObj(rhs.m_zpbObj) {}
203 
204  AxesPositionImpl(AxesPositionImpl &&rhs): m_zpbObj(std::move(rhs.m_zpbObj)) {}
205 
207  copy(that);
208  return *this;
209  }
210 
211  float getAlt() const override {
212  return m_zpbObj->alt();
213  }
214 
215  void setAlt(float alt) override {
216  m_zpbObj->set_alt(alt);
217  }
218  float getAz() const override {
219  return m_zpbObj->az();
220  }
221 
222  void setAz(float az) override {
223  m_zpbObj->set_az(az);
224  }
225 
226  std::unique_ptr<::exmalif::AxesPosition> clone() const override {
227  auto cloned = std::unique_ptr<::exmalif::AxesPosition>(new AxesPositionImpl(getAlt(),getAz()));
228 
229  auto const* traceableDataEntity = dynamic_cast<const ::elt::mal::ps::Traceable*>(this);
230  if (traceableDataEntity) {
231  auto *clonedTraceable = dynamic_cast<::elt::mal::ps::Traceable*>(cloned.get());
232  if (clonedTraceable) {
233  clonedTraceable->setTrace(traceableDataEntity->getTrace());
234  }
235  }
236  return cloned;
237  }
238 
239  bool keyEquals(const ::exmalif::AxesPosition& other) const override {
240  return false;
241  }
242 
243  std::size_t keyHash() const {
244  std::size_t seed = 0;
245  return seed;
246  }
247 
248  std::unique_ptr<::exmalif::AxesPosition> cloneKey() const override {
249  std::unique_ptr<::exmalif::AxesPosition> entity(new AxesPositionImpl());
250  return entity;
251  };
252 
253  bool hasKey() const override {
254  return false;
255  }
256 
257  bool toByteArray(zmq::message_t& msg) const override {
258  msg.rebuild(m_zpbObj->ByteSizeLong());
259  return m_zpbObj->SerializeToArray(msg.data(), msg.size());
260  }
261 
262  bool toByteArray(std::string &output) const override {
263  return m_zpbObj->SerializeToString(&output);
264  }
265 
266  bool fromByteArray(const std::string &data) override {
267  return m_zpbObj->ParseFromString(data);
268  }
269 
270  bool fromByteArray(const void * data, std::size_t size) override {
271  google::protobuf::io::ArrayInputStream ais(data, size);
272  return m_zpbObj->ParseFromZeroCopyStream(&ais);
273  }
274 
275  void copy(const ::exmalif::AxesPosition &from) override {
276  setAlt(from.getAlt());
277  setAz(from.getAz());
278 
279  auto const* traceableFrom = dynamic_cast<const ::elt::mal::ps::Traceable*>(&from);
280  if (traceableFrom) {
281  auto* traceableTo = dynamic_cast<::elt::mal::ps::Traceable*>(this);
282  if (traceableTo) {
283  traceableTo->setTrace(traceableFrom->getTrace());
284  }
285  }
286  }
287 
288  operator ZpbType*() const {
289  return &*m_zpbObj;
290  }
291 
292  static int32_t typeHash() {
293  return -1286306241;
294  }
295 
296 
297  private:
298 
299  std::shared_ptr<ZpbType> m_zpbObj;
300 
301  };
302 
303 } // namespace zpb
304 } // namespace exmalif
305 
306 
307 
308 
309 
310 
311 
312 
313 namespace exmalif {
314 namespace zpb {
315 
316 // generated
317 class LogInfoImpl : public virtual ::exmalif::LogInfo,
318  public virtual ::elt::mal::ps::ZpbDataEntity<::exmalif::LogInfo> {
319  public:
320  typedef ::generated::zpb::exmalif::LogInfo ZpbType;
321 
322  LogInfoImpl(): m_zpbObj(new ::generated::zpb::exmalif::LogInfo())
323  {}
324 
326  m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<ZpbType*>())
327  {}
328 
329 
330  explicit LogInfoImpl(const ::generated::zpb::exmalif::LogInfo& inner):
331  LogInfoImpl() {
332  *m_zpbObj = inner;
333  }
334 
335  LogInfoImpl( const std::string& level, const std::string& logger ): LogInfoImpl() {
336  setLevel(level);
337  setLogger(logger);
338  }
339 
340 
341  LogInfoImpl(const LogInfoImpl &rhs): m_zpbObj(rhs.m_zpbObj) {}
342 
343  LogInfoImpl(LogInfoImpl &&rhs): m_zpbObj(std::move(rhs.m_zpbObj)) {}
344 
346  copy(that);
347  return *this;
348  }
349 
350  std::string getLevel() const override {
351  return m_zpbObj->level();
352  }
353 
354  void setLevel(const std::string& level) override {
355  m_zpbObj->set_level(level);
356  }
357  std::string getLogger() const override {
358  return m_zpbObj->logger();
359  }
360 
361  void setLogger(const std::string& logger) override {
362  m_zpbObj->set_logger(logger);
363  }
364 
365  std::unique_ptr<::exmalif::LogInfo> clone() const override {
366  auto cloned = std::unique_ptr<::exmalif::LogInfo>(new LogInfoImpl(getLevel(),getLogger()));
367 
368  auto const* traceableDataEntity = dynamic_cast<const ::elt::mal::ps::Traceable*>(this);
369  if (traceableDataEntity) {
370  auto *clonedTraceable = dynamic_cast<::elt::mal::ps::Traceable*>(cloned.get());
371  if (clonedTraceable) {
372  clonedTraceable->setTrace(traceableDataEntity->getTrace());
373  }
374  }
375  return cloned;
376  }
377 
378  bool keyEquals(const ::exmalif::LogInfo& other) const override {
379  return false;
380  }
381 
382  std::size_t keyHash() const {
383  std::size_t seed = 0;
384  return seed;
385  }
386 
387  std::unique_ptr<::exmalif::LogInfo> cloneKey() const override {
388  std::unique_ptr<::exmalif::LogInfo> entity(new LogInfoImpl());
389  return entity;
390  };
391 
392  bool hasKey() const override {
393  return false;
394  }
395 
396  bool toByteArray(zmq::message_t& msg) const override {
397  msg.rebuild(m_zpbObj->ByteSizeLong());
398  return m_zpbObj->SerializeToArray(msg.data(), msg.size());
399  }
400 
401  bool toByteArray(std::string &output) const override {
402  return m_zpbObj->SerializeToString(&output);
403  }
404 
405  bool fromByteArray(const std::string &data) override {
406  return m_zpbObj->ParseFromString(data);
407  }
408 
409  bool fromByteArray(const void * data, std::size_t size) override {
410  google::protobuf::io::ArrayInputStream ais(data, size);
411  return m_zpbObj->ParseFromZeroCopyStream(&ais);
412  }
413 
414  void copy(const ::exmalif::LogInfo &from) override {
415  setLevel(from.getLevel());
416  setLogger(from.getLogger());
417 
418  auto const* traceableFrom = dynamic_cast<const ::elt::mal::ps::Traceable*>(&from);
419  if (traceableFrom) {
420  auto* traceableTo = dynamic_cast<::elt::mal::ps::Traceable*>(this);
421  if (traceableTo) {
422  traceableTo->setTrace(traceableFrom->getTrace());
423  }
424  }
425  }
426 
427  operator ZpbType*() const {
428  return &*m_zpbObj;
429  }
430 
431  static int32_t typeHash() {
432  return -1574765012;
433  }
434 
435 
436  private:
437 
438  std::shared_ptr<ZpbType> m_zpbObj;
439 
440  };
441 
442 } // namespace zpb
443 } // namespace exmalif
444 
445 
446 
447 
448 
449 
450 
451 
452 namespace exmalif {
453 namespace zpb {
454 
455 // generated
457  public:
458  typedef ::generated::zpb::exmalif::ExceptionErr ZpbType;
459 
460  ExceptionErrImpl(): m_zpbObj(new ::generated::zpb::exmalif::ExceptionErr())
461  {}
462 
464  m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<ZpbType*>())
465  {}
466 
467 
468  explicit ExceptionErrImpl(const ::generated::zpb::exmalif::ExceptionErr& inner):
469  ExceptionErrImpl() {
470  *m_zpbObj = inner;
471  }
472 
473  explicit ExceptionErrImpl(const ::exmalif::ExceptionErr& malVal):
474  ExceptionErrImpl() {
475  copy(malVal);
476  }
477 
478  ExceptionErrImpl( const std::string& desc, int32_t code ): ExceptionErrImpl() {
479  setDesc(desc);
480  setCode(code);
481  }
482 
483 
484  ExceptionErrImpl(const ExceptionErrImpl &rhs): m_zpbObj(rhs.m_zpbObj)
485  {}
486 
487  ExceptionErrImpl(ExceptionErrImpl &&rhs): m_zpbObj(std::move(rhs.m_zpbObj))
488  {}
489 
491  copy(that);
492  return *this;
493  }
494 
495  std::string getDesc() const override {
496  return m_zpbObj->desc();
497  }
498  int32_t getCode() const override {
499  return m_zpbObj->code();
500  }
501 
502  void copy(const ::exmalif::ExceptionErr &from) {
503  setDesc(from.getDesc());
504  setCode(from.getCode());
505  };
506 
507  operator ZpbType*() const {
508  return &*m_zpbObj;
509  }
510 
511  private:
512  void setDesc(const std::string& desc) {
513  m_zpbObj->set_desc(desc);
514  }
515  void setCode(int32_t code) {
516  m_zpbObj->set_code(code);
517  }
518 
519  std::shared_ptr<ZpbType> m_zpbObj;
520 
521  };
522 
523 } // namespace zpb
524 } // namespace exmalif
525 
526 
527 
528 
529 
530 
531 
532 namespace elt {
533 namespace mal {
534 namespace rr {
535 
536 template<>
538  public AmiZpbHelper<std::string>,
539  public ReplyObserver<::generated::zpb::exmalif::StdCmds_Reply> {
540  public:
541  void updateReply(const ::generated::zpb::exmalif::StdCmds_Reply& reply, bool isPending) {
542  auto& data = reply.data();
543  auto code = reply.header().code();
544 
545  if ((code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) && !isPending) {
546  std::ostringstream errMsg;
547 
548  errMsg << "Code:" << code << " Message:";
549  reply.header().has_exceptionmessage() ?
550  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
551 
552  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
553  handleCompletedExceptionally(::elt::mal::UnhandledRemoteException(errMsg.str())) :
554  handleCompletedExceptionally(::elt::mal::MalException(errMsg.str()));
555 
556  } else if (isPending) {
557  handlePending((std::string)data.getpresetprogress().retval());
558  } else {
559  handleCompleted((std::string)data.getpresetprogress().retval());
560  }
561  }
562 
563  void cancel() {}
564 
565  void timeout() {
566  handleCompletedExceptionally(::elt::mal::TimeoutException("Request timed out"));
567  }
568 };
569 
570 } // namespace rr
571 } // namespace mal
572 } // namespace elt
573 
574 
575 
576 namespace exmalif {
577 namespace zpb {
578 
579 
580 template<typename Intf>
582 
583 
584 template<>
586  : public virtual ::elt::mal::rr::ClientAsyncImpl<::exmalif::StdCmdsAsync,
587  ::generated::zpb::exmalif::StdCmds_Request,
588  ::generated::zpb::exmalif::StdCmds_Reply>,
589  public virtual ::exmalif::StdCmdsAsync {
590  public:
592  const ::elt::mal::Uri &uri,
593  const std::vector<std::shared_ptr<::elt::mal::rr::qos::QoS>> &standardQoS,
594  const ::elt::mal::Mal::Properties &malSpecificProperties,
595  const std::shared_ptr<::elt::mal::ZpbMal> &zpbMal):
596  ::elt::mal::rr::ClientAsyncImpl<::exmalif::StdCmdsAsync,
597  ::generated::zpb::exmalif::StdCmds_Request, ::generated::zpb::exmalif::StdCmds_Reply>(
598  uri, standardQoS, malSpecificProperties, zpbMal) {}
599 
600  ::elt::mal::future<std::string> Stop() override {
603  new ::generated::zpb::exmalif::StdCmds_Stop_In();
604 
605 
606 
607  request.mutable_data()->set_allocated_stop(params_);
608 
609  auto span = ::elt::mal::util::tracing::createSpan(
610  "Stop", {::opentracing::SetTag {
611  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
612 
613  return sendRequest(request, std::move(span)).then([](
614  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
615  auto reply = replyFut.get();
616  auto code = reply.header().code();
617 
618  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
619  std::ostringstream errMsg;
620 
621  errMsg << "Code:" << code << " Message:";
622  reply.header().has_exceptionmessage() ?
623  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
624 
625  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
626  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
627  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
628  }
629  auto data = reply.data();
630  if (data.stop().has_exexceptionerr()) {
631  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.stop().exexceptionerr()));
632  }
633  return (std::string)data.stop().retval();
634  });
635  }
636 
637  ::elt::mal::future<std::string> Init() override {
640  new ::generated::zpb::exmalif::StdCmds_Init_In();
641 
642 
643 
644  request.mutable_data()->set_allocated_init(params_);
645 
646  auto span = ::elt::mal::util::tracing::createSpan(
647  "Init", {::opentracing::SetTag {
648  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
649 
650  return sendRequest(request, std::move(span)).then([](
651  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
652  auto reply = replyFut.get();
653  auto code = reply.header().code();
654 
655  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
656  std::ostringstream errMsg;
657 
658  errMsg << "Code:" << code << " Message:";
659  reply.header().has_exceptionmessage() ?
660  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
661 
662  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
663  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
664  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
665  }
666  auto data = reply.data();
667  if (data.init().has_exexceptionerr()) {
668  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.init().exexceptionerr()));
669  }
670  return (std::string)data.init().retval();
671  });
672  }
673 
674  ::elt::mal::future<std::string> Reset() override {
677  new ::generated::zpb::exmalif::StdCmds_Reset_In();
678 
679 
680 
681  request.mutable_data()->set_allocated_reset(params_);
682 
683  auto span = ::elt::mal::util::tracing::createSpan(
684  "Reset", {::opentracing::SetTag {
685  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
686 
687  return sendRequest(request, std::move(span)).then([](
688  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
689  auto reply = replyFut.get();
690  auto code = reply.header().code();
691 
692  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
693  std::ostringstream errMsg;
694 
695  errMsg << "Code:" << code << " Message:";
696  reply.header().has_exceptionmessage() ?
697  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
698 
699  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
700  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
701  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
702  }
703  auto data = reply.data();
704  if (data.reset().has_exexceptionerr()) {
705  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.reset().exexceptionerr()));
706  }
707  return (std::string)data.reset().retval();
708  });
709  }
710 
711  ::elt::mal::future<std::string> Enable() override {
714  new ::generated::zpb::exmalif::StdCmds_Enable_In();
715 
716 
717 
718  request.mutable_data()->set_allocated_enable(params_);
719 
720  auto span = ::elt::mal::util::tracing::createSpan(
721  "Enable", {::opentracing::SetTag {
722  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
723 
724  return sendRequest(request, std::move(span)).then([](
725  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
726  auto reply = replyFut.get();
727  auto code = reply.header().code();
728 
729  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
730  std::ostringstream errMsg;
731 
732  errMsg << "Code:" << code << " Message:";
733  reply.header().has_exceptionmessage() ?
734  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
735 
736  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
737  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
738  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
739  }
740  auto data = reply.data();
741  if (data.enable().has_exexceptionerr()) {
742  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.enable().exexceptionerr()));
743  }
744  return (std::string)data.enable().retval();
745  });
746  }
747 
748  ::elt::mal::future<std::string> Disable() override {
751  new ::generated::zpb::exmalif::StdCmds_Disable_In();
752 
753 
754 
755  request.mutable_data()->set_allocated_disable(params_);
756 
757  auto span = ::elt::mal::util::tracing::createSpan(
758  "Disable", {::opentracing::SetTag {
759  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
760 
761  return sendRequest(request, std::move(span)).then([](
762  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
763  auto reply = replyFut.get();
764  auto code = reply.header().code();
765 
766  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
767  std::ostringstream errMsg;
768 
769  errMsg << "Code:" << code << " Message:";
770  reply.header().has_exceptionmessage() ?
771  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
772 
773  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
774  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
775  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
776  }
777  auto data = reply.data();
778  if (data.disable().has_exexceptionerr()) {
779  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.disable().exexceptionerr()));
780  }
781  return (std::string)data.disable().retval();
782  });
783  }
784 
785  ::elt::mal::future<std::string> GetState() override {
788  new ::generated::zpb::exmalif::StdCmds_GetState_In();
789 
790 
791 
792  request.mutable_data()->set_allocated_getstate(params_);
793 
794  auto span = ::elt::mal::util::tracing::createSpan(
795  "GetState", {::opentracing::SetTag {
796  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
797 
798  return sendRequest(request, std::move(span)).then([](
799  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
800  auto reply = replyFut.get();
801  auto code = reply.header().code();
802 
803  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
804  std::ostringstream errMsg;
805 
806  errMsg << "Code:" << code << " Message:";
807  reply.header().has_exceptionmessage() ?
808  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
809 
810  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
811  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
812  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
813  }
814  auto data = reply.data();
815  if (data.getstate().has_exexceptionerr()) {
816  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.getstate().exexceptionerr()));
817  }
818  return (std::string)data.getstate().retval();
819  });
820  }
821 
822  ::elt::mal::future<std::string> GetStatus() override {
825  new ::generated::zpb::exmalif::StdCmds_GetStatus_In();
826 
827 
828 
829  request.mutable_data()->set_allocated_getstatus(params_);
830 
831  auto span = ::elt::mal::util::tracing::createSpan(
832  "GetStatus", {::opentracing::SetTag {
833  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
834 
835  return sendRequest(request, std::move(span)).then([](
836  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
837  auto reply = replyFut.get();
838  auto code = reply.header().code();
839 
840  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
841  std::ostringstream errMsg;
842 
843  errMsg << "Code:" << code << " Message:";
844  reply.header().has_exceptionmessage() ?
845  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
846 
847  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
848  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
849  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
850  }
851  auto data = reply.data();
852  if (data.getstatus().has_exexceptionerr()) {
853  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.getstatus().exexceptionerr()));
854  }
855  return (std::string)data.getstatus().retval();
856  });
857  }
858 
859  ::elt::mal::future<std::string> GetVersion() override {
862  new ::generated::zpb::exmalif::StdCmds_GetVersion_In();
863 
864 
865 
866  request.mutable_data()->set_allocated_getversion(params_);
867 
868  auto span = ::elt::mal::util::tracing::createSpan(
869  "GetVersion", {::opentracing::SetTag {
870  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
871 
872  return sendRequest(request, std::move(span)).then([](
873  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
874  auto reply = replyFut.get();
875  auto code = reply.header().code();
876 
877  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
878  std::ostringstream errMsg;
879 
880  errMsg << "Code:" << code << " Message:";
881  reply.header().has_exceptionmessage() ?
882  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
883 
884  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
885  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
886  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
887  }
888  auto data = reply.data();
889  if (data.getversion().has_exexceptionerr()) {
890  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.getversion().exexceptionerr()));
891  }
892  return (std::string)data.getversion().retval();
893  });
894  }
895 
896  ::elt::mal::future<std::string> Config() override {
899  new ::generated::zpb::exmalif::StdCmds_Config_In();
900 
901 
902 
903  request.mutable_data()->set_allocated_config(params_);
904 
905  auto span = ::elt::mal::util::tracing::createSpan(
906  "Config", {::opentracing::SetTag {
907  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
908 
909  return sendRequest(request, std::move(span)).then([](
910  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
911  auto reply = replyFut.get();
912  auto code = reply.header().code();
913 
914  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
915  std::ostringstream errMsg;
916 
917  errMsg << "Code:" << code << " Message:";
918  reply.header().has_exceptionmessage() ?
919  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
920 
921  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
922  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
923  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
924  }
925  auto data = reply.data();
926  if (data.config().has_exexceptionerr()) {
927  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.config().exexceptionerr()));
928  }
929  return (std::string)data.config().retval();
930  });
931  }
932 
933  ::elt::mal::future<std::string> Exit() override {
936  new ::generated::zpb::exmalif::StdCmds_Exit_In();
937 
938 
939 
940  request.mutable_data()->set_allocated_exit(params_);
941 
942  auto span = ::elt::mal::util::tracing::createSpan(
943  "Exit", {::opentracing::SetTag {
944  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
945 
946  return sendRequest(request, std::move(span)).then([](
947  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
948  auto reply = replyFut.get();
949  auto code = reply.header().code();
950 
951  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
952  std::ostringstream errMsg;
953 
954  errMsg << "Code:" << code << " Message:";
955  reply.header().has_exceptionmessage() ?
956  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
957 
958  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
959  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
960  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
961  }
962  auto data = reply.data();
963  if (data.exit().has_exexceptionerr()) {
964  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.exit().exexceptionerr()));
965  }
966  return (std::string)data.exit().retval();
967  });
968  }
969 
970  ::elt::mal::future<std::string> SetLogLevel( const std::shared_ptr<::exmalif::LogInfo>& info) override {
973  new ::generated::zpb::exmalif::StdCmds_SetLogLevel_In();
974 
975 
976  {
977  auto _infoImpl = dynamic_cast< ::exmalif::zpb::LogInfoImpl*>(info.get());
978  if (_infoImpl) {
979  *params_->mutable_info() = **_infoImpl;
980  } else {
982  _tmp.copy(*info);
983  *params_->mutable_info() = **&_tmp;
984  }
985  }
986 
987  request.mutable_data()->set_allocated_setloglevel(params_);
988 
989  auto span = ::elt::mal::util::tracing::createSpan(
990  "SetLogLevel", {::opentracing::SetTag {
991  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
992 
993  return sendRequest(request, std::move(span)).then([](
994  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
995  auto reply = replyFut.get();
996  auto code = reply.header().code();
997 
998  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
999  std::ostringstream errMsg;
1000 
1001  errMsg << "Code:" << code << " Message:";
1002  reply.header().has_exceptionmessage() ?
1003  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
1004 
1005  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
1006  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
1007  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
1008  }
1009  auto data = reply.data();
1010  if (data.setloglevel().has_exexceptionerr()) {
1011  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.setloglevel().exexceptionerr()));
1012  }
1013  return (std::string)data.setloglevel().retval();
1014  });
1015  }
1016 
1017  ::elt::mal::future<std::string> Preset( const std::shared_ptr<::exmalif::TelPosition>& pos) override {
1020  new ::generated::zpb::exmalif::StdCmds_Preset_In();
1021 
1022 
1023  {
1024  auto _posImpl = dynamic_cast< ::exmalif::zpb::TelPositionImpl*>(pos.get());
1025  if (_posImpl) {
1026  *params_->mutable_pos() = **_posImpl;
1027  } else {
1029  _tmp.copy(*pos);
1030  *params_->mutable_pos() = **&_tmp;
1031  }
1032  }
1033 
1034  request.mutable_data()->set_allocated_preset(params_);
1035 
1036  auto span = ::elt::mal::util::tracing::createSpan(
1037  "Preset", {::opentracing::SetTag {
1038  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
1039 
1040  return sendRequest(request, std::move(span)).then([](
1041  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
1042  auto reply = replyFut.get();
1043  auto code = reply.header().code();
1044 
1045  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
1046  std::ostringstream errMsg;
1047 
1048  errMsg << "Code:" << code << " Message:";
1049  reply.header().has_exceptionmessage() ?
1050  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
1051 
1052  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
1053  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
1054  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
1055  }
1056  auto data = reply.data();
1057  return (std::string)data.preset().retval();
1058  });
1059  }
1060 
1061  ::elt::mal::future<std::string> Move( const std::shared_ptr<::exmalif::AxesPosition>& pos) override {
1064  new ::generated::zpb::exmalif::StdCmds_Move_In();
1065 
1066 
1067  {
1068  auto _posImpl = dynamic_cast< ::exmalif::zpb::AxesPositionImpl*>(pos.get());
1069  if (_posImpl) {
1070  *params_->mutable_pos() = **_posImpl;
1071  } else {
1073  _tmp.copy(*pos);
1074  *params_->mutable_pos() = **&_tmp;
1075  }
1076  }
1077 
1078  request.mutable_data()->set_allocated_move(params_);
1079 
1080  auto span = ::elt::mal::util::tracing::createSpan(
1081  "Move", {::opentracing::SetTag {
1082  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
1083 
1084  return sendRequest(request, std::move(span)).then([](
1085  ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
1086  auto reply = replyFut.get();
1087  auto code = reply.header().code();
1088 
1089  if (code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
1090  std::ostringstream errMsg;
1091 
1092  errMsg << "Code:" << code << " Message:";
1093  reply.header().has_exceptionmessage() ?
1094  errMsg << reply.header().exceptionmessage() : errMsg << "Unknown error message";
1095 
1096  code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
1097  ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
1098  ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
1099  }
1100  auto data = reply.data();
1101  if (data.move().has_exexceptionerr()) {
1102  ::elt::mal::throw_exception(::exmalif::zpb::ExceptionErrImpl(data.move().exexceptionerr()));
1103  }
1104  return (std::string)data.move().retval();
1105  });
1106  }
1107 
1108  std::shared_ptr<::elt::mal::rr::Ami<std::string>> GetPresetProgress() override {
1111  new ::generated::zpb::exmalif::StdCmds_GetPresetProgress_In();
1112 
1113 
1114 
1115  request.mutable_data()->set_allocated_getpresetprogress(params_);
1116 
1117  auto span = ::elt::mal::util::tracing::createSpan(
1118  "GetPresetProgress", {::opentracing::SetTag {
1119  ::opentracing::ext::span_kind, ::opentracing::ext::span_kind_rpc_client }});
1120 
1121  auto ami = std::shared_ptr<::elt::mal::rr::Ami<std::string>>(
1122  new ::elt::mal::rr::AmiZpb<std::string, ::generated::zpb::exmalif::StdCmds_Reply,
1124 
1125  auto observer =
1126  std::dynamic_pointer_cast<::elt::mal::rr::ReplyObserver<
1128 
1129  sendRequestWithObserver(request, observer, std::move(span));
1130  return ami;
1131 
1132 }
1133 
1134 };
1135 
1136 
1137 class StdCmdsSyncImpl : virtual public ::exmalif::StdCmdsSync {
1138  public:
1140  const ::elt::mal::Uri &uri,
1141  const std::vector<std::shared_ptr<::elt::mal::rr::qos::QoS>> &standardQoS,
1142  const ::elt::mal::Mal::Properties &malSpecificProperties,
1143  const std::shared_ptr<::elt::mal::ZpbMal> &zpbMal)
1144  : m_delegate(uri, standardQoS, malSpecificProperties, zpbMal), m_timeoutMs{} {
1145  m_timeoutMs = ::elt::mal::util::getReplyTimeQoS(standardQoS);
1146  }
1147 
1148  std::shared_ptr<::elt::mal::Mal> getMal() const override {
1149  return m_delegate.getMal();
1150  }
1151 
1152  std::string Stop() override {
1153  auto future = m_delegate.Stop();
1154  if (::elt::mal::future_status::ready
1155  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1156  return future.get();
1157  } else {
1158  throw ::elt::mal::TimeoutException("timeout");
1159  }
1160  }
1161 
1162  std::string Init() override {
1163  auto future = m_delegate.Init();
1164  if (::elt::mal::future_status::ready
1165  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1166  return future.get();
1167  } else {
1168  throw ::elt::mal::TimeoutException("timeout");
1169  }
1170  }
1171 
1172  std::string Reset() override {
1173  auto future = m_delegate.Reset();
1174  if (::elt::mal::future_status::ready
1175  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1176  return future.get();
1177  } else {
1178  throw ::elt::mal::TimeoutException("timeout");
1179  }
1180  }
1181 
1182  std::string Enable() override {
1183  auto future = m_delegate.Enable();
1184  if (::elt::mal::future_status::ready
1185  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1186  return future.get();
1187  } else {
1188  throw ::elt::mal::TimeoutException("timeout");
1189  }
1190  }
1191 
1192  std::string Disable() override {
1193  auto future = m_delegate.Disable();
1194  if (::elt::mal::future_status::ready
1195  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1196  return future.get();
1197  } else {
1198  throw ::elt::mal::TimeoutException("timeout");
1199  }
1200  }
1201 
1202  std::string GetState() override {
1203  auto future = m_delegate.GetState();
1204  if (::elt::mal::future_status::ready
1205  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1206  return future.get();
1207  } else {
1208  throw ::elt::mal::TimeoutException("timeout");
1209  }
1210  }
1211 
1212  std::string GetStatus() override {
1213  auto future = m_delegate.GetStatus();
1214  if (::elt::mal::future_status::ready
1215  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1216  return future.get();
1217  } else {
1218  throw ::elt::mal::TimeoutException("timeout");
1219  }
1220  }
1221 
1222  std::string GetVersion() override {
1223  auto future = m_delegate.GetVersion();
1224  if (::elt::mal::future_status::ready
1225  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1226  return future.get();
1227  } else {
1228  throw ::elt::mal::TimeoutException("timeout");
1229  }
1230  }
1231 
1232  std::string Config() override {
1233  auto future = m_delegate.Config();
1234  if (::elt::mal::future_status::ready
1235  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1236  return future.get();
1237  } else {
1238  throw ::elt::mal::TimeoutException("timeout");
1239  }
1240  }
1241 
1242  std::string Exit() override {
1243  auto future = m_delegate.Exit();
1244  if (::elt::mal::future_status::ready
1245  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1246  return future.get();
1247  } else {
1248  throw ::elt::mal::TimeoutException("timeout");
1249  }
1250  }
1251 
1252  std::string SetLogLevel( const std::shared_ptr<::exmalif::LogInfo>& info) override {
1253  auto future = m_delegate.SetLogLevel(info);
1254  if (::elt::mal::future_status::ready
1255  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1256  return future.get();
1257  } else {
1258  throw ::elt::mal::TimeoutException("timeout");
1259  }
1260  }
1261 
1262  std::string Preset( const std::shared_ptr<::exmalif::TelPosition>& pos) override {
1263  auto future = m_delegate.Preset(pos);
1264  if (::elt::mal::future_status::ready
1265  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1266  return future.get();
1267  } else {
1268  throw ::elt::mal::TimeoutException("timeout");
1269  }
1270  }
1271 
1272  std::string Move( const std::shared_ptr<::exmalif::AxesPosition>& pos) override {
1273  auto future = m_delegate.Move(pos);
1274  if (::elt::mal::future_status::ready
1275  == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1276  return future.get();
1277  } else {
1278  throw ::elt::mal::TimeoutException("timeout");
1279  }
1280  }
1281 
1282  std::shared_ptr<::elt::mal::rr::Ami<std::string>> GetPresetProgress() override {
1283  return m_delegate.GetPresetProgress();
1284  }
1285 
1286 
1287 
1288  void close() override {
1289  m_delegate.close();
1290  }
1291 
1292  ::elt::mal::future<void> asyncConnect() override {
1293  return m_delegate.asyncConnect();
1294  }
1295 
1296  ::elt::mal::rr::ListenerRegistration registerConnectionListener(ConnectionListener listener) override {
1297  return m_delegate.registerConnectionListener(listener);
1298  }
1299 
1300  private:
1302  int64_t m_timeoutMs;
1303 };
1304 
1305 
1306 class AsyncStdCmdsImpl : virtual public ::elt::mal::rr::ZpbRrEntity {
1307  public:
1309  ::elt::mal::rr::ZpbServer &zpbServer,
1310  const std::shared_ptr<::exmalif::AsyncStdCmds> &entity,
1311  const std::shared_ptr<::elt::mal::Mal> &mal)
1312  : m_zpbServer(zpbServer), m_entity(entity), m_mal(mal) {}
1313 
1314 
1315  void processRequest(zmq::socket_t &socket,
1316  const std::string &id, const std::string &topicIdFrame,
1317  const std::string &headerFrame,
1318  const ::elt::mal::zpb::rr::ZpbHeader &header) {
1319  if (!::elt::mal::util::getSocketHasRcvMore(socket)) {
1320  std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
1321  new ::elt::mal::zpb::rr::ReplyHeader());
1322 
1323  unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::INVALID_ARGUMENT);
1324  unhandledExReplyHeader->set_exceptionmessage("missing request frame");
1325 
1326  sendReply(socket, id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
1327  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
1328 
1329  return;
1330  }
1331 
1333 
1334  //auto requestStr = ::elt::mal::util::readFrame(socket);
1335  zmq::message_t msgFrame;
1336  socket.recv(&msgFrame, 0);
1337 
1338  if (!request.ParseFromArray(msgFrame.data(), msgFrame.size())) {
1339  std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
1340  new ::elt::mal::zpb::rr::ReplyHeader());
1341 
1342  unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::INVALID_ARGUMENT);
1343  unhandledExReplyHeader->set_exceptionmessage("Invalid Request: Request parsing failed");
1344 
1345  sendReply(socket, id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
1346  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
1347 
1348  return;
1349  }
1350 
1351  auto call = request.mutable_data();
1352 
1353  if (call->has_stop()) {
1354  auto span = std::shared_ptr<::opentracing::Span>();
1355  if (header.has_trace()) {
1356  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1357  "StdCmds::Stop", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1358  span = std::move(spanUnique);
1359  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1360  }
1361  auto params_ = call->mutable_stop();
1362 
1363  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1364  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1365 
1366  ::elt::mal::rr::ServerContextProvider::setInstance<
1367  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1368 
1369  m_entity->Stop().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1370  (::elt::mal::future<std::string> f) {
1371  if (!f.has_exception()) {
1372  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1373  new ::generated::zpb::exmalif::StdCmds_Return());
1374 
1375  auto out = new ::generated::zpb::exmalif::StdCmds_Stop_Out();
1376 
1377  out->set_retval(f.get());
1378 
1379  data->set_allocated_stop(out);
1380  if (span) { span->Finish();}
1381  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1382  } else {
1383  try {
1384  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1385  }
1386  catch (::exmalif::ExceptionErr &e) {
1387  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1388 
1390 
1391  auto out = new ::generated::zpb::exmalif::StdCmds_Stop_Out();
1392 
1393  *out->mutable_exexceptionerr() = **&_ex;
1394 
1395  data->set_allocated_stop(out);
1396  if (span) { span->Finish();}
1397  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1398  } catch (...) {}
1399  if (span) { span->Finish();}
1400  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1401  headerFrame, f.get_exception_ptr());
1402  }
1403  });
1404 
1405  } else if (call->has_init()) {
1406  auto span = std::shared_ptr<::opentracing::Span>();
1407  if (header.has_trace()) {
1408  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1409  "StdCmds::Init", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1410  span = std::move(spanUnique);
1411  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1412  }
1413  auto params_ = call->mutable_init();
1414 
1415  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1416  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1417 
1418  ::elt::mal::rr::ServerContextProvider::setInstance<
1419  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1420 
1421  m_entity->Init().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1422  (::elt::mal::future<std::string> f) {
1423  if (!f.has_exception()) {
1424  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1425  new ::generated::zpb::exmalif::StdCmds_Return());
1426 
1427  auto out = new ::generated::zpb::exmalif::StdCmds_Init_Out();
1428 
1429  out->set_retval(f.get());
1430 
1431  data->set_allocated_init(out);
1432  if (span) { span->Finish();}
1433  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1434  } else {
1435  try {
1436  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1437  }
1438  catch (::exmalif::ExceptionErr &e) {
1439  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1440 
1442 
1443  auto out = new ::generated::zpb::exmalif::StdCmds_Init_Out();
1444 
1445  *out->mutable_exexceptionerr() = **&_ex;
1446 
1447  data->set_allocated_init(out);
1448  if (span) { span->Finish();}
1449  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1450  } catch (...) {}
1451  if (span) { span->Finish();}
1452  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1453  headerFrame, f.get_exception_ptr());
1454  }
1455  });
1456 
1457  } else if (call->has_reset()) {
1458  auto span = std::shared_ptr<::opentracing::Span>();
1459  if (header.has_trace()) {
1460  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1461  "StdCmds::Reset", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1462  span = std::move(spanUnique);
1463  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1464  }
1465  auto params_ = call->mutable_reset();
1466 
1467  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1468  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1469 
1470  ::elt::mal::rr::ServerContextProvider::setInstance<
1471  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1472 
1473  m_entity->Reset().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1474  (::elt::mal::future<std::string> f) {
1475  if (!f.has_exception()) {
1476  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1477  new ::generated::zpb::exmalif::StdCmds_Return());
1478 
1479  auto out = new ::generated::zpb::exmalif::StdCmds_Reset_Out();
1480 
1481  out->set_retval(f.get());
1482 
1483  data->set_allocated_reset(out);
1484  if (span) { span->Finish();}
1485  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1486  } else {
1487  try {
1488  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1489  }
1490  catch (::exmalif::ExceptionErr &e) {
1491  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1492 
1494 
1495  auto out = new ::generated::zpb::exmalif::StdCmds_Reset_Out();
1496 
1497  *out->mutable_exexceptionerr() = **&_ex;
1498 
1499  data->set_allocated_reset(out);
1500  if (span) { span->Finish();}
1501  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1502  } catch (...) {}
1503  if (span) { span->Finish();}
1504  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1505  headerFrame, f.get_exception_ptr());
1506  }
1507  });
1508 
1509  } else if (call->has_enable()) {
1510  auto span = std::shared_ptr<::opentracing::Span>();
1511  if (header.has_trace()) {
1512  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1513  "StdCmds::Enable", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1514  span = std::move(spanUnique);
1515  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1516  }
1517  auto params_ = call->mutable_enable();
1518 
1519  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1520  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1521 
1522  ::elt::mal::rr::ServerContextProvider::setInstance<
1523  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1524 
1525  m_entity->Enable().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1526  (::elt::mal::future<std::string> f) {
1527  if (!f.has_exception()) {
1528  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1529  new ::generated::zpb::exmalif::StdCmds_Return());
1530 
1531  auto out = new ::generated::zpb::exmalif::StdCmds_Enable_Out();
1532 
1533  out->set_retval(f.get());
1534 
1535  data->set_allocated_enable(out);
1536  if (span) { span->Finish();}
1537  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1538  } else {
1539  try {
1540  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1541  }
1542  catch (::exmalif::ExceptionErr &e) {
1543  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1544 
1546 
1547  auto out = new ::generated::zpb::exmalif::StdCmds_Enable_Out();
1548 
1549  *out->mutable_exexceptionerr() = **&_ex;
1550 
1551  data->set_allocated_enable(out);
1552  if (span) { span->Finish();}
1553  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1554  } catch (...) {}
1555  if (span) { span->Finish();}
1556  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1557  headerFrame, f.get_exception_ptr());
1558  }
1559  });
1560 
1561  } else if (call->has_disable()) {
1562  auto span = std::shared_ptr<::opentracing::Span>();
1563  if (header.has_trace()) {
1564  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1565  "StdCmds::Disable", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1566  span = std::move(spanUnique);
1567  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1568  }
1569  auto params_ = call->mutable_disable();
1570 
1571  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1572  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1573 
1574  ::elt::mal::rr::ServerContextProvider::setInstance<
1575  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1576 
1577  m_entity->Disable().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1578  (::elt::mal::future<std::string> f) {
1579  if (!f.has_exception()) {
1580  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1581  new ::generated::zpb::exmalif::StdCmds_Return());
1582 
1583  auto out = new ::generated::zpb::exmalif::StdCmds_Disable_Out();
1584 
1585  out->set_retval(f.get());
1586 
1587  data->set_allocated_disable(out);
1588  if (span) { span->Finish();}
1589  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1590  } else {
1591  try {
1592  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1593  }
1594  catch (::exmalif::ExceptionErr &e) {
1595  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1596 
1598 
1599  auto out = new ::generated::zpb::exmalif::StdCmds_Disable_Out();
1600 
1601  *out->mutable_exexceptionerr() = **&_ex;
1602 
1603  data->set_allocated_disable(out);
1604  if (span) { span->Finish();}
1605  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1606  } catch (...) {}
1607  if (span) { span->Finish();}
1608  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1609  headerFrame, f.get_exception_ptr());
1610  }
1611  });
1612 
1613  } else if (call->has_getstate()) {
1614  auto span = std::shared_ptr<::opentracing::Span>();
1615  if (header.has_trace()) {
1616  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1617  "StdCmds::GetState", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1618  span = std::move(spanUnique);
1619  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1620  }
1621  auto params_ = call->mutable_getstate();
1622 
1623  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1624  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1625 
1626  ::elt::mal::rr::ServerContextProvider::setInstance<
1627  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1628 
1629  m_entity->GetState().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1630  (::elt::mal::future<std::string> f) {
1631  if (!f.has_exception()) {
1632  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1633  new ::generated::zpb::exmalif::StdCmds_Return());
1634 
1635  auto out = new ::generated::zpb::exmalif::StdCmds_GetState_Out();
1636 
1637  out->set_retval(f.get());
1638 
1639  data->set_allocated_getstate(out);
1640  if (span) { span->Finish();}
1641  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1642  } else {
1643  try {
1644  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1645  }
1646  catch (::exmalif::ExceptionErr &e) {
1647  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1648 
1650 
1651  auto out = new ::generated::zpb::exmalif::StdCmds_GetState_Out();
1652 
1653  *out->mutable_exexceptionerr() = **&_ex;
1654 
1655  data->set_allocated_getstate(out);
1656  if (span) { span->Finish();}
1657  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1658  } catch (...) {}
1659  if (span) { span->Finish();}
1660  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1661  headerFrame, f.get_exception_ptr());
1662  }
1663  });
1664 
1665  } else if (call->has_getstatus()) {
1666  auto span = std::shared_ptr<::opentracing::Span>();
1667  if (header.has_trace()) {
1668  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1669  "StdCmds::GetStatus", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1670  span = std::move(spanUnique);
1671  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1672  }
1673  auto params_ = call->mutable_getstatus();
1674 
1675  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1676  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1677 
1678  ::elt::mal::rr::ServerContextProvider::setInstance<
1679  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1680 
1681  m_entity->GetStatus().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1682  (::elt::mal::future<std::string> f) {
1683  if (!f.has_exception()) {
1684  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1685  new ::generated::zpb::exmalif::StdCmds_Return());
1686 
1687  auto out = new ::generated::zpb::exmalif::StdCmds_GetStatus_Out();
1688 
1689  out->set_retval(f.get());
1690 
1691  data->set_allocated_getstatus(out);
1692  if (span) { span->Finish();}
1693  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1694  } else {
1695  try {
1696  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1697  }
1698  catch (::exmalif::ExceptionErr &e) {
1699  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1700 
1702 
1703  auto out = new ::generated::zpb::exmalif::StdCmds_GetStatus_Out();
1704 
1705  *out->mutable_exexceptionerr() = **&_ex;
1706 
1707  data->set_allocated_getstatus(out);
1708  if (span) { span->Finish();}
1709  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1710  } catch (...) {}
1711  if (span) { span->Finish();}
1712  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1713  headerFrame, f.get_exception_ptr());
1714  }
1715  });
1716 
1717  } else if (call->has_getversion()) {
1718  auto span = std::shared_ptr<::opentracing::Span>();
1719  if (header.has_trace()) {
1720  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1721  "StdCmds::GetVersion", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1722  span = std::move(spanUnique);
1723  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1724  }
1725  auto params_ = call->mutable_getversion();
1726 
1727  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1728  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1729 
1730  ::elt::mal::rr::ServerContextProvider::setInstance<
1731  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1732 
1733  m_entity->GetVersion().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1734  (::elt::mal::future<std::string> f) {
1735  if (!f.has_exception()) {
1736  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1737  new ::generated::zpb::exmalif::StdCmds_Return());
1738 
1739  auto out = new ::generated::zpb::exmalif::StdCmds_GetVersion_Out();
1740 
1741  out->set_retval(f.get());
1742 
1743  data->set_allocated_getversion(out);
1744  if (span) { span->Finish();}
1745  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1746  } else {
1747  try {
1748  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1749  }
1750  catch (::exmalif::ExceptionErr &e) {
1751  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1752 
1754 
1755  auto out = new ::generated::zpb::exmalif::StdCmds_GetVersion_Out();
1756 
1757  *out->mutable_exexceptionerr() = **&_ex;
1758 
1759  data->set_allocated_getversion(out);
1760  if (span) { span->Finish();}
1761  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1762  } catch (...) {}
1763  if (span) { span->Finish();}
1764  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1765  headerFrame, f.get_exception_ptr());
1766  }
1767  });
1768 
1769  } else if (call->has_config()) {
1770  auto span = std::shared_ptr<::opentracing::Span>();
1771  if (header.has_trace()) {
1772  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1773  "StdCmds::Config", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1774  span = std::move(spanUnique);
1775  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1776  }
1777  auto params_ = call->mutable_config();
1778 
1779  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1780  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1781 
1782  ::elt::mal::rr::ServerContextProvider::setInstance<
1783  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1784 
1785  m_entity->Config().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1786  (::elt::mal::future<std::string> f) {
1787  if (!f.has_exception()) {
1788  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1789  new ::generated::zpb::exmalif::StdCmds_Return());
1790 
1791  auto out = new ::generated::zpb::exmalif::StdCmds_Config_Out();
1792 
1793  out->set_retval(f.get());
1794 
1795  data->set_allocated_config(out);
1796  if (span) { span->Finish();}
1797  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1798  } else {
1799  try {
1800  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1801  }
1802  catch (::exmalif::ExceptionErr &e) {
1803  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1804 
1806 
1807  auto out = new ::generated::zpb::exmalif::StdCmds_Config_Out();
1808 
1809  *out->mutable_exexceptionerr() = **&_ex;
1810 
1811  data->set_allocated_config(out);
1812  if (span) { span->Finish();}
1813  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1814  } catch (...) {}
1815  if (span) { span->Finish();}
1816  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1817  headerFrame, f.get_exception_ptr());
1818  }
1819  });
1820 
1821  } else if (call->has_exit()) {
1822  auto span = std::shared_ptr<::opentracing::Span>();
1823  if (header.has_trace()) {
1824  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1825  "StdCmds::Exit", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1826  span = std::move(spanUnique);
1827  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1828  }
1829  auto params_ = call->mutable_exit();
1830 
1831  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1832  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1833 
1834  ::elt::mal::rr::ServerContextProvider::setInstance<
1835  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1836 
1837  m_entity->Exit().then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1838  (::elt::mal::future<std::string> f) {
1839  if (!f.has_exception()) {
1840  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1841  new ::generated::zpb::exmalif::StdCmds_Return());
1842 
1843  auto out = new ::generated::zpb::exmalif::StdCmds_Exit_Out();
1844 
1845  out->set_retval(f.get());
1846 
1847  data->set_allocated_exit(out);
1848  if (span) { span->Finish();}
1849  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1850  } else {
1851  try {
1852  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1853  }
1854  catch (::exmalif::ExceptionErr &e) {
1855  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1856 
1858 
1859  auto out = new ::generated::zpb::exmalif::StdCmds_Exit_Out();
1860 
1861  *out->mutable_exexceptionerr() = **&_ex;
1862 
1863  data->set_allocated_exit(out);
1864  if (span) { span->Finish();}
1865  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1866  } catch (...) {}
1867  if (span) { span->Finish();}
1868  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1869  headerFrame, f.get_exception_ptr());
1870  }
1871  });
1872 
1873  } else if (call->has_setloglevel()) {
1874  auto span = std::shared_ptr<::opentracing::Span>();
1875  if (header.has_trace()) {
1876  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1877  "StdCmds::SetLogLevel", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1878  span = std::move(spanUnique);
1879  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1880  }
1881  auto params_ = call->mutable_setloglevel();
1882 
1883  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1884  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1885 
1886  ::elt::mal::rr::ServerContextProvider::setInstance<
1887  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1888 
1889  m_entity->SetLogLevel(std::shared_ptr< ::exmalif::LogInfo>(new ::exmalif::zpb::LogInfoImpl(params_->mutable_info()))).then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1890  (::elt::mal::future<std::string> f) {
1891  if (!f.has_exception()) {
1892  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1893  new ::generated::zpb::exmalif::StdCmds_Return());
1894 
1895  auto out = new ::generated::zpb::exmalif::StdCmds_SetLogLevel_Out();
1896 
1897  out->set_retval(f.get());
1898 
1899  data->set_allocated_setloglevel(out);
1900  if (span) { span->Finish();}
1901  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1902  } else {
1903  try {
1904  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1905  }
1906  catch (::exmalif::ExceptionErr &e) {
1907  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1908 
1910 
1911  auto out = new ::generated::zpb::exmalif::StdCmds_SetLogLevel_Out();
1912 
1913  *out->mutable_exexceptionerr() = **&_ex;
1914 
1915  data->set_allocated_setloglevel(out);
1916  if (span) { span->Finish();}
1917  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1918  } catch (...) {}
1919  if (span) { span->Finish();}
1920  sendUnhandledExceptionReply(socket, id, topicIdFrame,
1921  headerFrame, f.get_exception_ptr());
1922  }
1923  });
1924 
1925  } else if (call->has_preset()) {
1926  auto span = std::shared_ptr<::opentracing::Span>();
1927  if (header.has_trace()) {
1928  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1929  "StdCmds::Preset", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1930  span = std::move(spanUnique);
1931  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1932  }
1933  auto params_ = call->mutable_preset();
1934 
1935  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1936  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1937 
1938  ::elt::mal::rr::ServerContextProvider::setInstance<
1939  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1940 
1941  m_entity->Preset(std::shared_ptr< ::exmalif::TelPosition>(new ::exmalif::zpb::TelPositionImpl(params_->mutable_pos()))).then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1942  (::elt::mal::future<std::string> f) {
1943  if (!f.has_exception()) {
1944  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1945  new ::generated::zpb::exmalif::StdCmds_Return());
1946 
1947  auto out = new ::generated::zpb::exmalif::StdCmds_Preset_Out();
1948 
1949  out->set_retval(f.get());
1950 
1951  data->set_allocated_preset(out);
1952  if (span) { span->Finish();}
1953  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1954  } else {
1955  if (span) { span->Finish();}
1956  sendUnhandledExceptionReply(socket, id, topicIdFrame, headerFrame, f.get_exception_ptr());
1957  }
1958  });
1959 
1960  } else if (call->has_move()) {
1961  auto span = std::shared_ptr<::opentracing::Span>();
1962  if (header.has_trace()) {
1963  auto spanUnique = ::elt::mal::util::tracing::createSpan(
1964  "StdCmds::Move", header.trace(), ::opentracing::ext::span_kind_rpc_server);
1965  span = std::move(spanUnique);
1966  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
1967  }
1968  auto params_ = call->mutable_move();
1969 
1970  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1971  new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1972 
1973  ::elt::mal::rr::ServerContextProvider::setInstance<
1974  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1975 
1976  m_entity->Move(std::shared_ptr< ::exmalif::AxesPosition>(new ::exmalif::zpb::AxesPositionImpl(params_->mutable_pos()))).then(m_zpbServer.getExecutor(), [this, &socket, id, topicIdFrame, headerFrame, params_, span]
1977  (::elt::mal::future<std::string> f) {
1978  if (!f.has_exception()) {
1979  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1980  new ::generated::zpb::exmalif::StdCmds_Return());
1981 
1982  auto out = new ::generated::zpb::exmalif::StdCmds_Move_Out();
1983 
1984  out->set_retval(f.get());
1985 
1986  data->set_allocated_move(out);
1987  if (span) { span->Finish();}
1988  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
1989  } else {
1990  try {
1991  ::elt::mal::rethrow_exception(f.get_exception_ptr());
1992  }
1993  catch (::exmalif::ExceptionErr &e) {
1994  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1995 
1997 
1998  auto out = new ::generated::zpb::exmalif::StdCmds_Move_Out();
1999 
2000  *out->mutable_exexceptionerr() = **&_ex;
2001 
2002  data->set_allocated_move(out);
2003  if (span) { span->Finish();}
2004  sendCompletedReply(socket, id, topicIdFrame, headerFrame, std::move(data));
2005  } catch (...) {}
2006  if (span) { span->Finish();}
2007  sendUnhandledExceptionReply(socket, id, topicIdFrame,
2008  headerFrame, f.get_exception_ptr());
2009  }
2010  });
2011 
2012  } else if (call->has_getpresetprogress()) {
2013  auto span = std::shared_ptr<::opentracing::Span>();
2014  if (header.has_trace()) {
2015  auto spanUnique = ::elt::mal::util::tracing::createSpan(
2016  "StdCmds::GetPresetProgress", header.trace(), ::opentracing::ext::span_kind_rpc_server);
2017  span = std::move(spanUnique);
2018  ::elt::mal::util::tracing::ScopeManagerFactory::getScopeManager().activate(span);
2019  }
2020  auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
2021  new ::elt::mal::rr::ServerContextZpbAmi<std::string,
2024  *this, socket, id, topicIdFrame, headerFrame, header, m_mal));
2025 
2026  ::elt::mal::rr::ServerContextProvider::setInstance<
2027  ::elt::mal::rr::ServerContext<std::string>>(serverContext);
2028 
2029  try {
2030  m_entity->GetPresetProgress();
2031  } catch (std::exception &e) {
2032  auto ami = ::elt::mal::rr::ServerContextProvider::getInstance<
2033  ::elt::mal::rr::ServerContext<float>>().createAmi();
2034  if (ami) {
2035  ami->completeExceptionally(e);
2036  }
2037  }
2038 
2039 } else {
2040 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
2041  new ::elt::mal::zpb::rr::ReplyHeader());
2042 
2043 unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::UNKNOWN_OPERATION);
2044 
2045 sendReply(socket, id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
2046  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
2047 }
2048  }
2049 
2051  zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame,
2052  const std::string &headerFrame,
2053  std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> replyHeader,
2054  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data) {
2056 
2057  reply.set_allocated_header(replyHeader.release());
2058 
2059  if (data) {
2060  reply.set_allocated_data(data.release());
2061  }
2062 
2063  auto replyStr = reply.SerializeAsString();
2064 
2065  m_zpbServer.sendReply(socket, id, topicIdFrame, headerFrame, replyStr);
2066  }
2067 
2069  zmq::socket_t &socket, const std::string &id,
2070  const std::string &topicIdFrame, const std::string &headerFrame,
2071  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data) {
2072  std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> completedReplyHeader(
2073  new ::elt::mal::zpb::rr::ReplyHeader());
2074 
2075  completedReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::COMPLETED);
2076 
2077  sendReply(socket, id, topicIdFrame, headerFrame,
2078  std::move(completedReplyHeader), std::move(data));
2079  }
2080 
2082  zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame,
2083  const std::string &headerFrame, ::elt::mal::exception_ptr exceptionPtr) {
2084  std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
2085  new ::elt::mal::zpb::rr::ReplyHeader());
2086 
2087  unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION);
2088 
2089  std::string exceptionMessage = "Unknown";
2090 
2091  try {
2092  ::elt::mal::rethrow_exception(exceptionPtr);
2093  } catch (std::exception &e) {
2094  exceptionMessage = e.what();
2095  } catch (...) {}
2096 
2097  unhandledExReplyHeader->set_exceptionmessage(exceptionMessage);
2098 
2099  sendReply(socket, id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
2100  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
2101  }
2102 
2103  private:
2104  ::elt::mal::rr::ZpbServer &m_zpbServer;
2105  std::shared_ptr<::exmalif::AsyncStdCmds> m_entity;
2106  const std::shared_ptr<::elt::mal::Mal>& m_mal;
2107 };
2108 
2109 
2110 } // namespace zpb
2111 } // namespace exmalif
2112 
2113 
2114 
2115 namespace elt {
2116 namespace mal {
2117 namespace rr {
2118 
2119 
2120 template<>
2122  public ::elt::mal::rr::ServerAmi<std::string> {
2123  public:
2125  zmq::socket_t &socket,
2126  const std::string &id,
2127  const std::string &topicIdFrame,
2128  const std::string &headerFrame,
2129  const ::elt::mal::zpb::rr::ZpbHeader &header) :
2130  m_replier(replier),
2131  m_socket(socket),
2132  m_id(id),
2133  m_topicIdFrame(topicIdFrame),
2134  m_headerFrame(headerFrame),
2135  m_header(header) {}
2136 
2137  bool complete(const std::string& status) override {
2138  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
2139  new ::generated::zpb::exmalif::StdCmds_Return());
2140 
2141  std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> replyHeader(
2142  new ::elt::mal::zpb::rr::ReplyHeader());
2143 
2144  replyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::PENDING);
2145 
2146  data->mutable_getpresetprogress()->set_retval(status);
2147 
2148  m_replier.sendReply(m_socket, m_id, m_topicIdFrame,
2149  m_headerFrame, std::move(replyHeader), std::move(data));
2150 
2151  return true;
2152  }
2153 
2154  bool completeExceptionally(const std::exception &ex) override {
2155  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
2156  new ::generated::zpb::exmalif::StdCmds_Return());
2157 
2158  m_replier.sendUnhandledExceptionReply(m_socket, m_id, m_topicIdFrame,
2159  m_headerFrame, boost::copy_exception(ex));
2160  m_isCompleted = true;
2161  return true;
2162  }
2163 
2164  bool completed(const std::string& status) override {
2165  std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
2166  new ::generated::zpb::exmalif::StdCmds_Return());
2167 
2168  data->mutable_getpresetprogress()->set_retval(status);
2169 
2170  m_replier.sendCompletedReply(m_socket, m_id, m_topicIdFrame,
2171  m_headerFrame, std::move(data));
2172 
2173  m_isCompleted = true;
2174  return true;
2175  }
2176 
2177  bool isDone() override {
2178  return m_isCompleted;
2179  }
2180 
2181  future_type next() override {
2182  return future_type();
2183  }
2184 
2185  private:
2187 
2188  // replier arguments
2189 
2190  zmq::socket_t &m_socket;
2191  const std::string m_id;
2192  const std::string m_topicIdFrame;
2193  const std::string m_headerFrame;
2194  const ::elt::mal::zpb::rr::ZpbHeader m_header;
2195  bool m_isCompleted = false;
2196 };
2197 
2198 
2199 } // namespace rr
2200 } // namespace mal
2201 } // namespace elt
2202 
2203 
2204 
2205 
2206 
2207 
generated::zpb::exmalif::StdCmds_Enable_In
Definition: exmalif.pb.h:1054
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Init
::elt::mal::future< std::string > Init() override
Definition: ZpbExmalifImpl.hpp:637
generated
Definition: exmalif.pb.h:50
generated::zpb::exmalif::StdCmds_Call::set_allocated_exit
void set_allocated_exit(::generated::zpb::exmalif::StdCmds_Exit_In *exit)
hellorad.level
level
Definition: hellorad.py:30
generated::zpb::exmalif::StdCmds_Call::set_allocated_getstatus
void set_allocated_getstatus(::generated::zpb::exmalif::StdCmds_GetStatus_In *getstatus)
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::GetStatus
::elt::mal::future< std::string > GetStatus() override
Definition: ZpbExmalifImpl.hpp:822
exmalif::zpb::LogInfoImpl::clone
std::unique_ptr<::exmalif::LogInfo > clone() const override
Definition: ZpbExmalifImpl.hpp:365
elt::mal::rr::ServerAmiZpb< std::string, ::exmalif::zpb::AsyncStdCmdsImpl, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::completeExceptionally
bool completeExceptionally(const std::exception &ex) override
Definition: ZpbExmalifImpl.hpp:2154
exmalif::zpb::StdCmdsSyncImpl::GetPresetProgress
std::shared_ptr<::elt::mal::rr::Ami< std::string > > GetPresetProgress() override
Definition: ZpbExmalifImpl.hpp:1282
exmalif::zpb::LogInfoImpl::LogInfoImpl
LogInfoImpl(const LogInfoImpl &rhs)
Definition: ZpbExmalifImpl.hpp:341
exmalif::zpb::StdCmdsSyncImpl::Exit
std::string Exit() override
Definition: ZpbExmalifImpl.hpp:1242
exmalif::zpb::StdCmdsAsyncImpl
Definition: ZpbExmalifImpl.hpp:581
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Reset
::elt::mal::future< std::string > Reset() override
Definition: ZpbExmalifImpl.hpp:674
exmalif::zpb::AsyncStdCmdsImpl::processRequest
void processRequest(zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame, const std::string &headerFrame, const ::elt::mal::zpb::rr::ZpbHeader &header)
Definition: ZpbExmalifImpl.hpp:1315
generated::zpb::exmalif::StdCmds_Disable_In
Definition: exmalif.pb.h:1158
exmalif::zpb::TelPositionImpl::hasKey
bool hasKey() const override
Definition: ZpbExmalifImpl.hpp:114
exmalif::zpb::LogInfoImpl::cloneKey
std::unique_ptr<::exmalif::LogInfo > cloneKey() const override
Definition: ZpbExmalifImpl.hpp:387
exmalif::zpb::TelPositionImpl::TelPositionImpl
TelPositionImpl(::generated::zpb::exmalif::TelPosition *inner)
Definition: ZpbExmalifImpl.hpp:47
exmalif::zpb::TelPositionImpl::copy
void copy(const ::exmalif::TelPosition &from) override
Definition: ZpbExmalifImpl.hpp:136
exmalif::zpb::LogInfoImpl::hasKey
bool hasKey() const override
Definition: ZpbExmalifImpl.hpp:392
exmalif::zpb::AxesPositionImpl::keyEquals
bool keyEquals(const ::exmalif::AxesPosition &other) const override
Definition: ZpbExmalifImpl.hpp:239
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::SetLogLevel
::elt::mal::future< std::string > SetLogLevel(const std::shared_ptr<::exmalif::LogInfo > &info) override
Definition: ZpbExmalifImpl.hpp:970
generated::zpb::exmalif::StdCmds_Reply::set_allocated_header
void set_allocated_header(::elt::mal::zpb::rr::ReplyHeader *header)
Definition: exmalif.pb.h:8716
generated::zpb::exmalif::TelPosition
Definition: exmalif.pb.h:210
exmalif::zpb::TelPositionImpl::cloneKey
std::unique_ptr<::exmalif::TelPosition > cloneKey() const override
Definition: ZpbExmalifImpl.hpp:109
generated::zpb::exmalif::StdCmds_GetPresetProgress_Out
Definition: exmalif.pb.h:4474
generated::zpb::exmalif::StdCmds_Call::set_allocated_enable
void set_allocated_enable(::generated::zpb::exmalif::StdCmds_Enable_In *enable)
exmalif::zpb::AxesPositionImpl::setAlt
void setAlt(float alt) override
Definition: ZpbExmalifImpl.hpp:215
exmalif::zpb::ExceptionErrImpl::getDesc
std::string getDesc() const override
Definition: ZpbExmalifImpl.hpp:495
generated::zpb::exmalif::StdCmds_Call::set_allocated_config
void set_allocated_config(::generated::zpb::exmalif::StdCmds_Config_In *config)
elt::mal::rr::ServerAmiZpb< std::string, ::exmalif::zpb::AsyncStdCmdsImpl, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::isDone
bool isDone() override
Definition: ZpbExmalifImpl.hpp:2177
generated::zpb::exmalif::AxesPosition
Definition: exmalif.pb.h:337
exmalif::zpb::AxesPositionImpl::getAlt
float getAlt() const override
Definition: ZpbExmalifImpl.hpp:211
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Move
::elt::mal::future< std::string > Move(const std::shared_ptr<::exmalif::AxesPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:1061
exmalif::zpb::StdCmdsSyncImpl::Disable
std::string Disable() override
Definition: ZpbExmalifImpl.hpp:1192
exmalif::zpb::StdCmdsSyncImpl::Reset
std::string Reset() override
Definition: ZpbExmalifImpl.hpp:1172
exmalif::zpb::TelPositionImpl
Definition: ZpbExmalifImpl.hpp:40
exmalif::zpb::LogInfoImpl::toByteArray
bool toByteArray(zmq::message_t &msg) const override
Definition: ZpbExmalifImpl.hpp:396
exmalif::zpb::TelPositionImpl::clone
std::unique_ptr<::exmalif::TelPosition > clone() const override
Definition: ZpbExmalifImpl.hpp:87
generated::zpb::exmalif::StdCmds_SetLogLevel_In
Definition: exmalif.pb.h:1782
generated::zpb::exmalif::StdCmds_Move_In
Definition: exmalif.pb.h:2020
exmalif::zpb::AxesPositionImpl::fromByteArray
bool fromByteArray(const void *data, std::size_t size) override
Definition: ZpbExmalifImpl.hpp:270
exmalif::zpb::TelPositionImpl::TelPositionImpl
TelPositionImpl(TelPositionImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:65
exmalif::zpb::StdCmdsSyncImpl::Stop
std::string Stop() override
Definition: ZpbExmalifImpl.hpp:1152
generated::zpb::exmalif::StdCmds_Call::set_allocated_setloglevel
void set_allocated_setloglevel(::generated::zpb::exmalif::StdCmds_SetLogLevel_In *setloglevel)
elt::mal::rr::ServerAmiZpb< std::string, ::exmalif::zpb::AsyncStdCmdsImpl, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::next
future_type next() override
Definition: ZpbExmalifImpl.hpp:2181
exmalif::zpb::StdCmdsSyncImpl::Enable
std::string Enable() override
Definition: ZpbExmalifImpl.hpp:1182
generated::zpb::exmalif::StdCmds_Call::set_allocated_preset
void set_allocated_preset(::generated::zpb::exmalif::StdCmds_Preset_In *preset)
generated::zpb::exmalif::StdCmds_Call::set_allocated_stop
void set_allocated_stop(::generated::zpb::exmalif::StdCmds_Stop_In *stop)
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::StdCmdsAsyncImpl
StdCmdsAsyncImpl(const ::elt::mal::Uri &uri, const std::vector< std::shared_ptr<::elt::mal::rr::qos::QoS >> &standardQoS, const ::elt::mal::Mal::Properties &malSpecificProperties, const std::shared_ptr<::elt::mal::ZpbMal > &zpbMal)
Definition: ZpbExmalifImpl.hpp:591
exmalif::zpb::ExceptionErrImpl
Definition: ZpbExmalifImpl.hpp:456
elt::mal::rr::ServerAmiZpb< std::string, ::exmalif::zpb::AsyncStdCmdsImpl, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::complete
bool complete(const std::string &status) override
Definition: ZpbExmalifImpl.hpp:2137
exmalif::zpb::AxesPositionImpl::copy
void copy(const ::exmalif::AxesPosition &from) override
Definition: ZpbExmalifImpl.hpp:275
generated::zpb::exmalif::StdCmds_Exit_In
Definition: exmalif.pb.h:1678
exmalif::zpb::TelPositionImpl::toByteArray
bool toByteArray(zmq::message_t &msg) const override
Definition: ZpbExmalifImpl.hpp:118
exmalif::zpb::TelPositionImpl::typeHash
static int32_t typeHash()
Definition: ZpbExmalifImpl.hpp:153
exmalif::zpb::ExceptionErrImpl::ZpbType
::generated::zpb::exmalif::ExceptionErr ZpbType
Definition: ZpbExmalifImpl.hpp:458
exmalif::zpb::StdCmdsSyncImpl::Preset
std::string Preset(const std::shared_ptr<::exmalif::TelPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:1262
generated::zpb::exmalif::StdCmds_Call::set_allocated_getpresetprogress
void set_allocated_getpresetprogress(::generated::zpb::exmalif::StdCmds_GetPresetProgress_In *getpresetprogress)
elt::mal::rr::AmiZpb< std::string, ::generated::zpb::exmalif::StdCmds_Reply, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::cancel
void cancel()
Definition: ZpbExmalifImpl.hpp:563
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Config
::elt::mal::future< std::string > Config() override
Definition: ZpbExmalifImpl.hpp:896
scxml4py.activity.logger
logger
Definition: activity.py:32
generated::zpb::exmalif::StdCmds_Config_In
Definition: exmalif.pb.h:1574
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Enable
::elt::mal::future< std::string > Enable() override
Definition: ZpbExmalifImpl.hpp:711
exmalif::zpb::TelPositionImpl::TelPositionImpl
TelPositionImpl()
Definition: ZpbExmalifImpl.hpp:44
exmalif::zpb::StdCmdsSyncImpl::Init
std::string Init() override
Definition: ZpbExmalifImpl.hpp:1162
exmalif::zpb::LogInfoImpl::operator=
LogInfoImpl & operator=(const LogInfoImpl &that)
Definition: ZpbExmalifImpl.hpp:345
generated::zpb::exmalif::StdCmds_Request::mutable_data
::generated::zpb::exmalif::StdCmds_Call * mutable_data()
Definition: exmalif.pb.h:6344
exmalif::zpb::ExceptionErrImpl::copy
void copy(const ::exmalif::ExceptionErr &from)
Definition: ZpbExmalifImpl.hpp:502
exmalif::zpb::LogInfoImpl::LogInfoImpl
LogInfoImpl(const std::string &level, const std::string &logger)
Definition: ZpbExmalifImpl.hpp:335
exmalif::zpb::StdCmdsSyncImpl::Move
std::string Move(const std::shared_ptr<::exmalif::AxesPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:1272
generated::zpb::exmalif::LogInfo
Definition: exmalif.pb.h:464
exmalif::zpb::TelPositionImpl::TelPositionImpl
TelPositionImpl(float ra, float dec)
Definition: ZpbExmalifImpl.hpp:57
generated::zpb::exmalif::StdCmds_SetLogLevel_In::mutable_info
::generated::zpb::exmalif::LogInfo * mutable_info()
Definition: exmalif.pb.h:5471
generated::zpb::exmalif::StdCmds_Preset_In
Definition: exmalif.pb.h:1901
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl(const std::string &desc, int32_t code)
Definition: ZpbExmalifImpl.hpp:478
generated::zpb::exmalif::StdCmds_Init_In
Definition: exmalif.pb.h:846
exmalif::StdCmdsSync
Definition: Exmalif.hpp:183
exmalif::zpb::LogInfoImpl::setLogger
void setLogger(const std::string &logger) override
Definition: ZpbExmalifImpl.hpp:361
generated::zpb::exmalif::StdCmds_Preset_In::mutable_pos
::generated::zpb::exmalif::TelPosition * mutable_pos()
Definition: exmalif.pb.h:5533
exmalif::zpb::AxesPositionImpl::getAz
float getAz() const override
Definition: ZpbExmalifImpl.hpp:218
exmalif::zpb::StdCmdsSyncImpl
Definition: ZpbExmalifImpl.hpp:1137
exmalif::StdCmdsAsync
Definition: Exmalif.hpp:189
exmalif::zpb::AxesPositionImpl::setAz
void setAz(float az) override
Definition: ZpbExmalifImpl.hpp:222
elt::mal::rr::AmiZpb< std::string, ::generated::zpb::exmalif::StdCmds_Reply, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::updateReply
void updateReply(const ::generated::zpb::exmalif::StdCmds_Reply &reply, bool isPending)
Definition: ZpbExmalifImpl.hpp:541
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl(const ::generated::zpb::exmalif::ExceptionErr &inner)
Definition: ZpbExmalifImpl.hpp:468
exmalif::zpb::AxesPositionImpl::ZpbType
::generated::zpb::exmalif::AxesPosition ZpbType
Definition: ZpbExmalifImpl.hpp:181
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Preset
::elt::mal::future< std::string > Preset(const std::shared_ptr<::exmalif::TelPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:1017
exmalif::zpb::LogInfoImpl::keyHash
std::size_t keyHash() const
Definition: ZpbExmalifImpl.hpp:382
exmalif::zpb::AxesPositionImpl::fromByteArray
bool fromByteArray(const std::string &data) override
Definition: ZpbExmalifImpl.hpp:266
generated::zpb::exmalif::StdCmds_Call::set_allocated_disable
void set_allocated_disable(::generated::zpb::exmalif::StdCmds_Disable_In *disable)
exmalif::zpb::StdCmdsSyncImpl::asyncConnect
::elt::mal::future< void > asyncConnect() override
Definition: ZpbExmalifImpl.hpp:1292
generated::zpb::exmalif::StdCmds_Request
Definition: exmalif.pb.h:2571
exmalif::zpb::LogInfoImpl::LogInfoImpl
LogInfoImpl(::generated::zpb::exmalif::LogInfo *inner)
Definition: ZpbExmalifImpl.hpp:325
exmalif::zpb::TelPositionImpl::keyEquals
bool keyEquals(const ::exmalif::TelPosition &other) const override
Definition: ZpbExmalifImpl.hpp:100
generated::zpb::exmalif::StdCmds_GetPresetProgress_In
Definition: exmalif.pb.h:2139
exmalif::zpb::StdCmdsSyncImpl::registerConnectionListener
::elt::mal::rr::ListenerRegistration registerConnectionListener(ConnectionListener listener) override
Definition: ZpbExmalifImpl.hpp:1296
exmalif::zpb::LogInfoImpl::keyEquals
bool keyEquals(const ::exmalif::LogInfo &other) const override
Definition: ZpbExmalifImpl.hpp:378
exmalif::zpb::TelPositionImpl::getDec
float getDec() const override
Definition: ZpbExmalifImpl.hpp:79
exmalif::zpb::TelPositionImpl::setDec
void setDec(float dec) override
Definition: ZpbExmalifImpl.hpp:83
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl(ExceptionErrImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:487
exmalif::ExceptionErr::code
int32_t code
Definition: Exmalif.hpp:123
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >
Definition: ZpbExmalifImpl.hpp:589
exmalif::zpb::AxesPositionImpl
Definition: ZpbExmalifImpl.hpp:179
generated::zpb::exmalif::StdCmds_Stop_In
Definition: exmalif.pb.h:742
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl(const ExceptionErrImpl &rhs)
Definition: ZpbExmalifImpl.hpp:484
exmalif::zpb::LogInfoImpl::ZpbType
::generated::zpb::exmalif::LogInfo ZpbType
Definition: ZpbExmalifImpl.hpp:320
generated::zpb::exmalif::StdCmds_Move_In::mutable_pos
::generated::zpb::exmalif::AxesPosition * mutable_pos()
Definition: exmalif.pb.h:5595
exmalif::zpb::LogInfoImpl::getLevel
std::string getLevel() const override
Definition: ZpbExmalifImpl.hpp:350
exmalif::zpb::AxesPositionImpl::AxesPositionImpl
AxesPositionImpl(const ::generated::zpb::exmalif::AxesPosition &inner)
Definition: ZpbExmalifImpl.hpp:191
exmalif::zpb::AxesPositionImpl::cloneKey
std::unique_ptr<::exmalif::AxesPosition > cloneKey() const override
Definition: ZpbExmalifImpl.hpp:248
generated::zpb::exmalif::ExceptionErr
Definition: exmalif.pb.h:607
exmalif::zpb::TelPositionImpl::fromByteArray
bool fromByteArray(const std::string &data) override
Definition: ZpbExmalifImpl.hpp:127
exmalif::zpb::AxesPositionImpl::keyHash
std::size_t keyHash() const
Definition: ZpbExmalifImpl.hpp:243
generated::zpb::exmalif::StdCmds_Call::set_allocated_getstate
void set_allocated_getstate(::generated::zpb::exmalif::StdCmds_GetState_In *getstate)
elt::mal::rr::AmiZpb< std::string, ::generated::zpb::exmalif::StdCmds_Reply, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::timeout
void timeout()
Definition: ZpbExmalifImpl.hpp:565
exmalif::zpb::LogInfoImpl::LogInfoImpl
LogInfoImpl()
Definition: ZpbExmalifImpl.hpp:322
exmalif::zpb::TelPositionImpl::toByteArray
bool toByteArray(std::string &output) const override
Definition: ZpbExmalifImpl.hpp:123
elt
Definition: Exmalif.hpp:418
exmalif::zpb::TelPositionImpl::operator=
TelPositionImpl & operator=(const TelPositionImpl &that)
Definition: ZpbExmalifImpl.hpp:67
exmalif::zpb::ExceptionErrImpl::getCode
int32_t getCode() const override
Definition: ZpbExmalifImpl.hpp:498
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Stop
::elt::mal::future< std::string > Stop() override
Definition: ZpbExmalifImpl.hpp:600
exmalif::ExceptionErr::desc
std::string desc
Definition: Exmalif.hpp:122
exmalif::zpb::ExceptionErrImpl::operator=
ExceptionErrImpl & operator=(const ExceptionErrImpl &that)
Definition: ZpbExmalifImpl.hpp:490
exmalif::zpb::TelPositionImpl::fromByteArray
bool fromByteArray(const void *data, std::size_t size) override
Definition: ZpbExmalifImpl.hpp:131
exmalif::zpb::AxesPositionImpl::AxesPositionImpl
AxesPositionImpl(::generated::zpb::exmalif::AxesPosition *inner)
Definition: ZpbExmalifImpl.hpp:186
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::GetVersion
::elt::mal::future< std::string > GetVersion() override
Definition: ZpbExmalifImpl.hpp:859
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Exit
::elt::mal::future< std::string > Exit() override
Definition: ZpbExmalifImpl.hpp:933
exmalif::zpb::AsyncStdCmdsImpl::AsyncStdCmdsImpl
AsyncStdCmdsImpl(::elt::mal::rr::ZpbServer &zpbServer, const std::shared_ptr<::exmalif::AsyncStdCmds > &entity, const std::shared_ptr<::elt::mal::Mal > &mal)
Definition: ZpbExmalifImpl.hpp:1308
exmalif::zpb::TelPositionImpl::TelPositionImpl
TelPositionImpl(const TelPositionImpl &rhs)
Definition: ZpbExmalifImpl.hpp:63
exmalif::zpb::AxesPositionImpl::AxesPositionImpl
AxesPositionImpl()
Definition: ZpbExmalifImpl.hpp:183
exmalif::zpb::LogInfoImpl::fromByteArray
bool fromByteArray(const std::string &data) override
Definition: ZpbExmalifImpl.hpp:405
exmalif::zpb::LogInfoImpl
Definition: ZpbExmalifImpl.hpp:318
exmalif::zpb::AxesPositionImpl::operator=
AxesPositionImpl & operator=(const AxesPositionImpl &that)
Definition: ZpbExmalifImpl.hpp:206
exmalif::zpb::LogInfoImpl::getLogger
std::string getLogger() const override
Definition: ZpbExmalifImpl.hpp:357
exmalif::zpb::LogInfoImpl::typeHash
static int32_t typeHash()
Definition: ZpbExmalifImpl.hpp:431
elt::mal::rr::ServerAmiZpb< std::string, ::exmalif::zpb::AsyncStdCmdsImpl, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::ServerAmiZpb
ServerAmiZpb(::exmalif::zpb::AsyncStdCmdsImpl &replier, zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame, const std::string &headerFrame, const ::elt::mal::zpb::rr::ZpbHeader &header)
Definition: ZpbExmalifImpl.hpp:2124
exmalif::zpb::TelPositionImpl::keyHash
std::size_t keyHash() const
Definition: ZpbExmalifImpl.hpp:104
exmalif::zpb::LogInfoImpl::toByteArray
bool toByteArray(std::string &output) const override
Definition: ZpbExmalifImpl.hpp:401
exmalif::zpb::StdCmdsSyncImpl::GetStatus
std::string GetStatus() override
Definition: ZpbExmalifImpl.hpp:1212
exmalif::zpb::LogInfoImpl::setLevel
void setLevel(const std::string &level) override
Definition: ZpbExmalifImpl.hpp:354
exmalif::ExceptionErr
Definition: Exmalif.hpp:100
exmalif::zpb::TelPositionImpl::TelPositionImpl
TelPositionImpl(const ::generated::zpb::exmalif::TelPosition &inner)
Definition: ZpbExmalifImpl.hpp:52
std
Definition: errors.hpp:58
exmalif::LogInfo
Definition: Exmalif.hpp:79
exmalif::AxesPosition
Definition: Exmalif.hpp:55
exmalif::zpb::TelPositionImpl::setRa
void setRa(float ra) override
Definition: ZpbExmalifImpl.hpp:76
exmalif
Definition: Exmalif.hpp:25
exmalif::zpb::AsyncStdCmdsImpl
Definition: ZpbExmalifImpl.hpp:1306
exmalif::zpb::TelPositionImpl::getRa
float getRa() const override
Definition: ZpbExmalifImpl.hpp:72
exmalif::zpb::LogInfoImpl::LogInfoImpl
LogInfoImpl(LogInfoImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:343
generated::zpb::exmalif::StdCmds_Call::set_allocated_move
void set_allocated_move(::generated::zpb::exmalif::StdCmds_Move_In *move)
exmalif::zpb::StdCmdsSyncImpl::Config
std::string Config() override
Definition: ZpbExmalifImpl.hpp:1232
generated::zpb::exmalif::StdCmds_Call::set_allocated_init
void set_allocated_init(::generated::zpb::exmalif::StdCmds_Init_In *init)
exmalif::zpb::AxesPositionImpl::AxesPositionImpl
AxesPositionImpl(const AxesPositionImpl &rhs)
Definition: ZpbExmalifImpl.hpp:202
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl(const ::exmalif::ExceptionErr &malVal)
Definition: ZpbExmalifImpl.hpp:473
generated::zpb::exmalif::StdCmds_Reset_In
Definition: exmalif.pb.h:950
exmalif::zpb::AxesPositionImpl::AxesPositionImpl
AxesPositionImpl(AxesPositionImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:204
generated::zpb::exmalif::StdCmds_GetVersion_In
Definition: exmalif.pb.h:1470
exmalif::zpb::AxesPositionImpl::clone
std::unique_ptr<::exmalif::AxesPosition > clone() const override
Definition: ZpbExmalifImpl.hpp:226
exmalif::zpb::AxesPositionImpl::toByteArray
bool toByteArray(zmq::message_t &msg) const override
Definition: ZpbExmalifImpl.hpp:257
exmalif::zpb::LogInfoImpl::copy
void copy(const ::exmalif::LogInfo &from) override
Definition: ZpbExmalifImpl.hpp:414
exmalif::zpb::StdCmdsSyncImpl::GetVersion
std::string GetVersion() override
Definition: ZpbExmalifImpl.hpp:1222
generated::zpb::exmalif::StdCmds_Call::set_allocated_getversion
void set_allocated_getversion(::generated::zpb::exmalif::StdCmds_GetVersion_In *getversion)
exmalif::zpb::AxesPositionImpl::typeHash
static int32_t typeHash()
Definition: ZpbExmalifImpl.hpp:292
exmalif::zpb::LogInfoImpl::LogInfoImpl
LogInfoImpl(const ::generated::zpb::exmalif::LogInfo &inner)
Definition: ZpbExmalifImpl.hpp:330
generated::zpb::exmalif::StdCmds_GetStatus_In
Definition: exmalif.pb.h:1366
generated::zpb::exmalif::StdCmds_Reply::set_allocated_data
void set_allocated_data(::generated::zpb::exmalif::StdCmds_Return *data)
Definition: exmalif.pb.h:8774
exmalif::zpb::AxesPositionImpl::hasKey
bool hasKey() const override
Definition: ZpbExmalifImpl.hpp:253
exmalif::zpb::AsyncStdCmdsImpl::sendUnhandledExceptionReply
void sendUnhandledExceptionReply(zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame, const std::string &headerFrame, ::elt::mal::exception_ptr exceptionPtr)
Definition: ZpbExmalifImpl.hpp:2081
exmalif::TelPosition
Definition: Exmalif.hpp:31
generated::zpb::exmalif::StdCmds_Call::set_allocated_reset
void set_allocated_reset(::generated::zpb::exmalif::StdCmds_Reset_In *reset)
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::GetPresetProgress
std::shared_ptr<::elt::mal::rr::Ami< std::string > > GetPresetProgress() override
Definition: ZpbExmalifImpl.hpp:1108
exmalif::zpb::StdCmdsSyncImpl::GetState
std::string GetState() override
Definition: ZpbExmalifImpl.hpp:1202
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::GetState
::elt::mal::future< std::string > GetState() override
Definition: ZpbExmalifImpl.hpp:785
exmalif::zpb::AsyncStdCmdsImpl::sendReply
void sendReply(zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame, const std::string &headerFrame, std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader > replyHeader, std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return > data)
Definition: ZpbExmalifImpl.hpp:2050
exmalif::zpb::LogInfoImpl::fromByteArray
bool fromByteArray(const void *data, std::size_t size) override
Definition: ZpbExmalifImpl.hpp:409
exmalif::zpb::StdCmdsSyncImpl::getMal
std::shared_ptr<::elt::mal::Mal > getMal() const override
Definition: ZpbExmalifImpl.hpp:1148
exmalif::zpb::StdCmdsSyncImpl::close
void close() override
Definition: ZpbExmalifImpl.hpp:1288
elt::mal::rr::ServerAmiZpb< std::string, ::exmalif::zpb::AsyncStdCmdsImpl, ::generated::zpb::exmalif::StdCmds_GetPresetProgress_Out >::completed
bool completed(const std::string &status) override
Definition: ZpbExmalifImpl.hpp:2164
exmalif::zpb::StdCmdsAsyncImpl<::exmalif::StdCmdsAsync >::Disable
::elt::mal::future< std::string > Disable() override
Definition: ZpbExmalifImpl.hpp:748
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl()
Definition: ZpbExmalifImpl.hpp:460
exmalif::zpb::TelPositionImpl::ZpbType
::generated::zpb::exmalif::TelPosition ZpbType
Definition: ZpbExmalifImpl.hpp:42
exmalif::zpb::StdCmdsSyncImpl::SetLogLevel
std::string SetLogLevel(const std::shared_ptr<::exmalif::LogInfo > &info) override
Definition: ZpbExmalifImpl.hpp:1252
exmalif::zpb::StdCmdsSyncImpl::StdCmdsSyncImpl
StdCmdsSyncImpl(const ::elt::mal::Uri &uri, const std::vector< std::shared_ptr<::elt::mal::rr::qos::QoS >> &standardQoS, const ::elt::mal::Mal::Properties &malSpecificProperties, const std::shared_ptr<::elt::mal::ZpbMal > &zpbMal)
Definition: ZpbExmalifImpl.hpp:1139
generated::zpb::exmalif::StdCmds_GetState_In
Definition: exmalif.pb.h:1262
exmalif::zpb::AsyncStdCmdsImpl::sendCompletedReply
void sendCompletedReply(zmq::socket_t &socket, const std::string &id, const std::string &topicIdFrame, const std::string &headerFrame, std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return > data)
Definition: ZpbExmalifImpl.hpp:2068
exmalif::zpb::ExceptionErrImpl::ExceptionErrImpl
ExceptionErrImpl(::generated::zpb::exmalif::ExceptionErr *inner)
Definition: ZpbExmalifImpl.hpp:463
exmalif::zpb::AxesPositionImpl::toByteArray
bool toByteArray(std::string &output) const override
Definition: ZpbExmalifImpl.hpp:262
exmalif::zpb::AxesPositionImpl::AxesPositionImpl
AxesPositionImpl(float alt, float az)
Definition: ZpbExmalifImpl.hpp:196
generated::zpb::exmalif::StdCmds_Reply
Definition: exmalif.pb.h:4924