14 #include <boost/functional/hash.hpp>
16 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
18 #include <mal/Mal.hpp>
19 #include <mal/utility/future.hpp>
20 #include <mal/rr/ClientAsync.hpp>
21 #include <mal/rr/AmiZpb.hpp>
22 #include <mal/ps/ZpbDataEntity.hpp>
23 #include <mal/utility/Uri.hpp>
24 #include <mal/util/ZpbList.hpp>
25 #include <mal/types/ZpbMalTypes.hpp>
26 #include <mal/rr/ServerContextZpb.hpp>
27 #include <mal/rr/ServerContextZpbAmi.hpp>
28 #include <mal/rr/ServerContextProvider.hpp>
38 public virtual ::elt::mal::ps::ZpbDataEntity<::exmalif::TelPosition> {
46 m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<
ZpbType*>())
71 return m_zpbObj->ra();
78 return m_zpbObj->dec();
82 m_zpbObj->set_dec(dec);
85 std::unique_ptr<::exmalif::TelPosition>
clone()
const override {
98 std::unique_ptr<::exmalif::TelPosition>
cloneKey()
const override {
108 msg.rebuild(m_zpbObj->ByteSizeLong());
109 return m_zpbObj->SerializeToArray(msg.data(), msg.size());
113 return m_zpbObj->SerializeToString(&output);
117 return m_zpbObj->ParseFromString(data);
121 google::protobuf::io::ArrayInputStream ais(data, size);
122 return m_zpbObj->ParseFromZeroCopyStream(&ais);
140 std::shared_ptr<ZpbType> m_zpbObj;
159 public virtual ::elt::mal::ps::ZpbDataEntity<::exmalif::AxesPosition> {
167 m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<
ZpbType*>())
192 return m_zpbObj->alt();
196 m_zpbObj->set_alt(alt);
199 return m_zpbObj->az();
203 m_zpbObj->set_az(az);
206 std::unique_ptr<::exmalif::AxesPosition>
clone()
const override {
215 std::size_t seed = 0;
219 std::unique_ptr<::exmalif::AxesPosition>
cloneKey()
const override {
229 msg.rebuild(m_zpbObj->ByteSizeLong());
230 return m_zpbObj->SerializeToArray(msg.data(), msg.size());
234 return m_zpbObj->SerializeToString(&output);
238 return m_zpbObj->ParseFromString(data);
242 google::protobuf::io::ArrayInputStream ais(data, size);
243 return m_zpbObj->ParseFromZeroCopyStream(&ais);
261 std::shared_ptr<ZpbType> m_zpbObj;
280 public virtual ::elt::mal::ps::ZpbDataEntity<::exmalif::LogInfo> {
288 m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<
ZpbType*>())
313 return m_zpbObj->level();
317 m_zpbObj->set_level(level);
320 return m_zpbObj->logger();
324 m_zpbObj->set_logger(logger);
327 std::unique_ptr<::exmalif::LogInfo>
clone()
const override {
336 std::size_t seed = 0;
340 std::unique_ptr<::exmalif::LogInfo>
cloneKey()
const override {
341 std::unique_ptr<::exmalif::LogInfo> entity(
new LogInfoImpl());
350 msg.rebuild(m_zpbObj->ByteSizeLong());
351 return m_zpbObj->SerializeToArray(msg.data(), msg.size());
355 return m_zpbObj->SerializeToString(&output);
359 return m_zpbObj->ParseFromString(data);
363 google::protobuf::io::ArrayInputStream ais(data, size);
364 return m_zpbObj->ParseFromZeroCopyStream(&ais);
382 std::shared_ptr<ZpbType> m_zpbObj;
408 m_zpbObj(inner, ::elt::mal::util::list::NoopDeleter<
ZpbType*>())
438 return m_zpbObj->desc();
441 return m_zpbObj->code();
445 setDesc(from.getDesc());
446 setCode(from.getCode());
454 void setDesc(
const std::string&
desc) {
455 m_zpbObj->set_desc(desc);
457 void setCode(int32_t
code) {
458 m_zpbObj->set_code(code);
461 std::shared_ptr<ZpbType> m_zpbObj;
480 public AmiZpbHelper<std::string>,
481 public ReplyObserver<::generated::zpb::exmalif::StdCmds_Reply> {
483 void updateReply(const ::generated::zpb::exmalif::StdCmds_Reply& reply,
bool isPending) {
484 auto& data = reply.data();
485 auto code = reply.header().code();
487 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
488 std::ostringstream errMsg;
490 errMsg <<
"Code:" <<
code <<
" Message:";
491 reply.header().has_exceptionmessage() ?
492 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
494 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
495 handleCompletedExceptionally(::elt::mal::UnhandledRemoteException(errMsg.str())) :
496 handleCompletedExceptionally(::elt::mal::MalException(errMsg.str()));
498 }
else if (isPending) {
499 handlePending((std::string)data.getpresetprogress().retval());
501 handleCompleted((std::string)data.getpresetprogress().retval());
518 template<
typename Intf>
524 :
public virtual ::elt::mal::rr::ClientAsyncImpl<::exmalif::StdCmdsAsync,
525 ::generated::zpb::exmalif::StdCmds_Request,
526 ::generated::zpb::exmalif::StdCmds_Reply>,
530 const ::elt::mal::Uri &uri,
531 const std::vector<std::shared_ptr<::elt::mal::rr::qos::QoS>> &standardQoS,
532 const ::elt::mal::Mal::Properties &malSpecificProperties,
533 const std::shared_ptr<::elt::mal::ZpbMal> &zpbMal):
535 ::generated::zpb::
exmalif::StdCmds_Request, ::generated::zpb::
exmalif::StdCmds_Reply>(
536 uri, standardQoS, malSpecificProperties, zpbMal) {}
538 ::elt::mal::future<std::string>
Stop()
override {
541 new ::generated::zpb::exmalif::StdCmds_Stop_In();
547 return sendRequest(request).then([](
548 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
549 auto reply = replyFut.get();
550 auto code = reply.header().code();
552 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
553 std::ostringstream errMsg;
555 errMsg <<
"Code:" <<
code <<
" Message:";
556 reply.header().has_exceptionmessage() ?
557 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
559 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
560 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
561 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
563 auto data = reply.data();
564 return (std::string)data.stop().retval();
568 ::elt::mal::future<std::string>
Init()
override {
571 new ::generated::zpb::exmalif::StdCmds_Init_In();
577 return sendRequest(request).then([](
578 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
579 auto reply = replyFut.get();
580 auto code = reply.header().code();
582 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
583 std::ostringstream errMsg;
585 errMsg <<
"Code:" <<
code <<
" Message:";
586 reply.header().has_exceptionmessage() ?
587 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
589 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
590 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
591 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
593 auto data = reply.data();
594 return (std::string)data.init().retval();
598 ::elt::mal::future<std::string>
Reset()
override {
601 new ::generated::zpb::exmalif::StdCmds_Reset_In();
607 return sendRequest(request).then([](
608 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
609 auto reply = replyFut.get();
610 auto code = reply.header().code();
612 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
613 std::ostringstream errMsg;
615 errMsg <<
"Code:" <<
code <<
" Message:";
616 reply.header().has_exceptionmessage() ?
617 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
619 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
620 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
621 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
623 auto data = reply.data();
624 return (std::string)data.reset().retval();
628 ::elt::mal::future<std::string>
Enable()
override {
631 new ::generated::zpb::exmalif::StdCmds_Enable_In();
637 return sendRequest(request).then([](
638 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
639 auto reply = replyFut.get();
640 auto code = reply.header().code();
642 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
643 std::ostringstream errMsg;
645 errMsg <<
"Code:" <<
code <<
" Message:";
646 reply.header().has_exceptionmessage() ?
647 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
649 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
650 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
651 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
653 auto data = reply.data();
654 return (std::string)data.enable().retval();
658 ::elt::mal::future<std::string>
Disable()
override {
661 new ::generated::zpb::exmalif::StdCmds_Disable_In();
667 return sendRequest(request).then([](
668 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
669 auto reply = replyFut.get();
670 auto code = reply.header().code();
672 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
673 std::ostringstream errMsg;
675 errMsg <<
"Code:" <<
code <<
" Message:";
676 reply.header().has_exceptionmessage() ?
677 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
679 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
680 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
681 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
683 auto data = reply.data();
684 return (std::string)data.disable().retval();
688 ::elt::mal::future<std::string>
Status()
override {
691 new ::generated::zpb::exmalif::StdCmds_Status_In();
697 return sendRequest(request).then([](
698 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
699 auto reply = replyFut.get();
700 auto code = reply.header().code();
702 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
703 std::ostringstream errMsg;
705 errMsg <<
"Code:" <<
code <<
" Message:";
706 reply.header().has_exceptionmessage() ?
707 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
709 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
710 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
711 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
713 auto data = reply.data();
714 return (std::string)data.status().retval();
718 ::elt::mal::future<std::string>
Config()
override {
721 new ::generated::zpb::exmalif::StdCmds_Config_In();
727 return sendRequest(request).then([](
728 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
729 auto reply = replyFut.get();
730 auto code = reply.header().code();
732 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
733 std::ostringstream errMsg;
735 errMsg <<
"Code:" <<
code <<
" Message:";
736 reply.header().has_exceptionmessage() ?
737 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
739 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
740 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
741 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
743 auto data = reply.data();
744 return (std::string)data.config().retval();
748 ::elt::mal::future<std::string>
Exit()
override {
751 new ::generated::zpb::exmalif::StdCmds_Exit_In();
757 return sendRequest(request).then([](
758 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
759 auto reply = replyFut.get();
760 auto code = reply.header().code();
762 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
763 std::ostringstream errMsg;
765 errMsg <<
"Code:" <<
code <<
" Message:";
766 reply.header().has_exceptionmessage() ?
767 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
769 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
770 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
771 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
773 auto data = reply.data();
774 return (std::string)data.exit().retval();
778 ::elt::mal::future<std::string>
SetLogLevel(
const std::shared_ptr<::exmalif::LogInfo>& info)
override {
781 new ::generated::zpb::exmalif::StdCmds_SetLogLevel_In();
797 return sendRequest(request).then([](
798 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
799 auto reply = replyFut.get();
800 auto code = reply.header().code();
802 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
803 std::ostringstream errMsg;
805 errMsg <<
"Code:" <<
code <<
" Message:";
806 reply.header().has_exceptionmessage() ?
807 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
809 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
810 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
811 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
813 auto data = reply.data();
814 if (data.setloglevel().has_exexceptionerr()) {
817 return (std::string)data.setloglevel().retval();
821 ::elt::mal::future<std::string>
Preset(
const std::shared_ptr<::exmalif::TelPosition>& pos)
override {
824 new ::generated::zpb::exmalif::StdCmds_Preset_In();
840 return sendRequest(request).then([](
841 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
842 auto reply = replyFut.get();
843 auto code = reply.header().code();
845 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
846 std::ostringstream errMsg;
848 errMsg <<
"Code:" <<
code <<
" Message:";
849 reply.header().has_exceptionmessage() ?
850 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
852 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
853 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
854 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
856 auto data = reply.data();
857 return (std::string)data.preset().retval();
861 ::elt::mal::future<std::string>
Move(
const std::shared_ptr<::exmalif::AxesPosition>& pos)
override {
864 new ::generated::zpb::exmalif::StdCmds_Move_In();
880 return sendRequest(request).then([](
881 ::elt::mal::future<::generated::zpb::exmalif::StdCmds_Reply> replyFut) {
882 auto reply = replyFut.get();
883 auto code = reply.header().code();
885 if (
code != ::elt::mal::zpb::rr::CompletionCode::COMPLETED) {
886 std::ostringstream errMsg;
888 errMsg <<
"Code:" <<
code <<
" Message:";
889 reply.header().has_exceptionmessage() ?
890 errMsg << reply.header().exceptionmessage() : errMsg <<
"Unknown error message";
892 code == ::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION ?
893 ::elt::mal::throw_exception(::elt::mal::UnhandledRemoteException(errMsg.str())) :
894 ::elt::mal::throw_exception(::elt::mal::MalException(errMsg.str()));
896 auto data = reply.data();
897 if (data.move().has_exexceptionerr()) {
900 return (std::string)data.move().retval();
907 new ::generated::zpb::exmalif::StdCmds_GetPresetProgress_In();
913 auto ami = std::shared_ptr<::elt::mal::rr::Ami<std::string>>(
918 std::dynamic_pointer_cast<::elt::mal::rr::ReplyObserver<
919 ::generated::zpb::exmalif::StdCmds_Reply>>(ami);
921 sendRequestWithObserver(request, observer);
932 const ::elt::mal::Uri &uri,
933 const std::vector<std::shared_ptr<::elt::mal::rr::qos::QoS>> &standardQoS,
934 const ::elt::mal::Mal::Properties &malSpecificProperties,
935 const std::shared_ptr<::elt::mal::ZpbMal> &zpbMal)
936 : m_delegate(uri, standardQoS, malSpecificProperties, zpbMal), m_timeoutMs{} {
937 m_timeoutMs = ::elt::mal::util::getReplyTimeQoS(standardQoS);
940 std::shared_ptr<::elt::mal::Mal>
getMal()
const override {
941 return m_delegate.getMal();
945 auto future = m_delegate.
Stop();
946 if (::elt::mal::future_status::ready
947 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
950 throw ::elt::mal::TimeoutException(
"timeout");
955 auto future = m_delegate.
Init();
956 if (::elt::mal::future_status::ready
957 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
960 throw ::elt::mal::TimeoutException(
"timeout");
965 auto future = m_delegate.
Reset();
966 if (::elt::mal::future_status::ready
967 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
970 throw ::elt::mal::TimeoutException(
"timeout");
975 auto future = m_delegate.
Enable();
976 if (::elt::mal::future_status::ready
977 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
980 throw ::elt::mal::TimeoutException(
"timeout");
985 auto future = m_delegate.
Disable();
986 if (::elt::mal::future_status::ready
987 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
990 throw ::elt::mal::TimeoutException(
"timeout");
995 auto future = m_delegate.
Status();
996 if (::elt::mal::future_status::ready
997 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1000 throw ::elt::mal::TimeoutException(
"timeout");
1005 auto future = m_delegate.
Config();
1006 if (::elt::mal::future_status::ready
1007 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1008 return future.get();
1010 throw ::elt::mal::TimeoutException(
"timeout");
1015 auto future = m_delegate.
Exit();
1016 if (::elt::mal::future_status::ready
1017 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1018 return future.get();
1020 throw ::elt::mal::TimeoutException(
"timeout");
1024 std::string
SetLogLevel(
const std::shared_ptr<::exmalif::LogInfo>& info)
override {
1026 if (::elt::mal::future_status::ready
1027 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1028 return future.get();
1030 throw ::elt::mal::TimeoutException(
"timeout");
1034 std::string
Preset(
const std::shared_ptr<::exmalif::TelPosition>& pos)
override {
1035 auto future = m_delegate.
Preset(pos);
1036 if (::elt::mal::future_status::ready
1037 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1038 return future.get();
1040 throw ::elt::mal::TimeoutException(
"timeout");
1044 std::string
Move(
const std::shared_ptr<::exmalif::AxesPosition>& pos)
override {
1045 auto future = m_delegate.
Move(pos);
1046 if (::elt::mal::future_status::ready
1047 == future.wait_for(boost::chrono::milliseconds(m_timeoutMs))) {
1048 return future.get();
1050 throw ::elt::mal::TimeoutException(
"timeout");
1065 return m_delegate.asyncConnect();
1069 return m_delegate.registerConnectionListener(listener);
1074 int64_t m_timeoutMs;
1081 ::elt::mal::rr::ZpbServer &zpbServer,
1082 const std::shared_ptr<::exmalif::AsyncStdCmds> &entity,
1083 const std::shared_ptr<::elt::mal::Mal> &mal)
1084 : m_zpbServer(zpbServer), m_entity(entity), m_mal(mal) {}
1088 const std::string &
id,
const std::string &topicIdFrame,
1089 const std::string &headerFrame,
1090 const ::elt::mal::zpb::rr::ZpbHeader &header) {
1091 if (!::elt::mal::util::getSocketHasRcvMore(socket)) {
1092 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
1093 new ::elt::mal::zpb::rr::ReplyHeader());
1095 unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::INVALID_ARGUMENT);
1096 unhandledExReplyHeader->set_exceptionmessage(
"missing request frame");
1098 sendReply(socket,
id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
1099 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
1107 zmq::message_t msgFrame;
1108 socket.recv(&msgFrame, 0);
1110 if (!request.ParseFromArray(msgFrame.data(), msgFrame.size())) {
1111 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
1112 new ::elt::mal::zpb::rr::ReplyHeader());
1114 unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::INVALID_ARGUMENT);
1115 unhandledExReplyHeader->set_exceptionmessage(
"Invalid Request: Request parsing failed");
1117 sendReply(socket,
id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
1118 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
1125 if (call->has_stop()) {
1128 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1129 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1131 ::elt::mal::rr::ServerContextProvider::setInstance<
1132 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1134 m_entity->Stop().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1135 (::elt::mal::future<std::string> f) {
1136 if (!f.has_exception()) {
1137 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1138 new ::generated::zpb::exmalif::StdCmds_Return());
1140 auto out = new ::generated::zpb::exmalif::StdCmds_Stop_Out();
1142 out->set_retval(f.get());
1144 data->set_allocated_stop(out);
1152 }
else if (call->has_init()) {
1153 auto params = call->mutable_init();
1155 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1156 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1158 ::elt::mal::rr::ServerContextProvider::setInstance<
1159 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1161 m_entity->Init().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1162 (::elt::mal::future<std::string> f) {
1163 if (!f.has_exception()) {
1164 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1165 new ::generated::zpb::exmalif::StdCmds_Return());
1167 auto out = new ::generated::zpb::exmalif::StdCmds_Init_Out();
1169 out->set_retval(f.get());
1171 data->set_allocated_init(out);
1179 }
else if (call->has_reset()) {
1180 auto params = call->mutable_reset();
1182 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1183 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1185 ::elt::mal::rr::ServerContextProvider::setInstance<
1186 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1188 m_entity->Reset().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1189 (::elt::mal::future<std::string> f) {
1190 if (!f.has_exception()) {
1191 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1192 new ::generated::zpb::exmalif::StdCmds_Return());
1194 auto out = new ::generated::zpb::exmalif::StdCmds_Reset_Out();
1196 out->set_retval(f.get());
1198 data->set_allocated_reset(out);
1206 }
else if (call->has_enable()) {
1207 auto params = call->mutable_enable();
1209 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1210 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1212 ::elt::mal::rr::ServerContextProvider::setInstance<
1213 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1215 m_entity->Enable().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1216 (::elt::mal::future<std::string> f) {
1217 if (!f.has_exception()) {
1218 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1219 new ::generated::zpb::exmalif::StdCmds_Return());
1221 auto out = new ::generated::zpb::exmalif::StdCmds_Enable_Out();
1223 out->set_retval(f.get());
1225 data->set_allocated_enable(out);
1233 }
else if (call->has_disable()) {
1234 auto params = call->mutable_disable();
1236 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1237 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1239 ::elt::mal::rr::ServerContextProvider::setInstance<
1240 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1242 m_entity->Disable().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1243 (::elt::mal::future<std::string> f) {
1244 if (!f.has_exception()) {
1245 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1246 new ::generated::zpb::exmalif::StdCmds_Return());
1248 auto out = new ::generated::zpb::exmalif::StdCmds_Disable_Out();
1250 out->set_retval(f.get());
1252 data->set_allocated_disable(out);
1260 }
else if (call->has_status()) {
1261 auto params = call->mutable_status();
1263 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1264 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1266 ::elt::mal::rr::ServerContextProvider::setInstance<
1267 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1269 m_entity->Status().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1270 (::elt::mal::future<std::string> f) {
1271 if (!f.has_exception()) {
1272 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1273 new ::generated::zpb::exmalif::StdCmds_Return());
1275 auto out = new ::generated::zpb::exmalif::StdCmds_Status_Out();
1277 out->set_retval(f.get());
1279 data->set_allocated_status(out);
1287 }
else if (call->has_config()) {
1288 auto params = call->mutable_config();
1290 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1291 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1293 ::elt::mal::rr::ServerContextProvider::setInstance<
1294 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1296 m_entity->Config().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1297 (::elt::mal::future<std::string> f) {
1298 if (!f.has_exception()) {
1299 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1300 new ::generated::zpb::exmalif::StdCmds_Return());
1302 auto out = new ::generated::zpb::exmalif::StdCmds_Config_Out();
1304 out->set_retval(f.get());
1306 data->set_allocated_config(out);
1314 }
else if (call->has_exit()) {
1315 auto params = call->mutable_exit();
1317 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1318 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1320 ::elt::mal::rr::ServerContextProvider::setInstance<
1321 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1323 m_entity->Exit().then(m_zpbServer.getExecutor(), [
this, &socket, id, topicIdFrame, headerFrame, params]
1324 (::elt::mal::future<std::string> f) {
1325 if (!f.has_exception()) {
1326 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1327 new ::generated::zpb::exmalif::StdCmds_Return());
1329 auto out = new ::generated::zpb::exmalif::StdCmds_Exit_Out();
1331 out->set_retval(f.get());
1333 data->set_allocated_exit(out);
1341 }
else if (call->has_setloglevel()) {
1342 auto params = call->mutable_setloglevel();
1344 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1345 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1347 ::elt::mal::rr::ServerContextProvider::setInstance<
1348 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1350 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]
1351 (::elt::mal::future<std::string> f) {
1352 if (!f.has_exception()) {
1353 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1354 new ::generated::zpb::exmalif::StdCmds_Return());
1356 auto out = new ::generated::zpb::exmalif::StdCmds_SetLogLevel_Out();
1358 out->set_retval(f.get());
1360 data->set_allocated_setloglevel(out);
1365 ::elt::mal::rethrow_exception(f.get_exception_ptr());
1368 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1372 auto out = new ::generated::zpb::exmalif::StdCmds_SetLogLevel_Out();
1374 *out->mutable_exexceptionerr() = **&_ex;
1376 data->set_allocated_setloglevel(out);
1382 headerFrame, f.get_exception_ptr());
1386 }
else if (call->has_preset()) {
1387 auto params = call->mutable_preset();
1389 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1390 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1392 ::elt::mal::rr::ServerContextProvider::setInstance<
1393 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1395 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]
1396 (::elt::mal::future<std::string> f) {
1397 if (!f.has_exception()) {
1398 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1399 new ::generated::zpb::exmalif::StdCmds_Return());
1401 auto out = new ::generated::zpb::exmalif::StdCmds_Preset_Out();
1403 out->set_retval(f.get());
1405 data->set_allocated_preset(out);
1413 }
else if (call->has_move()) {
1414 auto params = call->mutable_move();
1416 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1417 new ::elt::mal::rr::ServerContextZpb<std::string>(m_mal));
1419 ::elt::mal::rr::ServerContextProvider::setInstance<
1420 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1422 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]
1423 (::elt::mal::future<std::string> f) {
1424 if (!f.has_exception()) {
1425 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1426 new ::generated::zpb::exmalif::StdCmds_Return());
1428 auto out = new ::generated::zpb::exmalif::StdCmds_Move_Out();
1430 out->set_retval(f.get());
1432 data->set_allocated_move(out);
1437 ::elt::mal::rethrow_exception(f.get_exception_ptr());
1440 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(new ::generated::zpb::exmalif::StdCmds_Return());
1444 auto out = new ::generated::zpb::exmalif::StdCmds_Move_Out();
1446 *out->mutable_exexceptionerr() = **&_ex;
1448 data->set_allocated_move(out);
1454 headerFrame, f.get_exception_ptr());
1458 }
else if (call->has_getpresetprogress()) {
1459 auto serverContext = std::unique_ptr<::elt::mal::rr::ServerContext<std::string>>(
1460 new ::elt::mal::rr::ServerContextZpbAmi<std::string,
1463 *
this, socket, id, topicIdFrame, headerFrame, header, m_mal));
1465 ::elt::mal::rr::ServerContextProvider::setInstance<
1466 ::elt::mal::rr::ServerContext<std::string>>(serverContext);
1469 m_entity->GetPresetProgress();
1470 }
catch (std::exception &e) {
1471 auto ami = ::elt::mal::rr::ServerContextProvider::getInstance<
1472 ::elt::mal::rr::ServerContext<float>>().createAmi();
1474 ami->completeExceptionally(e);
1479 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
1480 new ::elt::mal::zpb::rr::ReplyHeader());
1482 unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::UNKNOWN_OPERATION);
1484 sendReply(socket,
id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
1485 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
1490 zmq::socket_t &socket,
const std::string &
id,
const std::string &topicIdFrame,
1491 const std::string &headerFrame,
1492 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> replyHeader,
1493 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data) {
1502 auto replyStr = reply.SerializeAsString();
1504 m_zpbServer.sendReply(socket,
id, topicIdFrame, headerFrame, replyStr);
1508 zmq::socket_t &socket,
const std::string &
id,
1509 const std::string &topicIdFrame,
const std::string &headerFrame,
1510 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data) {
1511 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> completedReplyHeader(
1512 new ::elt::mal::zpb::rr::ReplyHeader());
1514 completedReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::COMPLETED);
1516 sendReply(socket,
id, topicIdFrame, headerFrame,
1517 std::move(completedReplyHeader), std::move(data));
1521 zmq::socket_t &socket,
const std::string &
id,
const std::string &topicIdFrame,
1522 const std::string &headerFrame, ::elt::mal::exception_ptr exceptionPtr) {
1523 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> unhandledExReplyHeader(
1524 new ::elt::mal::zpb::rr::ReplyHeader());
1526 unhandledExReplyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::UNKNOWN_EXCEPTION);
1528 std::string exceptionMessage =
"Unknown";
1531 ::elt::mal::rethrow_exception(exceptionPtr);
1532 }
catch (std::exception &e) {
1533 exceptionMessage = e.what();
1536 unhandledExReplyHeader->set_exceptionmessage(exceptionMessage);
1538 sendReply(socket,
id, topicIdFrame, headerFrame, std::move(unhandledExReplyHeader),
1539 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return>());
1543 ::elt::mal::rr::ZpbServer &m_zpbServer;
1544 std::shared_ptr<::exmalif::AsyncStdCmds> m_entity;
1545 const std::shared_ptr<::elt::mal::Mal>& m_mal;
1561 public ::elt::mal::rr::ServerAmi<std::string> {
1564 zmq::socket_t &socket,
1565 const std::string &
id,
1566 const std::string &topicIdFrame,
1567 const std::string &headerFrame,
1568 const ::elt::mal::zpb::rr::ZpbHeader &header) :
1572 m_topicIdFrame(topicIdFrame),
1573 m_headerFrame(headerFrame),
1577 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1578 new ::generated::zpb::exmalif::StdCmds_Return());
1580 std::unique_ptr<::elt::mal::zpb::rr::ReplyHeader> replyHeader(
1581 new ::elt::mal::zpb::rr::ReplyHeader());
1583 replyHeader->set_code(::elt::mal::zpb::rr::CompletionCode::PENDING);
1585 data->mutable_getpresetprogress()->set_retval(status);
1587 m_replier.sendReply(m_socket, m_id, m_topicIdFrame,
1588 m_headerFrame, std::move(replyHeader), std::move(data));
1594 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1595 new ::generated::zpb::exmalif::StdCmds_Return());
1597 m_replier.sendUnhandledExceptionReply(m_socket, m_id, m_topicIdFrame,
1598 m_headerFrame, boost::copy_exception(ex));
1599 m_isCompleted =
true;
1604 std::unique_ptr<::generated::zpb::exmalif::StdCmds_Return> data(
1605 new ::generated::zpb::exmalif::StdCmds_Return());
1607 data->mutable_getpresetprogress()->set_retval(status);
1609 m_replier.sendCompletedReply(m_socket, m_id, m_topicIdFrame,
1610 m_headerFrame, std::move(data));
1612 m_isCompleted =
true;
1617 return m_isCompleted;
1621 return future_type();
1629 zmq::socket_t &m_socket;
1630 const std::string m_id;
1631 const std::string m_topicIdFrame;
1632 const std::string m_headerFrame;
1633 const ::elt::mal::zpb::rr::ZpbHeader m_header;
1634 bool m_isCompleted =
false;
Definition: ZpbExmalifImpl.hpp:158
::generated::zpb::exmalif::TelPosition * mutable_pos()
Definition: exmalif.pb.h:4847
AsyncStdCmdsImpl(::elt::mal::rr::ZpbServer &zpbServer, const std::shared_ptr<::exmalif::AsyncStdCmds > &entity, const std::shared_ptr<::elt::mal::Mal > &mal)
Definition: ZpbExmalifImpl.hpp:1080
void setLevel(const std::string &level) override
Definition: ZpbExmalifImpl.hpp:316
Definition: Exmalif.hpp:28
LogInfoImpl(LogInfoImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:305
bool keyEquals(const ::exmalif::LogInfo &other) const override
Definition: ZpbExmalifImpl.hpp:331
std::shared_ptr<::elt::mal::Mal > getMal() const override
Definition: ZpbExmalifImpl.hpp:940
future_type next() override
Definition: ZpbExmalifImpl.hpp:1620
void close() override
Definition: ZpbExmalifImpl.hpp:1060
void set_allocated_disable(::generated::zpb::exmalif::StdCmds_Disable_In *disable)
Definition: exmalif.pb.h:4246
TelPositionImpl()
Definition: ZpbExmalifImpl.hpp:42
void set_allocated_preset(::generated::zpb::exmalif::StdCmds_Preset_In *preset)
TelPositionImpl(const ::generated::zpb::exmalif::TelPosition &inner)
Definition: ZpbExmalifImpl.hpp:50
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:931
required string logger
Definition: exmalif.proto:25
int32_t getCode() const override
Definition: ZpbExmalifImpl.hpp:440
ExceptionErrImpl(ExceptionErrImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:430
AxesPositionImpl(AxesPositionImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:184
::generated::zpb::exmalif::AxesPosition ZpbType
Definition: ZpbExmalifImpl.hpp:161
float getRa() const override
Definition: ZpbExmalifImpl.hpp:70
Definition: ZpbExmalifImpl.hpp:523
ExceptionErrImpl & operator=(const ExceptionErrImpl &that)
Definition: ZpbExmalifImpl.hpp:432
void set_allocated_stop(::generated::zpb::exmalif::StdCmds_Stop_In *stop)
std::unique_ptr<::exmalif::TelPosition > clone() const override
Definition: ZpbExmalifImpl.hpp:85
std::string Enable() override
Definition: ZpbExmalifImpl.hpp:974
Definition: exmalif.pb.h:726
Definition: exmalif.pb.h:2317
::elt::mal::future< std::string > Init() override
Definition: ZpbExmalifImpl.hpp:568
static int32_t typeHash()
Definition: ZpbExmalifImpl.hpp:255
bool keyEquals(const ::exmalif::TelPosition &other) const override
Definition: ZpbExmalifImpl.hpp:89
static int32_t typeHash()
Definition: ZpbExmalifImpl.hpp:376
::generated::zpb::exmalif::StdCmds_Call * mutable_data()
Definition: exmalif.pb.h:5570
bool hasKey() const override
Definition: ZpbExmalifImpl.hpp:224
bool fromByteArray(const std::string &data) override
Definition: ZpbExmalifImpl.hpp:237
void set_allocated_move(::generated::zpb::exmalif::StdCmds_Move_In *move)
bool toByteArray(std::string &output) const override
Definition: ZpbExmalifImpl.hpp:354
Definition: exmalif.pb.h:1915
Definition: Exmalif.hpp:90
void copy(const ::exmalif::TelPosition &from) override
Definition: ZpbExmalifImpl.hpp:125
bool toByteArray(std::string &output) const override
Definition: ZpbExmalifImpl.hpp:233
bool completed(const std::string &status) override
Definition: ZpbExmalifImpl.hpp:1603
LogInfoImpl(::generated::zpb::exmalif::LogInfo *inner)
Definition: ZpbExmalifImpl.hpp:287
::generated::zpb::exmalif::TelPosition ZpbType
Definition: ZpbExmalifImpl.hpp:40
std::string SetLogLevel(const std::shared_ptr<::exmalif::LogInfo > &info) override
Definition: ZpbExmalifImpl.hpp:1024
void set_allocated_init(::generated::zpb::exmalif::StdCmds_Init_In *init)
LogInfoImpl & operator=(const LogInfoImpl &that)
Definition: ZpbExmalifImpl.hpp:307
Definition: exmalif.pb.h:1454
TelPositionImpl(float ra, float dec)
Definition: ZpbExmalifImpl.hpp:55
required sfixed32 code
Definition: exmalif.proto:30
Definition: ZpbExmalifImpl.hpp:519
Definition: Exmalif.hpp:49
Definition: exmalif.pb.h:194
Definition: ZpbExmalifImpl.hpp:37
void cancel()
Definition: ZpbExmalifImpl.hpp:505
::generated::zpb::exmalif::AxesPosition * mutable_pos()
Definition: exmalif.pb.h:4909
Definition: ZpbExmalifImpl.hpp:1078
void set_allocated_data(::generated::zpb::exmalif::StdCmds_Return *data)
Definition: exmalif.pb.h:7192
void copy(const ::exmalif::LogInfo &from) override
Definition: ZpbExmalifImpl.hpp:367
std::unique_ptr<::exmalif::AxesPosition > cloneKey() const override
Definition: ZpbExmalifImpl.hpp:219
TelPositionImpl & operator=(const TelPositionImpl &that)
Definition: ZpbExmalifImpl.hpp:65
::generated::zpb::exmalif::StdCmds_Stop_In * mutable_stop()
Definition: exmalif.pb.h:4978
void set_allocated_setloglevel(::generated::zpb::exmalif::StdCmds_SetLogLevel_In *setloglevel)
bool fromByteArray(const std::string &data) override
Definition: ZpbExmalifImpl.hpp:358
bool completeExceptionally(const std::exception &ex) override
Definition: ZpbExmalifImpl.hpp:1593
AxesPositionImpl & operator=(const AxesPositionImpl &that)
Definition: ZpbExmalifImpl.hpp:186
std::string Reset() override
Definition: ZpbExmalifImpl.hpp:964
ExceptionErrImpl(const ::exmalif::ExceptionErr &malVal)
Definition: ZpbExmalifImpl.hpp:417
Definition: ZpbExmalifImpl.hpp:929
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:1489
::elt::mal::future< std::string > SetLogLevel(const std::shared_ptr<::exmalif::LogInfo > &info) override
Definition: ZpbExmalifImpl.hpp:778
std::string Stop() override
Definition: ZpbExmalifImpl.hpp:944
ExceptionErrImpl()
Definition: ZpbExmalifImpl.hpp:404
bool complete(const std::string &status) override
Definition: ZpbExmalifImpl.hpp:1576
bool keyEquals(const ::exmalif::AxesPosition &other) const override
Definition: ZpbExmalifImpl.hpp:210
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:1507
std::string Status() override
Definition: ZpbExmalifImpl.hpp:994
bool hasKey() const override
Definition: ZpbExmalifImpl.hpp:103
static int32_t typeHash()
Definition: ZpbExmalifImpl.hpp:134
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:1563
void set_allocated_header(::elt::mal::zpb::rr::ReplyHeader *header)
Definition: exmalif.pb.h:7134
Definition: exmalif.pb.h:448
::elt::mal::future< std::string > Move(const std::shared_ptr<::exmalif::AxesPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:861
AxesPositionImpl()
Definition: ZpbExmalifImpl.hpp:163
LogInfoImpl()
Definition: ZpbExmalifImpl.hpp:284
std::size_t keyHash() const
Definition: ZpbExmalifImpl.hpp:93
bool fromByteArray(const void *data, std::size_t size) override
Definition: ZpbExmalifImpl.hpp:362
void setRa(float ra) override
Definition: ZpbExmalifImpl.hpp:74
AxesPositionImpl(const AxesPositionImpl &rhs)
Definition: ZpbExmalifImpl.hpp:182
::elt::mal::future< std::string > Exit() override
Definition: ZpbExmalifImpl.hpp:748
bool fromByteArray(const std::string &data) override
Definition: ZpbExmalifImpl.hpp:116
bool toByteArray(zmq::message_t &msg) const override
Definition: ZpbExmalifImpl.hpp:228
std::unique_ptr<::exmalif::AxesPosition > clone() const override
Definition: ZpbExmalifImpl.hpp:206
std::unique_ptr<::exmalif::LogInfo > clone() const override
Definition: ZpbExmalifImpl.hpp:327
::elt::mal::future< std::string > Preset(const std::shared_ptr<::exmalif::TelPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:821
int32_t code
Definition: Exmalif.hpp:113
std::unique_ptr<::exmalif::TelPosition > cloneKey() const override
Definition: ZpbExmalifImpl.hpp:98
bool toByteArray(zmq::message_t &msg) const override
Definition: ZpbExmalifImpl.hpp:349
bool isDone() override
Definition: ZpbExmalifImpl.hpp:1616
Definition: exmalif.pb.h:1350
bool toByteArray(std::string &output) const override
Definition: ZpbExmalifImpl.hpp:112
required float dec
Definition: exmalif.proto:15
LogInfoImpl(const ::generated::zpb::exmalif::LogInfo &inner)
Definition: ZpbExmalifImpl.hpp:292
Definition: exmalif.pb.h:1796
std::string Move(const std::shared_ptr<::exmalif::AxesPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:1044
Definition: Exmalif.hpp:162
void setLogger(const std::string &logger) override
Definition: ZpbExmalifImpl.hpp:323
ExceptionErrImpl(::generated::zpb::exmalif::ExceptionErr *inner)
Definition: ZpbExmalifImpl.hpp:407
std::string Disable() override
Definition: ZpbExmalifImpl.hpp:984
LogInfoImpl(const LogInfoImpl &rhs)
Definition: ZpbExmalifImpl.hpp:303
void setAlt(float alt) override
Definition: ZpbExmalifImpl.hpp:195
void set_allocated_enable(::generated::zpb::exmalif::StdCmds_Enable_In *enable)
required float az
Definition: exmalif.proto:20
std::string desc
Definition: Exmalif.hpp:112
message AxesPosition
Definition: exmalif.proto:18
Definition: Exmalif.hpp:70
::elt::mal::future< void > asyncConnect() override
Definition: ZpbExmalifImpl.hpp:1064
Definition: exmalif.pb.h:1558
std::string Preset(const std::shared_ptr<::exmalif::TelPosition > &pos) override
Definition: ZpbExmalifImpl.hpp:1034
void updateReply(const ::generated::zpb::exmalif::StdCmds_Reply &reply, bool isPending)
Definition: ZpbExmalifImpl.hpp:483
LogInfoImpl(const std::string &level, const std::string &logger)
Definition: ZpbExmalifImpl.hpp:297
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:1087
void set_allocated_status(::generated::zpb::exmalif::StdCmds_Status_In *status)
package generated zpb exmalif
Definition: exmalif.proto:11
void copy(const ::exmalif::AxesPosition &from) override
Definition: ZpbExmalifImpl.hpp:246
void setDec(float dec) override
Definition: ZpbExmalifImpl.hpp:81
::generated::zpb::exmalif::LogInfo * mutable_info()
Definition: exmalif.pb.h:4785
std::size_t keyHash() const
Definition: ZpbExmalifImpl.hpp:335
Definition: exmalif.pb.h:591
message LogInfo
Definition: exmalif.proto:23
std::size_t keyHash() const
Definition: ZpbExmalifImpl.hpp:214
std::string Init() override
Definition: ZpbExmalifImpl.hpp:954
::elt::mal::future< std::string > Stop() override
Definition: ZpbExmalifImpl.hpp:538
void setAz(float az) override
Definition: ZpbExmalifImpl.hpp:202
AxesPositionImpl(float alt, float az)
Definition: ZpbExmalifImpl.hpp:176
std::shared_ptr<::elt::mal::rr::Ami< std::string > > GetPresetProgress() override
Definition: ZpbExmalifImpl.hpp:904
std::string getLogger() const override
Definition: ZpbExmalifImpl.hpp:319
message TelPosition
Definition: exmalif.proto:13
::elt::mal::future< std::string > Disable() override
Definition: ZpbExmalifImpl.hpp:658
Definition: exmalif.pb.h:934
std::string getDesc() const override
Definition: ZpbExmalifImpl.hpp:437
Definition: exmalif.pb.h:1677
std::string Exit() override
Definition: ZpbExmalifImpl.hpp:1014
bool fromByteArray(const void *data, std::size_t size) override
Definition: ZpbExmalifImpl.hpp:120
::generated::zpb::exmalif::ExceptionErr ZpbType
Definition: ZpbExmalifImpl.hpp:402
void set_allocated_exit(::generated::zpb::exmalif::StdCmds_Exit_In *exit)
void set_allocated_reset(::generated::zpb::exmalif::StdCmds_Reset_In *reset)
float getAz() const override
Definition: ZpbExmalifImpl.hpp:198
TelPositionImpl(const TelPositionImpl &rhs)
Definition: ZpbExmalifImpl.hpp:61
Definition: exmalif.pb.h:830
TelPositionImpl(::generated::zpb::exmalif::TelPosition *inner)
Definition: ZpbExmalifImpl.hpp:45
void set_allocated_config(::generated::zpb::exmalif::StdCmds_Config_In *config)
::elt::mal::rr::ListenerRegistration registerConnectionListener(ConnectionListener listener) override
Definition: ZpbExmalifImpl.hpp:1068
Definition: exmalif.pb.h:3826
float getDec() const override
Definition: ZpbExmalifImpl.hpp:77
AxesPositionImpl(const ::generated::zpb::exmalif::AxesPosition &inner)
Definition: ZpbExmalifImpl.hpp:171
Definition: ZpbExmalifImpl.hpp:400
float getAlt() const override
Definition: ZpbExmalifImpl.hpp:191
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:1520
bool hasKey() const override
Definition: ZpbExmalifImpl.hpp:345
::elt::mal::future< std::string > Config() override
Definition: ZpbExmalifImpl.hpp:718
Definition: exmalif.pb.h:1038
::generated::zpb::exmalif::LogInfo ZpbType
Definition: ZpbExmalifImpl.hpp:282
std::unique_ptr<::exmalif::LogInfo > cloneKey() const override
Definition: ZpbExmalifImpl.hpp:340
ExceptionErrImpl(const ::generated::zpb::exmalif::ExceptionErr &inner)
Definition: ZpbExmalifImpl.hpp:412
std::string getLevel() const override
Definition: ZpbExmalifImpl.hpp:312
Definition: exmalif.pb.h:321
::elt::mal::future< std::string > Reset() override
Definition: ZpbExmalifImpl.hpp:598
AxesPositionImpl(::generated::zpb::exmalif::AxesPosition *inner)
Definition: ZpbExmalifImpl.hpp:166
::elt::mal::future< std::string > Enable() override
Definition: ZpbExmalifImpl.hpp:628
message ExceptionErr
Definition: exmalif.proto:28
void set_allocated_getpresetprogress(::generated::zpb::exmalif::StdCmds_GetPresetProgress_In *getpresetprogress)
std::string Config() override
Definition: ZpbExmalifImpl.hpp:1004
void copy(const ::exmalif::ExceptionErr &from)
Definition: ZpbExmalifImpl.hpp:444
Definition: exmalif.pb.h:1142
std::shared_ptr<::elt::mal::rr::Ami< std::string > > GetPresetProgress() override
Definition: ZpbExmalifImpl.hpp:1054
ExceptionErrImpl(const std::string &desc, int32_t code)
Definition: ZpbExmalifImpl.hpp:422
Definition: exmalif.pb.h:1246
TelPositionImpl(TelPositionImpl &&rhs)
Definition: ZpbExmalifImpl.hpp:63
Definition: Exmalif.hpp:168
::elt::mal::future< std::string > Status() override
Definition: ZpbExmalifImpl.hpp:688
Definition: ZpbExmalifImpl.hpp:279
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:529
bool toByteArray(zmq::message_t &msg) const override
Definition: ZpbExmalifImpl.hpp:107
bool fromByteArray(const void *data, std::size_t size) override
Definition: ZpbExmalifImpl.hpp:241
ExceptionErrImpl(const ExceptionErrImpl &rhs)
Definition: ZpbExmalifImpl.hpp:428