Lines Matching refs:Element
82 template <typename Element>
95 const Element& Get(int index) const;
96 Element* Mutable(int index);
97 void Set(int index, const Element& value);
98 void Add(const Element& value);
99 Element* Add();
100 // Remove the last element in the array.
107 void ExtractSubrange(int start, int num, Element* elements);
120 void AddAlreadyReserved(const Element& value);
121 Element* AddAlreadyReserved();
126 Element* mutable_data();
127 const Element* data() const;
136 typedef Element* iterator;
137 typedef const Element* const_iterator;
138 typedef Element value_type;
174 Element* elements_;
180 // specialized for non-primitive types to, say, swap each element instead.
181 void MoveArray(Element to[], Element from[], int size);
184 void CopyArray(Element to[], const Element from[], int size);
198 template <typename Element,
199 bool HasTrivialCopy = has_trivial_copy<Element>::value>
201 void operator()(Element to[], const Element from[], int array_size);
322 static inline typename TypeHandler::Type* cast(void* element) {
323 return reinterpret_cast<typename TypeHandler::Type*>(element);
326 static inline const typename TypeHandler::Type* cast(const void* element) {
327 return reinterpret_cast<const typename TypeHandler::Type*>(element);
402 template <typename Element>
415 const Element& Get(int index) const;
416 Element* Mutable(int index);
417 Element* Add();
419 // Remove the last element in the array.
420 // Ownership of the element is retained by the array.
441 Element** mutable_data();
442 const Element* const* data() const;
451 typedef internal::RepeatedPtrIterator<Element> iterator;
452 typedef internal::RepeatedPtrIterator<const Element> const_iterator;
453 typedef Element value_type;
483 // pointers to Element rather than Element itself.
484 typedef internal::RepeatedPtrOverPtrsIterator<Element, void*>
486 typedef internal::RepeatedPtrOverPtrsIterator<const Element, const void*>
503 void AddAllocated(Element* value);
504 // Remove the last element and return it, passing ownership to the caller.
506 Element* ReleaseLast();
517 void ExtractSubrange(int start, int num, Element** elements);
530 // Add an element to the pool of cleared objects, passing ownership to
531 // the RepeatedPtrField. The element must be cleared prior to calling
533 void AddCleared(Element* value);
534 // Remove a single element from the cleared pool and return it, passing
535 // ownership to the caller. The element is guaranteed to be cleared.
537 Element* ReleaseCleared();
550 template <typename Element>
551 inline RepeatedField<Element>::RepeatedField()
557 template <typename Element>
558 inline RepeatedField<Element>::RepeatedField(const RepeatedField& other)
565 template <typename Element>
567 inline RepeatedField<Element>::RepeatedField(Iter begin, const Iter& end)
576 template <typename Element>
577 RepeatedField<Element>::~RepeatedField() {
581 template <typename Element>
582 inline RepeatedField<Element>&
583 RepeatedField<Element>::operator=(const RepeatedField& other) {
589 template <typename Element>
590 inline int RepeatedField<Element>::size() const {
594 template <typename Element>
595 inline int RepeatedField<Element>::Capacity() const {
599 template<typename Element>
600 inline void RepeatedField<Element>::AddAlreadyReserved(const Element& value) {
605 template<typename Element>
606 inline Element* RepeatedField<Element>::AddAlreadyReserved() {
611 template <typename Element>
612 inline const Element& RepeatedField<Element>::Get(int index) const {
617 template <typename Element>
618 inline Element* RepeatedField<Element>::Mutable(int index) {
623 template <typename Element>
624 inline void RepeatedField<Element>::Set(int index, const Element& value) {
629 template <typename Element>
630 inline void RepeatedField<Element>::Add(const Element& value) {
635 template <typename Element>
636 inline Element* RepeatedField<Element>::Add() {
641 template <typename Element>
642 inline void RepeatedField<Element>::RemoveLast() {
647 template <typename Element>
648 void RepeatedField<Element>::ExtractSubrange(
649 int start, int num, Element* elements) {
668 template <typename Element>
669 inline void RepeatedField<Element>::Clear() {
673 template <typename Element>
674 inline void RepeatedField<Element>::MergeFrom(const RepeatedField& other) {
682 template <typename Element>
683 inline void RepeatedField<Element>::CopyFrom(const RepeatedField& other) {
688 template <typename Element>
689 inline Element* RepeatedField<Element>::mutable_data() {
693 template <typename Element>
694 inline const Element* RepeatedField<Element>::data() const {
699 template <typename Element>
700 void RepeatedField<Element>::Swap(RepeatedField* other) {
702 Element* swap_elements = elements_;
715 template <typename Element>
716 void RepeatedField<Element>::SwapElements(int index1, int index2) {
720 template <typename Element>
721 inline typename RepeatedField<Element>::iterator
722 RepeatedField<Element>::begin() {
725 template <typename Element>
726 inline typename RepeatedField<Element>::const_iterator
727 RepeatedField<Element>::begin() const {
730 template <typename Element>
731 inline typename RepeatedField<Element>::iterator
732 RepeatedField<Element>::end() {
735 template <typename Element>
736 inline typename RepeatedField<Element>::const_iterator
737 RepeatedField<Element>::end() const {
741 template <typename Element>
742 inline int RepeatedField<Element>::SpaceUsedExcludingSelf() const {
748 template <typename Element>
749 void RepeatedField<Element>::Reserve(int new_size) {
752 Element* old_elements = elements_;
755 elements_ = new Element[total_size_];
762 template <typename Element>
763 inline void RepeatedField<Element>::Truncate(int new_size) {
768 template <typename Element>
769 inline void RepeatedField<Element>::MoveArray(
770 Element to[], Element from[], int array_size) {
774 template <typename Element>
775 inline void RepeatedField<Element>::CopyArray(
776 Element to[], const Element from[], int array_size) {
777 internal::ElementCopier<Element>()(to, from, array_size);
782 template <typename Element, bool HasTrivialCopy>
783 void ElementCopier<Element, HasTrivialCopy>::operator()(
784 Element to[], const Element from[], int array_size) {
788 template <typename Element>
789 struct ElementCopier<Element, true> {
790 void operator()(Element to[], const Element from[], int array_size) {
791 memcpy(to, from, array_size * sizeof(Element));
960 // There are cleared elements on the end; replace the removed element
961 // with the last allocated element.
988 template <typename Element>
989 class RepeatedPtrField<Element>::TypeHandler
990 : public internal::GenericTypeHandler<Element> {
999 template <typename Element>
1000 inline RepeatedPtrField<Element>::RepeatedPtrField() {}
1002 template <typename Element>
1003 Element>::RepeatedPtrField(
1008 template <typename Element>
1010 inline RepeatedPtrField<Element>::RepeatedPtrField(
1017 template <typename Element>
1018 RepeatedPtrField<Element>::~RepeatedPtrField() {
1022 template <typename Element>
1023 inline RepeatedPtrField<Element>& RepeatedPtrField<Element>::operator=(
1030 template <typename Element>
1031 inline int RepeatedPtrField<Element>::size() const {
1035 template <typename Element>
1036 inline const Element& RepeatedPtrField<Element>::Get(int index) const {
1041 template <typename Element>
1042 inline Element* RepeatedPtrField<Element>::Mutable(int index) {
1046 template <typename Element>
1047 inline Element* RepeatedPtrField<Element>::Add() {
1051 template <typename Element>
1052 inline void RepeatedPtrField<Element>::RemoveLast() {
1056 template <typename Element>
1057 inline void RepeatedPtrField<Element>::DeleteSubrange(int start, int num) {
1066 template <typename Element>
1067 inline void RepeatedPtrField<Element>::ExtractSubrange(
1068 int start, int num, Element** elements) {
1083 template <typename Element>
1084 inline void RepeatedPtrField<Element>::Clear() {
1088 template <typename Element>
1089 inline void RepeatedPtrField<Element>::MergeFrom(
1094 template <typename Element>
1095 inline void RepeatedPtrField<Element>::CopyFrom(
1100 template <typename Element>
1101 inline Element** RepeatedPtrField<Element>::mutable_data() {
1105 template <typename Element>
1106 inline const Element* const* RepeatedPtrField<Element>::data() const {
1110 template <typename Element>
1111 void RepeatedPtrField<Element>::Swap(RepeatedPtrField* other) {
1115 template <typename Element>
1116 void RepeatedPtrField<Element>::SwapElements(int index1, int index2) {
1120 template <typename Element>
1121 inline int RepeatedPtrField<Element>::SpaceUsedExcludingSelf() const {
1125 template <typename Element>
1126 inline void RepeatedPtrField<Element>::AddAllocated(Element* value) {
1130 template <typename Element>
1131 inline Element* RepeatedPtrField<Element>::ReleaseLast() {
1136 template <typename Element>
1137 inline int RepeatedPtrField<Element>::ClearedCount() const {
1141 template <typename Element>
1142 inline void RepeatedPtrField<Element>::AddCleared(Element* value) {
1146 template <typename Element>
1147 inline Element* RepeatedPtrField<Element>::ReleaseCleared() {
1151 template <typename Element>
1152 inline void RepeatedPtrField<Element>::Reserve(int new_size) {
1156 template <typename Element>
1157 inline int RepeatedPtrField<Element>::Capacity() const {
1176 template<typename Element>
1179 std::random_access_iterator_tag, Element> {
1181 typedef RepeatedPtrIterator<Element> iterator;
1183 std::random_access_iterator_tag, Element> superclass;
1201 implicit_cast<Element*, OtherElement*>(0);
1206 reference operator*() const { return *reinterpret_cast<Element*>(*it_); }
1268 template<typename Element, typename VoidPtr>
1270 : public std::iterator<std::random_access_iterator_tag, Element*> {
1272 typedef RepeatedPtrOverPtrsIterator<Element, VoidPtr> iterator;
1274 std::random_access_iterator_tag, Element*> superclass;
1286 reference operator*() const { return *reinterpret_cast<Element**>(it_); }
1343 template <typename Element>
1344 inline typename RepeatedPtrField<Element>::iterator
1345 RepeatedPtrField<Element>::begin() {
1348 template <typename Element>
1349 inline typename RepeatedPtrField<Element>::const_iterator
1350 RepeatedPtrField<Element>::begin() const {
1353 template <typename Element>
1354 inline typename RepeatedPtrField<Element>::iterator
1355 RepeatedPtrField<Element>::end() {
1358 template <typename Element>
1359 inline typename RepeatedPtrField<Element>::const_iterator
1360 RepeatedPtrField<Element>::end() const {
1364 template <typename Element>
1365 inline typename RepeatedPtrField<Element>::pointer_iterator
1366 RepeatedPtrField<Element>::pointer_begin() {
1369 template <typename Element>
1370 inline typename RepeatedPtrField<Element>::const_pointer_iterator
1371 RepeatedPtrField<Element>::pointer_begin() const {
1374 template <typename Element>
1375 inline typename RepeatedPtrField<Element>::pointer_iterator
1376 RepeatedPtrField<Element>::pointer_end() {
1379 template <typename Element>
1380 inline typename RepeatedPtrField<Element>::const_pointer_iterator
1381 RepeatedPtrField<Element>::pointer_end() const {