fw4spl
ICommand.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWCOMMAND_ICOMMAND_HPP__
8 #define __FWCOMMAND_ICOMMAND_HPP__
9 
10 #include "fwCommand/config.hpp"
11 
12 #include <memory>
13 #include <string>
14 
15 namespace fwCommand
16 {
17 
21 class FWCOMMAND_CLASS_API ICommand
22 {
23 
24 public:
25 
26  typedef std::shared_ptr<ICommand> sptr;
27 
31  FWCOMMAND_API virtual ~ICommand()
32  {
33  }
34 
38  FWCOMMAND_API virtual size_t getSize() const = 0;
39 
43  FWCOMMAND_API virtual bool redo() = 0;
44 
48  FWCOMMAND_API virtual bool undo() = 0;
49 
53  FWCOMMAND_API virtual const std::string getDescription() const
54  {
55  return "";
56  }
57 
58 };
59 
60 } // namespace fwCommand
61 
62 #endif // __FWCOMMAND_ICOMMAND_HPP__
virtual FWCOMMAND_API ~ICommand()
Virtual destructor.
Definition: ICommand.hpp:31
The base class for commands.
Definition: ICommand.hpp:21
virtual FWCOMMAND_API const std::string getDescription() const
Return an optionnal description of the command.
Definition: ICommand.hpp:53
The namespace fwCommand contains classes describing and managing commands.
Definition: ICommand.hpp:15