rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
guardCallback.hpp
Go to the documentation of this file.
1 
9 #ifndef RAD_GUARD_CALLBACK_HPP
10 #define RAD_GUARD_CALLBACK_HPP
11 
12 #include <rad/anyEvent.hpp>
13 
14 #include <scxml4cpp/Action.h>
15 #include <scxml4cpp/Context.h>
16 
17 #include <functional>
18 
19 namespace rad {
20 
24 class GuardCallback final : public scxml4cpp::Action {
25  public:
26  explicit GuardCallback(const std::string id, std::function<bool(AnyEvent const&)> guard_method);
27 
28  void execute(scxml4cpp::Context* c) override;
29  bool evaluate(scxml4cpp::Context* c) override;
30 
31  GuardCallback(GuardCallback&&) = default;
33  GuardCallback(const GuardCallback&) = delete;
34  GuardCallback& operator=(const GuardCallback&) = delete;
35 
36  private:
37  std::function<bool(AnyEvent const&)> m_guard_method;
38 };
39 
40 } // namespace rad
41 
42 #endif // RAD_GUARD_CALLBACK_HPP
void execute(scxml4cpp::Context *c) override
Definition: guardCallback.cpp:33
Definition: Action.h:40
GuardCallback(const std::string id, std::function< bool(AnyEvent const &)> guard_method)
Definition: guardCallback.cpp:20
Definition: Context.h:43
bool evaluate(scxml4cpp::Context *c) override
Definition: guardCallback.cpp:41
GuardCallback & operator=(GuardCallback &&)=default