|
Last change
on this file since 9ef76a was 5d4edf, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Added a class that allows constructing Processes that have a result
|
-
Property mode
set to
100644
|
|
File size:
609 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * Calculation.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Feb 19, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef CALCULATION_HPP_
|
|---|
| 9 | #define CALCULATION_HPP_
|
|---|
| 10 |
|
|---|
| 11 | #include "Actions/Process.hpp"
|
|---|
| 12 |
|
|---|
| 13 | template<typename T>
|
|---|
| 14 | class Calculation: public Process
|
|---|
| 15 | {
|
|---|
| 16 | public:
|
|---|
| 17 | Calculation(int _maxSteps, std::string _name, bool _doRegister=true);
|
|---|
| 18 | virtual ~Calculation();
|
|---|
| 19 |
|
|---|
| 20 | virtual void call();
|
|---|
| 21 | virtual void undo();
|
|---|
| 22 | virtual bool canUndo();
|
|---|
| 23 |
|
|---|
| 24 | virtual void calc();
|
|---|
| 25 | virtual bool hasResult();
|
|---|
| 26 | virtual T getResult();
|
|---|
| 27 | virtual void reset();
|
|---|
| 28 |
|
|---|
| 29 | protected:
|
|---|
| 30 | T* result;
|
|---|
| 31 | virtual T* doCalc()=0;
|
|---|
| 32 | private:
|
|---|
| 33 | bool done;
|
|---|
| 34 | };
|
|---|
| 35 |
|
|---|
| 36 | #endif /* CALCULATION_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.