template <typename>

class RepeatedField

Defined at line 246 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

RepeatedField is used to represent repeated fields of a primitive type (in

other words, everything except strings and nested Messages). Most users will

not ever use a RepeatedField directly; they will use the get-by-index,

set-by-index, and add accessors that are generated for all repeated fields.

Actually, in addition to primitive types, we use RepeatedField for repeated

Cords, because the Cord class is in fact just a reference-counted pointer.

We have to specialize several methods in the Cord case to get the memory

management right; e.g. swapping when appropriate, etc.

Public Methods

void RepeatedField<type-parameter-0-0> (const RepeatedField<Element> & rhs)

Defined at line 283 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void RepeatedField<type-parameter-0-0> (internal::InternalVisibility , Arena * arena)

Arena enabled constructors: for internal use only.

Defined at line 294 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void RepeatedField<type-parameter-0-0> (internal::InternalVisibility , Arena * arena, const RepeatedField<Element> & rhs)

Defined at line 296 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void RepeatedField<type-parameter-0-0> (RepeatedField<Element> && rhs)

Defined at line 303 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_reference operator[] (int index)

Defined at line 316 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

reference operator[] (int index)

Defined at line 319 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

reverse_iterator rbegin ()

Reverse iterator support

Defined at line 400 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_reverse_iterator rbegin ()

Defined at line 403 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

reverse_iterator rend ()

Defined at line 406 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_reverse_iterator rend ()

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

int SpaceUsedExcludingSelf ()

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

Arena * GetArena ()

Gets the Arena on which this RepeatedField stores its elements.

Note: this can be inaccurate for split default fields so we make this

function non-const.

Defined at line 440 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

size_t InternalGetArenaOffset (internal::InternalVisibility )

Defined at line 447 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void RepeatedField<type-parameter-0-0> ()

implementation ====================================================

Defined at line 637 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void RepeatedField<type-parameter-0-0> (Arena * arena)

TODO: make this constructor private

Defined at line 647 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

template <typename Iter, typename = typename std::enable_if<std::is_constructible<
                                    Element, decltype(*std::declval<Iter>())>::value>::type>
void RepeatedField<type-parameter-0-0> (Iter begin, Iter end)

Defined at line 671 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

RepeatedField<Element> & operator= (const RepeatedField<Element> & other)

Defined at line 698 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

RepeatedField<Element> & operator= (RepeatedField<Element> && other)

Defined at line 717 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void ~RepeatedField<type-parameter-0-0> ()

Defined at line 679 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

bool empty ()

Defined at line 732 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

int size ()

Defined at line 737 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_reference Get (int index)

Defined at line 803 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

pointer Mutable (int index)

Defined at line 827 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_reference at (int index)

Defined at line 811 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

reference at (int index)

Defined at line 819 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Set (int index, const Element & value)

Defined at line 835 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Add (Element value)

Defined at line 840 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

pointer Add ()

Appends a new element and returns a pointer to it.

The new element is uninitialized if |Element| is a POD type.

Defined at line 868 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

template <typename Iter>
void Add (Iter begin, Iter end)

Appends elements in the range [begin, end) after reserving

the appropriate number of elements.

Defined at line 939 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void RemoveLast ()

Removes the last element in the array.

Defined at line 951 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void ExtractSubrange (int start, int num, Element * elements)

Extracts elements with indices in "[start .. start+num-1]".

Copies them into "elements[0 .. num-1]" if "elements" is not nullptr.

Caution: also moves elements with indices [start+num ..].

Calling this routine inside a loop can cause quadratic behavior.

Defined at line 960 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Clear ()

Defined at line 983 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void MergeFrom (const RepeatedField<Element> & other)

Appends the elements from `other` after this instance.

The end result length will be `other.size() + this->size()`.

Defined at line 991 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void CopyFrom (const RepeatedField<Element> & other)

Replaces the contents with a copy of the elements from `other`.

Defined at line 1005 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

template <typename Iter>
void Assign (Iter begin, Iter end)

Replaces the contents with RepeatedField(begin, end).

Defined at line 1012 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Reserve (int new_size)

Reserves space to expand the field to at least the given size. If the

array is grown, it will always be at least doubled in size.

Defined at line 1171 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Truncate (int new_size)

Resizes the RepeatedField to a new, smaller size. This is O(1).

Except for RepeatedField

<Cord

>, for which it is O(size-new_size).

Defined at line 1246 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void AddAlreadyReserved (Element value)

Defined at line 747 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

int Capacity ()

Defined at line 742 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

pointer AddAlreadyReserved ()

Adds `n` elements to this instance asserting there is enough capacity.

The added elements are uninitialized if `Element` is trivial.

Defined at line 756 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

pointer AddNAlreadyReserved (int n)

Defined at line 768 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Resize (size_type new_size, const Element & value)

Like STL resize. Uses value to fill appended elements.

Like Truncate() if new_size

<

= size(), otherwise this is

O(new_size - size()).

Defined at line 783 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

pointer mutable_data ()

Gets the underlying array. This pointer is possibly invalidated by

any add or remove operation.

Defined at line 1035 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_pointer data ()

Defined at line 1041 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void Swap (RepeatedField<Element> * other)

Swaps entire contents with "other". If they are separate arenas, then

copies data between each other.

Defined at line 1064 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void SwapElements (int index1, int index2)

Swaps two elements.

Defined at line 1086 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

iterator begin ()

Defined at line 1093 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_iterator begin ()

Defined at line 1098 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_iterator cbegin ()

Defined at line 1103 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

iterator end ()

Defined at line 1108 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_iterator end ()

Defined at line 1114 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

const_iterator cend ()

Defined at line 1120 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

size_t SpaceUsedExcludingSelfLong ()

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

sizeof(*this)

Defined at line 1127 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

iterator erase (const_iterator position)

Removes the element referenced by position.

Returns an iterator to the element immediately following the removed

element.

Invalidates all iterators at or after the removed element, including end().

Defined at line 1019 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

iterator erase (const_iterator first, const_iterator last)

Removes the elements in the range [first, last).

Returns an iterator to the element immediately following the removed range.

Invalidates all iterators at or after the removed range, including end().

Defined at line 1025 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

void InternalSwap (RepeatedField<Element> * other)

For internal use only.

This is public due to it being called by generated code.

Defined at line 1047 of file ../../third_party/protobuf/src/google/protobuf/repeated_field.h

Friends

template <typename>
class Arena
template <typename T>
class InternalHelper