aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/feedoperation/newconfigoperation.h
blob: 05b146373789a6234e7175020f42d03eed896198 (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
30
31
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "feedoperation.h"

namespace proton {

    namespace feedoperation {
        struct IStreamHandler {
            virtual ~IStreamHandler() {}
            virtual void serializeConfig(search::SerialNum serialNum, vespalib::nbostream &os) = 0;
            virtual void deserializeConfig(search::SerialNum serialNum, vespalib::nbostream &is) = 0;
        };
    }

class NewConfigOperation : public FeedOperation
{
public:
    using IStreamHandler = feedoperation::IStreamHandler;
private:
    IStreamHandler &_streamHandler;
public:
    NewConfigOperation(SerialNum serialNum, IStreamHandler &streamHandler);
    ~NewConfigOperation() override {}
    void serialize(vespalib::nbostream &os) const override;
    void deserialize(vespalib::nbostream &is, const document::DocumentTypeRepo &repo) override;
    vespalib::string toString() const override;
};

} // namespace proton