File indexing completed on 2025-01-18 10:04:18
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
0039 NCollection_BasePointerVector() {}
0040
0041
0042 Standard_EXPORT NCollection_BasePointerVector(const NCollection_BasePointerVector& theOther);
0043
0044
0045 Standard_EXPORT NCollection_BasePointerVector(NCollection_BasePointerVector&& theOther) noexcept;
0046
0047
0048 ~NCollection_BasePointerVector() { clear(); }
0049
0050
0051 bool IsEmpty() const { return mySize == 0; }
0052
0053
0054 size_t Size() const { return mySize; }
0055
0056
0057 size_t Capacity() const { return myCapacity; }
0058
0059
0060 void RemoveLast() { mySize--; }
0061
0062
0063 void Clear(const bool theReleaseMemory = false)
0064 {
0065 if (theReleaseMemory)
0066 clear();
0067 mySize = 0;
0068 }
0069
0070 public:
0071
0072
0073 void** GetArray() const { return myArray; }
0074
0075
0076 void* Value (const size_t theInd) const { return myArray[theInd]; }
0077
0078 public:
0079
0080
0081
0082 Standard_EXPORT void Append (const void* thePnt);
0083
0084
0085
0086
0087 Standard_EXPORT void SetValue (const size_t theInd, const void* thePnt);
0088
0089
0090 Standard_EXPORT NCollection_BasePointerVector& operator= (const NCollection_BasePointerVector& theOther);
0091
0092
0093 Standard_EXPORT NCollection_BasePointerVector& operator= (NCollection_BasePointerVector&& theOther) noexcept;
0094
0095 private:
0096
0097
0098 Standard_EXPORT void clear();
0099
0100 private:
0101 size_t mySize = 0;
0102 size_t myCapacity = 0;
0103 void** myArray = nullptr;
0104 NCollection_Allocator<void*> myAllocator;
0105 };
0106
0107 #endif