CFx SDK Documentation  2022 SP0
OdVector.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef OdVector_H_INCLUDED
25 #define OdVector_H_INCLUDED
26 
27 #include <new>
28 
29 #include "TD_PackPush.h"
30 
31 #include "OdArrayMemAlloc.h"
32 #include "OdAlloc.h"
33 
34 template <class T, class A = OdObjectsAllocator<T>, class Mm = OdrxMemoryManager> class OdVector;
35 
53 template <class T, class A, class Mm> class OdVector
54 {
55 public:
56  typedef typename A::size_type size_type;
57  typedef T* iterator;
58  typedef const T* const_iterator;
59  // compatibility with OdArray
60  typedef T value_type;
61  typedef const T& const_reference;
62  typedef T& reference;
63 
64 private:
65  static T* allocate(size_type physicalLength);
66 
67  void release();
68 
69  void reallocate(size_type physicalLength, bool isUseRealloc = false, bool isForcePhysicalLength = false);
70 
71  bool isValid(size_type index) const;
72  void assertValid(size_type index) const;
73 
74  static void riseError(OdResult res);
75 
76  const_iterator begin_const() const;
77  iterator begin_non_const();
78  const_iterator end_const() const;
79  iterator end_non_const();
80 
81 public:
87  OdVector(const OdVector& vec);
88 
90  OdVector& operator=(const OdVector& vec);
91 
96 
103 
115 
129  iterator insert(iterator before, size_type numElem, const T& value);
139  iterator insert(iterator before, const T& value = T());
140 
155 
169 
181  OdVector& removeSubArray(size_type startIndex, size_type endIndex);
182 
194  bool remove(const T& value, size_type startIndex = 0);
195 
207 
211  size_type size() const;
212 
216  bool empty() const;
217 
222 
229  void reserve(size_type reserveLength);
230 
242 
250 
257 
261  void clear();
262 
266  void push_back(const T& value);
267 
274  bool contains(const T& value, size_type startIndex = 0) const;
275 
279  size_type length() const;
280 
284  bool isEmpty() const;
285 
290 
295 
299  int growLength() const;
300 
304  const T* asArrayPtr() const;
305 
309  const T* getPtr() const;
310 
315 
319  const T& operator[](size_type index) const;
324 
334  const T& at(size_type index) const;
335 
342 
347  const T& getAt(size_type index) const;
348 
352  T& first();
356  const T& first() const;
357 
361  T& last();
365  const T& last() const;
366 
375  size_type append(const T& value);
376 
382 
391  OdVector& append(const OdVector& vec);
392 
397 
402 
403  bool operator==(const OdVector& vec) const;
404 
409  OdVector& setAll(const T& value);
410 
421  bool find(const T& value, size_type& index, size_type startIndex = 0) const;
422 
430 
438 
444 
449 
455  OdVector& swap(size_type firstIndex, size_type secondIndex);
456 
457 private:
458  T* m_pData;
459  size_type m_physicalLength;
460  size_type m_logicalLength;
461  int m_growLength;
462 };
463 
464 
465 #define VEC_SIZE_TYPE typename OdVector<T, A, Mm>::size_type
466 #define VEC_ITERATOR typename OdVector<T, A, Mm>::iterator
467 #define VEC_CONST_ITERATOR typename OdVector<T, A, Mm>::const_iterator
468 
469 
470 template<class T, class A, class Mm>
471 inline OdVector<T, A, Mm>::OdVector(VEC_SIZE_TYPE physicalLength, int growLength)
472 : m_pData(NULL), m_physicalLength(physicalLength), m_logicalLength(0)
473 , m_growLength(growLength)
474 {
475  if(m_growLength == 0)
476  {
477  ODA_FAIL();
478  m_growLength = -200;
479  }
480  if (m_physicalLength)
481  {
482  m_pData = allocate(m_physicalLength);
483  }
484 }
485 
486 template <class T, class A, class Mm>
488 : m_pData(NULL), m_physicalLength(0), m_logicalLength(0), m_growLength(-200)
489 {
490 }
491 
492 template <class T, class A, class Mm>
494 : m_pData(NULL), m_physicalLength(vec.m_physicalLength)
495 , m_logicalLength(vec.m_logicalLength), m_growLength(vec.m_growLength)
496 {
497  if(m_physicalLength > 0)
498  {
499  m_pData = allocate(m_physicalLength);
500 
501  A::copy(m_pData, vec.m_pData, m_logicalLength);
502  }
503 }
504 
505 template <class T, class A, class Mm>
507 {
508  release();
509 }
510 
511 template <class T, class A, class Mm>
513 {
514  if(this != &vec)
515  {
516  if(m_physicalLength < vec.m_logicalLength)
517  {
518  release();
519 
520  m_pData = allocate(vec.m_logicalLength);
521  m_physicalLength = vec.m_logicalLength;
522  }
523 
524  m_logicalLength = vec.m_logicalLength;
525 
526  A::copy(m_pData, vec.m_pData, m_logicalLength);
527  }
528  return *this;
529 }
530 
531 template <class T, class A, class Mm>
532 inline T* OdVector<T, A, Mm>::allocate(VEC_SIZE_TYPE physicalLength)
533 {
534  ODA_ASSERT(physicalLength != 0);
535  const VEC_SIZE_TYPE numByte = physicalLength*sizeof(T);
536 
537  ODA_ASSERT(numByte >= physicalLength); // size_type overflow
538 
539  T* pData = ((numByte >= physicalLength)
540  ? reinterpret_cast<T*>(Mm::Alloc(numByte))
541  : NULL);
542 
543  if(pData == NULL)
544  throw OdError(eOutOfMemory);
545 
546  return pData;
547 }
548 
549 template <class T, class A, class Mm>
550 inline void OdVector<T, A, Mm>::release()
551 {
552  if(m_pData != NULL)
553  {
554  A::destroy(m_pData, m_logicalLength);
555 
556  Mm::Free(m_pData);
557  m_pData = NULL;
558  m_physicalLength = 0;
559  }
560 }
561 
562 template <class T, class A, class Mm>
563 inline void OdVector<T, A, Mm>::reallocate(VEC_SIZE_TYPE physicalLength, bool isUseRealloc, bool isForcePhysicalLength)
564 {
565  T* pOldData = m_pData;
566  VEC_SIZE_TYPE newPhysicalLength = physicalLength;
567 
568  if(!isForcePhysicalLength)
569  {
570  if(m_growLength > 0)
571  {
572  newPhysicalLength = ((newPhysicalLength + m_growLength - 1)/m_growLength) * m_growLength;
573  }
574  else
575  {
576  newPhysicalLength = m_logicalLength + (-m_growLength)*m_logicalLength/100;
577 
578  if(newPhysicalLength < physicalLength)
579  newPhysicalLength = physicalLength;
580  }
581  }
582 
583  if(isUseRealloc && A::useRealloc() && m_logicalLength > 0 && m_pData != NULL)
584  {
585  m_pData = reinterpret_cast<T*>(Mm::Realloc(pOldData, newPhysicalLength*sizeof(T), m_physicalLength*sizeof(T)));
586 
587  if (!m_pData)
588  throw OdError(eOutOfMemory);
589 
590  m_physicalLength = newPhysicalLength;
591 
592  if(physicalLength < m_logicalLength)
593  m_logicalLength = physicalLength;
594  }
595  else
596  {
597  T* pNewData = allocate(newPhysicalLength);
598  const VEC_SIZE_TYPE newLogicalLength = odmin(m_logicalLength, physicalLength);
599 
600  A::constructn(pNewData, pOldData, newLogicalLength);
601 
602  release();
603 
604  m_pData = pNewData;
605  m_physicalLength = newPhysicalLength;
606  m_logicalLength = newLogicalLength;
607  }
608 }
609 
610 template <class T, class A, class Mm>
612 {
613  // index is unsigned here, no need >= 0 check
614  return (index < m_logicalLength);
615 }
616 
617 template <class T, class A, class Mm>
619 {
620  if(!isValid(index))
621  {
622  ODA_FAIL();
623  throw OdError_InvalidIndex();
624  }
625 }
626 
627 template <class T, class A, class Mm>
629 {
630  ODA_FAIL();
631  throw OdError(res);
632 }
633 
634 template <class T, class A, class Mm>
636 {
637  return begin();
638 }
639 
640 template <class T, class A, class Mm>
642 {
643  return begin();
644 }
645 
646 template <class T, class A, class Mm>
648 {
649  return end();
650 }
651 
652 template <class T, class A, class Mm>
654 {
655  return end();
656 }
657 
658 template <class T, class A, class Mm>
660 {
661  return (!isEmpty() ? m_pData : NULL);
662 }
663 
664 template <class T, class A, class Mm>
666 {
667  return (!isEmpty() ? m_pData : NULL);
668 }
669 
670 template <class T, class A, class Mm>
672 {
673  return (!isEmpty() ? m_pData + m_logicalLength : NULL);
674 }
675 
676 template <class T, class A, class Mm>
678 {
679  return (!isEmpty() ? m_pData + m_logicalLength : NULL);
680 }
681 
682 template <class T, class A, class Mm>
684 {
685  const VEC_SIZE_TYPE oldLogicalLength = m_logicalLength;
686  const VEC_SIZE_TYPE index = (VEC_SIZE_TYPE)(before - begin_const());
687 
689  {
690  if(afterLast > first)
691  {
692  const VEC_SIZE_TYPE numElem = (VEC_SIZE_TYPE)(afterLast - first);
693  const VEC_SIZE_TYPE newLogicalLength = oldLogicalLength + numElem;
694 
695  if(newLogicalLength > m_physicalLength)
696  reallocate(newLogicalLength, first < begin() || first >= end());
697 
698  A::constructn(m_pData + oldLogicalLength, first, numElem);
699 
700  m_logicalLength = newLogicalLength;
701 
702  T* pData = m_pData + index;
703 
704  if(index != oldLogicalLength)
705  A::move(pData + numElem, pData, oldLogicalLength - index);
706 
707  A::copy(pData, first, numElem);
708  }
709  }
710  else
711  riseError(eInvalidInput);
712 }
713 
714 template <class T, class A, class Mm>
716 {
717  const VEC_SIZE_TYPE oldLogicalLength = m_logicalLength;
718  const VEC_SIZE_TYPE newLogicalLength = oldLogicalLength + numElem;
719  const VEC_SIZE_TYPE index = (VEC_SIZE_TYPE)(before - begin_const());
720 
721  if(newLogicalLength > m_physicalLength)
722  reallocate(newLogicalLength, &value < begin() || &value >= end());
723 
724  A::constructn(m_pData + oldLogicalLength, numElem, value);
725 
726  m_logicalLength = newLogicalLength;
727 
728  T* pData = m_pData + index;
729 
730  if(index != oldLogicalLength)
731  A::move(pData + numElem, pData, oldLogicalLength - index);
732 
733  while(numElem--)
734  pData[numElem] = value;
735 
736  return (begin_non_const() + index);
737 }
738 
739 template <class T, class A, class Mm>
741 {
742  const VEC_SIZE_TYPE index = (VEC_SIZE_TYPE)(before - begin_const());
743 
744  insertAt(index, value);
745 
746  return (begin_non_const() + index);
747 }
748 
749 template <class T, class A, class Mm>
751 {
752  const VEC_SIZE_TYPE oldLogicalLength = m_logicalLength;
753  const VEC_SIZE_TYPE newLogicalLength = oldLogicalLength + 1;
754 
755  if(index == oldLogicalLength)
756  resize(newLogicalLength, value);
757  else if(index < oldLogicalLength)
758  {
759  if(newLogicalLength > m_physicalLength)
760  reallocate(newLogicalLength, &value < begin() || &value >= end());
761 
762  A::construct(m_pData + oldLogicalLength);
763 
764  ++m_logicalLength;
765 
766  T* pData = m_pData + index;
767 
768  A::move(pData + 1, pData, oldLogicalLength - index);
769 
770  m_pData[index] = value;
771  }
772  else
773  riseError(eInvalidIndex);
774 
775  return *this;
776 }
777 
778 template <class T, class A, class Mm>
780 {
781  assertValid(index);
782 
783  const VEC_SIZE_TYPE newLogicalLength = m_logicalLength - 1;
784 
785  if(index < newLogicalLength)
786  {
787  T* pData = m_pData + index;
788  A::move(pData, pData + 1, newLogicalLength - index);
789  }
790 
791  resize(newLogicalLength);
792  return *this;
793 }
794 
795 template <class T, class A, class Mm>
797 {
798  if(!isValid(startIndex) || startIndex > endIndex)
799  riseError(eInvalidIndex);
800 
801  const VEC_SIZE_TYPE oldLogicalLength = m_logicalLength;
802 
803  T* pData = m_pData;
804 
805  ++endIndex;
806 
807  const VEC_SIZE_TYPE numElem = endIndex - startIndex;
808 
809  A::move(pData + startIndex, pData + endIndex, oldLogicalLength - endIndex);
810  A::destroy(pData + oldLogicalLength - numElem, numElem);
811 
812  m_logicalLength -= numElem;
813  return *this;
814 }
815 
816 template <class T, class A, class Mm>
817 inline bool OdVector<T, A, Mm>::remove(const T& value, VEC_SIZE_TYPE startIndex)
818 {
819  VEC_SIZE_TYPE index = 0;
820  if(find(value, index, startIndex))
821  {
822  removeAt(index);
823  return true;
824  }
825  return false;
826 }
827 
828 template <class T, class A, class Mm>
829 inline void OdVector<T, A, Mm>::resize(VEC_SIZE_TYPE logicalLength, const T& value)
830 {
831  const VEC_SIZE_TYPE oldLogicalLength = m_logicalLength;
832  const int lengthDiff = logicalLength - oldLogicalLength;
833 
834  if(lengthDiff > 0)
835  {
836  if(logicalLength > m_physicalLength)
837  reallocate(logicalLength, &value < begin() || &value >= end());
838 
839  A::constructn(m_pData + oldLogicalLength, lengthDiff, value);
840  }
841  else if(lengthDiff < 0)
842  A::destroy(m_pData + logicalLength, -lengthDiff);
843 
844  m_logicalLength = logicalLength;
845 }
846 
847 template <class T, class A, class Mm>
848 inline void OdVector<T, A, Mm>::resize(VEC_SIZE_TYPE logicalLength)
849 {
850  const VEC_SIZE_TYPE oldLogicalLength = m_logicalLength;
851  const int lengthDiff = logicalLength - oldLogicalLength;
852 
853  if(lengthDiff > 0)
854  {
855  if(logicalLength > m_physicalLength)
856  reallocate(logicalLength, true);
857  A::constructn(m_pData + oldLogicalLength, lengthDiff);
858  }
859  else if(lengthDiff < 0)
860  A::destroy(m_pData + logicalLength, -lengthDiff);
861 
862  m_logicalLength = logicalLength;
863 }
864 
865 template <class T, class A, class Mm>
867 {
868  return m_logicalLength;
869 }
870 
871 template <class T, class A, class Mm>
872 inline bool OdVector<T, A, Mm>::empty() const
873 {
874  return (m_logicalLength == 0);
875 }
876 
877 template <class T, class A, class Mm>
879 {
880  return m_physicalLength;
881 }
882 
883 template <class T, class A, class Mm>
884 inline void OdVector<T, A, Mm>::reserve(VEC_SIZE_TYPE reserveLength)
885 {
886  if(m_physicalLength < reserveLength)
887  setPhysicalLength(reserveLength);
888 }
889 
890 template <class T, class A, class Mm>
892 {
893  erase(begin_non_const(), end_non_const());
894 
895  insert(begin_non_const(), first, afterLast);
896 }
897 
898 template <class T, class A, class Mm>
900 {
901  const VEC_SIZE_TYPE index = (VEC_SIZE_TYPE)(first - begin_const());
902 
903  if(first != afterLast)
904  removeSubArray(index, (VEC_SIZE_TYPE)(afterLast - begin_const() - 1));
905 
906  return (begin_non_const() + index);
907 }
908 
909 template <class T, class A, class Mm>
911 {
912  const VEC_SIZE_TYPE index = (VEC_SIZE_TYPE)(it - begin_const());
913 
914  removeAt(index);
915 
916  return (begin_non_const() + index);
917 }
918 
919 template <class T, class A, class Mm>
921 {
922  erase(begin_non_const(), end_non_const());
923 }
924 
925 template <class T, class A, class Mm>
927 {
928  insertAt(m_logicalLength, value);
929 }
930 
931 template <class T, class A, class Mm>
932 inline bool OdVector<T, A, Mm>::contains(const T& value, VEC_SIZE_TYPE startIndex) const
933 {
935 
936  return find(value, index, startIndex);
937 }
938 
939 template <class T, class A, class Mm>
941 {
942  return m_logicalLength;
943 }
944 
945 template <class T, class A, class Mm>
946 inline bool OdVector<T, A, Mm>::isEmpty() const
947 {
948  return (m_logicalLength == 0);
949 }
950 
951 template <class T, class A, class Mm>
953 {
954  return m_logicalLength;
955 }
956 
957 template <class T, class A, class Mm>
959 {
960  return m_physicalLength;
961 }
962 
963 template <class T, class A, class Mm>
965 {
966  return m_growLength;
967 }
968 
969 template <class T, class A, class Mm>
970 inline const T* OdVector<T, A, Mm>::asArrayPtr() const
971 {
972  return m_pData;
973 }
974 
975 template <class T, class A, class Mm>
976 inline const T* OdVector<T, A, Mm>::getPtr() const
977 {
978  return m_pData;
979 }
980 
981 template <class T, class A, class Mm>
983 { // OdArray::asArrayPtr invokes non-const version of data() method which checks length and return null.
984  // Constant version of asArrayPtr and getPtr will return m_pData as is for OdArray too.
985  return (length()) ? m_pData : NULL;
986 }
987 
988 template <class T, class A, class Mm>
990 {
991  assertValid(index);
992  return m_pData[index];
993 }
994 
995 template <class T, class A, class Mm>
997 {
998  assertValid(index);
999  return m_pData[index];
1000 }
1001 
1002 template <class T, class A, class Mm>
1004 {
1005  assertValid(index);
1006  return m_pData[index];
1007 }
1008 
1009 template <class T, class A, class Mm>
1010 inline const T& OdVector<T, A, Mm>::at(VEC_SIZE_TYPE index) const
1011 {
1012  assertValid(index);
1013  return m_pData[index];
1014 }
1015 
1016 template <class T, class A, class Mm>
1018 {
1019  assertValid(index);
1020 
1021  m_pData[index] = value;
1022 
1023  return *this;
1024 }
1025 
1026 template <class T, class A, class Mm>
1028 {
1029  assertValid(index);
1030  return m_pData[index];
1031 }
1032 
1033 template <class T, class A, class Mm>
1035 {
1036  return m_pData[0];
1037 }
1038 
1039 template <class T, class A, class Mm>
1040 inline const T& OdVector<T, A, Mm>::first() const
1041 {
1042  return m_pData[0];
1043 }
1044 
1045 template <class T, class A, class Mm>
1047 {
1048  return m_pData[m_logicalLength - 1];
1049 }
1050 
1051 template <class T, class A, class Mm>
1052 inline const T& OdVector<T, A, Mm>::last() const
1053 {
1054  return m_pData[m_logicalLength - 1];
1055 }
1056 
1057 template <class T, class A, class Mm>
1059 {
1060  insertAt(m_logicalLength, value);
1061  return (m_logicalLength - 1);
1062 }
1063 
1064 template <class T, class A, class Mm>
1066 {
1067  const VEC_SIZE_TYPE index = append(T());
1068  return (begin_non_const() + index);
1069 }
1070 
1071 template <class T, class A, class Mm>
1073 {
1074  insert(end_non_const(), vec.begin(), vec.end());
1075  return *this;
1076 }
1077 
1078 template <class T, class A, class Mm>
1080 {
1081  return removeAt(0);
1082 }
1083 
1084 template <class T, class A, class Mm>
1086 {
1087  return removeAt(m_logicalLength - 1);
1088 }
1089 
1090 template <class T, class A, class Mm>
1092 {
1093  if(m_logicalLength == vec.m_logicalLength)
1094  {
1095  for(VEC_SIZE_TYPE i = 0; i < m_logicalLength; ++i)
1096  {
1097  if(m_pData[i] != vec.m_pData[i])
1098  return false;
1099  }
1100  return true;
1101  }
1102  return false;
1103 }
1104 
1105 template <class T, class A, class Mm>
1107 {
1108  for(VEC_SIZE_TYPE i = 0; i < m_logicalLength; ++i)
1109  m_pData[i] = value;
1110 
1111  return *this;
1112 }
1113 
1114 template <class T, class A, class Mm>
1115 inline bool OdVector<T, A, Mm>::find(const T& value, VEC_SIZE_TYPE& index, VEC_SIZE_TYPE startIndex) const
1116 {
1117  if(!isEmpty())
1118  {
1119  assertValid(startIndex);
1120 
1121  for(VEC_SIZE_TYPE i = startIndex; i < m_logicalLength; ++i)
1122  {
1123  if(m_pData[i] == value)
1124  {
1125  index = i;
1126  return true;
1127  }
1128  }
1129  }
1130  return false;
1131 }
1132 
1133 template <class T, class A, class Mm>
1135 {
1136  resize(logicalLength);
1137  return *this;
1138 }
1139 
1140 template <class T, class A, class Mm>
1142 {
1143  if(physicalLength == 0)
1144  {
1145  release();
1146 
1147  m_pData = NULL;
1148  m_physicalLength = 0;
1149  }
1150  else if(physicalLength != m_physicalLength)
1151  reallocate(physicalLength, true, true);
1152 
1153  if(m_physicalLength < m_logicalLength)
1154  m_logicalLength = m_physicalLength;
1155 
1156  return *this;
1157 }
1158 
1159 template <class T, class A, class Mm>
1161 {
1162  if(growLength != 0)
1163  m_growLength = growLength;
1164  else
1165  ODA_FAIL();
1166 
1167  return *this;
1168 }
1169 
1170 template <class T, class A, class Mm>
1172 {
1173  if(!isEmpty())
1174  {
1175  T value;
1176  VEC_ITERATOR it1 = begin_non_const();
1177  VEC_ITERATOR it2 = end_non_const();
1178 
1179  --it2;
1180 
1181  while(it1 < it2)
1182  {
1183  value = *it1;
1184  *it1 = *it2;
1185  *it2 = value;
1186 
1187  ++it1;
1188  --it2;
1189  }
1190  }
1191  return *this;
1192 }
1193 
1194 template <class T, class A, class Mm>
1196 {
1197  if(!isValid(firstIndex) || !isValid(secondIndex))
1198  riseError(eInvalidIndex);
1199 
1200  if(firstIndex != secondIndex)
1201  {
1202  const T value = m_pData[firstIndex];
1203  m_pData[firstIndex] = m_pData[secondIndex];
1204  m_pData[secondIndex] = value;
1205  }
1206 
1207  return *this;
1208 }
1209 
1210 
1211 #include "TD_PackPop.h"
1212 
1218 #ifdef OD_GEPNT3D_H
1219 typedef OdVector<OdGePoint3d, OdMemoryAllocator<OdGePoint3d> > OdGePoint3dVector;
1220 #endif
1221 #ifdef OD_GEVEC3D_H
1222 typedef OdVector<OdGeVector3d, OdMemoryAllocator<OdGeVector3d> > OdGeVector3dVector;
1223 #endif
1224 
1225 #endif // OdVector_H_INCLUDED
#define ODA_ASSERT(exp)
Definition: DebugStuff.h:49
#define ODA_FAIL()
Definition: DebugStuff.h:65
#define NULL
Definition: GsProperties.h:177
#define odmin(X, Y)
Definition: OdPlatform.h:34
OdResult
Definition: OdResult.h:29
#define VEC_CONST_ITERATOR
Definition: OdVector.h:467
#define VEC_SIZE_TYPE
Definition: OdVector.h:465
OdVector< OdUInt8, OdMemoryAllocator< OdUInt8 > > OdUInt8Vector
Definition: OdVector.h:1216
OdVector< OdUInt64, OdMemoryAllocator< OdUInt64 > > OdUInt64Vector
Definition: OdVector.h:1217
OdVector< int, OdMemoryAllocator< int > > OdIntVector
Definition: OdVector.h:1213
#define VEC_ITERATOR
Definition: OdVector.h:466
OdVector< OdInt32, OdMemoryAllocator< OdInt32 > > OdInt32Vector
Definition: OdVector.h:1215
OdVector< OdUInt32, OdMemoryAllocator< OdUInt32 > > OdUInt32Vector
Definition: OdVector.h:1214
OdVector & reverse()
Definition: OdVector.h:1171
iterator insert(iterator before, size_type numElem, const T &value)
const_iterator begin() const
Definition: OdVector.h:665
const T * const_iterator
Definition: OdVector.h:58
iterator append()
Definition: OdVector.h:1065
OdVector & setAll(const T &value)
Definition: OdVector.h:1106
const_iterator end() const
Definition: OdVector.h:677
void reserve(size_type reserveLength)
Definition: OdVector.h:884
OdVector & setGrowLength(int growLength)
Definition: OdVector.h:1160
OdVector & removeSubArray(size_type startIndex, size_type endIndex)
Definition: OdVector.h:796
bool empty() const
Definition: OdVector.h:872
OdVector & removeLast()
Definition: OdVector.h:1085
bool find(const T &value, size_type &index, size_type startIndex=0) const
Definition: OdVector.h:1115
OdVector()
Definition: OdVector.h:487
const T & at(size_type index) const
bool remove(const T &value, size_type startIndex=0)
Definition: OdVector.h:817
iterator erase(iterator first, iterator afterLast)
iterator begin()
Definition: OdVector.h:659
iterator erase(iterator where)
size_type length() const
Definition: OdVector.h:940
void clear()
Definition: OdVector.h:920
size_type physicalLength() const
Definition: OdVector.h:958
const T & first() const
Definition: OdVector.h:1040
void resize(size_type logicalLength, const T &value)
OdVector & append(const OdVector &vec)
Definition: OdVector.h:1072
bool contains(const T &value, size_type startIndex=0) const
Definition: OdVector.h:932
A::size_type size_type
Definition: OdVector.h:56
const T & const_reference
Definition: OdVector.h:61
~OdVector()
Definition: OdVector.h:506
void push_back(const T &value)
Definition: OdVector.h:926
OdVector & insertAt(size_type index, const T &value)
Definition: OdVector.h:750
const T & getAt(size_type index) const
Definition: OdVector.h:1027
size_type size() const
Definition: OdVector.h:866
void assign(const_iterator first, const_iterator afterLast)
Definition: OdVector.h:891
T & first()
Definition: OdVector.h:1034
T & at(size_type index)
const T * asArrayPtr() const
Definition: OdVector.h:970
const T * getPtr() const
Definition: OdVector.h:976
size_type append(const T &value)
Definition: OdVector.h:1058
size_type logicalLength() const
Definition: OdVector.h:952
T * asArrayPtr()
Definition: OdVector.h:982
size_type capacity() const
Definition: OdVector.h:878
OdVector & setLogicalLength(size_type logicalLength)
Definition: OdVector.h:1134
T & operator[](size_type index)
bool isEmpty() const
Definition: OdVector.h:946
OdVector & removeAt(size_type index)
Definition: OdVector.h:779
OdVector & setPhysicalLength(size_type physicalLength)
Definition: OdVector.h:1141
void resize(size_type logicalLength)
OdVector & swap(size_type firstIndex, size_type secondIndex)
Definition: OdVector.h:1195
bool operator==(const OdVector &vec) const
Definition: OdVector.h:1091
OdVector & operator=(const OdVector &vec)
Definition: OdVector.h:512
OdVector(size_type physicalLength, int growLength=8)
int growLength() const
Definition: OdVector.h:964
iterator insert(iterator before, const T &value=T())
void insert(iterator before, const_iterator first, const_iterator afterLast)
OdVector(const OdVector &vec)
Definition: OdVector.h:493
OdVector & removeFirst()
Definition: OdVector.h:1079
const T & operator[](size_type index) const
T & last()
Definition: OdVector.h:1046
T value_type
Definition: OdVector.h:60
iterator end()
Definition: OdVector.h:671
T & reference
Definition: OdVector.h:62
T * iterator
Definition: OdVector.h:57
OdVector & setAt(size_type index, const T &value)
Definition: OdVector.h:1017
const T & last() const
Definition: OdVector.h:1052
GLuint index
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei * length
Definition: gles2_ext.h:274
GLsizei const GLfloat * value
Definition: gles2_ext.h:302