aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h
blob: 75da3adc973a815416427fbfb555303b472025ef (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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/util/idestructorcallback.h>
#include <vespa/vespalib/stllike/string.h>
#include <vector>

namespace document { class GlobalId; }

namespace proton {

/*
 * Interface class for listening to changes in mapping from gid to lid
 * and updating reference attribute appropriately.
 */
class IGidToLidChangeListener
{
public:
    using IDestructorCallbackSP = std::shared_ptr<vespalib::IDestructorCallback>;
    virtual ~IGidToLidChangeListener() { }
    virtual void notifyPutDone(IDestructorCallbackSP context, document::GlobalId gid, uint32_t lid) = 0;
    virtual void notifyRemove(IDestructorCallbackSP context, document::GlobalId gid) = 0;
    virtual void notifyRegistered(const std::vector<document::GlobalId>& removes) = 0;
    virtual const vespalib::string &getName() const = 0;
    virtual const vespalib::string &getDocTypeName() const = 0;
};

} // namespace proton