TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid > Class Template Reference

#include <extension_set.h>

Public Types

typedef Type ConstType
 
typedef Type MutableType
 
typedef RepeatedEnumTypeTraits
< Type, IsValid > 
Repeated
 
typedef RepeatedField< TypeRepeatedFieldType
 

Static Public Member Functions

static ConstType Get (int number, const ExtensionSet &set, int index)
 
static void Set (int number, int index, ConstType value, ExtensionSet *set)
 
static void Add (int number, FieldType field_type, bool is_packed, ConstType value, ExtensionSet *set)
 
static const RepeatedField
< Type > & 
GetRepeated (int number, const ExtensionSet &set)
 
static RepeatedField< Type > * MutableRepeated (int number, FieldType field_type, bool is_packed, ExtensionSet *set)
 
static const RepeatedFieldTypeGetDefaultRepeatedField ()
 

Member Typedef Documentation

template<typename Type , bool IsValid>
typedef Type google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::ConstType
template<typename Type , bool IsValid>
typedef Type google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::MutableType
template<typename Type , bool IsValid>
typedef RepeatedEnumTypeTraits<Type, IsValid> google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::Repeated
template<typename Type , bool IsValid>
typedef RepeatedField<Type> google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::RepeatedFieldType

Member Function Documentation

template<typename Type , bool IsValid>
static void google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::Add ( int  number,
FieldType  field_type,
bool  is_packed,
ConstType  value,
ExtensionSet set 
)
inlinestatic
894  {
895  GOOGLE_DCHECK(IsValid(value));
896  set->AddEnum(number, field_type, is_packed, value, NULL);
897  }
#define GOOGLE_DCHECK
Definition: common.h:752
arena_t NULL
Definition: jemalloc_internal.h:624
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

template<typename Type , bool IsValid>
static ConstType google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::Get ( int  number,
const ExtensionSet set,
int  index 
)
inlinestatic
885  {
886  return static_cast<Type>(set.GetRepeatedEnum(number, index));
887  }
Type
Type of JSON value.
Definition: rapidjson.h:642

+ Here is the call graph for this function:

template<typename Type , bool IsValid>
static const RepeatedFieldType* google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::GetDefaultRepeatedField ( )
inlinestatic
917  {
918  // Hack: as noted above, repeated enum fields are internally stored as a
919  // RepeatedField<int>. We need to be able to instantiate global static
920  // objects to return as default (empty) repeated fields on non-existent
921  // extensions. We would not be able to know a-priori all of the enum types
922  // (values of |Type|) to instantiate all of these, so we just re-use int32's
923  // default repeated field object.
924  return reinterpret_cast<const RepeatedField<Type>*>(
926  }
static const RepeatedFieldType * GetDefaultRepeatedField()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename Type , bool IsValid>
static const RepeatedField<Type>& google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::GetRepeated ( int  number,
const ExtensionSet set 
)
inlinestatic
900  {
901  // Hack: the `Extension` struct stores a RepeatedField<int> for enums.
902  // RepeatedField<int> cannot implicitly convert to RepeatedField<EnumType>
903  // so we need to do some casting magic. See message.h for similar
904  // contortions for non-extension fields.
905  return *reinterpret_cast<const RepeatedField<Type>*>(
906  set.GetRawRepeatedField(number, GetDefaultRepeatedField()));
907  }
static const RepeatedFieldType * GetDefaultRepeatedField()
Definition: extension_set.h:917

+ Here is the call graph for this function:

template<typename Type , bool IsValid>
static RepeatedField<Type>* google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::MutableRepeated ( int  number,
FieldType  field_type,
bool  is_packed,
ExtensionSet set 
)
inlinestatic
912  {
913  return reinterpret_cast<RepeatedField<Type>*>(
914  set->MutableRawRepeatedField(number, field_type, is_packed, NULL));
915  }
arena_t NULL
Definition: jemalloc_internal.h:624

+ Here is the call graph for this function:

template<typename Type , bool IsValid>
static void google::protobuf::internal::RepeatedEnumTypeTraits< Type, IsValid >::Set ( int  number,
int  index,
ConstType  value,
ExtensionSet set 
)
inlinestatic
889  {
890  GOOGLE_DCHECK(IsValid(value));
891  set->SetRepeatedEnum(number, index, value);
892  }
#define GOOGLE_DCHECK
Definition: common.h:752
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:


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