CFx SDK Documentation  2023 SP0
Public Types | Public Member Functions | List of all members
OdVector< T, A, Mm > Class Template Reference

#include <OdVector.h>

Public Types

typedef A::size_type size_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef T value_type
 
typedef const T & const_reference
 
typedef T & reference
 

Public Member Functions

 OdVector (size_type physicalLength, int growLength=8)
 
 OdVector ()
 
 OdVector (const OdVector &vec)
 
 ~OdVector ()
 
OdVectoroperator= (const OdVector &vec)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void insert (iterator before, const_iterator first, const_iterator afterLast)
 
iterator insert (iterator before, size_type numElem, const T &value)
 
iterator insert (iterator before, const T &value=T())
 
OdVectorinsertAt (size_type index, const T &value)
 
OdVectorremoveAt (size_type index)
 
OdVectorremoveSubArray (size_type startIndex, size_type endIndex)
 
bool remove (const T &value, size_type startIndex=0)
 
void resize (size_type logicalLength, const T &value)
 
void resize (size_type logicalLength)
 
size_type size () const
 
bool empty () const
 
size_type capacity () const
 
void reserve (size_type reserveLength)
 
void assign (const_iterator first, const_iterator afterLast)
 
iterator erase (iterator first, iterator afterLast)
 
iterator erase (iterator where)
 
void clear ()
 
void push_back (const T &value)
 
bool contains (const T &value, size_type startIndex=0) const
 
size_type length () const
 
bool isEmpty () const
 
size_type logicalLength () const
 
size_type physicalLength () const
 
int growLength () const
 
const T * asArrayPtr () const
 
const T * getPtr () const
 
T * asArrayPtr ()
 
const T & operator[] (size_type index) const
 
T & operator[] (size_type index)
 
T & at (size_type index)
 
const T & at (size_type index) const
 
OdVectorsetAt (size_type index, const T &value)
 
const T & getAt (size_type index) const
 
T & first ()
 
const T & first () const
 
T & last ()
 
const T & last () const
 
size_type append (const T &value)
 
iterator append ()
 
OdVectorappend (const OdVector &vec)
 
OdVectorremoveFirst ()
 
OdVectorremoveLast ()
 
bool operator== (const OdVector &vec) const
 
OdVectorsetAll (const T &value)
 
bool find (const T &value, size_type &index, size_type startIndex=0) const
 
OdVectorsetLogicalLength (size_type logicalLength)
 
OdVectorsetPhysicalLength (size_type physicalLength)
 
OdVectorsetGrowLength (int growLength)
 
OdVectorreverse ()
 
OdVectorswap (size_type firstIndex, size_type secondIndex)
 

Detailed Description

template<class T, class A, class Mm>
class OdVector< T, A, Mm >

This template class implements dynamic Array objects within Teigha.

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

Some definitions are in order:

  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.
See also
Db

<group Other_Classes>

Definition at line 53 of file OdVector.h.

Member Typedef Documentation

◆ const_iterator

template<class T , class A , class Mm >
typedef const T* OdVector< T, A, Mm >::const_iterator

Definition at line 58 of file OdVector.h.

◆ const_reference

template<class T , class A , class Mm >
typedef const T& OdVector< T, A, Mm >::const_reference

Definition at line 61 of file OdVector.h.

◆ iterator

template<class T , class A , class Mm >
typedef T* OdVector< T, A, Mm >::iterator

Definition at line 57 of file OdVector.h.

◆ reference

template<class T , class A , class Mm >
typedef T& OdVector< T, A, Mm >::reference

Definition at line 62 of file OdVector.h.

◆ size_type

template<class T , class A , class Mm >
typedef A::size_type OdVector< T, A, Mm >::size_type

Definition at line 56 of file OdVector.h.

◆ value_type

template<class T , class A , class Mm >
typedef T OdVector< T, A, Mm >::value_type

Definition at line 60 of file OdVector.h.

Constructor & Destructor Documentation

◆ OdVector() [1/3]

template<class T , class A , class Mm >
OdVector< T, A, Mm >::OdVector ( size_type  physicalLength,
int  growLength = 8 
)
explicit
Parameters
physicalLength[in] Initial physical length.
growLength[in] Initial grow length.

◆ OdVector() [2/3]

template<class T , class A , class Mm >
OdVector< T, A, Mm >::OdVector
inline

Definition at line 487 of file OdVector.h.

◆ OdVector() [3/3]

template<class T , class A , class Mm >
OdVector< T, A, Mm >::OdVector ( const OdVector< T, A, Mm > &  vec)
inline

Definition at line 493 of file OdVector.h.

◆ ~OdVector()

template<class T , class A , class Mm >
OdVector< T, A, Mm >::~OdVector
inline

Definition at line 506 of file OdVector.h.

Member Function Documentation

◆ append() [1/3]

template<class T , class A , class Mm >
VEC_ITERATOR OdVector< T, A, Mm >::append
inline

Returns an interator (pointer) to the first element after the last element in the array.

Definition at line 1065 of file OdVector.h.

◆ append() [2/3]

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::append ( const OdVector< T, A, Mm > &  vec)
inline

Appends the Array object to the end of this Array object.

Parameters
vec[in] Array to append.
Remarks
Returns a reference to this Array object.

Definition at line 1072 of file OdVector.h.

◆ append() [3/3]

template<class T , class A , class Mm >
VEC_SIZE_TYPE OdVector< T, A, Mm >::append ( const T &  value)
inline

Appends the specified value to the end of this Array object.

Parameters
value[in] Value to append.
Remarks
Returns the index of the new last element.

Definition at line 1058 of file OdVector.h.

◆ asArrayPtr() [1/2]

template<class T , class A , class Mm >
T * OdVector< T, A, Mm >::asArrayPtr
inline

Returns the data buffer of this Array object.

Definition at line 982 of file OdVector.h.

◆ asArrayPtr() [2/2]

template<class T , class A , class Mm >
const T * OdVector< T, A, Mm >::asArrayPtr
inline

Returns the data buffer of this Array object.

Definition at line 970 of file OdVector.h.

◆ assign()

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::assign ( const_iterator  first,
const_iterator  afterLast 
)
inline

Assigns the specified range of elements to this Array object.

Parameters
first[in] Position of first element to be assigned.
afterLast[in] Position of first element after the last element to be assigned.
Remarks
After this Array object is cleared, this function assigns the specified range of elements from another Array object.

Definition at line 891 of file OdVector.h.

◆ at() [1/2]

template<class T , class A , class Mm >
T& OdVector< T, A, Mm >::at ( size_type  index)

Returns the element of this Array object at the specified index.

Parameters
arrayIndex[in] Array index.

◆ at() [2/2]

template<class T , class A , class Mm >
const T& OdVector< T, A, Mm >::at ( size_type  index) const

Returns the element of this Array object at the specified index.

Parameters
arrayIndex[in] Array index.

◆ begin() [1/2]

template<class T , class A , class Mm >
VEC_ITERATOR OdVector< T, A, Mm >::begin
inline

Returns an iterator that references the first element in this Array object.

Definition at line 659 of file OdVector.h.

◆ begin() [2/2]

template<class T , class A , class Mm >
VEC_CONST_ITERATOR OdVector< T, A, Mm >::begin
inline

Returns an iterator that references the first element in this Array object.

Definition at line 665 of file OdVector.h.

◆ capacity()

template<class T , class A , class Mm >
VEC_SIZE_TYPE OdVector< T, A, Mm >::capacity
inline

Returns the physical length of this Array object.

Definition at line 878 of file OdVector.h.

◆ clear()

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::clear
inline

Removes all elements from this Array object.

Definition at line 920 of file OdVector.h.

◆ contains()

template<class T , class A , class Mm >
bool OdVector< T, A, Mm >::contains ( const T &  value,
size_type  startIndex = 0 
) const
inline

Returns true if and only if this Array object contains ths specified value.

Parameters
value[in] Value for which to search.
startIndex[in] Starting index of search.

Definition at line 932 of file OdVector.h.

◆ empty()

template<class T , class A , class Mm >
bool OdVector< T, A, Mm >::empty
inline

Returns true if and only if this Array is empty.

Definition at line 872 of file OdVector.h.

◆ end() [1/2]

template<class T , class A , class Mm >
VEC_ITERATOR OdVector< T, A, Mm >::end
inline

Definition at line 671 of file OdVector.h.

◆ end() [2/2]

template<class T , class A , class Mm >
VEC_CONST_ITERATOR OdVector< T, A, Mm >::end
inline

Definition at line 677 of file OdVector.h.

◆ erase() [1/2]

template<class T , class A , class Mm >
iterator OdVector< T, A, Mm >::erase ( iterator  first,
iterator  afterLast 
)

Removes the range of elements from this Array object.

Parameters
first[in] Position of first element to be assigned.
afterLast[in] Position of first element after the last element to be assigned.

◆ erase() [2/2]

template<class T , class A , class Mm >
iterator OdVector< T, A, Mm >::erase ( iterator  where)

Removes the specified element from this Array object.

where [in] Element to remove.

◆ find()

template<class T , class A , class Mm >
bool OdVector< T, A, Mm >::find ( const T &  value,
size_type index,
size_type  startIndex = 0 
) const
inline

Returns true if and only if this Array object contains ths specified value.

Parameters
value[in] Value for which to search.
index[out] Receives the index of the found value.
startIndex[in] Starting index of search.
Returns
Returns the index at which the element was found.

Definition at line 1115 of file OdVector.h.

◆ first() [1/2]

template<class T , class A , class Mm >
T & OdVector< T, A, Mm >::first
inline

Returns the first element of this Array object.

Definition at line 1034 of file OdVector.h.

◆ first() [2/2]

template<class T , class A , class Mm >
const T & OdVector< T, A, Mm >::first
inline

Returns the first element of this Array object.

Definition at line 1040 of file OdVector.h.

◆ getAt()

template<class T , class A , class Mm >
const T & OdVector< T, A, Mm >::getAt ( size_type  index) const
inline

Returns the element of this Array object at the specified position.

Parameters
arrayIndex[in] Array index.

Definition at line 1027 of file OdVector.h.

◆ getPtr()

template<class T , class A , class Mm >
const T * OdVector< T, A, Mm >::getPtr
inline

Returns the data buffer of this Array object.

Definition at line 976 of file OdVector.h.

◆ growLength()

template<class T , class A , class Mm >
int OdVector< T, A, Mm >::growLength
inline

Returns the grow length of this Array object.

Definition at line 964 of file OdVector.h.

◆ insert() [1/3]

template<class T , class A , class Mm >
iterator OdVector< T, A, Mm >::insert ( iterator  before,
const T &  value = T() 
)

Inserts a range of elements into this Array object.

Parameters
before[in] Position after which the first element should be inserted.
value[in] Value to insert.
Remarks
The range of elements may be from another Array object.

◆ insert() [2/3]

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::insert ( iterator  before,
const_iterator  first,
const_iterator  afterLast 
)

Inserts an element into this Array object.

Parameters
before[in] Position after which the first element should be inserted.
first[in] Position of first element to be inserted.
afterLast[in] Position of first element after the last element to be inserted.
Remarks
The range of elements may be from another Array object.

◆ insert() [3/3]

template<class T , class A , class Mm >
iterator OdVector< T, A, Mm >::insert ( iterator  before,
size_type  numElem,
const T &  value 
)
Parameters
numElem[in] Number of elements to insert.
value[in] Value to insert.

Inserts a number of elements into this Array object.

Parameters
before[in] Position after which the first element should be inserted.
numElem[in] Number of elements to insert.
value[in] Value to insert.
Remarks
The range of elements may be from another Array object.

◆ insertAt()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::insertAt ( size_type  index,
const T &  value 
)
inline

Inserts the specified value into this Array object at the specified index.

Parameters
index[in] Array index.
value[in] Value to insert.
Remarks
0 <= index <= length()

Elements starting at index will have their indices incremented.

Returns a reference to this Array object.

Definition at line 750 of file OdVector.h.

◆ isEmpty()

template<class T , class A , class Mm >
bool OdVector< T, A, Mm >::isEmpty
inline

Returns true if and only if this Array is empty.

Definition at line 946 of file OdVector.h.

◆ last() [1/2]

template<class T , class A , class Mm >
T & OdVector< T, A, Mm >::last
inline

Returns the last element of this Array object.

Definition at line 1046 of file OdVector.h.

◆ last() [2/2]

template<class T , class A , class Mm >
const T & OdVector< T, A, Mm >::last
inline

Returns the last element of this Array object.

Definition at line 1052 of file OdVector.h.

◆ length()

template<class T , class A , class Mm >
VEC_SIZE_TYPE OdVector< T, A, Mm >::length
inline

Returns the number of elements in this Array object.

Definition at line 940 of file OdVector.h.

◆ logicalLength()

template<class T , class A , class Mm >
VEC_SIZE_TYPE OdVector< T, A, Mm >::logicalLength
inline

Returns the logical length of this Array object.

Definition at line 952 of file OdVector.h.

◆ operator=()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::operator= ( const OdVector< T, A, Mm > &  vec)
inline

Definition at line 512 of file OdVector.h.

◆ operator==()

template<class T , class A , class Mm >
bool OdVector< T, A, Mm >::operator== ( const OdVector< T, A, Mm > &  vec) const
inline

Definition at line 1091 of file OdVector.h.

◆ operator[]() [1/2]

template<class T , class A , class Mm >
T& OdVector< T, A, Mm >::operator[] ( size_type  index)

For convenient access to the data.

◆ operator[]() [2/2]

template<class T , class A , class Mm >
const T& OdVector< T, A, Mm >::operator[] ( size_type  index) const

For convenient access to the data.

◆ physicalLength()

template<class T , class A , class Mm >
VEC_SIZE_TYPE OdVector< T, A, Mm >::physicalLength
inline

Returns the physical length of this Array object.

Definition at line 958 of file OdVector.h.

◆ push_back()

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::push_back ( const T &  value)
inline

Appends an element to the end of this Array object.

Definition at line 926 of file OdVector.h.

◆ remove()

template<class T , class A , class Mm >
bool OdVector< T, A, Mm >::remove ( const T &  value,
size_type  startIndex = 0 
)
inline

Removes the element with the specified value from this Array object.

Parameters
value[in] Value for which to search.
startIndex[in] Starting index of search.
Remarks
Removes the first occurance of value starting at startIndex.

Returns true if and only if an element was removed.

Definition at line 817 of file OdVector.h.

◆ removeAt()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::removeAt ( size_type  index)
inline

Removes the element at the specified index from this Array object.

Parameters
index[in] Array index.
Remarks
0 <= index < length()

Elements starting at index+1 will have their indices decremented.

Returns a reference to this Array object.

Definition at line 779 of file OdVector.h.

◆ removeFirst()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::removeFirst
inline

Removes the first element in this Array object.

Definition at line 1079 of file OdVector.h.

◆ removeLast()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::removeLast
inline

Removes the last element in this Array object.

Definition at line 1085 of file OdVector.h.

◆ removeSubArray()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::removeSubArray ( size_type  startIndex,
size_type  endIndex 
)
inline

Removes the specified elements from this Array object.

Parameters
startIndex[in] Start index.
endIndex[in] End index.
Remarks
Elements from startIndex through endIndex inclusive will be removed.

Returns a reference to this Array object.

Definition at line 796 of file OdVector.h.

◆ reserve()

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::reserve ( size_type  reserveLength)
inline

Sets the physical length of this Array object to the specified reserve length if the reserve length is greater than its physical length.

Parameters
reserveLength[in] Minimum physical length.

Definition at line 884 of file OdVector.h.

◆ resize() [1/2]

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::resize ( size_type  logicalLength)

Specifies the logical length for this Array object.

Parameters
logicalLength[in] Logical length.

◆ resize() [2/2]

template<class T , class A , class Mm >
void OdVector< T, A, Mm >::resize ( size_type  logicalLength,
const T &  value 
)

Specifies the logical length for this Array object.

Parameters
logicalLength[in] Logical length.
value[in] Value for the elements added to obtain the new logical length.

◆ reverse()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::reverse
inline

Reverses the order of the elements in this Array object.

Definition at line 1171 of file OdVector.h.

◆ setAll()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::setAll ( const T &  value)
inline

Sets all the elements in this Array object to the specified value.

Parameters
value[in] Value to assign.

Definition at line 1106 of file OdVector.h.

◆ setAt()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::setAt ( size_type  index,
const T &  value 
)
inline

Sets the element of this Array object at the specified index.

Parameters
arrayIndex[in] Array index.
value[in] Value.

Definition at line 1017 of file OdVector.h.

◆ setGrowLength()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::setGrowLength ( int  growLength)
inline

Sets the grow length of this Array object.

Parameters
growLength[in] Grow length.

Definition at line 1160 of file OdVector.h.

◆ setLogicalLength()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::setLogicalLength ( size_type  logicalLength)
inline

Sets the logical length of this Array object.

Parameters
logicalLength[in] Logical length.
Remarks
The physical length is increased as required.

Definition at line 1134 of file OdVector.h.

◆ setPhysicalLength()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::setPhysicalLength ( size_type  physicalLength)
inline

Sets the physical length of this Array object.

Parameters
physicalLength[in] Physical length.
Remarks
The logical length is decreased as required.

Definition at line 1141 of file OdVector.h.

◆ size()

template<class T , class A , class Mm >
VEC_SIZE_TYPE OdVector< T, A, Mm >::size
inline

Returns the logical length of this Array object.

Definition at line 866 of file OdVector.h.

◆ swap()

template<class T , class A , class Mm >
OdVector< T, A, Mm > & OdVector< T, A, Mm >::swap ( size_type  firstIndex,
size_type  secondIndex 
)
inline

Swaps the specified elements in this Array object.

Parameters
firstIndex[in] Index of first element.
secondIndex[in] Index of second element.

Definition at line 1195 of file OdVector.h.


The documentation for this class was generated from the following file: