Changeset 01d28a for molecuilder/src/Actions/Calculation_impl.hpp
- Timestamp:
- Feb 19, 2010, 2:31:56 PM (16 years ago)
- Children:
- 7bfc19
- Parents:
- 9ef76a
- File:
-
- 1 edited
-
molecuilder/src/Actions/Calculation_impl.hpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/Actions/Calculation_impl.hpp
r9ef76a r01d28a 9 9 #define CALCULATION_IMPL_HPP_ 10 10 11 #include "Actions/Calculation.hpp" 12 11 13 #include <cassert> 12 14 13 15 template<typename T> 14 Calculation<T>::Calculation(int _maxSteps, std::string _name, bool _doRegister =true) :16 Calculation<T>::Calculation(int _maxSteps, std::string _name, bool _doRegister) : 15 17 Process(_maxSteps,_name,_doRegister), 16 18 done(false), … … 20 22 template<typename T> 21 23 Calculation<T>::~Calculation() 22 {} 24 { 25 delete result; 26 } 23 27 24 28 // methods inherited from Action … … 26 30 template<typename T> 27 31 void Calculation<T>::call(){ 28 calc(); 32 reset(); 33 (*this)(); 29 34 } 30 35 … … 41 46 42 47 template<typename T> 43 void Calculation<T>::calc(){48 T Calculation<T>::operator()(){ 44 49 if(!done){ 45 50 result = doCalc(); 46 51 done = true; 47 52 } 53 return *result; 48 54 } 49 55 … … 62 68 void Calculation<T>::reset(){ 63 69 done = false; 70 delete result; 64 71 result = 0; 65 72 }
Note:
See TracChangeset
for help on using the changeset viewer.
