1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/reader_base.proto
3
4 #include "tensorflow/core/framework/reader_base.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace tensorflow {
ReaderBaseState(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR ReaderBaseState::ReaderBaseState(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.current_work_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
25 , /*decltype(_impl_.work_started_)*/::int64_t{0}
26 , /*decltype(_impl_.work_finished_)*/::int64_t{0}
27 , /*decltype(_impl_.num_records_produced_)*/::int64_t{0}
28 , /*decltype(_impl_._cached_size_)*/{}} {}
29 struct ReaderBaseStateDefaultTypeInternal {
ReaderBaseStateDefaultTypeInternaltensorflow::ReaderBaseStateDefaultTypeInternal30 PROTOBUF_CONSTEXPR ReaderBaseStateDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~ReaderBaseStateDefaultTypeInternaltensorflow::ReaderBaseStateDefaultTypeInternal32 ~ReaderBaseStateDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 ReaderBaseState _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ReaderBaseStateDefaultTypeInternal _ReaderBaseState_default_instance_;
38 } // namespace tensorflow
39 namespace tensorflow {
40
41 // ===================================================================
42
43 class ReaderBaseState::_Internal {
44 public:
45 };
46
ReaderBaseState(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)47 ReaderBaseState::ReaderBaseState(::PROTOBUF_NAMESPACE_ID::Arena* arena,
48 bool is_message_owned)
49 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
50 SharedCtor(arena, is_message_owned);
51 // @@protoc_insertion_point(arena_constructor:tensorflow.ReaderBaseState)
52 }
ReaderBaseState(const ReaderBaseState & from)53 ReaderBaseState::ReaderBaseState(const ReaderBaseState& from)
54 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
55 ReaderBaseState* const _this = this; (void)_this;
56 new (&_impl_) Impl_{
57 decltype(_impl_.current_work_){}
58 , decltype(_impl_.work_started_){}
59 , decltype(_impl_.work_finished_){}
60 , decltype(_impl_.num_records_produced_){}
61 , /*decltype(_impl_._cached_size_)*/{}};
62
63 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
64 _impl_.current_work_.InitDefault();
65 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
66 _impl_.current_work_.Set("", GetArenaForAllocation());
67 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
68 if (!from._internal_current_work().empty()) {
69 _this->_impl_.current_work_.Set(from._internal_current_work(),
70 _this->GetArenaForAllocation());
71 }
72 ::memcpy(&_impl_.work_started_, &from._impl_.work_started_,
73 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.num_records_produced_) -
74 reinterpret_cast<char*>(&_impl_.work_started_)) + sizeof(_impl_.num_records_produced_));
75 // @@protoc_insertion_point(copy_constructor:tensorflow.ReaderBaseState)
76 }
77
SharedCtor(::_pb::Arena * arena,bool is_message_owned)78 inline void ReaderBaseState::SharedCtor(
79 ::_pb::Arena* arena, bool is_message_owned) {
80 (void)arena;
81 (void)is_message_owned;
82 new (&_impl_) Impl_{
83 decltype(_impl_.current_work_){}
84 , decltype(_impl_.work_started_){::int64_t{0}}
85 , decltype(_impl_.work_finished_){::int64_t{0}}
86 , decltype(_impl_.num_records_produced_){::int64_t{0}}
87 , /*decltype(_impl_._cached_size_)*/{}
88 };
89 _impl_.current_work_.InitDefault();
90 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
91 _impl_.current_work_.Set("", GetArenaForAllocation());
92 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
93 }
94
~ReaderBaseState()95 ReaderBaseState::~ReaderBaseState() {
96 // @@protoc_insertion_point(destructor:tensorflow.ReaderBaseState)
97 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
98 (void)arena;
99 return;
100 }
101 SharedDtor();
102 }
103
SharedDtor()104 inline void ReaderBaseState::SharedDtor() {
105 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
106 _impl_.current_work_.Destroy();
107 }
108
SetCachedSize(int size) const109 void ReaderBaseState::SetCachedSize(int size) const {
110 _impl_._cached_size_.Set(size);
111 }
112
Clear()113 void ReaderBaseState::Clear() {
114 // @@protoc_insertion_point(message_clear_start:tensorflow.ReaderBaseState)
115 ::uint32_t cached_has_bits = 0;
116 // Prevent compiler warnings about cached_has_bits being unused
117 (void) cached_has_bits;
118
119 _impl_.current_work_.ClearToEmpty();
120 ::memset(&_impl_.work_started_, 0, static_cast<size_t>(
121 reinterpret_cast<char*>(&_impl_.num_records_produced_) -
122 reinterpret_cast<char*>(&_impl_.work_started_)) + sizeof(_impl_.num_records_produced_));
123 _internal_metadata_.Clear<std::string>();
124 }
125
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)126 const char* ReaderBaseState::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
127 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
128 while (!ctx->Done(&ptr)) {
129 ::uint32_t tag;
130 ptr = ::_pbi::ReadTag(ptr, &tag);
131 switch (tag >> 3) {
132 // int64 work_started = 1;
133 case 1:
134 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
135 _impl_.work_started_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
136 CHK_(ptr);
137 } else {
138 goto handle_unusual;
139 }
140 continue;
141 // int64 work_finished = 2;
142 case 2:
143 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
144 _impl_.work_finished_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
145 CHK_(ptr);
146 } else {
147 goto handle_unusual;
148 }
149 continue;
150 // int64 num_records_produced = 3;
151 case 3:
152 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
153 _impl_.num_records_produced_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
154 CHK_(ptr);
155 } else {
156 goto handle_unusual;
157 }
158 continue;
159 // bytes current_work = 4;
160 case 4:
161 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
162 auto str = _internal_mutable_current_work();
163 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
164 CHK_(ptr);
165 } else {
166 goto handle_unusual;
167 }
168 continue;
169 default:
170 goto handle_unusual;
171 } // switch
172 handle_unusual:
173 if ((tag == 0) || ((tag & 7) == 4)) {
174 CHK_(ptr);
175 ctx->SetLastTag(tag);
176 goto message_done;
177 }
178 ptr = UnknownFieldParse(
179 tag,
180 _internal_metadata_.mutable_unknown_fields<std::string>(),
181 ptr, ctx);
182 CHK_(ptr != nullptr);
183 } // while
184 message_done:
185 return ptr;
186 failure:
187 ptr = nullptr;
188 goto message_done;
189 #undef CHK_
190 }
191
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const192 ::uint8_t* ReaderBaseState::_InternalSerialize(
193 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
194 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.ReaderBaseState)
195 ::uint32_t cached_has_bits = 0;
196 (void) cached_has_bits;
197
198 // int64 work_started = 1;
199 if (this->_internal_work_started() != 0) {
200 target = stream->EnsureSpace(target);
201 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_work_started(), target);
202 }
203
204 // int64 work_finished = 2;
205 if (this->_internal_work_finished() != 0) {
206 target = stream->EnsureSpace(target);
207 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_work_finished(), target);
208 }
209
210 // int64 num_records_produced = 3;
211 if (this->_internal_num_records_produced() != 0) {
212 target = stream->EnsureSpace(target);
213 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_num_records_produced(), target);
214 }
215
216 // bytes current_work = 4;
217 if (!this->_internal_current_work().empty()) {
218 target = stream->WriteBytesMaybeAliased(
219 4, this->_internal_current_work(), target);
220 }
221
222 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
223 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
224 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
225 }
226 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.ReaderBaseState)
227 return target;
228 }
229
ByteSizeLong() const230 size_t ReaderBaseState::ByteSizeLong() const {
231 // @@protoc_insertion_point(message_byte_size_start:tensorflow.ReaderBaseState)
232 size_t total_size = 0;
233
234 ::uint32_t cached_has_bits = 0;
235 // Prevent compiler warnings about cached_has_bits being unused
236 (void) cached_has_bits;
237
238 // bytes current_work = 4;
239 if (!this->_internal_current_work().empty()) {
240 total_size += 1 +
241 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
242 this->_internal_current_work());
243 }
244
245 // int64 work_started = 1;
246 if (this->_internal_work_started() != 0) {
247 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_work_started());
248 }
249
250 // int64 work_finished = 2;
251 if (this->_internal_work_finished() != 0) {
252 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_work_finished());
253 }
254
255 // int64 num_records_produced = 3;
256 if (this->_internal_num_records_produced() != 0) {
257 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_num_records_produced());
258 }
259
260 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
261 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
262 }
263 int cached_size = ::_pbi::ToCachedSize(total_size);
264 SetCachedSize(cached_size);
265 return total_size;
266 }
267
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)268 void ReaderBaseState::CheckTypeAndMergeFrom(
269 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
270 MergeFrom(*::_pbi::DownCast<const ReaderBaseState*>(
271 &from));
272 }
273
MergeFrom(const ReaderBaseState & from)274 void ReaderBaseState::MergeFrom(const ReaderBaseState& from) {
275 ReaderBaseState* const _this = this;
276 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.ReaderBaseState)
277 GOOGLE_DCHECK_NE(&from, _this);
278 ::uint32_t cached_has_bits = 0;
279 (void) cached_has_bits;
280
281 if (!from._internal_current_work().empty()) {
282 _this->_internal_set_current_work(from._internal_current_work());
283 }
284 if (from._internal_work_started() != 0) {
285 _this->_internal_set_work_started(from._internal_work_started());
286 }
287 if (from._internal_work_finished() != 0) {
288 _this->_internal_set_work_finished(from._internal_work_finished());
289 }
290 if (from._internal_num_records_produced() != 0) {
291 _this->_internal_set_num_records_produced(from._internal_num_records_produced());
292 }
293 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
294 }
295
CopyFrom(const ReaderBaseState & from)296 void ReaderBaseState::CopyFrom(const ReaderBaseState& from) {
297 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.ReaderBaseState)
298 if (&from == this) return;
299 Clear();
300 MergeFrom(from);
301 }
302
IsInitialized() const303 bool ReaderBaseState::IsInitialized() const {
304 return true;
305 }
306
InternalSwap(ReaderBaseState * other)307 void ReaderBaseState::InternalSwap(ReaderBaseState* other) {
308 using std::swap;
309 auto* lhs_arena = GetArenaForAllocation();
310 auto* rhs_arena = other->GetArenaForAllocation();
311 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
312 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
313 &_impl_.current_work_, lhs_arena,
314 &other->_impl_.current_work_, rhs_arena
315 );
316 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
317 PROTOBUF_FIELD_OFFSET(ReaderBaseState, _impl_.num_records_produced_)
318 + sizeof(ReaderBaseState::_impl_.num_records_produced_) // NOLINT
319 - PROTOBUF_FIELD_OFFSET(ReaderBaseState, _impl_.work_started_)>(
320 reinterpret_cast<char*>(&_impl_.work_started_),
321 reinterpret_cast<char*>(&other->_impl_.work_started_));
322 }
323
GetTypeName() const324 std::string ReaderBaseState::GetTypeName() const {
325 return "tensorflow.ReaderBaseState";
326 }
327
328
329 // @@protoc_insertion_point(namespace_scope)
330 } // namespace tensorflow
331 PROTOBUF_NAMESPACE_OPEN
332 template<> PROTOBUF_NOINLINE ::tensorflow::ReaderBaseState*
CreateMaybeMessage(Arena * arena)333 Arena::CreateMaybeMessage< ::tensorflow::ReaderBaseState >(Arena* arena) {
334 return Arena::CreateMessageInternal< ::tensorflow::ReaderBaseState >(arena);
335 }
336 PROTOBUF_NAMESPACE_CLOSE
337
338 // @@protoc_insertion_point(global_scope)
339 #include <google/protobuf/port_undef.inc>
340