46 #ifndef GOOGLE_PROTOBUF_REPEATED_FIELD_H__
47 #define GOOGLE_PROTOBUF_REPEATED_FIELD_H__
64 namespace google_opensource {
80 template <
typename Iter>
85 template <
typename Iter>
90 template <
typename Iter>
92 typedef typename std::iterator_traits<Iter>::iterator_category Category;
102 template <
typename Element>
103 class RepeatedField {
107 template <
typename Iter>
116 const Element&
Get(
int index)
const;
118 void Set(
int index,
const Element&
value);
153 const Element*
data()
const;
173 const_iterator
begin()
const;
175 const_iterator
end()
const;
189 const_reverse_iterator
rend()
const {
210 void CopyArray(Element to[],
const Element from[],
int size);
224 template <
typename Element,
227 void operator()(Element to[],
const Element from[],
int array_size);
271 template <typename TypeHandler>
277 template <typename TypeHandler>
279 template <typename TypeHandler>
281 template <typename TypeHandler>
283 template <typename TypeHandler>
285 template <typename TypeHandler>
287 template <typename TypeHandler>
288 void MergeFrom(const RepeatedPtrFieldBase& other);
289 template <typename TypeHandler>
290 void CopyFrom(const RepeatedPtrFieldBase& other);
292 void CloseGap(int start, int num) {
294 for (
int i = start + num; i < allocated_size_; ++i)
295 elements_[i - num] = elements_[i];
296 current_size_ -= num;
297 allocated_size_ -= num;
300 void Reserve(
int new_size);
302 int Capacity()
const;
305 void*
const* raw_data()
const;
306 void** raw_mutable_data()
const;
308 template <
typename TypeHandler>
310 template <
typename TypeHandler>
315 void SwapElements(
int index1,
int index2);
317 template <
typename TypeHandler>
318 int SpaceUsedExcludingSelf()
const;
324 template <
typename TypeHandler>
327 template <
typename TypeHandler>
329 template <
typename TypeHandler>
332 int ClearedCount()
const;
333 template <
typename TypeHandler>
335 template <
typename TypeHandler>
339 static const int kInitialSize = 0;
346 template <
typename TypeHandler>
350 template <
typename TypeHandler>
358 template <
typename GenericType>
362 static GenericType*
New() {
return new GenericType; }
365 static void Merge(
const GenericType& from, GenericType* to) {
408 static string* New();
409 static void Delete(
string*
value);
411 static void Merge(
const string& from,
string* to) { *to = from; }
429 template <
typename Element>
430 class RepeatedPtrField :
public internal::RepeatedPtrFieldBase {
434 template <
typename Iter>
443 const Element&
Get(
int index)
const;
470 const Element*
const*
data()
const;
490 const_iterator
begin()
const;
492 const_iterator
end()
const;
506 const_reverse_iterator
rend()
const {
578 template <
typename Element>
582 total_size_(kInitialSize) {
585 template <
typename Element>
589 total_size_(kInitialSize) {
593 template <
typename Element>
594 template <
typename Iter>
598 total_size_(kInitialSize) {
612 template <
typename Element>
617 template <
typename Element>
625 template <
typename Element>
627 return current_size_ == 0;
630 template <
typename Element>
632 return current_size_;
635 template <
typename Element>
640 template<
typename Element>
643 elements_[current_size_++] =
value;
646 template<
typename Element>
649 return &elements_[current_size_++];
652 template<
typename Element>
655 if (new_size > size()) {
657 std::fill(&elements_[current_size_], &elements_[new_size], value);
659 current_size_ = new_size;
662 template <
typename Element>
666 return elements_[index];
669 template <
typename Element>
673 return elements_ + index;
676 template <
typename Element>
680 elements_[index] =
value;
683 template <
typename Element>
685 if (current_size_ == total_size_) Reserve(total_size_ + 1);
686 elements_[current_size_++] =
value;
689 template <
typename Element>
691 if (current_size_ == total_size_) Reserve(total_size_ + 1);
692 return &elements_[current_size_++];
695 template <
typename Element>
701 template <
typename Element>
703 int start,
int num, Element* elements) {
709 if (elements !=
NULL) {
710 for (
int i = 0; i < num; ++i)
711 elements[i] = this->Get(i + start);
716 for (
int i = start + num; i < this->size(); ++i)
717 this->Set(i - num, this->Get(i));
718 this->Truncate(this->size() - num);
722 template <
typename Element>
727 template <
typename Element>
730 if (other.current_size_ != 0) {
731 Reserve(current_size_ + other.current_size_);
732 CopyArray(elements_ + current_size_, other.elements_, other.current_size_);
733 current_size_ += other.current_size_;
737 template <
typename Element>
739 if (&other ==
this)
return;
744 template <
typename Element>
749 template <
typename Element>
755 template <
typename Element>
757 if (
this == other)
return;
758 Element* swap_elements = elements_;
759 int swap_current_size = current_size_;
760 int swap_total_size = total_size_;
762 elements_ = other->elements_;
763 current_size_ = other->current_size_;
764 total_size_ = other->total_size_;
766 other->elements_ = swap_elements;
767 other->current_size_ = swap_current_size;
768 other->total_size_ = swap_total_size;
771 template <
typename Element>
774 swap(elements_[index1], elements_[index2]);
777 template <
typename Element>
782 template <
typename Element>
787 template <
typename Element>
790 return elements_ + current_size_;
792 template <
typename Element>
795 return elements_ + current_size_;
798 template <
typename Element>
800 return (elements_ !=
NULL) ? total_size_ *
sizeof(elements_[0]) : 0;
805 template <
typename Element>
807 if (total_size_ >= new_size)
return;
809 Element* old_elements = elements_;
811 max(total_size_ * 2, new_size));
812 elements_ =
new Element[total_size_];
813 if (old_elements !=
NULL) {
814 MoveArray(elements_, old_elements, current_size_);
815 delete [] old_elements;
819 template <
typename Element>
822 current_size_ = new_size;
825 template <
typename Element>
827 Element to[], Element from[],
int array_size) {
828 CopyArray(to, from, array_size);
831 template <
typename Element>
833 Element to[],
const Element from[],
int array_size) {
839 template <
typename Element,
bool HasTrivialCopy>
841 Element to[],
const Element from[],
int array_size) {
842 std::copy(from, from + array_size, to);
845 template <
typename Element>
847 void operator()(Element to[],
const Element from[],
int array_size) {
848 memcpy(to, from, array_size *
sizeof(Element));
863 total_size_(kInitialSize) {
866 template <
typename TypeHandler>
869 TypeHandler::Delete(cast<TypeHandler>(
elements_[i]));
882 template <
typename TypeHandler>
887 return *cast<TypeHandler>(
elements_[index]);
891 template <
typename TypeHandler>
896 return cast<TypeHandler>(
elements_[index]);
899 template <
typename TypeHandler>
911 template <
typename TypeHandler>
917 template <
typename TypeHandler>
920 TypeHandler::Clear(cast<TypeHandler>(
elements_[i]));
925 template <
typename TypeHandler>
930 TypeHandler::Merge(other.template Get<TypeHandler>(i), Add<TypeHandler>());
934 template <
typename TypeHandler>
936 if (&other ==
this)
return;
937 RepeatedPtrFieldBase::Clear<TypeHandler>();
938 RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);
953 template <
typename TypeHandler>
960 template <
typename TypeHandler>
973 template <
typename TypeHandler>
975 int allocated_bytes =
978 allocated_bytes += TypeHandler::SpaceUsed(*cast<TypeHandler>(
elements_[i]));
980 return allocated_bytes;
983 template <
typename TypeHandler>
992 template <
typename TypeHandler>
1019 template <
typename TypeHandler>
1037 template <
typename TypeHandler>
1044 template <
typename TypeHandler>
1054 template <
typename Element>
1065 template <
typename Element>
1068 template <
typename Element>
1071 : RepeatedPtrFieldBase() {
1075 template <
typename Element>
1076 template <
typename Iter>
1078 Iter begin,
const Iter& end) {
1080 if (reserve != -1) {
1083 for (; begin != end; ++begin) {
1088 template <
typename Element>
1090 Destroy<TypeHandler>();
1093 template <
typename Element>
1101 template <
typename Element>
1103 return RepeatedPtrFieldBase::empty();
1106 template <
typename Element>
1108 return RepeatedPtrFieldBase::size();
1111 template <
typename Element>
1113 return RepeatedPtrFieldBase::Get<TypeHandler>(index);
1117 template <
typename Element>
1119 return RepeatedPtrFieldBase::Mutable<TypeHandler>(index);
1122 template <
typename Element>
1124 return RepeatedPtrFieldBase::Add<TypeHandler>();
1127 template <
typename Element>
1129 RepeatedPtrFieldBase::RemoveLast<TypeHandler>();
1132 template <
typename Element>
1137 for (
int i = 0; i < num; ++i)
1138 delete RepeatedPtrFieldBase::Mutable<TypeHandler>(start + i);
1139 ExtractSubrange(start, num,
NULL);
1142 template <
typename Element>
1144 int start,
int num, Element** elements) {
1151 if (elements !=
NULL) {
1152 for (
int i = 0; i < num; ++i)
1153 elements[i] = RepeatedPtrFieldBase::Mutable<TypeHandler>(i + start);
1155 CloseGap(start, num);
1159 template <
typename Element>
1161 RepeatedPtrFieldBase::Clear<TypeHandler>();
1164 template <
typename Element>
1167 RepeatedPtrFieldBase::MergeFrom<TypeHandler>(other);
1170 template <
typename Element>
1173 RepeatedPtrFieldBase::CopyFrom<TypeHandler>(other);
1176 template <
typename Element>
1178 return RepeatedPtrFieldBase::mutable_data<TypeHandler>();
1181 template <
typename Element>
1183 return RepeatedPtrFieldBase::data<TypeHandler>();
1186 template <
typename Element>
1188 RepeatedPtrFieldBase::Swap(other);
1191 template <
typename Element>
1193 RepeatedPtrFieldBase::SwapElements(index1, index2);
1196 template <
typename Element>
1198 return RepeatedPtrFieldBase::SpaceUsedExcludingSelf<TypeHandler>();
1201 template <
typename Element>
1203 RepeatedPtrFieldBase::AddAllocated<TypeHandler>(
value);
1206 template <
typename Element>
1208 return RepeatedPtrFieldBase::ReleaseLast<TypeHandler>();
1212 template <
typename Element>
1214 return RepeatedPtrFieldBase::ClearedCount();
1217 template <
typename Element>
1219 return RepeatedPtrFieldBase::AddCleared<TypeHandler>(
value);
1222 template <
typename Element>
1224 return RepeatedPtrFieldBase::ReleaseCleared<TypeHandler>();
1227 template <
typename Element>
1229 return RepeatedPtrFieldBase::Reserve(new_size);
1232 template <
typename Element>
1234 return RepeatedPtrFieldBase::Capacity();
1252 template<
typename Element>
1253 class RepeatedPtrIterator
1254 :
public std::iterator<
1255 std::random_access_iterator_tag, Element> {
1258 typedef std::iterator<
1276 template<
typename OtherElement>
1286 reference
operator*()
const {
return *
reinterpret_cast<Element*
>(*it_); }
1328 reference
operator[](difference_type d)
const {
return *(*
this + d); }
1334 template<
typename OtherElement>
1348 template<
typename Element,
typename Vo
idPtr>
1350 :
public std::iterator<std::random_access_iterator_tag, Element*> {
1353 typedef std::iterator<
1412 reference
operator[](difference_type d)
const {
return *(*
this + d); }
1418 template<
typename OtherElement>
1427 template <
typename Element>
1432 template <
typename Element>
1437 template <
typename Element>
1440 return iterator(raw_data() + size());
1442 template <
typename Element>
1445 return iterator(raw_data() + size());
1448 template <
typename Element>
1453 template <
typename Element>
1458 template <
typename Element>
1463 template <
typename Element>
1467 const_cast<const void**>(raw_mutable_data() + size()));
1483 :
public std::iterator<std::output_iterator_tag, T> {
1487 :
field_(mutable_field) {
1509 :
public std::iterator<std::output_iterator_tag, T> {
1513 :
field_(mutable_field) {
1520 const T*
const ptr_to_value) {
1541 :
public std::iterator<std::output_iterator_tag, T> {
1545 :
field_(mutable_field) {
1548 T*
const ptr_to_value) {
1577 template<
typename T> internal::RepeatedPtrFieldBackInsertIterator<T>
1585 template<
typename T> internal::RepeatedPtrFieldBackInsertIterator<T>
1593 template<
typename T> internal::AllocatedRepeatedPtrFieldBackInsertIterator<T>
1603 #endif // GOOGLE_PROTOBUF_REPEATED_FIELD_H__
RepeatedField()
Definition: repeated_field.h:579
const value_type & const_reference
Definition: repeated_field.h:166
value_type & reference
Definition: repeated_field.h:482
const Element & Get(int index) const
Definition: repeated_field.h:1112
void RemoveLast()
Definition: repeated_field.h:696
void Reserve(int new_size)
Definition: repeated_field.h:1228
RepeatedField< T > * field_
Definition: repeated_field.h:1504
void Reserve(int new_size)
internal::AllocatedRepeatedPtrFieldBackInsertIterator< T > AllocatedRepeatedPtrFieldBackInserter(RepeatedPtrField< T > *const mutable_field)
Definition: repeated_field.h:1594
RepeatedPtrFieldBackInsertIterator< T > & operator++()
Definition: repeated_field.h:1527
Element * ReleaseCleared()
Definition: repeated_field.h:1223
bool operator==(const iterator &x) const
Definition: repeated_field.h:1296
bool operator!=(const iterator &x) const
Definition: repeated_field.h:1381
reverse_iterator rend()
Definition: repeated_field.h:503
void AddCleared(Element *value)
Definition: repeated_field.h:1218
Definition: message.h:144
TypeHandler::Type * AddFromCleared()
Definition: repeated_field.h:984
Definition: repeated_field.h:1482
static void Clear(GenericType *value)
Definition: repeated_field.h:364
Element * Add()
Definition: repeated_field.h:690
RepeatedPtrOverPtrsIterator(VoidPtr *it)
Definition: repeated_field.h:1367
LIBPROTOBUF_EXPORT int StringSpaceUsedExcludingSelf(const string &str)
int total_size_
Definition: repeated_field.h:344
Definition: message_lite.h:77
bool operator==(const iterator &x) const
Definition: repeated_field.h:1380
RepeatedFieldBackInsertIterator(RepeatedField< T > *const mutable_field)
Definition: repeated_field.h:1485
bool operator!=(const iterator &x) const
Definition: repeated_field.h:1297
RepeatedField & operator=(const RepeatedField &other)
Definition: repeated_field.h:619
TypeHandler::Type * Add()
Definition: repeated_field.h:900
const TypeHandler::Type & Get(int index) const
Definition: repeated_field.h:884
int size_type
Definition: repeated_field.h:169
bool operator<(const iterator &x) const
Definition: repeated_field.h:1384
~RepeatedField()
Definition: repeated_field.h:613
int Capacity() const
Definition: repeated_field.h:1233
string Type
Definition: repeated_field.h:407
Definition: repeated_field.h:226
static void Merge(const GenericType &from, GenericType *to)
Definition: repeated_field.h:365
static TypeHandler::Type * cast(void *element)
Definition: repeated_field.h:347
void AddAllocated(Element *value)
Definition: repeated_field.h:1202
const value_type * const_pointer
Definition: repeated_field.h:485
RepeatedPtrFieldBackInsertIterator< T > & operator=(const T *const ptr_to_value)
Definition: repeated_field.h:1519
bool operator>=(const iterator &x) const
Definition: repeated_field.h:1387
void CopyFrom(const RepeatedPtrFieldBase &other)
Definition: repeated_field.h:935
int size_type
Definition: repeated_field.h:486
RepeatedFieldBackInsertIterator< T > & operator*()
Definition: repeated_field.h:1493
static GenericType * New()
Definition: repeated_field.h:362
bool operator>(const iterator &x) const
Definition: repeated_field.h:1302
std::reverse_iterator< iterator > reverse_iterator
Definition: repeated_field.h:179
const Element * data() const
Definition: repeated_field.h:750
int SpaceUsedExcludingSelf() const
Definition: repeated_field.h:1197
iterator operator++(int)
Definition: repeated_field.h:1291
internal::RepeatedPtrOverPtrsIterator< Element, void * > pointer_iterator
Definition: repeated_field.h:513
RepeatedPtrField & operator=(const RepeatedPtrField &other)
Definition: repeated_field.h:1094
VoidPtr * it_
Definition: repeated_field.h:1422
iterator begin()
Definition: repeated_field.h:1429
static void Delete(GenericType *value)
Definition: repeated_field.h:363
internal::RepeatedFieldBackInsertIterator< T > RepeatedFieldBackInserter(RepeatedField< T > *const mutable_field)
Definition: repeated_field.h:1571
Element * Add()
Definition: repeated_field.h:1123
Element ** mutable_data()
Definition: repeated_field.h:1177
iterator end()
Definition: repeated_field.h:1439
friend iterator operator-(iterator it, difference_type d)
Definition: repeated_field.h:1406
Element value_type
Definition: repeated_field.h:481
T type
Definition: type_traits.h:273
Definition: repeated_field.h:1055
int total_size_
Definition: repeated_field.h:202
RepeatedPtrFieldBackInsertIterator< T > & operator++(int)
Definition: repeated_field.h:1530
void Resize(int new_size, const Element &value)
Definition: repeated_field.h:653
arena_t NULL
Definition: jemalloc_internal.h:624
RepeatedPtrFieldBackInsertIterator< T > & operator=(const T &value)
Definition: repeated_field.h:1515
Definition: message.h:147
const_reverse_iterator rend() const
Definition: repeated_field.h:506
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: common.h:89
iterator & operator--()
Definition: repeated_field.h:1376
void SwapElements(int index1, int index2)
Definition: repeated_field.h:1192
Element * elements_
Definition: repeated_field.h:200
RepeatedPtrOverPtrsIterator()
Definition: repeated_field.h:1366
int ClearedCount() const
Definition: repeated_field.h:1033
RepeatedPtrFieldBackInsertIterator< T > & operator*()
Definition: repeated_field.h:1524
void Truncate(int new_size)
Definition: repeated_field.h:820
static const TypeHandler::Type * cast(const void *element)
Definition: repeated_field.h:351
internal::RepeatedPtrFieldBackInsertIterator< T > RepeatedPtrFieldBackInserter(RepeatedPtrField< T > *const mutable_field)
Definition: repeated_field.h:1578
void ** elements_
Definition: repeated_field.h:341
difference_type operator-(const iterator &x) const
Definition: repeated_field.h:1331
bool operator<(const iterator &x) const
Definition: repeated_field.h:1300
friend iterator operator+(difference_type d, iterator it)
Definition: repeated_field.h:1314
RepeatedPtrFieldBackInsertIterator(RepeatedPtrField< T > *const mutable_field)
Definition: repeated_field.h:1511
int size() const
Definition: repeated_field.h:631
int ClearedCount() const
Definition: repeated_field.h:1213
void CopyArray(Element to[], const Element from[], int size)
Definition: repeated_field.h:832
value_type * pointer
Definition: repeated_field.h:167
void AddCleared(typename TypeHandler::Type *value)
Definition: repeated_field.h:1038
int current_size_
Definition: repeated_field.h:201
double distance(double x, double y)
Definition: g3dmath.h:731
int current_size_
Definition: repeated_field.h:342
void DeleteSubrange(int start, int num)
Definition: repeated_field.h:1133
Definition: message.h:165
TypeHandler::Type * ReleaseLast()
Definition: repeated_field.h:1020
void Clear()
Definition: repeated_field.h:1160
~RepeatedPtrField()
Definition: repeated_field.h:1089
RepeatedPtrIterator()
Definition: repeated_field.h:1271
difference_type operator-(const iterator &x) const
Definition: repeated_field.h:1415
T max(const T &x, const T &y)
Definition: g3dmath.h:320
reverse_iterator rbegin()
Definition: repeated_field.h:180
#define bool
Definition: CascPort.h:16
superclass::difference_type difference_type
Definition: repeated_field.h:1364
iterator end()
Definition: repeated_field.h:789
#define true
Definition: CascPort.h:17
reference operator[](difference_type d) const
Definition: repeated_field.h:1412
Element * iterator
Definition: repeated_field.h:162
void *const * it_
Definition: repeated_field.h:1338
int SpaceUsedExcludingSelf() const
Definition: repeated_field.h:799
static int SpaceUsed(const GenericType &value)
Definition: repeated_field.h:368
const value_type * const_pointer
Definition: repeated_field.h:168
AllocatedRepeatedPtrFieldBackInsertIterator< T > & operator*()
Definition: repeated_field.h:1552
superclass::difference_type difference_type
Definition: repeated_field.h:1269
pointer_iterator pointer_begin()
Definition: repeated_field.h:1450
void MergeFrom(const RepeatedPtrField &other)
Definition: repeated_field.h:1165
internal::RepeatedPtrIterator< const Element > const_iterator
Definition: repeated_field.h:480
int SpaceUsedExcludingSelf() const
Definition: repeated_field.h:974
Definition: type_traits.h:80
#define GOOGLE_DCHECK_GE
Definition: common.h:758
iterator operator--(int)
Definition: repeated_field.h:1293
void operator()(Element to[], const Element from[], int array_size)
Definition: repeated_field.h:847
static int SpaceUsed(const string &value)
Definition: repeated_field.h:419
Definition: repeated_field.h:417
Element * Mutable(int index)
Definition: repeated_field.h:670
RepeatedPtrFieldBase()
Definition: repeated_field.h:859
friend iterator operator+(iterator it, difference_type d)
Definition: repeated_field.h:1310
#define GOOGLE_DCHECK_LT
Definition: common.h:755
const Element *const * data() const
Definition: repeated_field.h:1182
Element * ReleaseLast()
Definition: repeated_field.h:1207
const_reverse_iterator rbegin() const
Definition: repeated_field.h:500
RepeatedFieldBackInsertIterator< T > & operator=(const T &value)
Definition: repeated_field.h:1489
Definition: repeated_field.h:359
Element * mutable_data()
Definition: repeated_field.h:745
Definition: repeated_field.h:214
const value_type & const_reference
Definition: repeated_field.h:483
reference operator*() const
Definition: repeated_field.h:1286
superclass::reference reference
Definition: repeated_field.h:1362
AllocatedRepeatedPtrFieldBackInsertIterator< T > & operator=(T *const ptr_to_value)
Definition: repeated_field.h:1547
pointer operator->() const
Definition: repeated_field.h:1287
internal::RepeatedPtrOverPtrsIterator< const Element, const void * > const_pointer_iterator
Definition: repeated_field.h:515
static void Merge(const string &from, string *to)
Definition: repeated_field.h:411
value_type & reference
Definition: repeated_field.h:165
ptrdiff_t difference_type
Definition: repeated_field.h:170
RepeatedPtrIterator(const RepeatedPtrIterator< OtherElement > &other)
Definition: repeated_field.h:1277
internal::RepeatedPtrIterator< Element > iterator
Definition: repeated_field.h:479
remove_const< Element * >::type value_type
Definition: repeated_field.h:1358
reverse_iterator rbegin()
Definition: repeated_field.h:497
Definition: repeated_field.h:215
static const int kInitialSize
Definition: repeated_field.h:198
friend iterator operator+(difference_type d, iterator it)
Definition: repeated_field.h:1398
#define GOOGLE_CHECK_NE(A, B)
Definition: common.h:717
void SwapElements(int index1, int index2)
Definition: repeated_field.h:968
RepeatedPtrIterator< Element > iterator
Definition: repeated_field.h:1257
void Swap(RepeatedPtrField *other)
Definition: repeated_field.h:1187
static const Type & default_instance()
Definition: repeated_field.h:412
void SwapElements(int index1, int index2)
Definition: repeated_field.h:772
superclass::pointer pointer
Definition: repeated_field.h:1363
iterator & operator++()
Definition: repeated_field.h:1290
void MoveArray(Element to[], Element from[], int size)
Definition: repeated_field.h:826
reverse_iterator rend()
Definition: repeated_field.h:186
RepeatedFieldBackInsertIterator< T > & operator++()
Definition: repeated_field.h:1496
iterator & operator--()
Definition: repeated_field.h:1292
static const int kMinRepeatedFieldAllocationSize
Definition: repeated_field.h:75
iterator & operator+=(difference_type d)
Definition: repeated_field.h:1390
Element value_type
Definition: repeated_field.h:164
TypeHandler::Type * ReleaseCleared()
Definition: repeated_field.h:1045
#define GOOGLE_DCHECK_LE
Definition: common.h:756
Definition: extension_set.h:157
LIBPROTOBUF_EXPORTconst::std::string & GetEmptyString()
Definition: generated_message_util.h:83
RepeatedPtrField< T > * field_
Definition: repeated_field.h:1535
void ** raw_mutable_data() const
Definition: repeated_field.h:949
Definition: repeated_field.h:250
reference operator[](difference_type d) const
Definition: repeated_field.h:1328
Definition: generated_message_reflection.h:96
virtual void CheckTypeAndMergeFrom(const MessageLite &other)=0
RepeatedPtrIterator(void *const *it)
Definition: repeated_field.h:1272
Definition: document.h:390
void Add(const Element &value)
Definition: repeated_field.h:684
#define LIBPROTOBUF_EXPORT
Definition: common.h:105
void Clear()
Definition: repeated_field.h:918
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: repeated_field.h:178
const Element * const_iterator
Definition: repeated_field.h:163
std::reverse_iterator< iterator > reverse_iterator
Definition: repeated_field.h:496
void Reserve(int new_size)
Definition: repeated_field.h:806
int Capacity() const
Definition: repeated_field.h:636
iterator operator++(int)
Definition: repeated_field.h:1375
bool empty() const
Definition: repeated_field.h:1102
AllocatedRepeatedPtrFieldBackInsertIterator(RepeatedPtrField< T > *const mutable_field)
Definition: repeated_field.h:1543
void MergeFrom(const RepeatedPtrFieldBase &other)
Definition: repeated_field.h:926
const_reverse_iterator rend() const
Definition: repeated_field.h:189
iterator & operator++()
Definition: repeated_field.h:1374
int size() const
Definition: repeated_field.h:878
GenericType Type
Definition: repeated_field.h:361
superclass::reference reference
Definition: repeated_field.h:1267
static const Type & default_instance()
Definition: repeated_field.h:369
pointer operator->() const
Definition: repeated_field.h:1371
Element * AddAlreadyReserved()
Definition: repeated_field.h:647
void AddAllocated(typename TypeHandler::Type *value)
Definition: repeated_field.h:993
void Clear()
Definition: repeated_field.h:723
int CalculateReserve(Iter begin, Iter end, std::forward_iterator_tag)
Definition: repeated_field.h:81
int allocated_size_
Definition: repeated_field.h:343
bool empty() const
Definition: repeated_field.h:874
bool operator<=(const iterator &x) const
Definition: repeated_field.h:1385
iterator & operator-=(difference_type d)
Definition: repeated_field.h:1318
value_type * pointer
Definition: repeated_field.h:484
static void Clear(string *value)
Definition: repeated_field.h:410
Definition: repeated_field.h:1508
reference operator*() const
Definition: repeated_field.h:1370
Definition: repeated_field.h:1540
const_reverse_iterator rbegin() const
Definition: repeated_field.h:183
friend iterator operator+(iterator it, difference_type d)
Definition: repeated_field.h:1394
remove_const< Element >::type value_type
Definition: repeated_field.h:1263
int size() const
Definition: repeated_field.h:1107
std::iterator< std::random_access_iterator_tag, Element > superclass
Definition: repeated_field.h:1259
pointer_iterator pointer_end()
Definition: repeated_field.h:1460
Definition: BnetFileGenerator.h:47
Definition: repeated_field.h:405
iterator & operator+=(difference_type d)
Definition: repeated_field.h:1306
void ExtractSubrange(int start, int num, Element **elements)
Definition: repeated_field.h:1143
const FieldDescriptor value
Definition: descriptor.h:1522
TypeHandler::Type ** mutable_data()
Definition: repeated_field.h:954
void operator()(Element to[], const Element from[], int array_size)
Definition: repeated_field.h:840
#define GOOGLE_DCHECK_GT
Definition: common.h:757
superclass::pointer pointer
Definition: repeated_field.h:1268
#define const
Definition: zconf.h:217
void RemoveLast()
Definition: repeated_field.h:912
void *const * raw_data() const
Definition: repeated_field.h:945
G3D::int16 x
Definition: Vector2int16.h:37
void Destroy()
Definition: repeated_field.h:867
RepeatedPtrOverPtrsIterator< Element, VoidPtr > iterator
Definition: repeated_field.h:1352
AllocatedRepeatedPtrFieldBackInsertIterator< T > & operator++()
Definition: repeated_field.h:1555
TypeHandler::Type * Mutable(int index)
Definition: repeated_field.h:893
ptrdiff_t difference_type
Definition: repeated_field.h:487
RepeatedPtrField()
Definition: repeated_field.h:1066
RepeatedFieldBackInsertIterator< T > & operator++(int)
Definition: repeated_field.h:1499
Type
Type of JSON value.
Definition: rapidjson.h:642
const Element & Get(int index) const
Definition: repeated_field.h:663
int Capacity() const
Definition: repeated_field.h:941
AllocatedRepeatedPtrFieldBackInsertIterator< T > & operator++(int)
Definition: repeated_field.h:1558
void RemoveLast()
Definition: repeated_field.h:1128
void CopyFrom(const RepeatedField &other)
Definition: repeated_field.h:738
std::iterator< std::random_access_iterator_tag, Element * > superclass
Definition: repeated_field.h:1354
void Swap(RepeatedField *other)
Definition: repeated_field.h:756
void ExtractSubrange(int start, int num, Element *elements)
Definition: repeated_field.h:702
iterator operator--(int)
Definition: repeated_field.h:1377
bool operator<=(const iterator &x) const
Definition: repeated_field.h:1301
void MergeFrom(const RepeatedField &other)
Definition: repeated_field.h:728
const TypeHandler::Type *const * data() const
Definition: repeated_field.h:962
iterator & operator-=(difference_type d)
Definition: repeated_field.h:1402
To implicit_cast(From const &f)
Definition: common.h:311
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: repeated_field.h:495
RepeatedPtrField< T > * field_
Definition: repeated_field.h:1564
Element * Mutable(int index)
Definition: repeated_field.h:1118
bool empty() const
Definition: repeated_field.h:626
void Set(int index, const Element &value)
Definition: repeated_field.h:677
bool operator>=(const iterator &x) const
Definition: repeated_field.h:1303
void CopyFrom(const RepeatedPtrField &other)
Definition: repeated_field.h:1171
void LogIndexOutOfBounds(int index, int size)
friend iterator operator-(iterator it, difference_type d)
Definition: repeated_field.h:1322
bool operator>(const iterator &x) const
Definition: repeated_field.h:1386
iterator begin()
Definition: repeated_field.h:779