Turn Calculator into a singletome and move the list of timesteps inside calculator.
This commit is contained in:
		| @@ -13,9 +13,23 @@ | |||||||
| using namespace std; | using namespace std; | ||||||
|  |  | ||||||
| class Calculator { | class Calculator { | ||||||
| public: |     mutable QList<int> m_timeSteps; | ||||||
|  |  | ||||||
|  | protected: | ||||||
|     explicit Calculator() = default; |     explicit Calculator() = default; | ||||||
|  |  | ||||||
|  | public: | ||||||
|  |     Calculator(Calculator const &other) = delete; | ||||||
|  |     void operator=(Calculator const &) = delete; | ||||||
|  |  | ||||||
|  |     static Calculator &GetInstance() { | ||||||
|  |         static Calculator c; | ||||||
|  |         return c; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     void ResetTimeSteps() { m_timeSteps.clear(); } | ||||||
|  |     QList<int> timeSteps() const { return m_timeSteps; } | ||||||
|  |  | ||||||
| 	/// <summary> | 	/// <summary> | ||||||
| 	/// Gets duration in seconds from cost | 	/// Gets duration in seconds from cost | ||||||
| 	/// </summary> | 	/// </summary> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user