Close

Relief for ODA Team in Ukraine

Learn more
ODA Kernel SDK
OdVector<class T, class A, class Mm> Template
Syntax
C++
template <class T, class A, class Mm> class OdVector;

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: 

  1. Logical length or size -- The number of entries in the vector. Initially zero.
  2. Physical length -- The maximum logical length of the vector before it automatically grows.
  3. Grow length -- The number of entries by which the physical length will grow as required.
 

OdVector@classT@classA@classMm

File: OdVector.h 

Module: API Reference 

Db 

 

Copyright © 2002-2022. Open Design Alliance All rights reserved.