table: simplify Measurements with C++11 features
This commit also changes TableMeasurements test suite to use UnitTestTimeFixture.
refs #2100
Change-Id: I6af9fbae435fb50d26f6ec54abc7219680c8ade8
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index 749e97c..e5aaab9 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -171,13 +171,13 @@
// going out of this strategy's namespace
return;
}
- this->getMeasurements().extendLifetime(measurementsEntry, MEASUREMENTS_LIFETIME);
+ this->getMeasurements().extendLifetime(*measurementsEntry, MEASUREMENTS_LIFETIME);
shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
this->getMeasurementsEntryInfo(measurementsEntry);
measurementsEntryInfo->adjustPredictUp();
- measurementsEntry = this->getMeasurements().getParent(measurementsEntry);
+ measurementsEntry = this->getMeasurements().getParent(*measurementsEntry);
}
}
@@ -198,13 +198,13 @@
// going out of this strategy's namespace
return;
}
- this->getMeasurements().extendLifetime(measurementsEntry, MEASUREMENTS_LIFETIME);
+ this->getMeasurements().extendLifetime(*measurementsEntry, MEASUREMENTS_LIFETIME);
shared_ptr<MeasurementsEntryInfo> measurementsEntryInfo =
this->getMeasurementsEntryInfo(measurementsEntry);
measurementsEntryInfo->updateBestFace(inFace);
- measurementsEntry = this->getMeasurements().getParent(measurementsEntry);
+ measurementsEntry = this->getMeasurements().getParent(*measurementsEntry);
}
shared_ptr<PitEntryInfo> pitEntryInfo = pitEntry->getStrategyInfo<PitEntryInfo>();
@@ -231,7 +231,7 @@
info = make_shared<MeasurementsEntryInfo>();
entry->setStrategyInfo(info);
- shared_ptr<measurements::Entry> parentEntry = this->getMeasurements().getParent(entry);
+ shared_ptr<measurements::Entry> parentEntry = this->getMeasurements().getParent(*entry);
if (static_cast<bool>(parentEntry)) {
shared_ptr<MeasurementsEntryInfo> parentInfo = this->getMeasurementsEntryInfo(parentEntry);
BOOST_ASSERT(static_cast<bool>(parentInfo));