This commit is contained in:
Eelco Dolstra 2017-08-28 14:30:35 +02:00
parent 8fff3e7bb5
commit e681b1f064
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 14 additions and 18 deletions

View file

@ -192,21 +192,6 @@ public:
update(*state);
}
void setExpected(ActivityId act, ActivityType type, uint64_t expected) override
{
auto state(state_.lock());
auto i = state->its.find(act);
assert(i != state->its.end());
ActInfo & actInfo = *i->second;
auto & j = actInfo.expectedByType[type];
state->activitiesByType[type].expected -= j;
j = expected;
state->activitiesByType[type].expected += j;
update(*state);
}
void result(ActivityId act, ResultType type, const std::vector<Field> & fields) override
{
auto state(state_.lock());
@ -258,6 +243,18 @@ public:
actInfo.failed = getI(fields, 3);
update(*state);
}
else if (type == resSetExpected) {
auto i = state->its.find(act);
assert(i != state->its.end());
ActInfo & actInfo = *i->second;
auto type = (ActivityType) getI(fields, 0);
auto & j = actInfo.expectedByType[type];
state->activitiesByType[type].expected -= j;
j = getI(fields, 1);
state->activitiesByType[type].expected += j;
update(*state);
}
}
void update()