38 #ifndef GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__
39 #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__
53 namespace google_opensource {
64 class DefaultEmptyOneof;
67 class GeneratedMessageReflection;
130 const Message* default_instance,
133 int unknown_fields_offset,
134 int extensions_offset,
164 const Message* default_instance,
167 int unknown_fields_offset,
168 int extensions_offset,
169 const void* default_oneof_instance,
170 int oneof_case_offset,
181 int SpaceUsed(
const Message& message)
const;
186 bool HasOneof(
const Message& message,
193 const vector<const FieldDescriptor*>& fields)
const;
195 int index1,
int index2)
const;
196 void ListFields(
const Message& message,
197 vector<const FieldDescriptor*>*
output)
const;
207 float GetFloat (
const Message& message,
209 double GetDouble(
const Message& message,
211 bool GetBool (
const Message& message,
213 string GetString(
const Message& message,
215 const string& GetStringReference(
const Message& message,
217 string* scratch)
const;
229 void SetInt32 (
Message* message,
231 void SetInt64 (
Message* message,
233 void SetUInt32(
Message* message,
235 void SetUInt64(
Message* message,
237 void SetFloat (
Message* message,
239 void SetDouble(
Message* message,
241 void SetBool (
Message* message,
243 void SetString(
Message* message,
245 const string& value)
const;
250 void SetAllocatedMessage(
Message* message,
264 float GetRepeatedFloat (
const Message& message,
266 double GetRepeatedDouble(
const Message& message,
268 bool GetRepeatedBool (
const Message& message,
270 string GetRepeatedString(
const Message& message,
272 const string& GetRepeatedStringReference(
const Message& message,
274 int index,
string* scratch)
const;
283 void SetRepeatedInt32 (
Message* message,
285 void SetRepeatedInt64 (
Message* message,
287 void SetRepeatedUInt32(
Message* message,
289 void SetRepeatedUInt64(
Message* message,
291 void SetRepeatedFloat (
Message* message,
293 void SetRepeatedDouble(
Message* message,
295 void SetRepeatedBool (
Message* message,
297 void SetRepeatedString(
Message* message,
299 const string& value)
const;
307 void AddInt32 (
Message* message,
309 void AddInt64 (
Message* message,
311 void AddUInt32(
Message* message,
313 void AddUInt64(
Message* message,
315 void AddFloat (
Message* message,
317 void AddDouble(
Message* message,
319 void AddBool (
Message* message,
321 void AddString(
Message* message,
329 const FieldDescriptor* FindKnownExtensionByName(
const string& name)
const;
333 virtual void* MutableRawRepeatedField(
338 friend class GeneratedMessage;
346 const void* default_oneof_instance_;
349 int has_bits_offset_;
350 int oneof_case_offset_;
351 int unknown_fields_offset_;
352 int extensions_offset_;
358 template <typename Type>
359 inline
const Type& GetRaw(const Message& message,
360 const FieldDescriptor* field)
const;
361 template <typename Type>
362 inline
Type* MutableRaw(Message* message,
363 const FieldDescriptor* field)
const;
364 template <typename Type>
365 inline
const Type& DefaultRaw(const FieldDescriptor* field)
const;
366 template <typename Type>
367 inline
const Type& DefaultOneofRaw(const FieldDescriptor* field)
const;
370 inline
uint32* MutableHasBits(Message* message)
const;
371 inline
uint32 GetOneofCase(
372 const Message& message,
373 const OneofDescriptor* oneof_descriptor)
const;
374 inline
uint32* MutableOneofCase(
376 const OneofDescriptor* oneof_descriptor)
const;
380 inline
bool HasBit(const Message& message,
381 const FieldDescriptor* field)
const;
382 inline void SetBit(Message* message,
383 const FieldDescriptor* field)
const;
384 inline void ClearBit(Message* message,
385 const FieldDescriptor* field)
const;
386 inline void SwapBit(Message* message1,
388 const FieldDescriptor* field)
const;
392 void SwapField(Message* message1,
394 const FieldDescriptor* field)
const;
396 void SwapOneofField(Message* message1,
398 const OneofDescriptor* oneof_descriptor)
const;
400 inline
bool HasOneofField(const Message& message,
401 const FieldDescriptor* field)
const;
402 inline void SetOneofCase(Message* message,
403 const FieldDescriptor* field)
const;
404 inline void ClearOneofField(Message* message,
405 const FieldDescriptor* field)
const;
407 template <typename Type>
408 inline
const Type& GetField(const Message& message,
409 const FieldDescriptor* field)
const;
410 template <typename Type>
411 inline void SetField(Message* message,
412 const FieldDescriptor* field, const Type& value)
const;
413 template <typename Type>
414 inline
Type* MutableField(Message* message,
415 const FieldDescriptor* field)
const;
416 template <typename Type>
417 inline
const Type& GetRepeatedField(const Message& message,
418 const FieldDescriptor* field,
420 template <typename Type>
421 inline
const Type& GetRepeatedPtrField(const Message& message,
422 const FieldDescriptor* field,
424 template <typename Type>
425 inline void SetRepeatedField(Message* message,
426 const FieldDescriptor* field, int index,
428 template <typename Type>
429 inline
Type* MutableRepeatedField(Message* message,
430 const FieldDescriptor* field,
432 template <typename Type>
433 inline void AddField(Message* message,
434 const FieldDescriptor* field, const Type& value)
const;
435 template <typename Type>
436 inline
Type* AddField(Message* message,
437 const FieldDescriptor* field)
const;
439 int GetExtensionNumberOrDie(const Descriptor* type)
const;
457 #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \
459 reinterpret_cast<const char*>( \
460 &reinterpret_cast<const TYPE*>(16)->FIELD) - \
461 reinterpret_cast<const char*>(16))
463 #define PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ONEOF, FIELD) \
465 reinterpret_cast<const char*>(&(ONEOF->FIELD)) \
466 - reinterpret_cast<const char*>(ONEOF))
491 template<typename To, typename From>
493 #if defined(GOOGLE_PROTOBUF_NO_RTTI) || (defined(_MSC_VER)&&!defined(_CPPRTTI))
496 return dynamic_cast<To
>(from);
504 #endif // GOOGLE_PROTOBUF_GENERATED_MESSAGE_REFLECTION_H__
Definition: unknown_field_set.h:74
Definition: descriptor.h:126
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: message.h:720
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: common.h:89
Definition: message.h:357
Definition: descriptor.h:780
#define desc
Definition: extension_set.h:309
Definition: message.h:165
#define bool
Definition: CascPort.h:16
int32_t int32
Definition: common.h:172
Definition: descriptor.h:1167
uint32_t uint32
Definition: common.h:177
uint64_t uint64
Definition: common.h:178
To dynamic_cast_if_available(From from)
Definition: generated_message_reflection.h:492
Definition: extension_set.h:157
Definition: generated_message_reflection.h:96
Definition: document.h:390
#define LIBPROTOBUF_EXPORT
Definition: common.h:105
CppType
Definition: descriptor.h:378
int64_t int64
Definition: common.h:173
Definition: descriptor.h:625
Definition: descriptor.h:342
Definition: BnetFileGenerator.h:47
const FieldDescriptor value
Definition: descriptor.h:1522
#define const
Definition: zconf.h:217
Type
Type of JSON value.
Definition: rapidjson.h:642