implement_an_operator.h 603 Bytes
Newer Older
1 2 3 4 5 6 7 8
#ifndef __smtk_ex_CounterOperator_h
#define __smtk_ex_CounterOperator_h

#include "smtk/model/Operator.h"

#include <string>

// ++ 1 ++
9 10
namespace ex
{
11 12 13 14 15 16 17 18 19

class CounterOperator : public smtk::model::Operator
{
public:
  smtkTypeMacro(CounterOperator);
  smtkCreateMacro(CounterOperator);
  smtkSharedFromThisMacro(Operator);
  smtkDeclareModelOperator();
  // ...
20
  // -- 1 --
21

22 23
  // ++ 2 ++
  virtual bool ableToOperate() { return this->ensureSpecification(); }
24 25 26

protected:
  virtual smtk::model::OperatorResult operateInternal();
27
  // -- 2 --
28 29 30 31 32
};

} // namespace ex

#endif // __smtk_ex_CounterOperator_h