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/duration.proto | 2 // source: google/protobuf/duration.proto |
3 | 3 |
4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION | 4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
5 #include <google/protobuf/duration.pb.h> | 5 #include <google/protobuf/duration.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 DurationDefaultTypeInternal : public ::google::protobuf::internal::Explici
tlyConstructed<Duration> {}; | |
23 DurationDefaultTypeInternal _Duration_default_instance_; | |
24 | 22 |
25 namespace { | 23 namespace { |
26 | 24 |
27 ::google::protobuf::Metadata file_level_metadata[1]; | 25 const ::google::protobuf::Descriptor* Duration_descriptor_ = NULL; |
| 26 const ::google::protobuf::internal::GeneratedMessageReflection* |
| 27 Duration_reflection_ = NULL; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 | 31 |
32 const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fduration_
2eproto() GOOGLE_ATTRIBUTE_COLD; | 32 void protobuf_AssignDesc_google_2fprotobuf_2fduration_2eproto() { |
33 const ::google::protobuf::uint32* protobuf_Offsets_google_2fprotobuf_2fduration_
2eproto() { | 33 protobuf_AddDesc_google_2fprotobuf_2fduration_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(Duration, _internal_metadata_
), | 36 "google/protobuf/duration.proto"); |
37 ~0u, // no _extensions_ | 37 GOOGLE_CHECK(file != NULL); |
38 ~0u, // no _oneof_case_ | 38 Duration_descriptor_ = file->message_type(0); |
| 39 static const int Duration_offsets_[2] = { |
39 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_), | 40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, seconds_), |
40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_), | 41 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, nanos_), |
41 }; | 42 }; |
42 return offsets; | 43 Duration_reflection_ = |
| 44 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessag
eReflection( |
| 45 Duration_descriptor_, |
| 46 Duration::default_instance_, |
| 47 Duration_offsets_, |
| 48 -1, |
| 49 -1, |
| 50 -1, |
| 51 sizeof(Duration), |
| 52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _internal_metadat
a_), |
| 53 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Duration, _is_default_insta
nce_)); |
43 } | 54 } |
44 | 55 |
45 static const ::google::protobuf::internal::MigrationSchema schemas[] = { | |
46 { 0, -1, sizeof(Duration)}, | |
47 }; | |
48 | |
49 static const ::google::protobuf::internal::DefaultInstanceData file_default_inst
ances[] = { | |
50 {reinterpret_cast<const ::google::protobuf::Message*>(&_Duration_default_insta
nce_), 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_2fduration_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_2fduration_2eproto); |
59 "google/protobuf/duration.proto", schemas, file_default_instances, protobu
f_Offsets_google_2fprotobuf_2fduration_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 Duration_descriptor_, &Duration::default_instance()); |
72 } | 68 } |
73 | 69 |
74 } // namespace | 70 } // namespace |
75 | 71 |
76 void protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto() { | 72 void protobuf_ShutdownFile_google_2fprotobuf_2fduration_2eproto() { |
77 _Duration_default_instance_.Shutdown(); | 73 delete Duration::default_instance_; |
78 delete file_level_metadata[0].reflection; | 74 delete Duration_reflection_; |
79 } | 75 } |
80 | 76 |
81 void protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto_impl() { | 77 void protobuf_AddDesc_google_2fprotobuf_2fduration_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 _Duration_default_instance_.DefaultConstruct(); | |
86 } | |
87 | |
88 void protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto() { | |
89 static GOOGLE_PROTOBUF_DECLARE_ONCE(once); | |
90 ::google::protobuf::GoogleOnceInit(&once, &protobuf_InitDefaults_google_2fprot
obuf_2fduration_2eproto_impl); | |
91 } | |
92 void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto_impl() { | |
93 protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); | |
94 static const char descriptor[] = { | |
95 "\n\036google/protobuf/duration.proto\022\017google" | |
96 ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r" | |
97 "\n\005nanos\030\002 \001(\005B|\n\023com.google.protobufB\rDu" | |
98 "rationProtoP\001Z*github.com/golang/protobu" | |
99 "f/ptypes/duration\370\001\001\242\002\003GPB\252\002\036Google.Prot" | |
100 "obuf.WellKnownTypesb\006proto3" | |
101 }; | |
102 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( | 83 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
103 descriptor, 227); | 84 "\n\036google/protobuf/duration.proto\022\017google" |
| 85 ".protobuf\"*\n\010Duration\022\017\n\007seconds\030\001 \001(\003\022\r" |
| 86 "\n\005nanos\030\002 \001(\005B|\n\023com.google.protobufB\rDu" |
| 87 "rationProtoP\001Z*github.com/golang/protobu" |
| 88 "f/ptypes/duration\240\001\001\242\002\003GPB\252\002\036Google.Prot" |
| 89 "obuf.WellKnownTypesb\006proto3", 227); |
104 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( | 90 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
105 "google/protobuf/duration.proto", &protobuf_RegisterTypes); | 91 "google/protobuf/duration.proto", &protobuf_RegisterTypes); |
| 92 Duration::default_instance_ = new Duration(); |
| 93 Duration::default_instance_->InitAsDefaultInstance(); |
106 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2fduration_2eproto); | 94 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto
buf_2fduration_2eproto); |
107 } | 95 } |
108 | 96 |
109 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_google_2fprotobuf_2fduration_2epro
to_once_); | |
110 void protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto() { | |
111 ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_google_2fprotobuf_2fdurat
ion_2eproto_once_, | |
112 &protobuf_AddDesc_google_2fprotobuf_2fduration_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_2fduration_2eproto { | 98 struct StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto { |
116 StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto() { | 99 StaticDescriptorInitializer_google_2fprotobuf_2fduration_2eproto() { |
117 protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto(); | 100 protobuf_AddDesc_google_2fprotobuf_2fduration_2eproto(); |
118 } | 101 } |
119 } static_descriptor_initializer_google_2fprotobuf_2fduration_2eproto_; | 102 } static_descriptor_initializer_google_2fprotobuf_2fduration_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 Duration::kSecondsFieldNumber; | 117 const int Duration::kSecondsFieldNumber; |
125 const int Duration::kNanosFieldNumber; | 118 const int Duration::kNanosFieldNumber; |
126 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 | 119 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
127 | 120 |
128 Duration::Duration() | 121 Duration::Duration() |
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_2fduration_2eproto(); | |
132 } | |
133 SharedCtor(); | 123 SharedCtor(); |
134 // @@protoc_insertion_point(constructor:google.protobuf.Duration) | 124 // @@protoc_insertion_point(constructor:google.protobuf.Duration) |
135 } | 125 } |
136 Duration::Duration(::google::protobuf::Arena* arena) | 126 |
137 : ::google::protobuf::Message(), | 127 void Duration::InitAsDefaultInstance() { |
138 _internal_metadata_(arena) { | 128 _is_default_instance_ = true; |
139 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER | |
140 protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); | |
141 #endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER | |
142 SharedCtor(); | |
143 RegisterArenaDtor(arena); | |
144 // @@protoc_insertion_point(arena_constructor:google.protobuf.Duration) | |
145 } | 129 } |
| 130 |
146 Duration::Duration(const Duration& from) | 131 Duration::Duration(const Duration& from) |
147 : ::google::protobuf::Message(), | 132 : ::google::protobuf::Message(), |
148 _internal_metadata_(NULL), | 133 _internal_metadata_(NULL) { |
149 _cached_size_(0) { | 134 SharedCtor(); |
150 _internal_metadata_.MergeFrom(from._internal_metadata_); | 135 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.Duration) | 136 // @@protoc_insertion_point(copy_constructor:google.protobuf.Duration) |
155 } | 137 } |
156 | 138 |
157 void Duration::SharedCtor() { | 139 void Duration::SharedCtor() { |
158 ::memset(&seconds_, 0, reinterpret_cast<char*>(&nanos_) - | 140 _is_default_instance_ = false; |
159 reinterpret_cast<char*>(&seconds_) + sizeof(nanos_)); | |
160 _cached_size_ = 0; | 141 _cached_size_ = 0; |
| 142 seconds_ = GOOGLE_LONGLONG(0); |
| 143 nanos_ = 0; |
161 } | 144 } |
162 | 145 |
163 Duration::~Duration() { | 146 Duration::~Duration() { |
164 // @@protoc_insertion_point(destructor:google.protobuf.Duration) | 147 // @@protoc_insertion_point(destructor:google.protobuf.Duration) |
165 SharedDtor(); | 148 SharedDtor(); |
166 } | 149 } |
167 | 150 |
168 void Duration::SharedDtor() { | 151 void Duration::SharedDtor() { |
169 ::google::protobuf::Arena* arena = GetArenaNoVirtual(); | 152 if (this != default_instance_) { |
170 if (arena != NULL) { | |
171 return; | |
172 } | 153 } |
173 | |
174 } | 154 } |
175 | 155 |
176 void Duration::ArenaDtor(void* object) { | |
177 Duration* _this = reinterpret_cast< Duration* >(object); | |
178 (void)_this; | |
179 } | |
180 void Duration::RegisterArenaDtor(::google::protobuf::Arena* arena) { | |
181 } | |
182 void Duration::SetCachedSize(int size) const { | 156 void Duration::SetCachedSize(int size) const { |
183 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | 157 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
184 _cached_size_ = size; | 158 _cached_size_ = size; |
185 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | 159 GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
186 } | 160 } |
187 const ::google::protobuf::Descriptor* Duration::descriptor() { | 161 const ::google::protobuf::Descriptor* Duration::descriptor() { |
188 protobuf_AssignDescriptorsOnce(); | 162 protobuf_AssignDescriptorsOnce(); |
189 return file_level_metadata[0].descriptor; | 163 return Duration_descriptor_; |
190 } | 164 } |
191 | 165 |
192 const Duration& Duration::default_instance() { | 166 const Duration& Duration::default_instance() { |
193 protobuf_InitDefaults_google_2fprotobuf_2fduration_2eproto(); | 167 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fduration_2
eproto(); |
194 return *internal_default_instance(); | 168 return *default_instance_; |
195 } | 169 } |
196 | 170 |
| 171 Duration* Duration::default_instance_ = NULL; |
| 172 |
197 Duration* Duration::New(::google::protobuf::Arena* arena) const { | 173 Duration* Duration::New(::google::protobuf::Arena* arena) const { |
198 return ::google::protobuf::Arena::CreateMessage<Duration>(arena); | 174 Duration* n = new Duration; |
| 175 if (arena != NULL) { |
| 176 arena->Own(n); |
| 177 } |
| 178 return n; |
199 } | 179 } |
200 | 180 |
201 void Duration::Clear() { | 181 void Duration::Clear() { |
202 // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration) | 182 // @@protoc_insertion_point(message_clear_start:google.protobuf.Duration) |
203 ::memset(&seconds_, 0, reinterpret_cast<char*>(&nanos_) - | 183 #if defined(__clang__) |
204 reinterpret_cast<char*>(&seconds_) + sizeof(nanos_)); | 184 #define ZR_HELPER_(f) \ |
| 185 _Pragma("clang diagnostic push") \ |
| 186 _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ |
| 187 __builtin_offsetof(Duration, f) \ |
| 188 _Pragma("clang diagnostic pop") |
| 189 #else |
| 190 #define ZR_HELPER_(f) reinterpret_cast<char*>(\ |
| 191 &reinterpret_cast<Duration*>(16)->f) |
| 192 #endif |
| 193 |
| 194 #define ZR_(first, last) do {\ |
| 195 ::memset(&first, 0,\ |
| 196 ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ |
| 197 } while (0) |
| 198 |
| 199 ZR_(seconds_, nanos_); |
| 200 |
| 201 #undef ZR_HELPER_ |
| 202 #undef ZR_ |
| 203 |
205 } | 204 } |
206 | 205 |
207 bool Duration::MergePartialFromCodedStream( | 206 bool Duration::MergePartialFromCodedStream( |
208 ::google::protobuf::io::CodedInputStream* input) { | 207 ::google::protobuf::io::CodedInputStream* input) { |
209 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure | 208 #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
210 ::google::protobuf::uint32 tag; | 209 ::google::protobuf::uint32 tag; |
211 // @@protoc_insertion_point(parse_start:google.protobuf.Duration) | 210 // @@protoc_insertion_point(parse_start:google.protobuf.Duration) |
212 for (;;) { | 211 for (;;) { |
213 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffN
oLastTag(127u); | 212 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(
127); |
214 tag = p.first; | 213 tag = p.first; |
215 if (!p.second) goto handle_unusual; | 214 if (!p.second) goto handle_unusual; |
216 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { | 215 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)
) { |
217 // int64 seconds = 1; | 216 // optional int64 seconds = 1; |
218 case 1: { | 217 case 1: { |
219 if (tag == 8u) { | 218 if (tag == 8) { |
220 | |
221 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< | 219 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
222 ::google::protobuf::int64, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT64>( | 220 ::google::protobuf::int64, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT64>( |
223 input, &seconds_))); | 221 input, &seconds_))); |
| 222 |
224 } else { | 223 } else { |
225 goto handle_unusual; | 224 goto handle_unusual; |
226 } | 225 } |
| 226 if (input->ExpectTag(16)) goto parse_nanos; |
227 break; | 227 break; |
228 } | 228 } |
229 | 229 |
230 // int32 nanos = 2; | 230 // optional int32 nanos = 2; |
231 case 2: { | 231 case 2: { |
232 if (tag == 16u) { | 232 if (tag == 16) { |
233 | 233 parse_nanos: |
234 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< | 234 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
235 ::google::protobuf::int32, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT32>( | 235 ::google::protobuf::int32, ::google::protobuf::internal::Wire
FormatLite::TYPE_INT32>( |
236 input, &nanos_))); | 236 input, &nanos_))); |
| 237 |
237 } else { | 238 } else { |
238 goto handle_unusual; | 239 goto handle_unusual; |
239 } | 240 } |
| 241 if (input->ExpectAtEnd()) goto success; |
240 break; | 242 break; |
241 } | 243 } |
242 | 244 |
243 default: { | 245 default: { |
244 handle_unusual: | 246 handle_unusual: |
245 if (tag == 0 || | 247 if (tag == 0 || |
246 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == | 248 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
247 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { | 249 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
248 goto success; | 250 goto success; |
249 } | 251 } |
250 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; | 252 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag))
; |
251 break; | 253 break; |
252 } | 254 } |
253 } | 255 } |
254 } | 256 } |
255 success: | 257 success: |
256 // @@protoc_insertion_point(parse_success:google.protobuf.Duration) | 258 // @@protoc_insertion_point(parse_success:google.protobuf.Duration) |
257 return true; | 259 return true; |
258 failure: | 260 failure: |
259 // @@protoc_insertion_point(parse_failure:google.protobuf.Duration) | 261 // @@protoc_insertion_point(parse_failure:google.protobuf.Duration) |
260 return false; | 262 return false; |
261 #undef DO_ | 263 #undef DO_ |
262 } | 264 } |
263 | 265 |
264 void Duration::SerializeWithCachedSizes( | 266 void Duration::SerializeWithCachedSizes( |
265 ::google::protobuf::io::CodedOutputStream* output) const { | 267 ::google::protobuf::io::CodedOutputStream* output) const { |
266 // @@protoc_insertion_point(serialize_start:google.protobuf.Duration) | 268 // @@protoc_insertion_point(serialize_start:google.protobuf.Duration) |
267 // int64 seconds = 1; | 269 // optional int64 seconds = 1; |
268 if (this->seconds() != 0) { | 270 if (this->seconds() != 0) { |
269 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(),
output); | 271 ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->seconds(),
output); |
270 } | 272 } |
271 | 273 |
272 // int32 nanos = 2; | 274 // optional int32 nanos = 2; |
273 if (this->nanos() != 0) { | 275 if (this->nanos() != 0) { |
274 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), o
utput); | 276 ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->nanos(), o
utput); |
275 } | 277 } |
276 | 278 |
277 // @@protoc_insertion_point(serialize_end:google.protobuf.Duration) | 279 // @@protoc_insertion_point(serialize_end:google.protobuf.Duration) |
278 } | 280 } |
279 | 281 |
280 ::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray( | 282 ::google::protobuf::uint8* Duration::SerializeWithCachedSizesToArray( |
281 bool deterministic, ::google::protobuf::uint8* target) const { | 283 ::google::protobuf::uint8* target) const { |
282 (void)deterministic; // Unused | |
283 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration) | 284 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration) |
284 // int64 seconds = 1; | 285 // optional int64 seconds = 1; |
285 if (this->seconds() != 0) { | 286 if (this->seconds() != 0) { |
286 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1,
this->seconds(), target); | 287 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1,
this->seconds(), target); |
287 } | 288 } |
288 | 289 |
289 // int32 nanos = 2; | 290 // optional int32 nanos = 2; |
290 if (this->nanos() != 0) { | 291 if (this->nanos() != 0) { |
291 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2,
this->nanos(), target); | 292 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2,
this->nanos(), target); |
292 } | 293 } |
293 | 294 |
294 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration) | 295 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Duration) |
295 return target; | 296 return target; |
296 } | 297 } |
297 | 298 |
298 size_t Duration::ByteSizeLong() const { | 299 int Duration::ByteSize() const { |
299 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration) | 300 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Duration) |
300 size_t total_size = 0; | 301 int total_size = 0; |
301 | 302 |
302 // int64 seconds = 1; | 303 // optional int64 seconds = 1; |
303 if (this->seconds() != 0) { | 304 if (this->seconds() != 0) { |
304 total_size += 1 + | 305 total_size += 1 + |
305 ::google::protobuf::internal::WireFormatLite::Int64Size( | 306 ::google::protobuf::internal::WireFormatLite::Int64Size( |
306 this->seconds()); | 307 this->seconds()); |
307 } | 308 } |
308 | 309 |
309 // int32 nanos = 2; | 310 // optional int32 nanos = 2; |
310 if (this->nanos() != 0) { | 311 if (this->nanos() != 0) { |
311 total_size += 1 + | 312 total_size += 1 + |
312 ::google::protobuf::internal::WireFormatLite::Int32Size( | 313 ::google::protobuf::internal::WireFormatLite::Int32Size( |
313 this->nanos()); | 314 this->nanos()); |
314 } | 315 } |
315 | 316 |
316 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); | |
317 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); | 317 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
318 _cached_size_ = cached_size; | 318 _cached_size_ = total_size; |
319 GOOGLE_SAFE_CONCURRENT_WRITES_END(); | 319 GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
320 return total_size; | 320 return total_size; |
321 } | 321 } |
322 | 322 |
323 void Duration::MergeFrom(const ::google::protobuf::Message& from) { | 323 void Duration::MergeFrom(const ::google::protobuf::Message& from) { |
324 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Duratio
n) | 324 // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Duratio
n) |
325 GOOGLE_DCHECK_NE(&from, this); | 325 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
326 const Duration* source = | 326 const Duration* source = |
327 ::google::protobuf::internal::DynamicCastToGenerated<const Duration>( | 327 ::google::protobuf::internal::DynamicCastToGenerated<const Duration>( |
328 &from); | 328 &from); |
329 if (source == NULL) { | 329 if (source == NULL) { |
330 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.D
uration) | 330 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.D
uration) |
331 ::google::protobuf::internal::ReflectionOps::Merge(from, this); | 331 ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
332 } else { | 332 } else { |
333 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobu
f.Duration) | 333 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobu
f.Duration) |
334 MergeFrom(*source); | 334 MergeFrom(*source); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 void Duration::MergeFrom(const Duration& from) { | 338 void Duration::MergeFrom(const Duration& from) { |
339 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Dura
tion) | 339 // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Dura
tion) |
340 GOOGLE_DCHECK_NE(&from, this); | 340 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
341 _internal_metadata_.MergeFrom(from._internal_metadata_); | |
342 if (from.seconds() != 0) { | 341 if (from.seconds() != 0) { |
343 set_seconds(from.seconds()); | 342 set_seconds(from.seconds()); |
344 } | 343 } |
345 if (from.nanos() != 0) { | 344 if (from.nanos() != 0) { |
346 set_nanos(from.nanos()); | 345 set_nanos(from.nanos()); |
347 } | 346 } |
348 } | 347 } |
349 | 348 |
350 void Duration::CopyFrom(const ::google::protobuf::Message& from) { | 349 void Duration::CopyFrom(const ::google::protobuf::Message& from) { |
351 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Duration
) | 350 // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Duration
) |
352 if (&from == this) return; | 351 if (&from == this) return; |
353 Clear(); | 352 Clear(); |
354 MergeFrom(from); | 353 MergeFrom(from); |
355 } | 354 } |
356 | 355 |
357 void Duration::CopyFrom(const Duration& from) { | 356 void Duration::CopyFrom(const Duration& from) { |
358 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Durat
ion) | 357 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Durat
ion) |
359 if (&from == this) return; | 358 if (&from == this) return; |
360 Clear(); | 359 Clear(); |
361 MergeFrom(from); | 360 MergeFrom(from); |
362 } | 361 } |
363 | 362 |
364 bool Duration::IsInitialized() const { | 363 bool Duration::IsInitialized() const { |
| 364 |
365 return true; | 365 return true; |
366 } | 366 } |
367 | 367 |
368 void Duration::Swap(Duration* other) { | 368 void Duration::Swap(Duration* other) { |
369 if (other == this) return; | 369 if (other == this) return; |
370 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { | |
371 InternalSwap(other); | |
372 } else { | |
373 Duration* temp = New(GetArenaNoVirtual()); | |
374 temp->MergeFrom(*other); | |
375 other->CopyFrom(*this); | |
376 InternalSwap(temp); | |
377 if (GetArenaNoVirtual() == NULL) { | |
378 delete temp; | |
379 } | |
380 } | |
381 } | |
382 void Duration::UnsafeArenaSwap(Duration* other) { | |
383 if (other == this) return; | |
384 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); | |
385 InternalSwap(other); | 370 InternalSwap(other); |
386 } | 371 } |
387 void Duration::InternalSwap(Duration* other) { | 372 void Duration::InternalSwap(Duration* other) { |
388 std::swap(seconds_, other->seconds_); | 373 std::swap(seconds_, other->seconds_); |
389 std::swap(nanos_, other->nanos_); | 374 std::swap(nanos_, other->nanos_); |
| 375 _internal_metadata_.Swap(&other->_internal_metadata_); |
390 std::swap(_cached_size_, other->_cached_size_); | 376 std::swap(_cached_size_, other->_cached_size_); |
391 } | 377 } |
392 | 378 |
393 ::google::protobuf::Metadata Duration::GetMetadata() const { | 379 ::google::protobuf::Metadata Duration::GetMetadata() const { |
394 protobuf_AssignDescriptorsOnce(); | 380 protobuf_AssignDescriptorsOnce(); |
395 return file_level_metadata[0]; | 381 ::google::protobuf::Metadata metadata; |
| 382 metadata.descriptor = Duration_descriptor_; |
| 383 metadata.reflection = Duration_reflection_; |
| 384 return metadata; |
396 } | 385 } |
397 | 386 |
398 #if PROTOBUF_INLINE_NOT_IN_HEADERS | 387 #if PROTOBUF_INLINE_NOT_IN_HEADERS |
399 // Duration | 388 // Duration |
400 | 389 |
401 // int64 seconds = 1; | 390 // optional int64 seconds = 1; |
402 void Duration::clear_seconds() { | 391 void Duration::clear_seconds() { |
403 seconds_ = GOOGLE_LONGLONG(0); | 392 seconds_ = GOOGLE_LONGLONG(0); |
404 } | 393 } |
405 ::google::protobuf::int64 Duration::seconds() const { | 394 ::google::protobuf::int64 Duration::seconds() const { |
406 // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds) | 395 // @@protoc_insertion_point(field_get:google.protobuf.Duration.seconds) |
407 return seconds_; | 396 return seconds_; |
408 } | 397 } |
409 void Duration::set_seconds(::google::protobuf::int64 value) { | 398 void Duration::set_seconds(::google::protobuf::int64 value) { |
410 | 399 |
411 seconds_ = value; | 400 seconds_ = value; |
412 // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds) | 401 // @@protoc_insertion_point(field_set:google.protobuf.Duration.seconds) |
413 } | 402 } |
414 | 403 |
415 // int32 nanos = 2; | 404 // optional int32 nanos = 2; |
416 void Duration::clear_nanos() { | 405 void Duration::clear_nanos() { |
417 nanos_ = 0; | 406 nanos_ = 0; |
418 } | 407 } |
419 ::google::protobuf::int32 Duration::nanos() const { | 408 ::google::protobuf::int32 Duration::nanos() const { |
420 // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos) | 409 // @@protoc_insertion_point(field_get:google.protobuf.Duration.nanos) |
421 return nanos_; | 410 return nanos_; |
422 } | 411 } |
423 void Duration::set_nanos(::google::protobuf::int32 value) { | 412 void Duration::set_nanos(::google::protobuf::int32 value) { |
424 | 413 |
425 nanos_ = value; | 414 nanos_ = value; |
426 // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos) | 415 // @@protoc_insertion_point(field_set:google.protobuf.Duration.nanos) |
427 } | 416 } |
428 | 417 |
429 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS | 418 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
430 | 419 |
431 // @@protoc_insertion_point(namespace_scope) | 420 // @@protoc_insertion_point(namespace_scope) |
432 | 421 |
433 } // namespace protobuf | 422 } // namespace protobuf |
434 } // namespace google | 423 } // namespace google |
435 | 424 |
436 // @@protoc_insertion_point(global_scope) | 425 // @@protoc_insertion_point(global_scope) |
OLD | NEW |