RTC Toolkit  2.0.0
statePublisher.hpp
Go to the documentation of this file.
1 
12 #ifndef RTCTK_COMPONENTFRAMEWORK_STATEPUBLISHER_HPP
13 #define RTCTK_COMPONENTFRAMEWORK_STATEPUBLISHER_HPP
14 
15 #include <mal/utility/Uri.hpp>
16 
17 #include <memory>
18 
19 namespace elt::mal::ps {
20 template <typename TOPIC_TYPE>
21 class Publisher;
22 }
23 
24 namespace stdif {
25 class State;
26 }
27 
28 namespace rtctk::componentFramework {
29 
34 public:
35  StatePublisher(const elt::mal::Uri& uri, const std::string& name);
36 
37  // no copy allowed
38  StatePublisher(const StatePublisher& other) = delete;
39  StatePublisher& operator=(const StatePublisher& other) = delete;
40 
41  // move it instead
42  StatePublisher(StatePublisher&& other) = default;
44 
45  virtual ~StatePublisher() = default;
46 
47  void PublishState(const std::string& state);
48 
49 private:
50  std::unique_ptr<elt::mal::ps::Publisher<stdif::State>> m_publisher;
51  std::string m_name;
52 };
53 } // namespace rtctk::componentFramework
54 
55 #endif // RTCTK_COMPONENTFRAMEWORK_STATEPUBLISHER_HPP
rtctk::componentFramework::StatePublisher::~StatePublisher
virtual ~StatePublisher()=default
wscript.name
name
Definition: wscript:15
rtctk::componentFramework
Definition: commandReplier.cpp:20
rtctk::componentFramework::StatePublisher::StatePublisher
StatePublisher(StatePublisher &&other)=default
rtctk::componentFramework::StatePublisher
Class used to publish state-changed-topic using MAL.
Definition: statePublisher.hpp:33
rtctk::componentFramework::StatePublisher::StatePublisher
StatePublisher(const elt::mal::Uri &uri, const std::string &name)
rtctk::componentFramework::StatePublisher::operator=
StatePublisher & operator=(const StatePublisher &other)=delete
rtctk::componentFramework::StatePublisher::PublishState
void PublishState(const std::string &state)
Definition: statePublisher.cpp:36
rtctk::componentFramework::StatePublisher::StatePublisher
StatePublisher(const StatePublisher &other)=delete
elt::mal::ps
Definition: statePublisher.hpp:19
rtctk::componentFramework::StatePublisher::operator=
StatePublisher & operator=(StatePublisher &&other)=default
rtctk_ctrl_mon_tool.state
def state(ctx, str component)
Definition: rtctk_ctrl_mon_tool.py:158
stdif
Definition: statePublisher.hpp:24
elt::mal::ps::Publisher
Definition: statePublisher.hpp:21