source: molecuilder/src/Actions/Calculation.hpp@ 98a2987

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
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
13template<typename T>
14class Calculation : public Process
15{
16public:
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 T operator()();
25 virtual bool hasResult();
26 virtual T getResult();
27 virtual void reset();
28
29protected:
30 T* result;
31 virtual T* doCalc()=0;
32private:
33 bool done;
34};
35
36#endif /* CALCULATION_HPP_ */
Note: See TracBrowser for help on using the repository browser.