- Timestamp:
- Apr 8, 2009, 12:36:08 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/LinearMath/btAlignedObjectArray.h
r2662 r2907 59 59 return (size ? size*2 : 1); 60 60 } 61 SIMD_FORCE_INLINE void copy(int start,int end, T* dest) 61 SIMD_FORCE_INLINE void copy(int start,int end, T* dest) const 62 62 { 63 63 int i; … … 121 121 } 122 122 123 SIMD_FORCE_INLINE int capacity() const 124 { // return current length of allocated storage 125 return m_capacity; 126 } 127 123 ///Generally it is best to avoid using the copy constructor of an btAlignedObjectArray, and use a (const) reference to the array instead. 124 btAlignedObjectArray(const btAlignedObjectArray& otherArray) 125 { 126 init(); 127 128 int otherSize = otherArray.size(); 129 resize (otherSize); 130 otherArray.copy(0, otherSize, m_data); 131 } 132 133 134 135 /// return the number of elements in the array 128 136 SIMD_FORCE_INLINE int size() const 129 { // return length of sequence137 { 130 138 return m_size; 131 139 } … … 142 150 143 151 152 ///clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations. 144 153 SIMD_FORCE_INLINE void clear() 145 154 { … … 157 166 } 158 167 168 ///resize changes the number of elements in the array. If the new size is larger, the new elements will be constructed using the optional second argument. 169 ///when the new number of elements is smaller, the destructor will be called, but memory will not be freed, to reduce performance overhead of run-time memory (de)allocations. 159 170 SIMD_FORCE_INLINE void resize(int newsize, const T& fillData=T()) 160 171 { … … 220 231 221 232 233 /// return the pre-allocated (reserved) elements, this is at least as large as the total number of elements,see size() and reserve() 234 SIMD_FORCE_INLINE int capacity() const 235 { 236 return m_capacity; 237 } 222 238 223 239 SIMD_FORCE_INLINE void reserve(int _Count)
Note: See TracChangeset
for help on using the changeset viewer.