ifw  0.0.1-dev
 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 {
26 public:
27  explicit GuardCallback(const std::string id, std::function<bool(AnyEvent const&)> guardMethod);
28 
29  void execute(scxml4cpp::Context* c) override;
30  bool evaluate(scxml4cpp::Context* c) override;
31 
32  GuardCallback(GuardCallback&&) = default;
34  GuardCallback(const GuardCallback&) = delete;
35  GuardCallback& operator= (const GuardCallback&) = delete;
36 
37 private:
38  std::function<bool(AnyEvent const&)> mGuardMethod;
39 };
40 
41 } // namespace rad
42 
43 #endif
GuardCallback(const std::string id, std::function< bool(AnyEvent const &)> guardMethod)
Definition: GuardCallback.cpp:20
Definition: GuardCallback.hpp:24
void execute(scxml4cpp::Context *c) override
Definition: GuardCallback.cpp:34
Definition: Action.h:41
Definition: Context.h:43
bool evaluate(scxml4cpp::Context *c) override
Definition: GuardCallback.cpp:43
Definition: AnyEvent.hpp:55
GuardCallback & operator=(GuardCallback &&)=default