timestamp.pb.cc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Generated by the protocol buffer compiler. DO NOT EDIT!
  17. // source: google/protobuf/timestamp.proto
  18. #include <google/protobuf/timestamp.pb.h>
  19. #include <algorithm>
  20. #include <google/protobuf/stubs/common.h>
  21. #include <google/protobuf/stubs/port.h>
  22. #include <google/protobuf/stubs/once.h>
  23. #include <google/protobuf/io/coded_stream.h>
  24. #include <google/protobuf/wire_format_lite_inl.h>
  25. #include <google/protobuf/descriptor.h>
  26. #include <google/protobuf/generated_message_reflection.h>
  27. #include <google/protobuf/reflection_ops.h>
  28. #include <google/protobuf/wire_format.h>
  29. // This is a temporary google only hack
  30. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  31. #include "third_party/protobuf/version.h"
  32. #endif
  33. // @@protoc_insertion_point(includes)
  34. namespace google {
  35. namespace protobuf {
  36. class TimestampDefaultTypeInternal {
  37. public:
  38. ::google::protobuf::internal::ExplicitlyConstructed<Timestamp>
  39. _instance;
  40. } _Timestamp_default_instance_;
  41. } // namespace protobuf
  42. } // namespace google
  43. namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto {
  44. void InitDefaultsTimestampImpl() {
  45. GOOGLE_PROTOBUF_VERIFY_VERSION;
  46. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  47. ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
  48. #else
  49. ::google::protobuf::internal::InitProtobufDefaults();
  50. #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  51. {
  52. void* ptr = &::google::protobuf::_Timestamp_default_instance_;
  53. new (ptr) ::google::protobuf::Timestamp();
  54. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  55. }
  56. ::google::protobuf::Timestamp::InitAsDefaultInstance();
  57. }
  58. void InitDefaultsTimestamp() {
  59. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  60. ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsTimestampImpl);
  61. }
  62. ::google::protobuf::Metadata file_level_metadata[1];
  63. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  64. ~0u, // no _has_bits_
  65. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, _internal_metadata_),
  66. ~0u, // no _extensions_
  67. ~0u, // no _oneof_case_
  68. ~0u, // no _weak_field_map_
  69. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, seconds_),
  70. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Timestamp, nanos_),
  71. };
  72. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  73. { 0, -1, sizeof(::google::protobuf::Timestamp)},
  74. };
  75. static ::google::protobuf::Message const * const file_default_instances[] = {
  76. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Timestamp_default_instance_),
  77. };
  78. void protobuf_AssignDescriptors() {
  79. AddDescriptors();
  80. ::google::protobuf::MessageFactory* factory = NULL;
  81. AssignDescriptors(
  82. "google/protobuf/timestamp.proto", schemas, file_default_instances, TableStruct::offsets, factory,
  83. file_level_metadata, NULL, NULL);
  84. }
  85. void protobuf_AssignDescriptorsOnce() {
  86. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  87. ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
  88. }
  89. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  90. void protobuf_RegisterTypes(const ::std::string&) {
  91. protobuf_AssignDescriptorsOnce();
  92. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
  93. }
  94. void AddDescriptorsImpl() {
  95. InitDefaults();
  96. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  97. "\n\037google/protobuf/timestamp.proto\022\017googl"
  98. "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003"
  99. "\022\r\n\005nanos\030\002 \001(\005B~\n\023com.google.protobufB\016"
  100. "TimestampProtoP\001Z+github.com/golang/prot"
  101. "obuf/ptypes/timestamp\370\001\001\242\002\003GPB\252\002\036Google."
  102. "Protobuf.WellKnownTypesb\006proto3"
  103. };
  104. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  105. descriptor, 231);
  106. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  107. "google/protobuf/timestamp.proto", &protobuf_RegisterTypes);
  108. }
  109. void AddDescriptors() {
  110. static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  111. ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
  112. }
  113. // Force AddDescriptors() to be called at dynamic initialization time.
  114. struct StaticDescriptorInitializer {
  115. StaticDescriptorInitializer() {
  116. AddDescriptors();
  117. }
  118. } static_descriptor_initializer;
  119. } // namespace protobuf_google_2fprotobuf_2ftimestamp_2eproto
  120. namespace google {
  121. namespace protobuf {
  122. // ===================================================================
  123. void Timestamp::InitAsDefaultInstance() {
  124. }
  125. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  126. const int Timestamp::kSecondsFieldNumber;
  127. const int Timestamp::kNanosFieldNumber;
  128. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  129. Timestamp::Timestamp()
  130. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  131. if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
  132. ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
  133. }
  134. SharedCtor();
  135. // @@protoc_insertion_point(constructor:google.protobuf.Timestamp)
  136. }
  137. Timestamp::Timestamp(::google::protobuf::Arena* arena)
  138. : ::google::protobuf::Message(),
  139. _internal_metadata_(arena) {
  140. ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
  141. SharedCtor();
  142. RegisterArenaDtor(arena);
  143. // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp)
  144. }
  145. Timestamp::Timestamp(const Timestamp& from)
  146. : ::google::protobuf::Message(),
  147. _internal_metadata_(NULL),
  148. _cached_size_(0) {
  149. _internal_metadata_.MergeFrom(from._internal_metadata_);
  150. ::memcpy(&seconds_, &from.seconds_,
  151. static_cast<size_t>(reinterpret_cast<char*>(&nanos_) -
  152. reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
  153. // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp)
  154. }
  155. void Timestamp::SharedCtor() {
  156. ::memset(&seconds_, 0, static_cast<size_t>(
  157. reinterpret_cast<char*>(&nanos_) -
  158. reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
  159. _cached_size_ = 0;
  160. }
  161. Timestamp::~Timestamp() {
  162. // @@protoc_insertion_point(destructor:google.protobuf.Timestamp)
  163. SharedDtor();
  164. }
  165. void Timestamp::SharedDtor() {
  166. GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
  167. }
  168. void Timestamp::ArenaDtor(void* object) {
  169. Timestamp* _this = reinterpret_cast< Timestamp* >(object);
  170. (void)_this;
  171. }
  172. void Timestamp::RegisterArenaDtor(::google::protobuf::Arena* arena) {
  173. }
  174. void Timestamp::SetCachedSize(int size) const {
  175. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  176. _cached_size_ = size;
  177. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  178. }
  179. const ::google::protobuf::Descriptor* Timestamp::descriptor() {
  180. ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce();
  181. return ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  182. }
  183. const Timestamp& Timestamp::default_instance() {
  184. ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
  185. return *internal_default_instance();
  186. }
  187. Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const {
  188. return ::google::protobuf::Arena::CreateMessage<Timestamp>(arena);
  189. }
  190. void Timestamp::Clear() {
  191. // @@protoc_insertion_point(message_clear_start:google.protobuf.Timestamp)
  192. ::google::protobuf::uint32 cached_has_bits = 0;
  193. // Prevent compiler warnings about cached_has_bits being unused
  194. (void) cached_has_bits;
  195. ::memset(&seconds_, 0, static_cast<size_t>(
  196. reinterpret_cast<char*>(&nanos_) -
  197. reinterpret_cast<char*>(&seconds_)) + sizeof(nanos_));
  198. _internal_metadata_.Clear();
  199. }
  200. bool Timestamp::MergePartialFromCodedStream(
  201. ::google::protobuf::io::CodedInputStream* input) {
  202. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  203. ::google::protobuf::uint32 tag;
  204. // @@protoc_insertion_point(parse_start:google.protobuf.Timestamp)
  205. for (;;) {
  206. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  207. tag = p.first;
  208. if (!p.second) goto handle_unusual;
  209. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  210. // int64 seconds = 1;
  211. case 1: {
  212. if (static_cast< ::google::protobuf::uint8>(tag) ==
  213. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  214. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  215. ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
  216. input, &seconds_)));
  217. } else {
  218. goto handle_unusual;
  219. }
  220. break;
  221. }
  222. // int32 nanos = 2;
  223. case 2: {
  224. if (static_cast< ::google::protobuf::uint8>(tag) ==
  225. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  226. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  227. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  228. input, &nanos_)));
  229. } else {
  230. goto handle_unusual;
  231. }
  232. break;
  233. }
  234. default: {
  235. handle_unusual:
  236. if (tag == 0) {
  237. goto success;
  238. }
  239. DO_(::google::protobuf::internal::WireFormat::SkipField(
  240. input, tag, _internal_metadata_.mutable_unknown_fields()));
  241. break;
  242. }
  243. }
  244. }
  245. success:
  246. // @@protoc_insertion_point(parse_success:google.protobuf.Timestamp)
  247. return true;
  248. failure:
  249. // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp)
  250. return false;
  251. #undef DO_
  252. }
  253. void Timestamp::SerializeWithCachedSizes(
  254. ::google::protobuf::io::CodedOutputStream* output) const {
  255. // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp)
  256. ::google::protobuf::uint32 cached_has_bits = 0;
  257. (void) cached_has_bits;
  258. // int64 seconds = 1;
  259. if (this->seconds() != 0) {
  260. ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(), output);
  261. }
  262. // int32 nanos = 2;
  263. if (this->nanos() != 0) {
  264. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), output);
  265. }
  266. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  267. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  268. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  269. }
  270. // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp)
  271. }
  272. ::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray(
  273. bool deterministic, ::google::protobuf::uint8* target) const {
  274. (void)deterministic; // Unused
  275. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp)
  276. ::google::protobuf::uint32 cached_has_bits = 0;
  277. (void) cached_has_bits;
  278. // int64 seconds = 1;
  279. if (this->seconds() != 0) {
  280. target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->seconds(), target);
  281. }
  282. // int32 nanos = 2;
  283. if (this->nanos() != 0) {
  284. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->nanos(), target);
  285. }
  286. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  287. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  288. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  289. }
  290. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp)
  291. return target;
  292. }
  293. size_t Timestamp::ByteSizeLong() const {
  294. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Timestamp)
  295. size_t total_size = 0;
  296. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  297. total_size +=
  298. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  299. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  300. }
  301. // int64 seconds = 1;
  302. if (this->seconds() != 0) {
  303. total_size += 1 +
  304. ::google::protobuf::internal::WireFormatLite::Int64Size(
  305. this->seconds());
  306. }
  307. // int32 nanos = 2;
  308. if (this->nanos() != 0) {
  309. total_size += 1 +
  310. ::google::protobuf::internal::WireFormatLite::Int32Size(
  311. this->nanos());
  312. }
  313. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  314. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  315. _cached_size_ = cached_size;
  316. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  317. return total_size;
  318. }
  319. void Timestamp::MergeFrom(const ::google::protobuf::Message& from) {
  320. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Timestamp)
  321. GOOGLE_DCHECK_NE(&from, this);
  322. const Timestamp* source =
  323. ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>(
  324. &from);
  325. if (source == NULL) {
  326. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Timestamp)
  327. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  328. } else {
  329. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Timestamp)
  330. MergeFrom(*source);
  331. }
  332. }
  333. void Timestamp::MergeFrom(const Timestamp& from) {
  334. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Timestamp)
  335. GOOGLE_DCHECK_NE(&from, this);
  336. _internal_metadata_.MergeFrom(from._internal_metadata_);
  337. ::google::protobuf::uint32 cached_has_bits = 0;
  338. (void) cached_has_bits;
  339. if (from.seconds() != 0) {
  340. set_seconds(from.seconds());
  341. }
  342. if (from.nanos() != 0) {
  343. set_nanos(from.nanos());
  344. }
  345. }
  346. void Timestamp::CopyFrom(const ::google::protobuf::Message& from) {
  347. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Timestamp)
  348. if (&from == this) return;
  349. Clear();
  350. MergeFrom(from);
  351. }
  352. void Timestamp::CopyFrom(const Timestamp& from) {
  353. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Timestamp)
  354. if (&from == this) return;
  355. Clear();
  356. MergeFrom(from);
  357. }
  358. bool Timestamp::IsInitialized() const {
  359. return true;
  360. }
  361. void Timestamp::Swap(Timestamp* other) {
  362. if (other == this) return;
  363. if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
  364. InternalSwap(other);
  365. } else {
  366. Timestamp* temp = New(GetArenaNoVirtual());
  367. temp->MergeFrom(*other);
  368. other->CopyFrom(*this);
  369. InternalSwap(temp);
  370. if (GetArenaNoVirtual() == NULL) {
  371. delete temp;
  372. }
  373. }
  374. }
  375. void Timestamp::UnsafeArenaSwap(Timestamp* other) {
  376. if (other == this) return;
  377. GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
  378. InternalSwap(other);
  379. }
  380. void Timestamp::InternalSwap(Timestamp* other) {
  381. using std::swap;
  382. swap(seconds_, other->seconds_);
  383. swap(nanos_, other->nanos_);
  384. _internal_metadata_.Swap(&other->_internal_metadata_);
  385. swap(_cached_size_, other->_cached_size_);
  386. }
  387. ::google::protobuf::Metadata Timestamp::GetMetadata() const {
  388. protobuf_google_2fprotobuf_2ftimestamp_2eproto::protobuf_AssignDescriptorsOnce();
  389. return ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::file_level_metadata[kIndexInFileMessages];
  390. }
  391. // @@protoc_insertion_point(namespace_scope)
  392. } // namespace protobuf
  393. } // namespace google
  394. // @@protoc_insertion_point(global_scope)