[apps/probability] Implement reset of snapshot

Change-Id: I180915a255f45930b407743b9c43e55c2723e1a1
This commit is contained in:
Émilie Feral
2017-05-18 18:02:41 +02:00
parent f6dd2d1180
commit 53b2aa09f4
2 changed files with 9 additions and 0 deletions

View File

@@ -42,6 +42,14 @@ App::Descriptor * App::Snapshot::descriptor() {
return &descriptor;
}
void App::Snapshot::reset() {
law()->~Law();
new(m_law) BinomialLaw();
calculation()->~Calculation();
new(m_calculation) LeftIntegralCalculation();
m_activePage = Page::Law;
}
Law * App::Snapshot::law() {
return (Law *)m_law;
}

View File

@@ -41,6 +41,7 @@ public:
~Snapshot();
App * unpack(Container * container) override;
Descriptor * descriptor() override;
void reset() override;
Law * law();
Calculation * calculation();
Page activePage();