class MapFieldBase

Defined at line 298 of file ../../third_party/protobuf/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

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.

bool InsertOrLookupMapValue (const MapKey & map_key, MapValueRef * val)
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.

void Clear ()
void MapBegin (MapIterator * map_iter)
void MapEnd (MapIterator * map_iter)
bool EqualIterator (const MapIterator & a, const MapIterator & b)
void MapFieldBase (const VTable * vtable)

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

void MapFieldBase (const VTable * vtable, Arena * arena)

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

void MapFieldBase (const MapFieldBase & )

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

MapFieldBase & operator= (const MapFieldBase & )

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

const VTable * vtable ()

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

bool ContainsMapKey (const MapKey & map_key)

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

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

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

bool LookupMapValue (const MapKey & , MapValueRef * )

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

bool DeleteMapValue (const MapKey & map_key)

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

void MergeFrom (const MapFieldBase & other)

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

void Swap (MapFieldBase * other)

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

void UnsafeShallowSwap (MapFieldBase * other)

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

void SetMapIteratorValue (MapIterator * map_iter)

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

int SpaceUsedExcludingSelf ()

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

size_t InternalGetArenaOffset (internal::InternalVisibility )

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

RepeatedPtrFieldBase * MutableRepeatedField ()

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

int size ()

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

size_t SpaceUsedExcludingSelfLong ()

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

sizeof(*this)

Protected Methods

void InternalSwap (MapFieldBase * other)
const UntypedMapBase & GetMapImpl (const MapFieldBaseForParse & map, bool is_mutable)
template <typename T>
VTable MakeVTable ()

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

size_t SpaceUsedExcludingSelfNoLock ()

Gets the size of space used by map field.

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

const Message * GetPrototype ()

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

void ClearMapNoSync ()

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

bool InsertOrLookupMapValueNoSync (const MapKey & map_key, MapValueRef * val)

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

void ConstAccess ()

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

void MutableAccess ()

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

void ~MapFieldBase ()

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

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 SwapImpl (MapFieldBase & lhs, MapFieldBase & rhs)
void UnsafeShallowSwapImpl (MapFieldBase & lhs, MapFieldBase & rhs)
void SetMapDirty ()

Tells MapFieldBase that there is new change to Map.

void SetRepeatedDirty ()

Tells MapFieldBase that there is new change to RepeatedPtrField.

void * MutableRepeatedPtrField ()

Provides derived class the access to repeated field.

ReflectionPayload & PayloadSlow ()
Arena * arena ()

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

ReflectionPayload * maybe_payload ()

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

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

ReflectionPayload & payload ()

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

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

State state ()

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

Enumerations

enum State
Name Value
STATE_MODIFIED_MAP 0
STATE_MODIFIED_REPEATED 1
CLEAN 2

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

Records

Friends

class MapIterator
class DynamicMessage
class Reflection
class MapFieldAccessor
class GeneratedMessageReflection
class ContendedMapCleanTest