class MapFieldBase

Defined at line 308 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

This class provides access to map field using reflection, which is the same

as those provided for RepeatedPtrField

<Message

>. It is used for internal

reflection implementation only. Users should never use this directly.

Public Methods

bool IsRepeatedFieldValid ()

Returns whether changes to the map are reflected in the repeated field.

bool IsMapValid ()

Insures operations after won't get executed before calling this.

bool DeleteMapValue (Arena * arena, const MapKey & map_key)
void ConstMapBegin (ConstMapIterator * map_iter)
void ConstMapEnd (ConstMapIterator * map_iter)
template <bool kIsMutable>
bool EqualIterator (const MapIteratorBase<kIsMutable> & a, const MapIteratorBase<kIsMutable> & b)
void MapFieldBase (const void * globals_as_void)

Defined at line 310 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void MapFieldBase (const Message * prototype)

Defined at line 312 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void MapFieldBase (const MapFieldBase & )

Defined at line 314 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void MergeFrom (Arena * arena, const MapFieldBase & other)
int SpaceUsedExcludingSelf ()

Defined at line 371 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void Swap (Arena * arena, MapFieldBase * other, Arena * other_arena)
void InternalSwap (MapFieldBase * other)
size_t SpaceUsedExcludingSelfLong ()

Returns the number of bytes used by the repeated field, excluding

sizeof(*this)

MapFieldBase & operator= (const MapFieldBase & )

Defined at line 315 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

bool ContainsMapKey (const MapKey & map_key)

Defined at line 332 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

const RepeatedPtrFieldBase & GetRepeatedField ()

Returns reference to internal repeated field. Data written using

Map's api prior to calling this function is guarantted to be

included in repeated field.

RepeatedPtrFieldBase * MutableRepeatedField ()

Like above. Returns mutable pointer to the internal repeated field.

bool InsertOrLookupMapValue (const MapKey & map_key, MapValueRef * val)
bool LookupMapValue (const MapKey & map_key, MapValueConstRef * val)

Defined at line 336 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

bool LookupMapValue (const MapKey & , MapValueRef * )

Defined at line 341 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

int size ()

Sync Map with repeated field and returns the size of map.

void Clear ()
template <bool kIsMutable>
void SetMapIteratorValue (MapIteratorBase<kIsMutable> * map_iter)
void MapBegin (MapIterator * map_iter)
void MapEnd (MapIterator * map_iter)

Protected Methods

const Message * GetPrototype ()
void ClearMapNoSync ()
void SetMapDirty ()

Tells MapFieldBase that there is new change to Map.

Defined at line 392 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void ConstAccess ()

Support thread sanitizer (tsan) by making const / mutable races

more apparent. If one thread calls MutableAccess() while another

thread calls either ConstAccess() or MutableAccess(), on the same

MapFieldBase-derived object, and there is no synchronization going

on between them, tsan will alert.

Defined at line 415 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void MutableAccess ()

Defined at line 416 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

const RepeatedPtrFieldBase & SyncRepeatedFieldWithMap (bool for_mutation)

Synchronizes the content in Map to RepeatedPtrField if there is any change

to Map after last synchronization.

void SyncRepeatedFieldWithMapNoLock ()
void SyncMapWithRepeatedField ()

Synchronizes the content in RepeatedPtrField to Map if there is any change

to RepeatedPtrField after last synchronization.

void SyncMapWithRepeatedFieldNoLock ()
void SwapPayload (MapFieldBase & lhs, MapFieldBase & rhs)
void SetRepeatedDirty ()

Tells MapFieldBase that there is new change to RepeatedPtrField.

void * MutableRepeatedPtrField ()

Provides derived class the access to repeated field.

bool InsertOrLookupMapValueNoSync (const MapKey & map_key, MapValueRef * val)
ReflectionPayload & PayloadSlow ()
Arena * arena ()

Defined at line 465 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

ReflectionPayload * maybe_payload ()

Returns the reflection payload. Returns null if it does not exist yet.

Defined at line 468 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

ReflectionPayload & payload ()

Returns the reflection payload, and constructs one if does not exist yet.

Defined at line 473 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

State state ()

Defined at line 479 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

void ~MapFieldBase ()

"protected" stops users from deleting a `MapFieldBase *`

Enumerations

enum State
Name Value Comments
STATE_MODIFIED_MAP 0

map has newly added data that has not been
synchronized to repeated field

STATE_MODIFIED_REPEATED 1

repeated field has newly added data that
has not been synchronized to map

CLEAN 2

data in map and repeated field are same

Defined at line 417 of file ../../third_party/protobuf/src/src/google/protobuf/map_field.h

Records

Friends

class MapIterator
template <bool>
class MapIteratorBase
class DynamicMessage
class Reflection
class MapFieldAccessor
class GeneratedMessageReflection
class ContendedMapCleanTest