| OLD | NEW |
| 1 // Generated by the protocol buffer compiler. DO NOT EDIT! | 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 // source: google/protobuf/timestamp.proto | 2 // source: google/protobuf/timestamp.proto |
| 3 | 3 |
| 4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION | 4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
| 5 #include <google/protobuf/timestamp.pb.h> | 5 #include <google/protobuf/timestamp.pb.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include <google/protobuf/stubs/common.h> | 9 #include <google/protobuf/stubs/common.h> |
| 10 #include <google/protobuf/stubs/port.h> | 10 #include <google/protobuf/stubs/port.h> |
| 11 #include <google/protobuf/stubs/once.h> | 11 #include <google/protobuf/stubs/once.h> |
| 12 #include <google/protobuf/io/coded_stream.h> | 12 #include <google/protobuf/io/coded_stream.h> |
| 13 #include <google/protobuf/wire_format_lite_inl.h> | 13 #include <google/protobuf/wire_format_lite_inl.h> |
| 14 #include <google/protobuf/descriptor.h> | 14 #include <google/protobuf/descriptor.h> |
| 15 #include <google/protobuf/generated_message_reflection.h> | 15 #include <google/protobuf/generated_message_reflection.h> |
| 16 #include <google/protobuf/reflection_ops.h> | 16 #include <google/protobuf/reflection_ops.h> |
| 17 #include <google/protobuf/wire_format.h> | 17 #include <google/protobuf/wire_format.h> |
| 18 // @@protoc_insertion_point(includes) | 18 // @@protoc_insertion_point(includes) |
| 19 | 19 |
| 20 namespace google { | 20 namespace google { |
| 21 namespace protobuf { | 21 namespace protobuf { |
| 22 class TimestampDefaultTypeInternal : public ::google::protobuf::internal::Explic
itlyConstructed<Timestamp> {}; | |
| 23 TimestampDefaultTypeInternal _Timestamp_default_instance_; | |
| 24 | 22 |
| 25 namespace { | 23 namespace { |
| 26 | 24 |
| 27 ::google::protobuf::Metadata file_level_metadata[1]; | 25 const ::google::protobuf::Descriptor* Timestamp_descriptor_ = NULL; |
| 26 const ::google::protobuf::internal::GeneratedMessageReflection* |
| 27 Timestamp_reflection_ = NULL; |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 | 31 |
| 32 const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftimestamp
_2eproto() GOOGLE_ATTRIBUTE_COLD; | 32 void protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto() { |
| 33 const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2ftimestamp
_2eproto() { | 33 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); |
| 34 static const ::google::protobuf::uint32 offsets[] = { | 34 const ::google::protobuf::FileDescriptor* file = |
| 35 ~0u, // no _has_bits_ | 35 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( |
| 36 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metadata
_), | 36 "google/protobuf/timestamp.proto"); |
| 37 ~0u, // no _extensions_ | 37 GOOGLE_CHECK(file != NULL); |
| 38 ~0u, // no _oneof_case_ | 38 Timestamp_descriptor_ = file->message_type(0); |
| 39 static const int Timestamp_offsets_[2] = { |
| 39 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_), | 40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, seconds_), |
| 40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_), | 41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, nanos_), |
| 41 }; | 42 }; |
| 42 return offsets; | 43 Timestamp_reflection_ = |
| 44 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessag
eReflection( |
| 45 Timestamp_descriptor_, |
| 46 Timestamp::default_instance_, |
| 47 Timestamp_offsets_, |
| 48 -1, |
| 49 -1, |
| 50 -1, |
| 51 sizeof(Timestamp), |
| 52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _internal_metada
ta_), |
| 53 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Timestamp, _is_default_inst
ance_)); |
| 43 } | 54 } |
| 44 | 55 |
| 45 static const ::google::protobuf::internal::MigrationSchema schemas[] = { | |
| 46 { 0, -1, sizeof(Timestamp)}, | |
| 47 }; | |
| 48 | |
| 49 static const ::google::protobuf::internal::DefaultInstanceData file_default_inst
ances[] = { | |
| 50 {reinterpret_cast<const ::google::protobuf::Message*>(&_Timestamp_default_inst
ance_), NULL}, | |
| 51 }; | |
| 52 | |
| 53 namespace { | 56 namespace { |
| 54 | 57 |
| 55 void protobuf_AssignDescriptors() { | 58 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); |
| 56 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); | 59 inline void protobuf_AssignDescriptorsOnce() { |
| 57 ::google::protobuf::MessageFactory* factory = NULL; | 60 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, |
| 58 AssignDescriptors( | 61 &protobuf_AssignDesc_google_2fprotobuf_2ftimestamp_2eproto); |
| 59 "google/protobuf/timestamp.proto", schemas, file_default_instances, protob
uf_Offsets_google_2fprotobuf_2ftimestamp_2eproto(), factory, | |
| 60 file_level_metadata, NULL, NULL); | |
| 61 } | 62 } |
| 62 | 63 |
| 63 void protobuf_AssignDescriptorsOnce() { | |
| 64 static GOOGLE_PROTOBUF_DECLARE_ONCE(once); | |
| 65 ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); | |
| 66 } | |
| 67 | |
| 68 void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; | |
| 69 void protobuf_RegisterTypes(const ::std::string&) { | 64 void protobuf_RegisterTypes(const ::std::string&) { |
| 70 protobuf_AssignDescriptorsOnce(); | 65 protobuf_AssignDescriptorsOnce(); |
| 71 ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); | 66 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 67 Timestamp_descriptor_, &Timestamp::default_instance()); |
| 72 } | 68 } |
| 73 | 69 |
| 74 } // namespace | 70 } // namespace |
| 75 | 71 |
| 76 void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto() { | 72 void protobuf_ShutdownFile_google_2fprotobuf_2ftimestamp_2eproto() { |
| 77 _Timestamp_default_instance_.Shutdown(); | 73 delete Timestamp::default_instance_; |
| 78 delete file_level_metadata[0].reflection; | 74 delete Timestamp_reflection_; |
| 79 } | 75 } |
| 80 | 76 |
| 81 void protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto_impl() { | 77 void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto() { |
| 78 static bool already_here = false; |
| 79 if (already_here) return; |
| 80 already_here = true; |
| 82 GOOGLE_PROTOBUF_VERIFY_VERSION; | 81 GOOGLE_PROTOBUF_VERIFY_VERSION; |
| 83 | 82 |
| 84 ::google::protobuf::internal::InitProtobufDefaults(); | |
| 85 _Timestamp_default_instance_.DefaultConstruct(); | |
| 86 } | |
| 87 | |
| 88 void protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto() { | |
| 89 static GOOGLE_PROTOBUF_DECLARE_ONCE(once); | |
| 90 ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprot
obuf_2ftimestamp_2eproto_impl); | |
| 91 } | |
| 92 void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_impl() { | |
| 93 protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); | |
| 94 static const char descriptor[] = { | |
| 95 "\n\037google/protobuf/timestamp.proto\022\017googl" | |
| 96 "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003" | |
| 97 "\022\r\n\005nanos\030\002 \001(\005B~\n\023com.google.protobufB\016" | |
| 98 "TimestampProtoP\001Z+github.com/golang/prot" | |
| 99 "obuf/ptypes/timestamp\370\001\001\242\002\003GPB\252\002\036Google." | |
| 100 "Protobuf.WellKnownTypesb\006proto3" | |
| 101 }; | |
| 102 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( | 83 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
| 103 descriptor, 231); | 84 "\n\037google/protobuf/timestamp.proto\022\017googl" |
| 85 "e.protobuf\"+\n\tTimestamp\022\017\n\007seconds\030\001 \001(\003" |
| 86 "\022\r\n\005nanos\030\002 \001(\005B\201\001\n\023com.google.protobufB" |
| 87 "\016TimestampProtoP\001Z+github.com/golang/pro" |
| 88 "tobuf/ptypes/timestamp\240\001\001\370\001\001\242\002\003GPB\252\002\036Go
o" |
| 89 "gle.Protobuf.WellKnownTypesb\006proto3", 235); |
| 104 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( | 90 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
| 105 "google/protobuf/timestamp.proto", &protobuf_RegisterTypes); | 91 "google/protobuf/timestamp.proto", &protobuf_RegisterTypes); |
| 92 Timestamp::default_instance_ = new Timestamp(); |
| 93 Timestamp::default_instance_->InitAsDefaultInstance(); |
| 106 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2ftimestamp_2eproto); | 94 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2ftimestamp_2eproto); |
| 107 } | 95 } |
| 108 | 96 |
| 109 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2epr
oto_once_); | |
| 110 void protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto() { | |
| 111 ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2ftimes
tamp_2eproto_once_, | |
| 112 &protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto_impl); | |
| 113 } | |
| 114 // Force AddDescriptors() to be called at static initialization time. | 97 // Force AddDescriptors() to be called at static initialization time. |
| 115 struct StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto { | 98 struct StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto { |
| 116 StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto() { | 99 StaticDescriptorInitializer_google_2fprotobuf_2ftimestamp_2eproto() { |
| 117 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); | 100 protobuf_AddDesc_google_2fprotobuf_2ftimestamp_2eproto(); |
| 118 } | 101 } |
| 119 } static_descriptor_initializer_google_2fprotobuf_2ftimestamp_2eproto_; | 102 } static_descriptor_initializer_google_2fprotobuf_2ftimestamp_2eproto_; |
| 120 | 103 |
| 104 namespace { |
| 105 |
| 106 static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; |
| 107 static void MergeFromFail(int line) { |
| 108 GOOGLE_CHECK(false) << __FILE__ << ":" << line; |
| 109 } |
| 110 |
| 111 } // namespace |
| 112 |
| 113 |
| 121 // =================================================================== | 114 // =================================================================== |
| 122 | 115 |
| 123 #if !defined(_MSC_VER) || _MSC_VER >= 1900 | 116 #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 124 const int Timestamp::kSecondsFieldNumber; | 117 const int Timestamp::kSecondsFieldNumber; |
| 125 const int Timestamp::kNanosFieldNumber; | 118 const int Timestamp::kNanosFieldNumber; |
| 126 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 | 119 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 127 | 120 |
| 128 Timestamp::Timestamp() | 121 Timestamp::Timestamp() |
| 129 : ::google::protobuf::Message(), _internal_metadata_(NULL) { | 122 : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
| 130 if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { | |
| 131 protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); | |
| 132 } | |
| 133 SharedCtor(); | 123 SharedCtor(); |
| 134 // @@protoc_insertion_point(constructor:google.protobuf.Timestamp) | 124 // @@protoc_insertion_point(constructor:google.protobuf.Timestamp) |
| 135 } | 125 } |
| 126 |
| 136 Timestamp::Timestamp(::google::protobuf::Arena* arena) | 127 Timestamp::Timestamp(::google::protobuf::Arena* arena) |
| 137 : ::google::protobuf::Message(), | 128 : ::google::protobuf::Message(), |
| 138 _internal_metadata_(arena) { | 129 _internal_metadata_(arena) { |
| 139 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER | |
| 140 protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); | |
| 141 #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER | |
| 142 SharedCtor(); | 130 SharedCtor(); |
| 143 RegisterArenaDtor(arena); | 131 RegisterArenaDtor(arena); |
| 144 // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp) | 132 // @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp) |
| 145 } | 133 } |
| 134 |
| 135 void Timestamp::InitAsDefaultInstance() { |
| 136 _is_default_instance_ = true; |
| 137 } |
| 138 |
| 146 Timestamp::Timestamp(const Timestamp& from) | 139 Timestamp::Timestamp(const Timestamp& from) |
| 147 : ::google::protobuf::Message(), | 140 : ::google::protobuf::Message(), |
| 148 _internal_metadata_(NULL), | 141 _internal_metadata_(NULL) { |
| 149 _cached_size_(0) { | 142 SharedCtor(); |
| 150 _internal_metadata_.MergeFrom(from._internal_metadata_); | 143 MergeFrom(from); |
| 151 ::memcpy(&seconds_, &from.seconds_, | |
| 152 reinterpret_cast<char*>(&nanos_) - | |
| 153 reinterpret_cast<char*>(&seconds_) + sizeof(nanos_)); | |
| 154 // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp) | 144 // @@protoc_insertion_point(copy_constructor:google.protobuf.Timestamp) |
| 155 } | 145 } |
| 156 | 146 |
| 157 void Timestamp::SharedCtor() { | 147 void Timestamp::SharedCtor() { |
| 158 ::memset(&seconds_, 0, reinterpret_cast<char*>(&nanos_) - | 148 _is_default_instance_ = false; |
| 159 reinterpret_cast<char*>(&seconds_) + sizeof(nanos_)); | |
| 160 _cached_size_ = 0; | 149 _cached_size_ = 0; |
| 150 seconds_ = GOOGLE_LONGLONG(0); |
| 151 nanos_ = 0; |
| 161 } | 152 } |
| 162 | 153 |
| 163 Timestamp::~Timestamp() { | 154 Timestamp::~Timestamp() { |
| 164 // @@protoc_insertion_point(destructor:google.protobuf.Timestamp) | 155 // @@protoc_insertion_point(destructor:google.protobuf.Timestamp) |
| 165 SharedDtor(); | 156 SharedDtor(); |
| 166 } | 157 } |
| 167 | 158 |
| 168 void Timestamp::SharedDtor() { | 159 void Timestamp::SharedDtor() { |
| 169 ::google::protobuf::Arena* arena = GetArenaNoVirtual(); | 160 if (GetArenaNoVirtual() != NULL) { |
| 170 if (arena != NULL) { | |
| 171 return; | 161 return; |
| 172 } | 162 } |
| 173 | 163 |
| 164 if (this != default_instance_) { |
| 165 } |
| 174 } | 166 } |
| 175 | 167 |
| 176 void Timestamp::ArenaDtor(void* object) { | 168 void Timestamp::ArenaDtor(void* object) { |
| 177 Timestamp* _this = reinterpret_cast< Timestamp* >(object); | 169 Timestamp* _this = reinterpret_cast< Timestamp* >(object); |
| 178 (void)_this; | 170 (void)_this; |
| 179 } | 171 } |
| 180 void Timestamp::RegisterArenaDtor(::google::protobuf::Arena* arena) { | 172 void Timestamp::RegisterArenaDtor(::google::protobuf::Arena* arena) { |
| 181 } | 173 } |
| 182 void Timestamp::SetCachedSize(int size) const { | 174 void Timestamp::SetCachedSize(int size) const { |
| 183 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | 175 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 184 _cached_size_ = size; | 176 _cached_size_ = size; |
| 185 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | 177 GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 186 } | 178 } |
| 187 const ::google::protobuf::Descriptor* Timestamp::descriptor() { | 179 const ::google::protobuf::Descriptor* Timestamp::descriptor() { |
| 188 protobuf_AssignDescriptorsOnce(); | 180 protobuf_AssignDescriptorsOnce(); |
| 189 return file_level_metadata[0].descriptor; | 181 return Timestamp_descriptor_; |
| 190 } | 182 } |
| 191 | 183 |
| 192 const Timestamp& Timestamp::default_instance() { | 184 const Timestamp& Timestamp::default_instance() { |
| 193 protobuf_InitDefaults_google_2fprotobuf_2ftimestamp_2eproto(); | 185 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ftimestamp_
2eproto(); |
| 194 return *internal_default_instance(); | 186 return *default_instance_; |
| 195 } | 187 } |
| 196 | 188 |
| 189 Timestamp* Timestamp::default_instance_ = NULL; |
| 190 |
| 197 Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const { | 191 Timestamp* Timestamp::New(::google::protobuf::Arena* arena) const { |
| 198 return ::google::protobuf::Arena::CreateMessage<Timestamp>(arena); | 192 return ::google::protobuf::Arena::CreateMessage<Timestamp>(arena); |
| 199 } | 193 } |
| 200 | 194 |
| 201 void Timestamp::Clear() { | 195 void Timestamp::Clear() { |
| 202 // @@protoc_insertion_point(message_clear_start:google.protobuf.Timestamp) | 196 // @@protoc_insertion_point(message_clear_start:google.protobuf.Timestamp) |
| 203 ::memset(&seconds_, 0, reinterpret_cast<char*>(&nanos_) - | 197 #if defined(__clang__) |
| 204 reinterpret_cast<char*>(&seconds_) + sizeof(nanos_)); | 198 #define ZR_HELPER_(f) \ |
| 199 _Pragma("clang diagnostic push") \ |
| 200 _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ |
| 201 __builtin_offsetof(Timestamp, f) \ |
| 202 _Pragma("clang diagnostic pop") |
| 203 #else |
| 204 #define ZR_HELPER_(f) reinterpret_cast<char*>(\ |
| 205 &reinterpret_cast<Timestamp*>(16)->f) |
| 206 #endif |
| 207 |
| 208 #define ZR_(first, last) do {\ |
| 209 ::memset(&first, 0,\ |
| 210 ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ |
| 211 } while (0) |
| 212 |
| 213 ZR_(seconds_, nanos_); |
| 214 |
| 215 #undef ZR_HELPER_ |
| 216 #undef ZR_ |
| 217 |
| 205 } | 218 } |
| 206 | 219 |
| 207 bool Timestamp::MergePartialFromCodedStream( | 220 bool Timestamp::MergePartialFromCodedStream( |
| 208 ::google::protobuf::io::CodedInputStream* input) { | 221 ::google::protobuf::io::CodedInputStream* input) { |
| 209 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure | 222 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
| 210 ::google::protobuf::uint32 tag; | 223 ::google::protobuf::uint32 tag; |
| 211 // @@protoc_insertion_point(parse_start:google.protobuf.Timestamp) | 224 // @@protoc_insertion_point(parse_start:google.protobuf.Timestamp) |
| 212 for (;;) { | 225 for (;;) { |
| 213 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffN
oLastTag(127u); | 226 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(
127); |
| 214 tag = p.first; | 227 tag = p.first; |
| 215 if (!p.second) goto handle_unusual; | 228 if (!p.second) goto handle_unusual; |
| 216 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { | 229 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { |
| 217 // int64 seconds = 1; | 230 // optional int64 seconds = 1; |
| 218 case 1: { | 231 case 1: { |
| 219 if (tag == 8u) { | 232 if (tag == 8) { |
| 220 | |
| 221 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< | 233 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 222 ::google::protobuf::int64, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT64>( | 234 ::google::protobuf::int64, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT64>( |
| 223 input, &seconds_))); | 235 input, &seconds_))); |
| 236 |
| 224 } else { | 237 } else { |
| 225 goto handle_unusual; | 238 goto handle_unusual; |
| 226 } | 239 } |
| 240 if (input->ExpectTag(16)) goto parse_nanos; |
| 227 break; | 241 break; |
| 228 } | 242 } |
| 229 | 243 |
| 230 // int32 nanos = 2; | 244 // optional int32 nanos = 2; |
| 231 case 2: { | 245 case 2: { |
| 232 if (tag == 16u) { | 246 if (tag == 16) { |
| 233 | 247 parse_nanos: |
| 234 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< | 248 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 235 ::google::protobuf::int32, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT32>( | 249 ::google::protobuf::int32, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT32>( |
| 236 input, &nanos_))); | 250 input, &nanos_))); |
| 251 |
| 237 } else { | 252 } else { |
| 238 goto handle_unusual; | 253 goto handle_unusual; |
| 239 } | 254 } |
| 255 if (input->ExpectAtEnd()) goto success; |
| 240 break; | 256 break; |
| 241 } | 257 } |
| 242 | 258 |
| 243 default: { | 259 default: { |
| 244 handle_unusual: | 260 handle_unusual: |
| 245 if (tag == 0 || | 261 if (tag == 0 || |
| 246 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == | 262 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 247 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { | 263 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 248 goto success; | 264 goto success; |
| 249 } | 265 } |
| 250 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; | 266 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; |
| 251 break; | 267 break; |
| 252 } | 268 } |
| 253 } | 269 } |
| 254 } | 270 } |
| 255 success: | 271 success: |
| 256 // @@protoc_insertion_point(parse_success:google.protobuf.Timestamp) | 272 // @@protoc_insertion_point(parse_success:google.protobuf.Timestamp) |
| 257 return true; | 273 return true; |
| 258 failure: | 274 failure: |
| 259 // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp) | 275 // @@protoc_insertion_point(parse_failure:google.protobuf.Timestamp) |
| 260 return false; | 276 return false; |
| 261 #undef DO_ | 277 #undef DO_ |
| 262 } | 278 } |
| 263 | 279 |
| 264 void Timestamp::SerializeWithCachedSizes( | 280 void Timestamp::SerializeWithCachedSizes( |
| 265 ::google::protobuf::io::CodedOutputStream* output) const { | 281 ::google::protobuf::io::CodedOutputStream* output) const { |
| 266 // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp) | 282 // @@protoc_insertion_point(serialize_start:google.protobuf.Timestamp) |
| 267 // int64 seconds = 1; | 283 // optional int64 seconds = 1; |
| 268 if (this->seconds() != 0) { | 284 if (this->seconds() != 0) { |
| 269 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(),
output); | 285 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(),
output); |
| 270 } | 286 } |
| 271 | 287 |
| 272 // int32 nanos = 2; | 288 // optional int32 nanos = 2; |
| 273 if (this->nanos() != 0) { | 289 if (this->nanos() != 0) { |
| 274 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), o
utput); | 290 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), o
utput); |
| 275 } | 291 } |
| 276 | 292 |
| 277 // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp) | 293 // @@protoc_insertion_point(serialize_end:google.protobuf.Timestamp) |
| 278 } | 294 } |
| 279 | 295 |
| 280 ::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray( | 296 ::google::protobuf::uint8* Timestamp::SerializeWithCachedSizesToArray( |
| 281 bool deterministic, ::google::protobuf::uint8* target) const { | 297 ::google::protobuf::uint8* target) const { |
| 282 (void)deterministic; // Unused | |
| 283 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp
) | 298 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp
) |
| 284 // int64 seconds = 1; | 299 // optional int64 seconds = 1; |
| 285 if (this->seconds() != 0) { | 300 if (this->seconds() != 0) { |
| 286 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1,
this->seconds(), target); | 301 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1,
this->seconds(), target); |
| 287 } | 302 } |
| 288 | 303 |
| 289 // int32 nanos = 2; | 304 // optional int32 nanos = 2; |
| 290 if (this->nanos() != 0) { | 305 if (this->nanos() != 0) { |
| 291 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2,
this->nanos(), target); | 306 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2,
this->nanos(), target); |
| 292 } | 307 } |
| 293 | 308 |
| 294 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp) | 309 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Timestamp) |
| 295 return target; | 310 return target; |
| 296 } | 311 } |
| 297 | 312 |
| 298 size_t Timestamp::ByteSizeLong() const { | 313 int Timestamp::ByteSize() const { |
| 299 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Timestamp) | 314 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Timestamp) |
| 300 size_t total_size = 0; | 315 int total_size = 0; |
| 301 | 316 |
| 302 // int64 seconds = 1; | 317 // optional int64 seconds = 1; |
| 303 if (this->seconds() != 0) { | 318 if (this->seconds() != 0) { |
| 304 total_size += 1 + | 319 total_size += 1 + |
| 305 ::google::protobuf::internal::WireFormatLite::Int64Size( | 320 ::google::protobuf::internal::WireFormatLite::Int64Size( |
| 306 this->seconds()); | 321 this->seconds()); |
| 307 } | 322 } |
| 308 | 323 |
| 309 // int32 nanos = 2; | 324 // optional int32 nanos = 2; |
| 310 if (this->nanos() != 0) { | 325 if (this->nanos() != 0) { |
| 311 total_size += 1 + | 326 total_size += 1 + |
| 312 ::google::protobuf::internal::WireFormatLite::Int32Size( | 327 ::google::protobuf::internal::WireFormatLite::Int32Size( |
| 313 this->nanos()); | 328 this->nanos()); |
| 314 } | 329 } |
| 315 | 330 |
| 316 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); | |
| 317 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | 331 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 318 _cached_size_ = cached_size; | 332 _cached_size_ = total_size; |
| 319 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | 333 GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 320 return total_size; | 334 return total_size; |
| 321 } | 335 } |
| 322 | 336 |
| 323 void Timestamp::MergeFrom(const ::google::protobuf::Message& from) { | 337 void Timestamp::MergeFrom(const ::google::protobuf::Message& from) { |
| 324 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Timesta
mp) | 338 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Timesta
mp) |
| 325 GOOGLE_DCHECK_NE(&from, this); | 339 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 326 const Timestamp* source = | 340 const Timestamp* source = |
| 327 ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>( | 341 ::google::protobuf::internal::DynamicCastToGenerated<const Timestamp>( |
| 328 &from); | 342 &from); |
| 329 if (source == NULL) { | 343 if (source == NULL) { |
| 330 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.T
imestamp) | 344 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.T
imestamp) |
| 331 ::google::protobuf::internal::ReflectionOps::Merge(from, this); | 345 ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 332 } else { | 346 } else { |
| 333 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobu
f.Timestamp) | 347 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobu
f.Timestamp) |
| 334 MergeFrom(*source); | 348 MergeFrom(*source); |
| 335 } | 349 } |
| 336 } | 350 } |
| 337 | 351 |
| 338 void Timestamp::MergeFrom(const Timestamp& from) { | 352 void Timestamp::MergeFrom(const Timestamp& from) { |
| 339 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Time
stamp) | 353 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Time
stamp) |
| 340 GOOGLE_DCHECK_NE(&from, this); | 354 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 341 _internal_metadata_.MergeFrom(from._internal_metadata_); | |
| 342 if (from.seconds() != 0) { | 355 if (from.seconds() != 0) { |
| 343 set_seconds(from.seconds()); | 356 set_seconds(from.seconds()); |
| 344 } | 357 } |
| 345 if (from.nanos() != 0) { | 358 if (from.nanos() != 0) { |
| 346 set_nanos(from.nanos()); | 359 set_nanos(from.nanos()); |
| 347 } | 360 } |
| 348 } | 361 } |
| 349 | 362 |
| 350 void Timestamp::CopyFrom(const ::google::protobuf::Message& from) { | 363 void Timestamp::CopyFrom(const ::google::protobuf::Message& from) { |
| 351 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Timestam
p) | 364 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Timestam
p) |
| 352 if (&from == this) return; | 365 if (&from == this) return; |
| 353 Clear(); | 366 Clear(); |
| 354 MergeFrom(from); | 367 MergeFrom(from); |
| 355 } | 368 } |
| 356 | 369 |
| 357 void Timestamp::CopyFrom(const Timestamp& from) { | 370 void Timestamp::CopyFrom(const Timestamp& from) { |
| 358 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Times
tamp) | 371 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Times
tamp) |
| 359 if (&from == this) return; | 372 if (&from == this) return; |
| 360 Clear(); | 373 Clear(); |
| 361 MergeFrom(from); | 374 MergeFrom(from); |
| 362 } | 375 } |
| 363 | 376 |
| 364 bool Timestamp::IsInitialized() const { | 377 bool Timestamp::IsInitialized() const { |
| 378 |
| 365 return true; | 379 return true; |
| 366 } | 380 } |
| 367 | 381 |
| 368 void Timestamp::Swap(Timestamp* other) { | 382 void Timestamp::Swap(Timestamp* other) { |
| 369 if (other == this) return; | 383 if (other == this) return; |
| 370 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { | 384 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { |
| 371 InternalSwap(other); | 385 InternalSwap(other); |
| 372 } else { | 386 } else { |
| 373 Timestamp* temp = New(GetArenaNoVirtual()); | 387 Timestamp temp; |
| 374 temp->MergeFrom(*other); | 388 temp.MergeFrom(*this); |
| 375 other->CopyFrom(*this); | 389 CopyFrom(*other); |
| 376 InternalSwap(temp); | 390 other->CopyFrom(temp); |
| 377 if (GetArenaNoVirtual() == NULL) { | |
| 378 delete temp; | |
| 379 } | |
| 380 } | 391 } |
| 381 } | 392 } |
| 382 void Timestamp::UnsafeArenaSwap(Timestamp* other) { | 393 void Timestamp::UnsafeArenaSwap(Timestamp* other) { |
| 383 if (other == this) return; | 394 if (other == this) return; |
| 384 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); | 395 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); |
| 385 InternalSwap(other); | 396 InternalSwap(other); |
| 386 } | 397 } |
| 387 void Timestamp::InternalSwap(Timestamp* other) { | 398 void Timestamp::InternalSwap(Timestamp* other) { |
| 388 std::swap(seconds_, other->seconds_); | 399 std::swap(seconds_, other->seconds_); |
| 389 std::swap(nanos_, other->nanos_); | 400 std::swap(nanos_, other->nanos_); |
| 401 _internal_metadata_.Swap(&other->_internal_metadata_); |
| 390 std::swap(_cached_size_, other->_cached_size_); | 402 std::swap(_cached_size_, other->_cached_size_); |
| 391 } | 403 } |
| 392 | 404 |
| 393 ::google::protobuf::Metadata Timestamp::GetMetadata() const { | 405 ::google::protobuf::Metadata Timestamp::GetMetadata() const { |
| 394 protobuf_AssignDescriptorsOnce(); | 406 protobuf_AssignDescriptorsOnce(); |
| 395 return file_level_metadata[0]; | 407 ::google::protobuf::Metadata metadata; |
| 408 metadata.descriptor = Timestamp_descriptor_; |
| 409 metadata.reflection = Timestamp_reflection_; |
| 410 return metadata; |
| 396 } | 411 } |
| 397 | 412 |
| 398 #if PROTOBUF_INLINE_NOT_IN_HEADERS | 413 #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 399 // Timestamp | 414 // Timestamp |
| 400 | 415 |
| 401 // int64 seconds = 1; | 416 // optional int64 seconds = 1; |
| 402 void Timestamp::clear_seconds() { | 417 void Timestamp::clear_seconds() { |
| 403 seconds_ = GOOGLE_LONGLONG(0); | 418 seconds_ = GOOGLE_LONGLONG(0); |
| 404 } | 419 } |
| 405 ::google::protobuf::int64 Timestamp::seconds() const { | 420 ::google::protobuf::int64 Timestamp::seconds() const { |
| 406 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds) | 421 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.seconds) |
| 407 return seconds_; | 422 return seconds_; |
| 408 } | 423 } |
| 409 void Timestamp::set_seconds(::google::protobuf::int64 value) { | 424 void Timestamp::set_seconds(::google::protobuf::int64 value) { |
| 410 | 425 |
| 411 seconds_ = value; | 426 seconds_ = value; |
| 412 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds) | 427 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.seconds) |
| 413 } | 428 } |
| 414 | 429 |
| 415 // int32 nanos = 2; | 430 // optional int32 nanos = 2; |
| 416 void Timestamp::clear_nanos() { | 431 void Timestamp::clear_nanos() { |
| 417 nanos_ = 0; | 432 nanos_ = 0; |
| 418 } | 433 } |
| 419 ::google::protobuf::int32 Timestamp::nanos() const { | 434 ::google::protobuf::int32 Timestamp::nanos() const { |
| 420 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos) | 435 // @@protoc_insertion_point(field_get:google.protobuf.Timestamp.nanos) |
| 421 return nanos_; | 436 return nanos_; |
| 422 } | 437 } |
| 423 void Timestamp::set_nanos(::google::protobuf::int32 value) { | 438 void Timestamp::set_nanos(::google::protobuf::int32 value) { |
| 424 | 439 |
| 425 nanos_ = value; | 440 nanos_ = value; |
| 426 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos) | 441 // @@protoc_insertion_point(field_set:google.protobuf.Timestamp.nanos) |
| 427 } | 442 } |
| 428 | 443 |
| 429 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS | 444 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 430 | 445 |
| 431 // @@protoc_insertion_point(namespace_scope) | 446 // @@protoc_insertion_point(namespace_scope) |
| 432 | 447 |
| 433 } // namespace protobuf | 448 } // namespace protobuf |
| 434 } // namespace google | 449 } // namespace google |
| 435 | 450 |
| 436 // @@protoc_insertion_point(global_scope) | 451 // @@protoc_insertion_point(global_scope) |
| OLD | NEW |