-
Notifications
You must be signed in to change notification settings - Fork 0
/
grams.capnp.h
166 lines (134 loc) · 5.91 KB
/
grams.capnp.h
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// Generated by Cap'n Proto compiler, DO NOT EDIT
// source: grams.capnp
#pragma once
#include <capnp/generated-header-support.h>
#include <kj/windows-sanity.h>
#if CAPNP_VERSION != 9001
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
#endif
CAPNP_BEGIN_HEADER
namespace capnp {
namespace schemas {
CAPNP_DECLARE_SCHEMA(caafec65957915d6);
} // namespace schemas
} // namespace capnp
struct Phrase {
Phrase() = delete;
class Reader;
class Builder;
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(caafec65957915d6, 0, 1)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
#endif // !CAPNP_LITE
};
};
// =======================================================================================
class Phrase::Reader {
public:
typedef Phrase Reads;
Reader() = default;
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
inline ::capnp::MessageSize totalSize() const {
return _reader.totalSize().asPublic();
}
#if !CAPNP_LITE
inline ::kj::StringTree toString() const {
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
}
#endif // !CAPNP_LITE
inline bool hasIds() const;
inline ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Reader getIds() const;
private:
::capnp::_::StructReader _reader;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
template <typename, ::capnp::Kind>
friend struct ::capnp::_::PointerHelpers;
template <typename, ::capnp::Kind>
friend struct ::capnp::List;
friend class ::capnp::MessageBuilder;
friend class ::capnp::Orphanage;
};
class Phrase::Builder {
public:
typedef Phrase Builds;
Builder() = delete; // Deleted to discourage incorrect usage.
// You can explicitly initialize to nullptr instead.
inline Builder(decltype(nullptr)) {}
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
#if !CAPNP_LITE
inline ::kj::StringTree toString() const { return asReader().toString(); }
#endif // !CAPNP_LITE
inline bool hasIds();
inline ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Builder getIds();
inline void setIds( ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Reader value);
inline void setIds(::kj::ArrayPtr<const ::uint32_t> value);
inline ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Builder initIds(unsigned int size);
inline void adoptIds(::capnp::Orphan< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>&& value);
inline ::capnp::Orphan< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>> disownIds();
private:
::capnp::_::StructBuilder _builder;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
friend class ::capnp::Orphanage;
template <typename, ::capnp::Kind>
friend struct ::capnp::_::PointerHelpers;
};
#if !CAPNP_LITE
class Phrase::Pipeline {
public:
typedef Phrase Pipelines;
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
: _typeless(kj::mv(typeless)) {}
private:
::capnp::AnyPointer::Pipeline _typeless;
friend class ::capnp::PipelineHook;
template <typename, ::capnp::Kind>
friend struct ::capnp::ToDynamic_;
};
#endif // !CAPNP_LITE
// =======================================================================================
inline bool Phrase::Reader::hasIds() const {
return !_reader.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
}
inline bool Phrase::Builder::hasIds() {
return !_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
}
inline ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Reader Phrase::Reader::getIds() const {
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS));
}
inline ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Builder Phrase::Builder::getIds() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS));
}
inline void Phrase::Builder::setIds( ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Reader value) {
::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS), value);
}
inline void Phrase::Builder::setIds(::kj::ArrayPtr<const ::uint32_t> value) {
::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS), value);
}
inline ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>::Builder Phrase::Builder::initIds(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS), size);
}
inline void Phrase::Builder::adoptIds(
::capnp::Orphan< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>&& value) {
::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>> Phrase::Builder::disownIds() {
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint32_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField(
::capnp::bounded<0>() * ::capnp::POINTERS));
}
CAPNP_END_HEADER