1 #ifndef __COMMAND_CALLABLE_H
2 #define __COMMAND_CALLABLE_H
9 * Callable behaviour class.
11 template<typename ParameterType>
15 * Function handling user Arguments
17 // void (*func)(ParameterType);
18 std::function<void(ParameterType)> func;
22 * Default constructor.
24 * @param function Function that will be invoked
26 // Callable(void (*function)(ParameterType))
30 Callable(std::function<void(ParameterType)> function)
34 virtual ~Callable() { }
38 * Executes command binded with argument
40 * @param value Value passed to program argument
42 void call(ParameterType value) {
48 * Template specialization of Callable behaviour class.
49 * Allows passing functions with void argument
52 class Callable<void> {
55 * Function handling user Arguments
57 // void (*func)(void);
58 std::function<void(void)> func;
62 * Default constructor.
64 * @param function Function that will be invoked
66 // Callable(void (*function)(void))
70 Callable(std::function<void(void)> function)
74 virtual ~Callable() { }
86 #endif /* __COMMAND_DESCRIPTIVE_H */