aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/vespa/documentapi/messagebus/messages/removedocumentreply.h
blob: 5ed254343bbe66dc7cee06e5767a369ad30c2c8a (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "writedocumentreply.h"

namespace documentapi {

class RemoveDocumentReply : public WriteDocumentReply {
private:
    bool _found;

public:
    /**
     * Convenience typedef.
     */
    using UP = std::unique_ptr<RemoveDocumentReply>;
    using SP = std::shared_ptr<RemoveDocumentReply>;

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

    /**
     * Set whether or not the document was found and removed.
     *
     * @param found True if the document was found.
     */
    void setWasFound(bool found) { _found = found; }

    /**
     * Returns whether or not the document was found and removed.
     *
     * @return True if document was found.
     */
    bool wasFound() const { return getWasFound(); }

    /**
     * Returns whether or not the document was found and removed.
     *
     * @return True if document was found.
     */
    bool getWasFound() const { return _found; }

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

}