OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kv.pb.cc
Go to the documentation of this file.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: kv.proto
3 
4 #include "kv.pb.h"
5 
6 #include <algorithm>
7 
8 #include <google/protobuf/stubs/common.h>
9 #include <google/protobuf/stubs/port.h>
10 #include <google/protobuf/stubs/once.h>
11 #include <google/protobuf/io/coded_stream.h>
12 #include <google/protobuf/wire_format_lite_inl.h>
13 #include <google/protobuf/descriptor.h>
14 #include <google/protobuf/generated_message_reflection.h>
15 #include <google/protobuf/reflection_ops.h>
16 #include <google/protobuf/wire_format.h>
17 // This is a temporary google only hack
18 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
19 #include "third_party/protobuf/version.h"
20 #endif
21 // @@protoc_insertion_point(includes)
22 namespace mvccpb {
24  public:
25  ::google::protobuf::internal::ExplicitlyConstructed<KeyValue>
29  public:
30  ::google::protobuf::internal::ExplicitlyConstructed<Event>
33 } // namespace mvccpb
34 namespace protobuf_kv_2eproto {
36  GOOGLE_PROTOBUF_VERIFY_VERSION;
37 
38 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
39  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
40 #else
41  ::google::protobuf::internal::InitProtobufDefaults();
42 #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
43  {
45  new (ptr) ::mvccpb::KeyValue();
46  ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
47  }
49 }
50 
52  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
53  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsKeyValueImpl);
54 }
55 
57  GOOGLE_PROTOBUF_VERIFY_VERSION;
58 
59 #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
60  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
61 #else
62  ::google::protobuf::internal::InitProtobufDefaults();
63 #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
65  {
67  new (ptr) ::mvccpb::Event();
68  ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
69  }
71 }
72 
74  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
75  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsEventImpl);
76 }
77 
78 ::google::protobuf::Metadata file_level_metadata[2];
79 const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
80 
81 const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
82  ~0u, // no _has_bits_
83  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, _internal_metadata_),
84  ~0u, // no _extensions_
85  ~0u, // no _oneof_case_
86  ~0u, // no _weak_field_map_
87  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, key_),
88  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, create_revision_),
89  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, mod_revision_),
90  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, version_),
91  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, value_),
92  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::KeyValue, lease_),
93  ~0u, // no _has_bits_
94  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::Event, _internal_metadata_),
95  ~0u, // no _extensions_
96  ~0u, // no _oneof_case_
97  ~0u, // no _weak_field_map_
98  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::Event, type_),
99  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::Event, kv_),
100  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::mvccpb::Event, prev_kv_),
101 };
102 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
103  { 0, -1, sizeof(::mvccpb::KeyValue)},
104  { 11, -1, sizeof(::mvccpb::Event)},
105 };
106 
107 static ::google::protobuf::Message const * const file_default_instances[] = {
108  reinterpret_cast<const ::google::protobuf::Message*>(&::mvccpb::_KeyValue_default_instance_),
109  reinterpret_cast<const ::google::protobuf::Message*>(&::mvccpb::_Event_default_instance_),
110 };
111 
113  AddDescriptors();
114  ::google::protobuf::MessageFactory* factory = NULL;
115  AssignDescriptors(
116  "kv.proto", schemas, file_default_instances, TableStruct::offsets, factory,
118 }
119 
121  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
122  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
123 }
124 
125 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
126 void protobuf_RegisterTypes(const ::std::string&) {
128  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
129 }
130 
132  InitDefaults();
133  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
134  "\n\010kv.proto\022\006mvccpb\"u\n\010KeyValue\022\013\n\003key\030\001 "
135  "\001(\014\022\027\n\017create_revision\030\002 \001(\003\022\024\n\014mod_revi"
136  "sion\030\003 \001(\003\022\017\n\007version\030\004 \001(\003\022\r\n\005value\030\005 \001"
137  "(\014\022\r\n\005lease\030\006 \001(\003\"\221\001\n\005Event\022%\n\004type\030\001 \001("
138  "\0162\027.mvccpb.Event.EventType\022\034\n\002kv\030\002 \001(\0132\020"
139  ".mvccpb.KeyValue\022!\n\007prev_kv\030\003 \001(\0132\020.mvcc"
140  "pb.KeyValue\" \n\tEventType\022\007\n\003PUT\020\000\022\n\n\006DEL"
141  "ETE\020\001b\006proto3"
142  };
143  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
144  descriptor, 293);
145  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
146  "kv.proto", &protobuf_RegisterTypes);
147 }
148 
150  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
151  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
152 }
153 // Force AddDescriptors() to be called at dynamic initialization time.
156  AddDescriptors();
157  }
159 } // namespace protobuf_kv_2eproto
160 namespace mvccpb {
161 const ::google::protobuf::EnumDescriptor* Event_EventType_descriptor() {
164 }
165 bool Event_EventType_IsValid(int value) {
166  switch (value) {
167  case 0:
168  case 1:
169  return true;
170  default:
171  return false;
172  }
173 }
174 
175 #if !defined(_MSC_VER) || _MSC_VER >= 1900
176 const Event_EventType Event::PUT;
178 const Event_EventType Event::EventType_MIN;
179 const Event_EventType Event::EventType_MAX;
180 const int Event::EventType_ARRAYSIZE;
181 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
182 
183 // ===================================================================
184 
185 void KeyValue::InitAsDefaultInstance() {
186 }
187 #if !defined(_MSC_VER) || _MSC_VER >= 1900
188 const int KeyValue::kKeyFieldNumber;
189 const int KeyValue::kCreateRevisionFieldNumber;
190 const int KeyValue::kModRevisionFieldNumber;
191 const int KeyValue::kVersionFieldNumber;
192 const int KeyValue::kValueFieldNumber;
193 const int KeyValue::kLeaseFieldNumber;
194 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
195 
196 KeyValue::KeyValue()
197  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
198  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
200  }
201  SharedCtor();
202  // @@protoc_insertion_point(constructor:mvccpb.KeyValue)
203 }
205  : ::google::protobuf::Message(),
206  _internal_metadata_(NULL),
207  _cached_size_(0) {
209  key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
210  if (from.key().size() > 0) {
211  key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_);
212  }
213  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
214  if (from.value().size() > 0) {
215  value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
216  }
217  ::memcpy(&create_revision_, &from.create_revision_,
218  static_cast<size_t>(reinterpret_cast<char*>(&lease_) -
219  reinterpret_cast<char*>(&create_revision_)) + sizeof(lease_));
220  // @@protoc_insertion_point(copy_constructor:mvccpb.KeyValue)
221 }
222 
224  key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
225  value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
226  ::memset(&create_revision_, 0, static_cast<size_t>(
227  reinterpret_cast<char*>(&lease_) -
228  reinterpret_cast<char*>(&create_revision_)) + sizeof(lease_));
229  _cached_size_ = 0;
230 }
231 
233  // @@protoc_insertion_point(destructor:mvccpb.KeyValue)
234  SharedDtor();
235 }
236 
238  key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
239  value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
240 }
241 
242 void KeyValue::SetCachedSize(int size) const {
243  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
244  _cached_size_ = size;
245  GOOGLE_SAFE_CONCURRENT_WRITES_END();
246 }
247 const ::google::protobuf::Descriptor* KeyValue::descriptor() {
250 }
251 
254  return *internal_default_instance();
255 }
256 
257 KeyValue* KeyValue::New(::google::protobuf::Arena* arena) const {
258  KeyValue* n = new KeyValue;
259  if (arena != NULL) {
260  arena->Own(n);
261  }
262  return n;
263 }
264 
266 // @@protoc_insertion_point(message_clear_start:mvccpb.KeyValue)
267  ::google::protobuf::uint32 cached_has_bits = 0;
268  // Prevent compiler warnings about cached_has_bits being unused
269  (void) cached_has_bits;
270 
271  key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
272  value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
273  ::memset(&create_revision_, 0, static_cast<size_t>(
274  reinterpret_cast<char*>(&lease_) -
275  reinterpret_cast<char*>(&create_revision_)) + sizeof(lease_));
276  _internal_metadata_.Clear();
277 }
278 
280  ::google::protobuf::io::CodedInputStream* input) {
281 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
282  ::google::protobuf::uint32 tag;
283  // @@protoc_insertion_point(parse_start:mvccpb.KeyValue)
284  for (;;) {
285  ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
286  tag = p.first;
287  if (!p.second) goto handle_unusual;
288  switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
289  // bytes key = 1;
290  case 1: {
291  if (static_cast< ::google::protobuf::uint8>(tag) ==
292  static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
293  DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
294  input, this->mutable_key()));
295  } else {
296  goto handle_unusual;
297  }
298  break;
299  }
300 
301  // int64 create_revision = 2;
302  case 2: {
303  if (static_cast< ::google::protobuf::uint8>(tag) ==
304  static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
305 
306  DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
307  ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
308  input, &create_revision_)));
309  } else {
310  goto handle_unusual;
311  }
312  break;
313  }
314 
315  // int64 mod_revision = 3;
316  case 3: {
317  if (static_cast< ::google::protobuf::uint8>(tag) ==
318  static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
319 
320  DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
321  ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
322  input, &mod_revision_)));
323  } else {
324  goto handle_unusual;
325  }
326  break;
327  }
328 
329  // int64 version = 4;
330  case 4: {
331  if (static_cast< ::google::protobuf::uint8>(tag) ==
332  static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
333 
334  DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
335  ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
336  input, &version_)));
337  } else {
338  goto handle_unusual;
339  }
340  break;
341  }
342 
343  // bytes value = 5;
344  case 5: {
345  if (static_cast< ::google::protobuf::uint8>(tag) ==
346  static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
347  DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
348  input, this->mutable_value()));
349  } else {
350  goto handle_unusual;
351  }
352  break;
353  }
354 
355  // int64 lease = 6;
356  case 6: {
357  if (static_cast< ::google::protobuf::uint8>(tag) ==
358  static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
359 
360  DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
361  ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
362  input, &lease_)));
363  } else {
364  goto handle_unusual;
365  }
366  break;
367  }
368 
369  default: {
370  handle_unusual:
371  if (tag == 0) {
372  goto success;
373  }
374  DO_(::google::protobuf::internal::WireFormat::SkipField(
375  input, tag, _internal_metadata_.mutable_unknown_fields()));
376  break;
377  }
378  }
379  }
380 success:
381  // @@protoc_insertion_point(parse_success:mvccpb.KeyValue)
382  return true;
383 failure:
384  // @@protoc_insertion_point(parse_failure:mvccpb.KeyValue)
385  return false;
386 #undef DO_
387 }
388 
390  ::google::protobuf::io::CodedOutputStream* output) const {
391  // @@protoc_insertion_point(serialize_start:mvccpb.KeyValue)
392  ::google::protobuf::uint32 cached_has_bits = 0;
393  (void) cached_has_bits;
394 
395  // bytes key = 1;
396  if (this->key().size() > 0) {
397  ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
398  1, this->key(), output);
399  }
400 
401  // int64 create_revision = 2;
402  if (this->create_revision() != 0) {
403  ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->create_revision(), output);
404  }
405 
406  // int64 mod_revision = 3;
407  if (this->mod_revision() != 0) {
408  ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->mod_revision(), output);
409  }
410 
411  // int64 version = 4;
412  if (this->version() != 0) {
413  ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->version(), output);
414  }
415 
416  // bytes value = 5;
417  if (this->value().size() > 0) {
418  ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
419  5, this->value(), output);
420  }
421 
422  // int64 lease = 6;
423  if (this->lease() != 0) {
424  ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->lease(), output);
425  }
426 
427  if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
428  ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
429  (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
430  }
431  // @@protoc_insertion_point(serialize_end:mvccpb.KeyValue)
432 }
433 
435  bool deterministic, ::google::protobuf::uint8* target) const {
436  (void)deterministic; // Unused
437  // @@protoc_insertion_point(serialize_to_array_start:mvccpb.KeyValue)
438  ::google::protobuf::uint32 cached_has_bits = 0;
439  (void) cached_has_bits;
440 
441  // bytes key = 1;
442  if (this->key().size() > 0) {
443  target =
444  ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
445  1, this->key(), target);
446  }
447 
448  // int64 create_revision = 2;
449  if (this->create_revision() != 0) {
450  target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->create_revision(), target);
451  }
452 
453  // int64 mod_revision = 3;
454  if (this->mod_revision() != 0) {
455  target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->mod_revision(), target);
456  }
457 
458  // int64 version = 4;
459  if (this->version() != 0) {
460  target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->version(), target);
461  }
462 
463  // bytes value = 5;
464  if (this->value().size() > 0) {
465  target =
466  ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
467  5, this->value(), target);
468  }
469 
470  // int64 lease = 6;
471  if (this->lease() != 0) {
472  target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->lease(), target);
473  }
474 
475  if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
476  target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
477  (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
478  }
479  // @@protoc_insertion_point(serialize_to_array_end:mvccpb.KeyValue)
480  return target;
481 }
482 
483 size_t KeyValue::ByteSizeLong() const {
484 // @@protoc_insertion_point(message_byte_size_start:mvccpb.KeyValue)
485  size_t total_size = 0;
486 
487  if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
488  total_size +=
489  ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
490  (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
491  }
492  // bytes key = 1;
493  if (this->key().size() > 0) {
494  total_size += 1 +
495  ::google::protobuf::internal::WireFormatLite::BytesSize(
496  this->key());
497  }
498 
499  // bytes value = 5;
500  if (this->value().size() > 0) {
501  total_size += 1 +
502  ::google::protobuf::internal::WireFormatLite::BytesSize(
503  this->value());
504  }
505 
506  // int64 create_revision = 2;
507  if (this->create_revision() != 0) {
508  total_size += 1 +
509  ::google::protobuf::internal::WireFormatLite::Int64Size(
510  this->create_revision());
511  }
512 
513  // int64 mod_revision = 3;
514  if (this->mod_revision() != 0) {
515  total_size += 1 +
516  ::google::protobuf::internal::WireFormatLite::Int64Size(
517  this->mod_revision());
518  }
519 
520  // int64 version = 4;
521  if (this->version() != 0) {
522  total_size += 1 +
523  ::google::protobuf::internal::WireFormatLite::Int64Size(
524  this->version());
525  }
526 
527  // int64 lease = 6;
528  if (this->lease() != 0) {
529  total_size += 1 +
530  ::google::protobuf::internal::WireFormatLite::Int64Size(
531  this->lease());
532  }
533 
534  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
535  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
536  _cached_size_ = cached_size;
537  GOOGLE_SAFE_CONCURRENT_WRITES_END();
538  return total_size;
539 }
540 
541 void KeyValue::MergeFrom(const ::google::protobuf::Message& from) {
542 // @@protoc_insertion_point(generalized_merge_from_start:mvccpb.KeyValue)
543  GOOGLE_DCHECK_NE(&from, this);
544  const KeyValue* source =
545  ::google::protobuf::internal::DynamicCastToGenerated<const KeyValue>(
546  &from);
547  if (source == NULL) {
548  // @@protoc_insertion_point(generalized_merge_from_cast_fail:mvccpb.KeyValue)
549  ::google::protobuf::internal::ReflectionOps::Merge(from, this);
550  } else {
551  // @@protoc_insertion_point(generalized_merge_from_cast_success:mvccpb.KeyValue)
552  MergeFrom(*source);
553  }
554 }
555 
556 void KeyValue::MergeFrom(const KeyValue& from) {
557 // @@protoc_insertion_point(class_specific_merge_from_start:mvccpb.KeyValue)
558  GOOGLE_DCHECK_NE(&from, this);
560  ::google::protobuf::uint32 cached_has_bits = 0;
561  (void) cached_has_bits;
562 
563  if (from.key().size() > 0) {
564 
565  key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.key_);
566  }
567  if (from.value().size() > 0) {
568 
569  value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.value_);
570  }
571  if (from.create_revision() != 0) {
573  }
574  if (from.mod_revision() != 0) {
576  }
577  if (from.version() != 0) {
578  set_version(from.version());
579  }
580  if (from.lease() != 0) {
581  set_lease(from.lease());
582  }
583 }
584 
585 void KeyValue::CopyFrom(const ::google::protobuf::Message& from) {
586 // @@protoc_insertion_point(generalized_copy_from_start:mvccpb.KeyValue)
587  if (&from == this) return;
588  Clear();
589  MergeFrom(from);
590 }
591 
592 void KeyValue::CopyFrom(const KeyValue& from) {
593 // @@protoc_insertion_point(class_specific_copy_from_start:mvccpb.KeyValue)
594  if (&from == this) return;
595  Clear();
596  MergeFrom(from);
597 }
598 
600  return true;
601 }
602 
603 void KeyValue::Swap(KeyValue* other) {
604  if (other == this) return;
605  InternalSwap(other);
606 }
608  using std::swap;
609  key_.Swap(&other->key_);
610  value_.Swap(&other->value_);
613  swap(version_, other->version_);
614  swap(lease_, other->lease_);
617 }
618 
619 ::google::protobuf::Metadata KeyValue::GetMetadata() const {
622 }
623 
624 
625 // ===================================================================
626 
628  ::mvccpb::_Event_default_instance_._instance.get_mutable()->kv_ = const_cast< ::mvccpb::KeyValue*>(
630  ::mvccpb::_Event_default_instance_._instance.get_mutable()->prev_kv_ = const_cast< ::mvccpb::KeyValue*>(
632 }
633 #if !defined(_MSC_VER) || _MSC_VER >= 1900
634 const int Event::kTypeFieldNumber;
635 const int Event::kKvFieldNumber;
636 const int Event::kPrevKvFieldNumber;
637 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
638 
640  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
641  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
643  }
644  SharedCtor();
645  // @@protoc_insertion_point(constructor:mvccpb.Event)
646 }
647 Event::Event(const Event& from)
648  : ::google::protobuf::Message(),
649  _internal_metadata_(NULL),
650  _cached_size_(0) {
652  if (from.has_kv()) {
653  kv_ = new ::mvccpb::KeyValue(*from.kv_);
654  } else {
655  kv_ = NULL;
656  }
657  if (from.has_prev_kv()) {
658  prev_kv_ = new ::mvccpb::KeyValue(*from.prev_kv_);
659  } else {
660  prev_kv_ = NULL;
661  }
662  type_ = from.type_;
663  // @@protoc_insertion_point(copy_constructor:mvccpb.Event)
664 }
665 
667  ::memset(&kv_, 0, static_cast<size_t>(
668  reinterpret_cast<char*>(&type_) -
669  reinterpret_cast<char*>(&kv_)) + sizeof(type_));
670  _cached_size_ = 0;
671 }
672 
674  // @@protoc_insertion_point(destructor:mvccpb.Event)
675  SharedDtor();
676 }
677 
679  if (this != internal_default_instance()) delete kv_;
680  if (this != internal_default_instance()) delete prev_kv_;
681 }
682 
683 void Event::SetCachedSize(int size) const {
684  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
685  _cached_size_ = size;
686  GOOGLE_SAFE_CONCURRENT_WRITES_END();
687 }
688 const ::google::protobuf::Descriptor* Event::descriptor() {
691 }
692 
695  return *internal_default_instance();
696 }
697 
698 Event* Event::New(::google::protobuf::Arena* arena) const {
699  Event* n = new Event;
700  if (arena != NULL) {
701  arena->Own(n);
702  }
703  return n;
704 }
705 
706 void Event::Clear() {
707 // @@protoc_insertion_point(message_clear_start:mvccpb.Event)
708  ::google::protobuf::uint32 cached_has_bits = 0;
709  // Prevent compiler warnings about cached_has_bits being unused
710  (void) cached_has_bits;
711 
712  if (GetArenaNoVirtual() == NULL && kv_ != NULL) {
713  delete kv_;
714  }
715  kv_ = NULL;
716  if (GetArenaNoVirtual() == NULL && prev_kv_ != NULL) {
717  delete prev_kv_;
718  }
719  prev_kv_ = NULL;
720  type_ = 0;
721  _internal_metadata_.Clear();
722 }
723 
725  ::google::protobuf::io::CodedInputStream* input) {
726 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
727  ::google::protobuf::uint32 tag;
728  // @@protoc_insertion_point(parse_start:mvccpb.Event)
729  for (;;) {
730  ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
731  tag = p.first;
732  if (!p.second) goto handle_unusual;
733  switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
734  // .mvccpb.Event.EventType type = 1;
735  case 1: {
736  if (static_cast< ::google::protobuf::uint8>(tag) ==
737  static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
738  int value;
739  DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
740  int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
741  input, &value)));
742  set_type(static_cast< ::mvccpb::Event_EventType >(value));
743  } else {
744  goto handle_unusual;
745  }
746  break;
747  }
748 
749  // .mvccpb.KeyValue kv = 2;
750  case 2: {
751  if (static_cast< ::google::protobuf::uint8>(tag) ==
752  static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
753  DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
754  input, mutable_kv()));
755  } else {
756  goto handle_unusual;
757  }
758  break;
759  }
760 
761  // .mvccpb.KeyValue prev_kv = 3;
762  case 3: {
763  if (static_cast< ::google::protobuf::uint8>(tag) ==
764  static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
765  DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
766  input, mutable_prev_kv()));
767  } else {
768  goto handle_unusual;
769  }
770  break;
771  }
772 
773  default: {
774  handle_unusual:
775  if (tag == 0) {
776  goto success;
777  }
778  DO_(::google::protobuf::internal::WireFormat::SkipField(
779  input, tag, _internal_metadata_.mutable_unknown_fields()));
780  break;
781  }
782  }
783  }
784 success:
785  // @@protoc_insertion_point(parse_success:mvccpb.Event)
786  return true;
787 failure:
788  // @@protoc_insertion_point(parse_failure:mvccpb.Event)
789  return false;
790 #undef DO_
791 }
792 
794  ::google::protobuf::io::CodedOutputStream* output) const {
795  // @@protoc_insertion_point(serialize_start:mvccpb.Event)
796  ::google::protobuf::uint32 cached_has_bits = 0;
797  (void) cached_has_bits;
798 
799  // .mvccpb.Event.EventType type = 1;
800  if (this->type() != 0) {
801  ::google::protobuf::internal::WireFormatLite::WriteEnum(
802  1, this->type(), output);
803  }
804 
805  // .mvccpb.KeyValue kv = 2;
806  if (this->has_kv()) {
807  ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
808  2, *this->kv_, output);
809  }
810 
811  // .mvccpb.KeyValue prev_kv = 3;
812  if (this->has_prev_kv()) {
813  ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
814  3, *this->prev_kv_, output);
815  }
816 
817  if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
818  ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
819  (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
820  }
821  // @@protoc_insertion_point(serialize_end:mvccpb.Event)
822 }
823 
825  bool deterministic, ::google::protobuf::uint8* target) const {
826  (void)deterministic; // Unused
827  // @@protoc_insertion_point(serialize_to_array_start:mvccpb.Event)
828  ::google::protobuf::uint32 cached_has_bits = 0;
829  (void) cached_has_bits;
830 
831  // .mvccpb.Event.EventType type = 1;
832  if (this->type() != 0) {
833  target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
834  1, this->type(), target);
835  }
836 
837  // .mvccpb.KeyValue kv = 2;
838  if (this->has_kv()) {
839  target = ::google::protobuf::internal::WireFormatLite::
840  InternalWriteMessageToArray(
841  2, *this->kv_, deterministic, target);
842  }
843 
844  // .mvccpb.KeyValue prev_kv = 3;
845  if (this->has_prev_kv()) {
846  target = ::google::protobuf::internal::WireFormatLite::
847  InternalWriteMessageToArray(
848  3, *this->prev_kv_, deterministic, target);
849  }
850 
851  if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
852  target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
853  (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
854  }
855  // @@protoc_insertion_point(serialize_to_array_end:mvccpb.Event)
856  return target;
857 }
858 
859 size_t Event::ByteSizeLong() const {
860 // @@protoc_insertion_point(message_byte_size_start:mvccpb.Event)
861  size_t total_size = 0;
862 
863  if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
864  total_size +=
865  ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
866  (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
867  }
868  // .mvccpb.KeyValue kv = 2;
869  if (this->has_kv()) {
870  total_size += 1 +
871  ::google::protobuf::internal::WireFormatLite::MessageSize(
872  *this->kv_);
873  }
874 
875  // .mvccpb.KeyValue prev_kv = 3;
876  if (this->has_prev_kv()) {
877  total_size += 1 +
878  ::google::protobuf::internal::WireFormatLite::MessageSize(
879  *this->prev_kv_);
880  }
881 
882  // .mvccpb.Event.EventType type = 1;
883  if (this->type() != 0) {
884  total_size += 1 +
885  ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
886  }
887 
888  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
889  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
890  _cached_size_ = cached_size;
891  GOOGLE_SAFE_CONCURRENT_WRITES_END();
892  return total_size;
893 }
894 
895 void Event::MergeFrom(const ::google::protobuf::Message& from) {
896 // @@protoc_insertion_point(generalized_merge_from_start:mvccpb.Event)
897  GOOGLE_DCHECK_NE(&from, this);
898  const Event* source =
899  ::google::protobuf::internal::DynamicCastToGenerated<const Event>(
900  &from);
901  if (source == NULL) {
902  // @@protoc_insertion_point(generalized_merge_from_cast_fail:mvccpb.Event)
903  ::google::protobuf::internal::ReflectionOps::Merge(from, this);
904  } else {
905  // @@protoc_insertion_point(generalized_merge_from_cast_success:mvccpb.Event)
906  MergeFrom(*source);
907  }
908 }
909 
910 void Event::MergeFrom(const Event& from) {
911 // @@protoc_insertion_point(class_specific_merge_from_start:mvccpb.Event)
912  GOOGLE_DCHECK_NE(&from, this);
914  ::google::protobuf::uint32 cached_has_bits = 0;
915  (void) cached_has_bits;
916 
917  if (from.has_kv()) {
918  mutable_kv()->::mvccpb::KeyValue::MergeFrom(from.kv());
919  }
920  if (from.has_prev_kv()) {
921  mutable_prev_kv()->::mvccpb::KeyValue::MergeFrom(from.prev_kv());
922  }
923  if (from.type() != 0) {
924  set_type(from.type());
925  }
926 }
927 
928 void Event::CopyFrom(const ::google::protobuf::Message& from) {
929 // @@protoc_insertion_point(generalized_copy_from_start:mvccpb.Event)
930  if (&from == this) return;
931  Clear();
932  MergeFrom(from);
933 }
934 
935 void Event::CopyFrom(const Event& from) {
936 // @@protoc_insertion_point(class_specific_copy_from_start:mvccpb.Event)
937  if (&from == this) return;
938  Clear();
939  MergeFrom(from);
940 }
941 
942 bool Event::IsInitialized() const {
943  return true;
944 }
945 
946 void Event::Swap(Event* other) {
947  if (other == this) return;
948  InternalSwap(other);
949 }
951  using std::swap;
952  swap(kv_, other->kv_);
953  swap(prev_kv_, other->prev_kv_);
954  swap(type_, other->type_);
957 }
958 
959 ::google::protobuf::Metadata Event::GetMetadata() const {
962 }
963 
964 
965 // @@protoc_insertion_point(namespace_scope)
966 } // namespace mvccpb
967 
968 // @@protoc_insertion_point(global_scope)
::google::protobuf::int64 lease() const
Definition: kv.pb.h:544
void Clear() PROTOBUF_FINAL
Definition: kv.pb.cc:706
bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL
Definition: kv.pb.cc:279
::google::protobuf::internal::ArenaStringPtr value_
Definition: kv.pb.h:227
void MergeFrom(const ::google::protobuf::Message &from) PROTOBUF_FINAL
Definition: kv.pb.cc:895
void Clear() PROTOBUF_FINAL
Definition: kv.pb.cc:265
void CopyFrom(const ::google::protobuf::Message &from) PROTOBUF_FINAL
Definition: kv.pb.cc:585
virtual ~Event()
Definition: kv.pb.cc:673
void protobuf_AssignDescriptorsOnce()
Definition: kv.pb.cc:120
static void InitAsDefaultInstance()
Definition: kv.pb.cc:627
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold)
void failure(const char *fmt,...)
void SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL
Definition: kv.pb.cc:389
void SharedCtor()
Definition: kv.pb.cc:666
friend void swap(KeyValue &a, KeyValue &b)
Definition: kv.pb.h:126
#define DO_(EXPRESSION)
static const KeyValue * internal_default_instance()
Definition: kv.pb.h:118
::google::protobuf::internal::ArenaStringPtr key_
Definition: kv.pb.h:226
static void InitAsDefaultInstance()
Definition: kv.pb.cc:185
int _cached_size_
Definition: kv.pb.h:232
::std::string * mutable_key()
Definition: kv.pb.h:425
static const ::google::protobuf::Descriptor * descriptor()
Definition: kv.pb.cc:688
void SetCachedSize(int size) const PROTOBUF_FINAL
Definition: kv.pb.cc:683
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_
Definition: kv.pb.h:373
void InternalSwap(Event *other)
Definition: kv.pb.cc:950
::google::protobuf::uint8 * InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 *target) const PROTOBUF_FINAL
Definition: kv.pb.cc:824
::google::protobuf::uint8 * InternalSerializeWithCachedSizesToArray(bool deterministic,::google::protobuf::uint8 *target) const PROTOBUF_FINAL
Definition: kv.pb.cc:434
void Swap(Event *other)
Definition: kv.pb.cc:946
::google::protobuf::int64 version_
Definition: kv.pb.h:230
int _cached_size_
Definition: kv.pb.h:377
bool has_prev_kv() const
Definition: kv.pb.h:623
static const ::google::protobuf::Descriptor * descriptor()
Definition: kv.pb.cc:247
void SetCachedSize(int size) const PROTOBUF_FINAL
Definition: kv.pb.cc:242
void SharedCtor()
Definition: kv.pb.cc:223
static const int kPrevKvFieldNumber
Definition: kv.pb.h:358
virtual ~KeyValue()
Definition: kv.pb.cc:232
struct protobuf_kv_2eproto::StaticDescriptorInitializer static_descriptor_initializer
void InitDefaultsKeyValueImpl()
Definition: kv.pb.cc:35
::google::protobuf::internal::ExplicitlyConstructed< Event > _instance
Definition: kv.pb.cc:31
::google::protobuf::int64 create_revision_
Definition: kv.pb.h:228
::google::protobuf::Metadata file_level_metadata[2]
Definition: kv.pb.cc:78
::google::protobuf::int64 mod_revision() const
Definition: kv.pb.h:463
const ::std::string & key() const
Definition: kv.pb.h:396
static const KeyValue & default_instance()
Definition: kv.pb.cc:252
const ::google::protobuf::EnumDescriptor * file_level_enum_descriptors[1]
Definition: kv.pb.cc:79
const ::std::string & value() const
Definition: kv.pb.h:491
const ::mvccpb::KeyValue & prev_kv() const
Definition: kv.pb.h:632
inline::google::protobuf::Arena * GetArenaNoVirtual() const
Definition: kv.pb.h:306
void AddDescriptorsImpl()
Definition: kv.pb.cc:131
::mvccpb::KeyValue * mutable_prev_kv()
Definition: kv.pb.h:645
::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL
Definition: kv.pb.cc:959
void set_create_revision(::google::protobuf::int64 value)
Definition: kv.pb.h:453
::google::protobuf::int64 version() const
Definition: kv.pb.h:477
void protobuf_RegisterTypes(const ::std::string &) GOOGLE_PROTOBUF_ATTRIBUTE_COLD
Definition: kv.pb.cc:126
static const int kKvFieldNumber
Definition: kv.pb.h:349
friend void swap(Event &a, Event &b)
Definition: kv.pb.h:276
Event
Definition: http_client.h:27
const ::mvccpb::KeyValue & kv() const
Definition: kv.pb.h:582
void SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL
Definition: kv.pb.cc:793
static const Event & default_instance()
Definition: kv.pb.cc:693
void SharedDtor()
Definition: kv.pb.cc:237
class mvccpb::KeyValueDefaultTypeInternal _KeyValue_default_instance_
Definition: kv.pb.h:60
void AddDescriptors()
Definition: kv.pb.cc:149
class mvccpb::EventDefaultTypeInternal _Event_default_instance_
Definition: kv.pb.h:57
bool IsInitialized() const PROTOBUF_FINAL
Definition: kv.pb.cc:599
::google::protobuf::internal::ExplicitlyConstructed< KeyValue > _instance
Definition: kv.pb.cc:26
KeyValue * New() const PROTOBUF_FINAL
Definition: kv.pb.h:132
void set_mod_revision(::google::protobuf::int64 value)
Definition: kv.pb.h:467
size_t ByteSizeLong() const PROTOBUF_FINAL
Definition: kv.pb.cc:859
void protobuf_AssignDescriptorsOnce()
Definition: auth.pb.cc:151
bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL
Definition: kv.pb.cc:724
::google::protobuf::Message const *const file_default_instances[]
Definition: kv.pb.cc:107
::mvccpb::Event_EventType type() const
Definition: kv.pb.h:562
const ::google::protobuf::EnumDescriptor * Event_EventType_descriptor()
Definition: kv.pb.cc:161
::mvccpb::KeyValue * prev_kv_
Definition: kv.pb.h:375
void InitDefaultsKeyValue()
Definition: kv.pb.cc:51
void protobuf_AssignDescriptors()
Definition: kv.pb.cc:112
Event_EventType
Definition: kv.pb.h:65
::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL
Definition: kv.pb.cc:619
::google::protobuf::int64 lease_
Definition: kv.pb.h:231
static PROTOBUF_CONSTEXPR int const kIndexInFileMessages
Definition: kv.pb.h:122
Event * New() const PROTOBUF_FINAL
Definition: kv.pb.h:282
void InternalSwap(KeyValue *other)
Definition: kv.pb.cc:607
::mvccpb::KeyValue * mutable_kv()
Definition: kv.pb.h:595
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_
Definition: kv.pb.h:225
static const int kTypeFieldNumber
Definition: kv.pb.h:366
::google::protobuf::int64 create_revision() const
Definition: kv.pb.h:449
void InitDefaults()
Definition: kv.pb.h:50
void InitDefaultsEvent()
Definition: kv.pb.cc:73
static PROTOBUF_CONSTEXPR int const kIndexInFileMessages
Definition: kv.pb.h:272
void set_type(::mvccpb::Event_EventType value)
Definition: kv.pb.h:566
bool IsInitialized() const PROTOBUF_FINAL
Definition: kv.pb.cc:942
void InitDefaultsEventImpl()
Definition: kv.pb.cc:56
int type_
Definition: kv.pb.h:376
bool has_kv() const
Definition: kv.pb.h:573
void MergeFrom(const ::google::protobuf::Message &from) PROTOBUF_FINAL
Definition: kv.pb.cc:541
::mvccpb::KeyValue * kv_
Definition: kv.pb.h:374
void Swap(KeyValue *other)
Definition: kv.pb.cc:603
static const Event * internal_default_instance()
Definition: kv.pb.h:268
void set_lease(::google::protobuf::int64 value)
Definition: kv.pb.h:548
bool Event_EventType_IsValid(int value)
Definition: kv.pb.cc:165
size_t ByteSizeLong() const PROTOBUF_FINAL
Definition: kv.pb.cc:483
static const ::google::protobuf::uint32 offsets[]
Definition: kv.pb.h:43
void SharedDtor()
Definition: kv.pb.cc:678
void set_version(::google::protobuf::int64 value)
Definition: kv.pb.h:481
::google::protobuf::Metadata file_level_metadata[3]
Definition: auth.pb.cc:104
::std::string * mutable_value()
Definition: kv.pb.h:520
::google::protobuf::int64 mod_revision_
Definition: kv.pb.h:229
void CopyFrom(const ::google::protobuf::Message &from) PROTOBUF_FINAL
Definition: kv.pb.cc:928