This template class implements dynamic vector objects within the ODA Platform.
Objects of the OdVector and OdArray classes are similar: elements are sequenced linearly, elements can be directly accessed, adding and deleting elements from the end is fast, and the objects can resize automatically when an element is inserted or deleted. However, OdVector objects use internal dynamic arrays that may need to be reallocated to increase in size when new elements are inserted. This does not happen every time an element is added though because an initial larger size is set to allow for growth.
A vector owns its own buffer. This means that when a class object is copied or moved, the buffer is also copied or moved.
Use the OdArray class to avoid unnecessary array copies in cases where, according to the rules of C++, OdVector is copied, although this is not necessary. It is recommended to use C++11 move semantics with OdVector to avoid unnecessary buffer copying. The OdVector class works similarly to std::vector.
Methods are provided to access vector elements via both vector indices and vector pointers (iterators).
Definitions:
File: OdVector.h
Module: API Reference
Db
This is the overview for the OdVector constructor overload. | |
Destroys a vector instance. |
This is the overview for the append method overload. | |
Appends the specified vector object to the end of the vector object. | |
This is the overview for the asArrayPtr method overload. | |
Assigns the specified range of elements to the vector object. | |
Assigns the specified range of elements to the vector object. | |
This is the overview for the at method overload. | |
This is the overview for the begin method overload. | |
Returns the physical length of the vector object. | |
Removes all elements from the vector object. | |
Indicates whether the vector object contains ths specified value. | |
Indicates whether the vector is empty. | |
This is the overview for the end method overload. | |
This is the overview for the erase method overload. | |
Indicates whether the vector object contains the specified value and receives the index of the found value. | |
This is the overview for the first method overload. | |
Returns the element of the vector object at the specified position. | |
Returns the data buffer of the vector object. | |
Returns the grow length of the vector object. | |
This is the overview for the insert method overload. | |
This is the overview for the insertAt method overload. | |
Inserts a range of elements into the vector object. | |
Indicates whether the vector is empty. | |
This is the overview for the last method overload. | |
Returns the length of the vector object. | |
Returns the logical length of the vector object. | |
Returns the physical length of the vector object. | |
This is the overview for the push_back method overload. | |
Removes the element with the specified value from the vector object. | |
Removes the element at the specified index from the vector object. | |
Removes the first element from the vector object. | |
Removes the last element from the vector object. | |
Removes the specified elements from the vector object. | |
Sets the physical length of the vector object to the specified reserve length if the reserve length is greater than its physical length. | |
This is the overview for the resize method overload. | |
Reverses the order of the elements in the vector object. | |
Sets all the elements in the vector object to the specified value. | |
Sets the element of the vector object at the specified index. | |
Sets the grow length of the vector object. | |
Sets the logical length of the vector object. | |
Sets the physical length of the vector object. | |
Returns the logical length of the vector object. | |
This is the overview for the swap method overload. |
This is the overview for the = operator overload. | |
| |
This is the overview for the [] operator overload. |
Copyright © 2002-2022. Open Design Alliance All rights reserved.
|