blob: c5729478efbae1db269cd8378b51e8b553933065 (
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
54
55
56
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/data/slime/type.h>
#include <vespa/vespalib/data/memory.h>
namespace vespalib {
namespace slime {
// internal traits for data type types
template<typename T> struct TypeTraits {};
template<> struct TypeTraits<NIX> {
static void assertIsCreatedEmpty() {}
};
template<> struct TypeTraits<BOOL> {
typedef bool PassType;
typedef PassType StoreType;
static const bool unsetValue = false;
};
template<> struct TypeTraits<LONG> {
typedef int64_t PassType;
typedef PassType StoreType;
static const int64_t unsetValue = 0;
};
template<> struct TypeTraits<DOUBLE> {
typedef double PassType;
typedef PassType StoreType;
static const double unsetValue;
};
template<> struct TypeTraits<STRING> {
typedef Memory PassType;
static const Memory unsetValue;
};
template<> struct TypeTraits<DATA> {
typedef Memory PassType;
static const Memory unsetValue;
};
template<> struct TypeTraits<ARRAY> {
static void assertIsCreatedEmpty() {}
};
template<> struct TypeTraits<OBJECT> {
static void assertIsCreatedEmpty() {}
};
} // namespace vespalib::slime
} // namespace vespalib
|