blob: a60a49fda27f19e3aa7d36bdc34cc9008559b9c7 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstdint>
namespace vespalib::slime {
/**
* A Symbol may be used to look up a field within an OBJECT.
**/
class Symbol
{
private:
static constexpr uint32_t UNDEFINED = (uint32_t)-1;
uint32_t _value;
public:
Symbol() noexcept : _value(UNDEFINED) {}
Symbol(uint32_t v) noexcept : _value(v) {}
bool undefined() const noexcept { return (_value == UNDEFINED); }
uint32_t getValue() const noexcept { return _value; }
bool operator<(const Symbol &rhs) const noexcept { return (_value < rhs._value); }
bool operator==(const Symbol &rhs) const noexcept { return (_value == rhs._value); }
};
} // namespace vespalib::slime
|