30 : current_metrics_(current_metrics),
31 insertion_metrics_(current_metrics),
32 diff_insertion_metrics_(current_metrics) {}
35 const Metrics &diff_insertion_metrics)
36 : current_metrics_(current_metrics),
37 insertion_metrics_(insertion_metrics),
38 insertion_metrics_set_(
true),
39 diff_insertion_metrics_(diff_insertion_metrics),
40 diff_insertion_metrics_set_(
true) {}
42 const Metrics &getCurrentMetrics()
const {
return current_metrics_; }
44 void updateCurrentMetrics(
const Metrics &updated_current_metrics) {
45 current_metrics_ = updated_current_metrics;
48 void setDiffInsertionMetrics(
const Metrics &diff_insertion_metrics) {
49 if (!diff_insertion_metrics_set_) {
50 diff_insertion_metrics_ = diff_insertion_metrics;
51 diff_insertion_metrics_set_ =
true;
53 throw std::logic_error(
"diff insertion metrics already set");
57 const Metrics &getInsertionMetrics()
const {
return insertion_metrics_; }
59 const Metrics &getDiffInsertionMetrics()
const {
return diff_insertion_metrics_; }
61 const Metrics &getMetricsForAuction()
const {
return getDiffInsertionMetrics(); }
63 bool hasDiffInsertionMetrics()
const {
return diff_insertion_metrics_set_; }
65 void fixInsertionMetrics() {
66 if (!insertion_metrics_set_) {
67 insertion_metrics_ = current_metrics_;
68 insertion_metrics_set_ =
true;
70 throw std::logic_error(
"insertion metrics already set");
75 return getMetricsForAuction() < other.getMetricsForAuction();
79 return getMetricsForAuction() <= other.getMetricsForAuction();
83 return getMetricsForAuction() > other.getMetricsForAuction();
87 return getMetricsForAuction() >= other.getMetricsForAuction();
91 return getMetricsForAuction() == other.getMetricsForAuction();
95 return getMetricsForAuction() != other.getMetricsForAuction();
100 current_metrics_ - other.current_metrics_};
103 SERIALIZE(current_metrics_, insertion_metrics_, insertion_metrics_set_, diff_insertion_metrics_,
104 diff_insertion_metrics_set_);
113 bool insertion_metrics_set_ =
false;
116 Metrics diff_insertion_metrics_;
117 bool diff_insertion_metrics_set_ =
false;