Make FbTk::Command inherit from FbTk::Slot

Command offers a subset of functionality and could be completely removed at some point.
This commit is contained in:
Pavel Labath 2011-07-09 23:25:28 +02:00
parent 3ad611928a
commit bca20c5db4

View file

@ -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