aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/vespa/documentapi/messagebus/messages/getbucketstatereply.h
blob: 5c07c3c9327102b9fd945fd8aefd08808a5c8c96 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "documentreply.h"
#include "documentstate.h"

namespace documentapi {

class GetBucketStateReply : public DocumentReply {
private:
    std::vector<DocumentState> _state;

public:
    /**
     * Constructs a new reply with no content.
     */
    GetBucketStateReply();

    /**
     * Constructs a new reply with initial content. This method takes ownership of the provided state, i.e. it
     * swaps the content of the argument into self.
     *
     * @param state The state to swap.
     */
    GetBucketStateReply(std::vector<DocumentState> &state);
    ~GetBucketStateReply();

    /**
     * Sets the bucket state of this by swapping the content of the provided state object.
     *
     * @param state The state to swap.
     */
    void setBucketState(std::vector<DocumentState> &state) { _state.swap(state); }

    /**
     * Returns the bucket state contained in this.
     *
     * @return The state object.
     */
    std::vector<DocumentState> &getBucketState() { return _state; }

    /**
     * Returns the bucket state contained in this.
     *
     * @return The state object.
     */
    const std::vector<DocumentState> &getBucketState() const { return _state; }

    string toString() const override { return "getbucketstatereply"; }
};

} // documentapi