Last change
on this file since 98a2987 was 01d28a, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
Added templates that allow arbitrary calculations on atoms to be mapped to sets of Atoms
|
-
Property mode
set to
100644
|
File size:
613 bytes
|
Rev | Line | |
---|
[5d4edf] | 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>
|
---|
[01d28a] | 14 | class Calculation : public Process
|
---|
[5d4edf] | 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 |
|
---|
[01d28a] | 24 | virtual T operator()();
|
---|
[5d4edf] | 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.