aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/bucket/bucket.cpp
blob: bc009a0445d94aaed3b38ba9242eb43015fb8490 (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.

#include "bucket.h"
#include <vespa/vespalib/stllike/asciistream.h>

namespace document {

Bucket::Bucket() noexcept
    : _bucketSpace(BucketSpace::invalid()),
      _bucketId()
{
}

vespalib::string Bucket::toString() const
{
    vespalib::asciistream os;
    os << *this;
    return os.str();
}

vespalib::asciistream& operator<<(vespalib::asciistream& os, const Bucket& id)
{
    return os << "Bucket(" << id.getBucketSpace() << ", " << id.getBucketId() << ")";
}

std::ostream& operator<<(std::ostream& os, const Bucket& id)
{
    return os << id.toString();
}

}