timestamp.pb.cc 15 KB

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