File indexing completed on 2026-05-24 08:18:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef NCollection_BasePointerVector_HeaderFile
0015 #define NCollection_BasePointerVector_HeaderFile
0016
0017 #include <Standard.hxx>
0018
0019 #include <NCollection_Allocator.hxx>
0020 #include <NCollection_DefineAlloc.hxx>
0021
0022
0023
0024
0025
0026
0027
0028
0029 class NCollection_BasePointerVector
0030 {
0031 public:
0032
0033 DEFINE_STANDARD_ALLOC
0034 DEFINE_NCOLLECTION_ALLOC
0035
0036 public:
0037
0038 NCollection_BasePointerVector() {}
0039
0040
0041 Standard_EXPORT NCollection_BasePointerVector(const NCollection_BasePointerVector& theOther);
0042
0043
0044 Standard_EXPORT NCollection_BasePointerVector(NCollection_BasePointerVector&& theOther) noexcept;
0045
0046
0047 ~NCollection_BasePointerVector() { clear(); }
0048
0049
0050 bool IsEmpty() const { return mySize == 0; }
0051
0052
0053 size_t Size() const { return mySize; }
0054
0055
0056 size_t Capacity() const { return myCapacity; }
0057
0058
0059 void RemoveLast() { mySize--; }
0060
0061
0062 void Clear(const bool theReleaseMemory = false)
0063 {
0064 if (theReleaseMemory)
0065 clear();
0066 mySize = 0;
0067 }
0068
0069 public:
0070
0071 void** GetArray() const { return myArray; }
0072
0073
0074 void* Value(const size_t theInd) const { return myArray[theInd]; }
0075
0076 public:
0077
0078
0079 Standard_EXPORT void Append(const void* thePnt);
0080
0081
0082
0083
0084 Standard_EXPORT void SetValue(const size_t theInd, const void* thePnt);
0085
0086
0087 Standard_EXPORT NCollection_BasePointerVector& operator=(
0088 const NCollection_BasePointerVector& theOther);
0089
0090
0091 Standard_EXPORT NCollection_BasePointerVector& operator=(
0092 NCollection_BasePointerVector&& theOther) noexcept;
0093
0094 private:
0095
0096 Standard_EXPORT void clear();
0097
0098 private:
0099 size_t mySize = 0;
0100 size_t myCapacity = 0;
0101 void** myArray = nullptr;
0102 NCollection_Allocator<void*> myAllocator;
0103 };
0104
0105 #endif