HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
simCmdsImpl.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020-2025 European Southern Observatory (ESO)
2//
3// SPDX-License-Identifier: LGPL-3.0-only
4
13#ifndef HLCC_PFSSIMHLCC_SIMCMDSIMPL_HPP
14#define HLCC_PFSSIMHLCC_SIMCMDSIMPL_HPP
15
16#include <rad/exceptions.hpp>
17#include <rad/smAdapter.hpp>
18
19#include "pfssimhlcc/simCmds.rad.hpp"
20#include "pfssimhlcc/logger.hpp"
21
22namespace hlcc::pfssimhlcc {
23
24
25class SimCmdsImpl : public pfssimhlccif::AsyncSimCmds {
26public:
27 explicit SimCmdsImpl(rad::SMAdapter& sm) : m_sm(sm) {
28 RAD_TRACE(GetLogger());
29 }
30
31 virtual ~SimCmdsImpl() {
32 RAD_TRACE(GetLogger());
33 }
34
35 virtual elt::mal::future<std::string> SetSim(const std::string& config) override {
36
37 RAD_TRACE(GetLogger());
38 auto ev = std::make_shared<SimCmds::SetSim>(config);
39 m_sm.RegisterDefaultRequestRejectHandler<SimCmds::SetSim>();
40 m_sm.PostEvent(ev);
41 RAD_TRACE(GetLogger());
42
43 return ev->GetPayload().GetReplyFuture();
44
45 }
46
47private:
48 rad::SMAdapter& m_sm;
49};
50
51} // namespace hlcc::pfssimhlcc
52
53#endif // HLCC_PFSSIMHLCC_SIMCMDSIMPL_HPP
Definition simCmdsImpl.hpp:25
virtual ~SimCmdsImpl()
Definition simCmdsImpl.hpp:31
virtual elt::mal::future< std::string > SetSim(const std::string &config) override
Definition simCmdsImpl.hpp:35
SimCmdsImpl(rad::SMAdapter &sm)
Definition simCmdsImpl.hpp:27
Definition actionMgr.cpp:34
log4cplus::Logger & GetLogger()
Definition logger.cpp:21
Default logger name.