TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
google::protobuf::FieldDescriptor Class Reference

#include <descriptor.h>

Public Types

enum  Type {
  TYPE_DOUBLE = 1, TYPE_FLOAT = 2, TYPE_INT64 = 3, TYPE_UINT64 = 4,
  TYPE_INT32 = 5, TYPE_FIXED64 = 6, TYPE_FIXED32 = 7, TYPE_BOOL = 8,
  TYPE_STRING = 9, TYPE_GROUP = 10, TYPE_MESSAGE = 11, TYPE_BYTES = 12,
  TYPE_UINT32 = 13, TYPE_ENUM = 14, TYPE_SFIXED32 = 15, TYPE_SFIXED64 = 16,
  TYPE_SINT32 = 17, TYPE_SINT64 = 18, MAX_TYPE = 18
}
 
enum  CppType {
  CPPTYPE_INT32 = 1, CPPTYPE_INT64 = 2, CPPTYPE_UINT32 = 3, CPPTYPE_UINT64 = 4,
  CPPTYPE_DOUBLE = 5, CPPTYPE_FLOAT = 6, CPPTYPE_BOOL = 7, CPPTYPE_ENUM = 8,
  CPPTYPE_STRING = 9, CPPTYPE_MESSAGE = 10, MAX_CPPTYPE = 10
}
 
enum  Label { LABEL_OPTIONAL = 1, LABEL_REQUIRED = 2, LABEL_REPEATED = 3, MAX_LABEL = 3 }
 

Public Member Functions

const string & name () const
 
const string & full_name () const
 
const FileDescriptorfile () const
 
bool is_extension () const
 
int number () const
 
const string & lowercase_name () const
 
const string & camelcase_name () const
 
Type type () const
 
const char * type_name () const
 
CppType cpp_type () const
 
const char * cpp_type_name () const
 
Label label () const
 
bool is_required () const
 
bool is_optional () const
 
bool is_repeated () const
 
bool is_packable () const
 
bool is_packed () const
 
int index () const
 
bool has_default_value () const
 
int32 default_value_int32 () const
 
int64 default_value_int64 () const
 
uint32 default_value_uint32 () const
 
uint64 default_value_uint64 () const
 
float default_value_float () const
 
double default_value_double () const
 
bool default_value_bool () const
 
const EnumValueDescriptordefault_value_enum () const
 
const string & default_value_string () const
 
const Descriptorcontaining_type () const
 
const OneofDescriptorcontaining_oneof () const
 
int index_in_oneof () const
 
const Descriptorextension_scope () const
 
const Descriptormessage_type () const
 
const EnumDescriptorenum_type () const
 
const FieldDescriptorexperimental_map_key () const
 
const FieldOptionsoptions () const
 
void CopyTo (FieldDescriptorProto *proto) const
 
string DebugString () const
 
bool GetSourceLocation (SourceLocation *out_location) const
 

Static Public Member Functions

static CppType TypeToCppType (Type type)
 
static const char * TypeName (Type type)
 
static const char * CppTypeName (CppType cpp_type)
 
static bool IsTypePackable (Type field_type)
 

Static Public Attributes

static const int kMaxNumber = (1 << 29) - 1
 
static const int kFirstReservedNumber = 19000
 
static const int kLastReservedNumber = 19999
 

Private Types

enum  PrintLabelFlag { PRINT_LABEL, OMIT_LABEL }
 
typedef FieldOptions OptionsType
 

Private Member Functions

void DebugString (int depth, PrintLabelFlag print_label_flag, string *contents) const
 
string DefaultValueAsString (bool quote_string_type) const
 
void GetLocationPath (vector< int > *output) const
 
 FieldDescriptor ()
 
 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS (FieldDescriptor)
 

Private Attributes

const string * name_
 
const string * full_name_
 
const string * lowercase_name_
 
const string * camelcase_name_
 
const FileDescriptorfile_
 
int number_
 
Type type_
 
Label label_
 
bool is_extension_
 
int index_in_oneof_
 
const Descriptorcontaining_type_
 
const OneofDescriptorcontaining_oneof_
 
const Descriptorextension_scope_
 
const Descriptormessage_type_
 
const EnumDescriptorenum_type_
 
const FieldDescriptorexperimental_map_key_
 
const FieldOptionsoptions_
 
bool has_default_value_
 
union {
   int32   default_value_int32_
 
   int64   default_value_int64_
 
   uint32   default_value_uint32_
 
   uint64   default_value_uint64_
 
   float   default_value_float_
 
   double   default_value_double_
 
   bool   default_value_bool_
 
   const EnumValueDescriptor *   default_value_enum_
 
   const string *   default_value_string_
 
}; 
 

Static Private Attributes

static const CppType kTypeToCppTypeMap [MAX_TYPE+1]
 
static const char *const kTypeToName [MAX_TYPE+1]
 
static const char *const kCppTypeToName [MAX_CPPTYPE+1]
 
static const char *const kLabelToName [MAX_LABEL+1]
 

Friends

class DescriptorBuilder
 
class FileDescriptor
 
class Descriptor
 
class OneofDescriptor
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
CPPTYPE_INT32 
CPPTYPE_INT64 
CPPTYPE_UINT32 
CPPTYPE_UINT64 
CPPTYPE_DOUBLE 
CPPTYPE_FLOAT 
CPPTYPE_BOOL 
CPPTYPE_ENUM 
CPPTYPE_STRING 
CPPTYPE_MESSAGE 
MAX_CPPTYPE 
378  {
379  CPPTYPE_INT32 = 1, // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32
380  CPPTYPE_INT64 = 2, // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64
381  CPPTYPE_UINT32 = 3, // TYPE_UINT32, TYPE_FIXED32
382  CPPTYPE_UINT64 = 4, // TYPE_UINT64, TYPE_FIXED64
383  CPPTYPE_DOUBLE = 5, // TYPE_DOUBLE
384  CPPTYPE_FLOAT = 6, // TYPE_FLOAT
385  CPPTYPE_BOOL = 7, // TYPE_BOOL
386  CPPTYPE_ENUM = 8, // TYPE_ENUM
387  CPPTYPE_STRING = 9, // TYPE_STRING, TYPE_BYTES
388  CPPTYPE_MESSAGE = 10, // TYPE_MESSAGE, TYPE_GROUP
389 
390  MAX_CPPTYPE = 10, // Constant useful for defining lookup tables
391  // indexed by CppType.
392  };
Enumerator
LABEL_OPTIONAL 
LABEL_REQUIRED 
LABEL_REPEATED 
MAX_LABEL 
396  {
397  LABEL_OPTIONAL = 1, // optional
398  LABEL_REQUIRED = 2, // required
399  LABEL_REPEATED = 3, // repeated
400 
401  MAX_LABEL = 3, // Constant useful for defining lookup tables
402  // indexed by Label.
403  };
Enumerator
PRINT_LABEL 
OMIT_LABEL 
Enumerator
TYPE_DOUBLE 
TYPE_FLOAT 
TYPE_INT64 
TYPE_UINT64 
TYPE_INT32 
TYPE_FIXED64 
TYPE_FIXED32 
TYPE_BOOL 
TYPE_STRING 
TYPE_GROUP 
TYPE_MESSAGE 
TYPE_BYTES 
TYPE_UINT32 
TYPE_ENUM 
TYPE_SFIXED32 
TYPE_SFIXED64 
TYPE_SINT32 
TYPE_SINT64 
MAX_TYPE 
346  {
347  TYPE_DOUBLE = 1, // double, exactly eight bytes on the wire.
348  TYPE_FLOAT = 2, // float, exactly four bytes on the wire.
349  TYPE_INT64 = 3, // int64, varint on the wire. Negative numbers
350  // take 10 bytes. Use TYPE_SINT64 if negative
351  // values are likely.
352  TYPE_UINT64 = 4, // uint64, varint on the wire.
353  TYPE_INT32 = 5, // int32, varint on the wire. Negative numbers
354  // take 10 bytes. Use TYPE_SINT32 if negative
355  // values are likely.
356  TYPE_FIXED64 = 6, // uint64, exactly eight bytes on the wire.
357  TYPE_FIXED32 = 7, // uint32, exactly four bytes on the wire.
358  TYPE_BOOL = 8, // bool, varint on the wire.
359  TYPE_STRING = 9, // UTF-8 text.
360  TYPE_GROUP = 10, // Tag-delimited message. Deprecated.
361  TYPE_MESSAGE = 11, // Length-delimited message.
362 
363  TYPE_BYTES = 12, // Arbitrary byte array.
364  TYPE_UINT32 = 13, // uint32, varint on the wire
365  TYPE_ENUM = 14, // Enum, varint on the wire
366  TYPE_SFIXED32 = 15, // int32, exactly four bytes on the wire
367  TYPE_SFIXED64 = 16, // int64, exactly eight bytes on the wire
368  TYPE_SINT32 = 17, // int32, ZigZag-encoded varint on the wire
369  TYPE_SINT64 = 18, // int64, ZigZag-encoded varint on the wire
370 
371  MAX_TYPE = 18, // Constant useful for defining lookup tables
372  // indexed by Type.
373  };

Constructor & Destructor Documentation

google::protobuf::FieldDescriptor::FieldDescriptor ( )
inlineprivate
616 {}

Member Function Documentation

const string& google::protobuf::FieldDescriptor::camelcase_name ( ) const
const OneofDescriptor* google::protobuf::FieldDescriptor::containing_oneof ( ) const
const Descriptor* google::protobuf::FieldDescriptor::containing_type ( ) const

+ Here is the caller graph for this function:

void google::protobuf::FieldDescriptor::CopyTo ( FieldDescriptorProto proto) const
FieldDescriptor::CppType google::protobuf::FieldDescriptor::cpp_type ( ) const
inline
1641  {
1642  return kTypeToCppTypeMap[type_];
1643 }
Type type_
Definition: descriptor.h:578
static const CppType kTypeToCppTypeMap[MAX_TYPE+1]
Definition: descriptor.h:607

+ Here is the caller graph for this function:

const char * google::protobuf::FieldDescriptor::cpp_type_name ( ) const
inline
1645  {
1647 }
Type type_
Definition: descriptor.h:578
static const char *const kCppTypeToName[MAX_CPPTYPE+1]
Definition: descriptor.h:611
static const CppType kTypeToCppTypeMap[MAX_TYPE+1]
Definition: descriptor.h:607
const char * google::protobuf::FieldDescriptor::CppTypeName ( CppType  cpp_type)
inlinestatic
1657  {
1658  return kCppTypeToName[cpp_type];
1659 }
CppType cpp_type() const
Definition: descriptor.h:1641
static const char *const kCppTypeToName[MAX_CPPTYPE+1]
Definition: descriptor.h:611

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string google::protobuf::FieldDescriptor::DebugString ( ) const
void google::protobuf::FieldDescriptor::DebugString ( int  depth,
PrintLabelFlag  print_label_flag,
string *  contents 
) const
private
bool google::protobuf::FieldDescriptor::default_value_bool ( ) const
double google::protobuf::FieldDescriptor::default_value_double ( ) const
const EnumValueDescriptor* google::protobuf::FieldDescriptor::default_value_enum ( ) const
float google::protobuf::FieldDescriptor::default_value_float ( ) const
int32 google::protobuf::FieldDescriptor::default_value_int32 ( ) const
int64 google::protobuf::FieldDescriptor::default_value_int64 ( ) const
const string& google::protobuf::FieldDescriptor::default_value_string ( ) const
uint32 google::protobuf::FieldDescriptor::default_value_uint32 ( ) const
uint64 google::protobuf::FieldDescriptor::default_value_uint64 ( ) const
string google::protobuf::FieldDescriptor::DefaultValueAsString ( bool  quote_string_type) const
private
const EnumDescriptor* google::protobuf::FieldDescriptor::enum_type ( ) const

+ Here is the caller graph for this function:

const FieldDescriptor* google::protobuf::FieldDescriptor::experimental_map_key ( ) const
const Descriptor* google::protobuf::FieldDescriptor::extension_scope ( ) const

+ Here is the caller graph for this function:

const FileDescriptor* google::protobuf::FieldDescriptor::file ( ) const
const string& google::protobuf::FieldDescriptor::full_name ( ) const

+ Here is the caller graph for this function:

void google::protobuf::FieldDescriptor::GetLocationPath ( vector< int > *  output) const
private
bool google::protobuf::FieldDescriptor::GetSourceLocation ( SourceLocation out_location) const
google::protobuf::FieldDescriptor::GOOGLE_DISALLOW_EVIL_CONSTRUCTORS ( FieldDescriptor  )
private
bool google::protobuf::FieldDescriptor::has_default_value ( ) const
int google::protobuf::FieldDescriptor::index ( ) const
inline
1595  {
1596  if (!is_extension_) {
1597  return static_cast<int>(this - containing_type_->fields_);
1598  } else if (extension_scope_ != NULL) {
1599  return static_cast<int>(this - extension_scope_->extensions_);
1600  } else {
1601  return static_cast<int>(this - file_->extensions_);
1602  }
1603 }
const Descriptor * containing_type_
Definition: descriptor.h:582
FieldDescriptor * fields_
Definition: descriptor.h:304
arena_t NULL
Definition: jemalloc_internal.h:624
FieldDescriptor * extensions_
Definition: descriptor.h:1120
bool is_extension_
Definition: descriptor.h:580
const FileDescriptor * file_
Definition: descriptor.h:576
FieldDescriptor * extensions_
Definition: descriptor.h:314
const Descriptor * extension_scope_
Definition: descriptor.h:584
int google::protobuf::FieldDescriptor::index_in_oneof ( ) const
bool google::protobuf::FieldDescriptor::is_extension ( ) const

+ Here is the caller graph for this function:

bool google::protobuf::FieldDescriptor::is_optional ( ) const
inline
1581  {
1582  return label() == LABEL_OPTIONAL;
1583 }

+ Here is the call graph for this function:

bool google::protobuf::FieldDescriptor::is_packable ( ) const
inline
1589  {
1590  return is_repeated() && IsTypePackable(type());
1591 }
static bool IsTypePackable(Type field_type)
Definition: descriptor.h:1661
bool is_repeated() const
Definition: descriptor.h:1585

+ Here is the call graph for this function:

bool google::protobuf::FieldDescriptor::is_packed ( ) const
bool google::protobuf::FieldDescriptor::is_repeated ( ) const
inline
1585  {
1586  return label() == LABEL_REPEATED;
1587 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool google::protobuf::FieldDescriptor::is_required ( ) const
inline
1577  {
1578  return label() == LABEL_REQUIRED;
1579 }

+ Here is the call graph for this function:

bool google::protobuf::FieldDescriptor::IsTypePackable ( Type  field_type)
inlinestatic
1661  {
1662  return (field_type != FieldDescriptor::TYPE_STRING &&
1663  field_type != FieldDescriptor::TYPE_GROUP &&
1664  field_type != FieldDescriptor::TYPE_MESSAGE &&
1665  field_type != FieldDescriptor::TYPE_BYTES);
1666 }

+ Here is the caller graph for this function:

Label google::protobuf::FieldDescriptor::label ( ) const

+ Here is the caller graph for this function:

const string& google::protobuf::FieldDescriptor::lowercase_name ( ) const
const Descriptor* google::protobuf::FieldDescriptor::message_type ( ) const
const string& google::protobuf::FieldDescriptor::name ( ) const

+ Here is the caller graph for this function:

int google::protobuf::FieldDescriptor::number ( ) const

+ Here is the caller graph for this function:

const FieldOptions& google::protobuf::FieldDescriptor::options ( ) const

+ Here is the caller graph for this function:

Type google::protobuf::FieldDescriptor::type ( ) const

+ Here is the caller graph for this function:

const char * google::protobuf::FieldDescriptor::type_name ( ) const
inline
1637  {
1638  return kTypeToName[type_];
1639 }
Type type_
Definition: descriptor.h:578
static const char *const kTypeToName[MAX_TYPE+1]
Definition: descriptor.h:609
const char * google::protobuf::FieldDescriptor::TypeName ( Type  type)
inlinestatic
1653  {
1654  return kTypeToName[type];
1655 }
static const char *const kTypeToName[MAX_TYPE+1]
Definition: descriptor.h:609

+ Here is the call graph for this function:

FieldDescriptor::CppType google::protobuf::FieldDescriptor::TypeToCppType ( Type  type)
inlinestatic
1649  {
1650  return kTypeToCppTypeMap[type];
1651 }
static const CppType kTypeToCppTypeMap[MAX_TYPE+1]
Definition: descriptor.h:607

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class Descriptor
friend
friend class DescriptorBuilder
friend
friend class FileDescriptor
friend
friend class OneofDescriptor
friend

Member Data Documentation

union { ... }
const string* google::protobuf::FieldDescriptor::camelcase_name_
private
const OneofDescriptor* google::protobuf::FieldDescriptor::containing_oneof_
private
const Descriptor* google::protobuf::FieldDescriptor::containing_type_
private
bool google::protobuf::FieldDescriptor::default_value_bool_
double google::protobuf::FieldDescriptor::default_value_double_
const EnumValueDescriptor* google::protobuf::FieldDescriptor::default_value_enum_
float google::protobuf::FieldDescriptor::default_value_float_
int32 google::protobuf::FieldDescriptor::default_value_int32_
int64 google::protobuf::FieldDescriptor::default_value_int64_
const string* google::protobuf::FieldDescriptor::default_value_string_
uint32 google::protobuf::FieldDescriptor::default_value_uint32_
uint64 google::protobuf::FieldDescriptor::default_value_uint64_
const EnumDescriptor* google::protobuf::FieldDescriptor::enum_type_
private
const FieldDescriptor* google::protobuf::FieldDescriptor::experimental_map_key_
private
const Descriptor* google::protobuf::FieldDescriptor::extension_scope_
private
const FileDescriptor* google::protobuf::FieldDescriptor::file_
private
const string* google::protobuf::FieldDescriptor::full_name_
private
bool google::protobuf::FieldDescriptor::has_default_value_
private
int google::protobuf::FieldDescriptor::index_in_oneof_
private
bool google::protobuf::FieldDescriptor::is_extension_
private
const char* const google::protobuf::FieldDescriptor::kCppTypeToName[MAX_CPPTYPE+1]
staticprivate
const int google::protobuf::FieldDescriptor::kFirstReservedNumber = 19000
static
const char* const google::protobuf::FieldDescriptor::kLabelToName[MAX_LABEL+1]
staticprivate
const int google::protobuf::FieldDescriptor::kLastReservedNumber = 19999
static
const int google::protobuf::FieldDescriptor::kMaxNumber = (1 << 29) - 1
static
const CppType google::protobuf::FieldDescriptor::kTypeToCppTypeMap[MAX_TYPE+1]
staticprivate
const char* const google::protobuf::FieldDescriptor::kTypeToName[MAX_TYPE+1]
staticprivate
Label google::protobuf::FieldDescriptor::label_
private
const string* google::protobuf::FieldDescriptor::lowercase_name_
private
const Descriptor* google::protobuf::FieldDescriptor::message_type_
private
const string* google::protobuf::FieldDescriptor::name_
private
int google::protobuf::FieldDescriptor::number_
private
const FieldOptions* google::protobuf::FieldDescriptor::options_
private
Type google::protobuf::FieldDescriptor::type_
private

The documentation for this class was generated from the following file: