Close

Relief for ODA Team in Ukraine

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

This template class implements dynamic array objects within the ODA Platform.

Objects of the OdArray and OdVector classes are similar: elements are sequenced linearly, elements can be directly accessed, adding and deleting elements from the end of the sequence is fast, and the objects can resize automatically when an element is inserted or deleted. 

The OdArray class uses copy-on-write (implicit sharing) to duplicate or copy data. 

This prevents accidental corruption of unrelated data when changing the contents of an OdArray object. OdArray objects share data when possible, which reduces memory consumption and unnecessary data copying. 

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. However, OdArray does not support C++11 move semantics, which OdVector supports. The OdArray class works similarly to QList. 

Methods are provided to access array elements via both array indices and array pointers (iterators). 

Definitions: 

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

OdArray@classT@classA

File: OdArray.h 

Module: API Reference 

TD_Db 

 

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