Make FbTk::Command inherit from FbTk::Slot Command offers a subset of functionality and could be completely removed at some point.
Pavel Labath pavelo@centrum.sk
1 files changed,
8 insertions(+),
3 deletions(-)
jump to
M
src/FbTk/Command.hh
→
src/FbTk/Command.hh
@@ -22,14 +22,19 @@
#ifndef FBTK_COMMAND_HH #define FBTK_COMMAND_HH +#include "Slot.hh" + namespace FbTk { -/// Interface class for commands +/** Interface class for commands + * Actually, it's very similar to Slot (execute instead of operator()) and could be removed at + * some point. + */ template <typename Ret=void> -class Command { +class Command: public Slot<Ret> { public: - virtual ~Command() { } virtual Ret execute() = 0; + virtual Ret operator()() { return execute(); } }; } // end namespace FbTk