blob: 1ddb5a2ef0386e6fc8485ab2aef4ad8dcbbb4859 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "pending_gid_to_lid_changes.h"
#include "gid_to_lid_change_handler.h"
namespace proton {
PendingGidToLidChanges::PendingGidToLidChanges(GidToLidChangeHandler& handler, std::vector<PendingGidToLidChange> &&pending_changes)
: IPendingGidToLidChanges(),
_handler(handler),
_pending_changes(std::move(pending_changes))
{
}
PendingGidToLidChanges::~PendingGidToLidChanges() = default;
void
PendingGidToLidChanges::notify_done()
{
for (auto& change : _pending_changes) {
if (change.is_remove()) {
_handler.notifyRemoveDone(change.get_gid(), change.get_serial_num());
} else {
_handler.notifyPutDone(std::move(change).steal_context(), change.get_gid(), change.get_lid(), change.get_serial_num());
}
}
}
}
|