Turn Calculator into a singletome and move the list of timesteps inside calculator.
This commit is contained in:
parent
17ae11212a
commit
9af39fa83f
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user