53 #include <initializer_list> 58 #include <type_traits> 67 #ifndef LLVM_NODISCARD 68 #define LLVM_NODISCARD 70 #ifndef LLVM_GSL_OWNER 71 #define LLVM_GSL_OWNER 78 void *Result = std::malloc(Sz);
79 if (Result ==
nullptr) {
84 throw std::bad_alloc();
90 void *Result = std::realloc(Ptr, Sz);
91 if (Result ==
nullptr) {
96 throw std::bad_alloc();
101 template <
typename IteratorT>
112 template <
class Size_T>
120 return std::numeric_limits<Size_T>::max();
125 : BeginX(FirstEl),
Capacity(TotalCapacity) {}
130 void *
mallocForGrow(
size_t MinSize,
size_t TSize,
size_t &NewCapacity);
135 void grow_pod(
void *FirstEl,
size_t MinSize,
size_t TSize);
156 typename std::conditional<sizeof(T) < 4 && sizeof(void *) >= 8,
161 template <
class T,
typename =
void>
165 alignas(T)
char FirstEl[
sizeof(T)];
171 template <
typename T,
typename =
void>
179 void *getFirstEl()
const {
180 return const_cast<void *
>(
reinterpret_cast<const void *
>(
181 reinterpret_cast<const char *
>(
this) +
191 Base::grow_pod(getFirstEl(), MinSize, TSize);
200 this->
BeginX = getFirstEl();
208 const void *Last)
const {
210 std::less<> LessThan;
211 return !LessThan(V, First) && LessThan(V, Last);
216 return isReferenceToRange(V, this->begin(), this->end());
223 std::less<> LessThan;
224 return !LessThan(First, this->begin()) && !LessThan(Last, First) &&
225 !LessThan(this->end(), Last);
232 if (
LLVM_LIKELY(!isReferenceToStorage(Elt)))
return true;
235 if (NewSize <= this->
size())
return Elt < this->begin() + NewSize;
243 assert(isSafeToReferenceAfterResize(Elt, NewSize) &&
244 "Attempting to reference an element of the vector in an " 246 "that invalidates it");
252 this->assertSafeToReferenceAfterResize(Elt, this->
size() + N);
257 if (From == To)
return;
258 this->assertSafeToReferenceAfterResize(From, 0);
259 this->assertSafeToReferenceAfterResize(To - 1, 0);
261 template <
class ItTy,
263 !std::is_same<std::remove_const_t<ItTy>, T *>::value,
269 if (From == To)
return;
270 this->assertSafeToAdd(From, To - From);
271 this->assertSafeToAdd(To - 1, To - From);
273 template <
class ItTy,
275 !std::is_same<std::remove_const_t<ItTy>, T *>::value,
285 size_t NewSize = This->size() + N;
288 bool ReferencesStorage =
false;
290 if (!U::TakesParamByValue) {
292 ReferencesStorage =
true;
293 Index = &Elt - This->begin();
297 return ReferencesStorage ? This->begin() + Index : &Elt;
315 using Base::capacity;
348 assert(idx <
size());
352 assert(idx <
size());
383 template <
typename T,
384 bool = (std::is_trivially_copy_constructible<T>::value) &&
385 (std::is_trivially_move_constructible<T>::value) &&
386 std::is_trivially_destructible<T>::value>
391 static constexpr
bool TakesParamByValue =
false;
405 template <
typename It1,
typename It2>
407 std::uninitialized_copy(std::make_move_iterator(I),
408 std::make_move_iterator(E), Dest);
413 template <
typename It1,
typename It2>
415 std::uninitialized_copy(I, E, Dest);
421 void grow(
size_t MinSize = 0);
426 return static_cast<T *
>(
428 MinSize,
sizeof(T), NewCapacity));
433 void moveElementsForGrow(T *NewElts);
436 void takeAllocationForGrow(T *NewElts,
size_t NewCapacity);
441 return this->reserveForParamAndGetAddressImpl(
this, Elt, N);
447 return const_cast<T *
>(
448 this->reserveForParamAndGetAddressImpl(
this, Elt, N));
458 std::uninitialized_fill_n(NewElts, NumElts, Elt);
459 this->destroy_range(this->begin(), this->end());
460 takeAllocationForGrow(NewElts, NewCapacity);
464 template <
typename... ArgTypes>
469 ::new ((
void *)(NewElts + this->
size()))
470 T(std::forward<ArgTypes>(Args)...);
471 moveElementsForGrow(NewElts);
472 takeAllocationForGrow(NewElts, NewCapacity);
479 const T *EltPtr = reserveForParamAndGetAddress(Elt);
480 ::new ((
void *)this->end()) T(*EltPtr);
485 T *EltPtr = reserveForParamAndGetAddress(Elt);
486 ::new ((
void *)this->end()) T(::std::move(*EltPtr));
497 template <
typename T,
bool TriviallyCopyable>
501 moveElementsForGrow(NewElts);
502 takeAllocationForGrow(NewElts, NewCapacity);
506 template <
typename T,
bool TriviallyCopyable>
510 this->uninitialized_move(this->begin(), this->end(), NewElts);
513 destroy_range(this->begin(), this->end());
517 template <
typename T,
bool TriviallyCopyable>
519 T *NewElts,
size_t NewCapacity) {
521 if (!this->isSmall()) free(this->begin());
531 template <
typename T>
538 static constexpr
bool TakesParamByValue =
sizeof(T) <= 2 *
sizeof(
void *);
552 template <
typename It1,
typename It2>
555 uninitialized_copy(I, E, Dest);
560 template <
typename It1,
typename It2>
563 std::uninitialized_copy(I, E, Dest);
568 template <
typename T1,
typename T2>
574 T2>::value> * =
nullptr) {
580 memcpy(reinterpret_cast<void *>(Dest), I, (E - I) *
sizeof(T));
590 return this->reserveForParamAndGetAddressImpl(
this, Elt, N);
596 return const_cast<T *
>(
597 this->reserveForParamAndGetAddressImpl(
this, Elt, N));
609 std::uninitialized_fill_n(this->begin(), NumElts, Elt);
613 template <
typename... ArgTypes>
618 push_back(T(std::forward<ArgTypes>(Args)...));
624 const T *EltPtr = reserveForParamAndGetAddress(Elt);
625 memcpy(reinterpret_cast<void *>(this->end()), EltPtr,
sizeof(T));
634 template <
typename T>
652 this->destroy_range(this->begin(), this->end());
653 if (!this->isSmall()) free(this->begin());
654 this->
BeginX = RHS.BeginX;
655 this->
Size = RHS.Size;
666 if (!this->isSmall()) free(this->begin());
670 this->destroy_range(this->begin(), this->end());
676 using SuperClass::set_size;
678 template <
bool ForOverwrite>
680 if (N == this->
size())
return;
682 if (N < this->
size()) {
688 for (
auto I = this->end(), E = this->begin() + N; I != E; ++I)
704 assert(this->
size() >= N &&
"Cannot increase size with truncate");
705 this->destroy_range(this->begin() + N, this->end());
710 if (N == this->
size())
return;
712 if (N < this->
size()) {
718 this->append(N - this->
size(), NV);
722 if (this->
capacity() < N) this->grow(N);
726 assert(this->
size() >= NumItems);
727 truncate(this->
size() - NumItems);
731 T Result = ::std::move(this->back());
739 template <
typename in_iter,
740 typename = std::enable_if_t<std::is_convertible<
741 typename std::iterator_traits<in_iter>::iterator_category,
742 std::input_iterator_tag>::value>>
743 void append(in_iter in_start, in_iter in_end) {
744 this->assertSafeToAddRange(in_start, in_end);
745 size_type NumInputs = std::distance(in_start, in_end);
746 this->reserve(this->
size() + NumInputs);
747 this->uninitialized_copy(in_start, in_end, this->end());
753 const T *EltPtr = this->reserveForParamAndGetAddress(Elt, NumInputs);
754 std::uninitialized_fill_n(this->end(), NumInputs, *EltPtr);
758 void append(std::initializer_list<T> IL) {
append(IL.begin(), IL.end()); }
765 this->growAndAssign(NumElts, Elt);
770 std::fill_n(this->begin(), std::min(NumElts, this->
size()), Elt);
771 if (NumElts > this->
size())
772 std::uninitialized_fill_n(this->end(), NumElts - this->
size(), Elt);
773 else if (NumElts < this->
size())
774 this->destroy_range(this->begin() + NumElts, this->end());
781 template <
typename in_iter,
782 typename = std::enable_if_t<std::is_convertible<
783 typename std::iterator_traits<in_iter>::iterator_category,
784 std::input_iterator_tag>::value>>
785 void assign(in_iter in_start, in_iter in_end) {
786 this->assertSafeToReferenceAfterClear(in_start, in_end);
788 append(in_start, in_end);
791 void assign(std::initializer_list<T> IL) {
802 assert(this->isReferenceToStorage(CI) &&
803 "Iterator to erase is out of bounds.");
807 std::move(I + 1, this->end(), I);
818 assert(this->isRangeInStorage(S, E) &&
819 "Range to erase is out of bounds.");
823 iterator I = std::move(E, this->end(), S);
825 this->destroy_range(I, this->end());
831 template <
class ArgType>
836 std::remove_const_t<std::remove_reference_t<ArgType>>,
838 "ArgType must be derived from T!");
840 if (I == this->end()) {
841 this->push_back(::std::forward<ArgType>(Elt));
842 return this->end() - 1;
845 assert(this->isReferenceToStorage(I) &&
846 "Insertion iterator is out of bounds.");
849 size_t Index = I - this->begin();
850 std::remove_reference_t<ArgType> *EltPtr =
851 this->reserveForParamAndGetAddress(Elt);
852 I = this->begin() + Index;
854 ::new ((
void *)this->end()) T(::std::move(this->back()));
856 std::move_backward(I, this->end() - 1, this->end());
861 static_assert(!TakesParamByValue || std::is_same<ArgType, T>::value,
862 "ArgType must be 'T' when taking by value!");
863 if (!TakesParamByValue &&
864 this->isReferenceToRange(EltPtr, I, this->end()))
867 *I = ::std::forward<ArgType>(*EltPtr);
873 return insert_one_impl(I, this->forward_value_param(std::move(Elt)));
877 return insert_one_impl(I, this->forward_value_param(Elt));
883 size_t InsertElt = I - this->begin();
885 if (I == this->end()) {
886 append(NumToInsert, Elt);
887 return this->begin() + InsertElt;
890 assert(this->isReferenceToStorage(I) &&
891 "Insertion iterator is out of bounds.");
895 const T *EltPtr = this->reserveForParamAndGetAddress(Elt, NumToInsert);
898 I = this->begin() + InsertElt;
904 if (
size_t(this->end() - I) >= NumToInsert) {
905 T *OldEnd = this->end();
906 append(std::move_iterator<iterator>(this->end() - NumToInsert),
907 std::move_iterator<iterator>(this->end()));
910 std::move_backward(I, OldEnd - NumToInsert, OldEnd);
914 if (!TakesParamByValue && I <= EltPtr && EltPtr < this->end())
915 EltPtr += NumToInsert;
917 std::fill_n(I, NumToInsert, *EltPtr);
925 T *OldEnd = this->end();
927 size_t NumOverwritten = OldEnd - I;
928 this->uninitialized_move(I, OldEnd, this->end() - NumOverwritten);
932 if (!TakesParamByValue && I <= EltPtr && EltPtr < this->end())
933 EltPtr += NumToInsert;
936 std::fill_n(I, NumOverwritten, *EltPtr);
939 std::uninitialized_fill_n(OldEnd, NumToInsert - NumOverwritten,
944 template <
typename ItTy,
945 typename = std::enable_if_t<std::is_convertible<
946 typename std::iterator_traits<ItTy>::iterator_category,
947 std::input_iterator_tag>::value>>
951 size_t InsertElt = I - this->begin();
953 if (I == this->end()) {
955 return this->begin() + InsertElt;
958 assert(this->isReferenceToStorage(I) &&
959 "Insertion iterator is out of bounds.");
962 this->assertSafeToAddRange(From, To);
964 size_t NumToInsert = std::distance(From, To);
967 reserve(this->
size() + NumToInsert);
970 I = this->begin() + InsertElt;
976 if (
size_t(this->end() - I) >= NumToInsert) {
977 T *OldEnd = this->end();
978 append(std::move_iterator<iterator>(this->end() - NumToInsert),
979 std::move_iterator<iterator>(this->end()));
982 std::move_backward(I, OldEnd - NumToInsert, OldEnd);
992 T *OldEnd = this->end();
994 size_t NumOverwritten = OldEnd - I;
995 this->uninitialized_move(I, OldEnd, this->end() - NumOverwritten);
998 for (T *J = I; NumOverwritten > 0; --NumOverwritten) {
1005 this->uninitialized_copy(From, To, OldEnd);
1010 insert(I, IL.begin(), IL.end());
1013 template <
typename... ArgTypes>
1016 return this->growAndEmplaceBack(std::forward<ArgTypes>(Args)...);
1018 ::new ((
void *)this->end()) T(std::forward<ArgTypes>(Args)...);
1020 return this->back();
1028 if (this->
size() != RHS.
size())
return false;
1029 return std::equal(this->begin(), this->end(), RHS.
begin());
1032 return !(*
this == RHS);
1036 return std::lexicographical_compare(this->begin(), this->end(),
1044 template <
typename T>
1046 if (
this == &RHS)
return;
1049 if (!this->isSmall() && !RHS.
isSmall()) {
1055 this->reserve(RHS.
size());
1059 size_t NumShared = this->
size();
1060 if (NumShared > RHS.
size()) NumShared = RHS.
size();
1065 size_t EltDiff = this->
size() - RHS.
size();
1066 this->uninitialized_copy(this->begin() + NumShared, this->end(),
1069 this->destroy_range(this->begin() + NumShared, this->end());
1071 }
else if (RHS.
size() > this->
size()) {
1072 size_t EltDiff = RHS.
size() - this->
size();
1073 this->uninitialized_copy(RHS.
begin() + NumShared, RHS.
end(),
1076 this->destroy_range(RHS.
begin() + NumShared, RHS.
end());
1081 template <
typename T>
1085 if (
this == &RHS)
return *
this;
1089 size_t RHSSize = RHS.
size();
1090 size_t CurSize = this->
size();
1091 if (CurSize >= RHSSize) {
1098 NewEnd = this->begin();
1101 this->destroy_range(NewEnd, this->end());
1115 this->grow(RHSSize);
1116 }
else if (CurSize) {
1122 this->uninitialized_copy(RHS.
begin() + CurSize, RHS.
end(),
1123 this->begin() + CurSize);
1130 template <
typename T>
1133 if (
this == &RHS)
return *
this;
1136 if (!RHS.isSmall()) {
1137 this->assignRemote(std::move(RHS));
1143 size_t RHSSize = RHS.size();
1144 size_t CurSize = this->
size();
1145 if (CurSize >= RHSSize) {
1148 if (RHSSize) NewEnd = std::move(RHS.begin(), RHS.end(), NewEnd);
1151 this->destroy_range(NewEnd, this->end());
1168 this->grow(RHSSize);
1169 }
else if (CurSize) {
1171 std::move(RHS.begin(), RHS.begin() + CurSize, this->begin());
1175 this->uninitialized_move(RHS.begin() + CurSize, RHS.end(),
1176 this->begin() + CurSize);
1187 template <
typename T,
unsigned N>
1189 alignas(T)
char InlineElts[N *
sizeof(T)];
1195 template <
typename T>
1201 template <
typename T,
unsigned N>
1209 template <
typename T>
1218 static constexpr
size_t kPreferredSmallVectorSizeof = 64;
1245 "You are trying to use a default number of inlined elements for " 1246 "`SmallVector<T>` but `sizeof(T)` is really big! Please use an " 1247 "explicit number of inlined elements with `SmallVector<T, N>` to " 1249 "sure you really want that much inline storage.");
1253 static constexpr
size_t PreferredInlineBytes =
1255 static constexpr
size_t NumElementsThatFit =
1256 PreferredInlineBytes /
sizeof(T);
1257 static constexpr
size_t value =
1258 NumElementsThatFit == 0 ? 1 : NumElementsThatFit;
1277 template <
typename T,
1286 this->destroy_range(this->begin(), this->end());
1291 this->assign(Size, Value);
1294 template <
typename ItTy,
1295 typename = std::enable_if_t<std::is_convertible<
1296 typename std::iterator_traits<ItTy>::iterator_category,
1297 std::input_iterator_tag>::value>>
1302 template <
typename RangeTy>
1305 this->append(R.begin(), R.end());
1336 if (
this == &RHS)
return *
this;
1338 this->destroy_range(this->begin(), this->end());
1341 this->assignRemote(std::move(RHS));
1357 template <
typename T,
unsigned N>
1362 template <
typename RangeType>
1364 typename std::remove_const<
typename std::remove_reference<decltype(
1365 *std::begin(std::declval<RangeType &>()))>::type>
::type;
1370 template <
unsigned Size,
typename R>
1372 return {std::begin(Range), std::end(Range)};
1374 template <
typename R>
1379 return {std::begin(Range), std::end(Range)};
1388 template <
typename T>
1395 template <
typename T,
unsigned N>
static void uninitialized_move(It1 I, It1 E, It2 Dest)
Definition: SmallVector.h:406
Size_T Size
Definition: SmallVector.h:116
void moveElementsForGrow(T *NewElts)
Definition: SmallVector.h:507
Definition: SmallVector.h:172
bool isReferenceToStorage(const void *V) const
Return true if V is an internal reference to this vector.
Definition: SmallVector.h:215
SmallVectorBase(void *FirstEl, size_t TotalCapacity)
Definition: SmallVector.h:124
const_reference back() const
Definition: SmallVector.h:369
SmallVector(SmallVectorImpl< T > &&RHS)
Definition: SmallVector.h:1325
ptrdiff_t difference_type
Definition: SmallVector.h:302
void grow(size_t MinSize=0)
Definition: SmallVector.h:585
const_reverse_iterator rbegin() const
Definition: SmallVector.h:327
T & growAndEmplaceBack(ArgTypes &&... Args)
Definition: SmallVector.h:614
T * reserveForParamAndGetAddress(T &Elt, size_t N=1)
Definition: SmallVector.h:595
void assign(std::initializer_list< T > IL)
Definition: SmallVector.h:791
#define LLVM_LIKELY
Definition: SmallVector.h:62
~SmallVector()
Definition: SmallVector.h:1284
Definition: SmallVector.h:1279
Size_T Capacity
Definition: SmallVector.h:116
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle uint32_t
Definition: K4aPlugin.cpp:567
void growAndAssign(size_t NumElts, T Elt)
Definition: SmallVector.h:603
bool isSafeToReferenceAfterResize(const void *Elt, size_t NewSize)
Definition: SmallVector.h:230
void grow_pod(size_t MinSize, size_t TSize)
Definition: SmallVector.h:190
void grow(size_t MinSize=0)
Definition: SmallVector.h:498
void pop_back()
Definition: SmallVector.h:490
void insert(iterator I, std::initializer_list< T > IL)
Definition: SmallVector.h:1009
void resize(size_type N, ValueParamT NV)
Definition: SmallVector.h:709
const_reference front() const
Definition: SmallVector.h:360
bool isReferenceToRange(const void *V, const void *First, const void *Last) const
Return true if V is an internal reference to the given range.
Definition: SmallVector.h:206
SmallVector & operator=(SmallVector &&RHS)
Definition: SmallVector.h:1329
size_type max_size() const
Definition: SmallVector.h:336
void assertSafeToReferenceAfterClear(const T *From, const T *To)
Check whether any part of the range will be invalidated by clearing.
Definition: SmallVector.h:256
iterator end()
Definition: SmallVector.h:322
void swap(SmallVectorImpl &RHS)
Definition: SmallVector.h:1045
bool operator>=(const SmallVectorImpl &RHS) const
Definition: SmallVector.h:1041
typename std::conditional< TakesParamByValue, T, const T & >::type ValueParamT
Definition: SmallVector.h:543
bool operator>(const SmallVectorImpl &RHS) const
Definition: SmallVector.h:1039
size_t size() const
Definition: SmallVector.h:138
T * mallocForGrow(size_t MinSize, size_t &NewCapacity)
Definition: SmallVector.h:425
SmallVector & operator=(SmallVectorImpl< T > &&RHS)
Definition: SmallVector.h:1346
void * safe_malloc(size_t Sz)
Definition: SmallVector.h:77
iterator erase(const_iterator CS, const_iterator CE)
Definition: SmallVector.h:813
void resize(size_type N)
Definition: SmallVector.h:697
void assign(in_iter in_start, in_iter in_end)
Definition: SmallVector.h:785
bool isRangeInStorage(const void *First, const void *Last) const
Definition: SmallVector.h:221
void swap(open3d::core::SmallVectorImpl< T > &LHS, open3d::core::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.
Definition: SmallVector.h:1389
static void uninitialized_copy(It1 I, It1 E, It2 Dest)
Definition: SmallVector.h:414
#define LLVM_NODISCARD
Definition: SmallVector.h:68
Definition: SmallVector.h:1188
SmallVector(ItTy S, ItTy E)
Definition: SmallVector.h:1298
static void destroy_range(T *, T *)
Definition: SmallVector.h:548
reference operator[](size_type idx)
Definition: SmallVector.h:347
typename std::remove_const< typename std::remove_reference< decltype(*std::begin(std::declval< RangeType & >()))>::type >::type ValueTypeFromRangeType
Definition: SmallVector.h:1365
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: SmallVector.h:307
size_type size_in_bytes() const
Definition: SmallVector.h:335
bool isSmall() const
Definition: SmallVector.h:196
reverse_iterator rbegin()
Definition: SmallVector.h:326
SmallVector(const iterator_range< RangeTy > &R)
Definition: SmallVector.h:1303
void assertSafeToAddRange(const T *From, const T *To)
Check whether any part of the range will be invalidated by growing.
Definition: SmallVector.h:268
void resize_for_overwrite(size_type N)
Like resize, but T is POD, the new values won't be initialized.
Definition: SmallVector.h:700
Definition: SmallVector.h:387
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:362
void assertSafeToAddRange(ItTy, ItTy)
Definition: SmallVector.h:277
static void uninitialized_copy(It1 I, It1 E, It2 Dest)
Definition: SmallVector.h:561
void push_back(const T &Elt)
Definition: SmallVector.h:478
void set_size(size_t N)
Definition: SmallVector.h:148
void clear()
Definition: SmallVector.h:669
void assertSafeToAdd(const void *Elt, size_t N=1)
Definition: SmallVector.h:251
void * X
Definition: SmallVector.cpp:64
const_iterator end() const
Definition: SmallVector.h:323
LLVM_NODISCARD bool empty() const
Definition: SmallVector.h:141
iterator insert(iterator I, ItTy From, ItTy To)
Definition: SmallVector.h:948
void append(const SmallVectorImpl &RHS)
Definition: SmallVector.h:760
const_iterator begin() const
Definition: SmallVector.h:321
size_t size_type
Definition: SmallVector.h:301
SmallVector()
Definition: SmallVector.h:1282
static void destroy_range(T *S, T *E)
Definition: SmallVector.h:396
iterator insert(iterator I, const T &Elt)
Definition: SmallVector.h:876
void assign(size_type NumElts, ValueParamT Elt)
Definition: SmallVector.h:762
void push_back(ValueParamT Elt)
Definition: SmallVector.h:623
void append(std::initializer_list< T > IL)
Definition: SmallVector.h:758
typename std::conditional< sizeof(T)< 4 &&sizeof(void *) >=8, uint64_t, uint32_t >::type SmallVectorSizeType
Definition: SmallVector.h:158
reverse_iterator rend()
Definition: SmallVector.h:330
void To(const core::Tensor &src, core::Tensor &dst, double scale, double offset)
Definition: Image.cpp:36
void assertSafeToReferenceAfterResize(const void *Elt, size_t NewSize)
Check whether Elt will be invalidated by resizing the vector to NewSize.
Definition: SmallVector.h:242
size_t capacity_in_bytes() const
Definition: SmallVector.h:340
void pop_back()
Definition: SmallVector.h:629
void assignRemote(SmallVectorImpl &&RHS)
Definition: SmallVector.h:651
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:743
#define LLVM_UNLIKELY
Definition: SmallVector.h:65
static void uninitialized_move(It1 I, It1 E, It2 Dest)
Definition: SmallVector.h:553
iterator begin()
Definition: SmallVector.h:320
SmallVectorTemplateBase(size_t Size)
Definition: SmallVector.h:394
void grow_pod(void *FirstEl, size_t MinSize, size_t TSize)
Definition: SmallVector.cpp:153
bool operator==(const SmallVectorImpl &RHS) const
Definition: SmallVector.h:1027
SmallVectorTemplateBase(size_t Size)
Definition: SmallVector.h:545
void resetToSmall()
Put this vector in a state of being small.
Definition: SmallVector.h:199
iterator insert(iterator I, T &&Elt)
Definition: SmallVector.h:872
void growAndAssign(size_t NumElts, const T &Elt)
Definition: SmallVector.h:454
~SmallVectorImpl()
Definition: SmallVector.h:663
SmallVector(std::initializer_list< T > IL)
Definition: SmallVector.h:1308
SmallVector & operator=(std::initializer_list< T > IL)
Definition: SmallVector.h:1351
Definition: SmallVector.h:102
SmallVector< ValueTypeFromRangeType< R >, Size > to_vector(R &&Range)
Definition: SmallVector.h:1371
static T && forward_value_param(T &&V)
Definition: SmallVector.h:451
static constexpr size_t SizeTypeMax()
The maximum value of the Size_T used.
Definition: SmallVector.h:119
bool operator<(const SmallVectorImpl &RHS) const
Definition: SmallVector.h:1035
SmallVector(const SmallVector &RHS)
Definition: SmallVector.h:1312
void takeAllocationForGrow(T *NewElts, size_t NewCapacity)
Transfer ownership of the allocation, finishing up grow().
Definition: SmallVector.h:518
void swap(open3d::core::SmallVector< T, N > &LHS, open3d::core::SmallVector< T, N > &RHS)
Implement std::swap in terms of SmallVector swap.
Definition: SmallVector.h:1396
SmallVectorImpl(unsigned N)
Definition: SmallVector.h:649
void reserve(size_type N)
Definition: SmallVector.h:721
static const T & forward_value_param(const T &V)
Definition: SmallVector.h:452
SmallVectorTemplateCommon(size_t Size)
Definition: SmallVector.h:188
Definition: PinholeCameraIntrinsic.cpp:35
bool operator!=(const SmallVectorImpl &RHS) const
Definition: SmallVector.h:1031
Definition: SmallVector.h:113
reference back()
Definition: SmallVector.h:365
void append(size_type NumInputs, ValueParamT Elt)
Append NumInputs copies of Elt to the end.
Definition: SmallVector.h:752
Definition: SmallVector.h:635
const T * reserveForParamAndGetAddress(const T &Elt, size_t N=1)
Definition: SmallVector.h:440
Definition: SmallVector.h:1210
bool operator<=(const SmallVectorImpl &RHS) const
Definition: SmallVector.h:1040
SmallVectorImpl & operator=(const SmallVectorImpl &RHS)
Definition: SmallVector.h:1082
size_t capacity_in_bytes(const SmallVector< T, N > &X)
Definition: SmallVector.h:1358
SmallVector(size_t Size, const T &Value=T())
Definition: SmallVector.h:1289
void push_back(T &&Elt)
Definition: SmallVector.h:484
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle image_handle timestamp_usec white_balance image_handle k4a_device_configuration_t config device_handle char size_t serial_number_size bool int32_t int32_t int32_t int32_t k4a_color_control_mode_t default_mode value const const k4a_calibration_t calibration char size_t
Definition: K4aPlugin.cpp:734
const_pointer data() const
Return a pointer to the vector's buffer, even if empty().
Definition: SmallVector.h:345
reference emplace_back(ArgTypes &&... Args)
Definition: SmallVector.h:1014
void assign(const SmallVectorImpl &RHS)
Definition: SmallVector.h:796
void * BeginX
Definition: SmallVector.h:115
size_t capacity() const
Definition: SmallVector.h:139
void pop_back_n(size_type NumItems)
Definition: SmallVector.h:725
reference front()
Definition: SmallVector.h:356
std::reverse_iterator< iterator > reverse_iterator
Definition: SmallVector.h:308
iterator erase(const_iterator CI)
Definition: SmallVector.h:798
pointer data()
Return a pointer to the vector's buffer, even if empty().
Definition: SmallVector.h:343
SmallVector & operator=(const SmallVector &RHS)
Definition: SmallVector.h:1316
#define LLVM_GSL_OWNER
Definition: SmallVector.h:71
bool copy
Definition: VtkUtils.cpp:89
Figure out the offset of the first element.
Definition: SmallVector.h:162
static const T * reserveForParamAndGetAddressImpl(U *This, const T &Elt, size_t N)
Definition: SmallVector.h:282
static void uninitialized_copy(T1 *I, T1 *E, T2 *Dest, std::enable_if_t< std::is_same< typename std::remove_const< T1 >::type, T2 >::value > *=nullptr)
Definition: SmallVector.h:569
const_reference operator[](size_type idx) const
Definition: SmallVector.h:351
LLVM_NODISCARD T pop_back_val()
Definition: SmallVector.h:730
SmallVector(SmallVector &&RHS)
Definition: SmallVector.h:1321
T & growAndEmplaceBack(ArgTypes &&... Args)
Definition: SmallVector.h:465
static ValueParamT forward_value_param(ValueParamT V)
Copy V or return a reference, depending on ValueParamT.
Definition: SmallVector.h:601
void assertSafeToReferenceAfterClear(ItTy, ItTy)
Definition: SmallVector.h:265
iterator insert(iterator I, size_type NumToInsert, ValueParamT Elt)
Definition: SmallVector.h:880
void * mallocForGrow(size_t MinSize, size_t TSize, size_t &NewCapacity)
Definition: SmallVector.cpp:144
const T * reserveForParamAndGetAddress(const T &Elt, size_t N=1)
Definition: SmallVector.h:589
void truncate(size_type N)
Like resize, but requires that N is less than size().
Definition: SmallVector.h:703
T * reserveForParamAndGetAddress(T &Elt, size_t N=1)
Definition: SmallVector.h:446
void * safe_realloc(void *Ptr, size_t Sz)
Definition: SmallVector.h:89
const_reverse_iterator rend() const
Definition: SmallVector.h:331