CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Friends | List of all members
OdArrayMemAlloc< T, A, Mm > Class Template Reference

#include <OdArrayMemAlloc.h>

Public Types

typedef A::size_type size_type
 
typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void insert (iterator before, const_iterator first, const_iterator afterLast)
 
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)
 
iterator insert (iterator before, size_type numElements, const T &value)
 
iterator insert (iterator before, const T &value=T())
 
bool contains (const T &value, size_type start=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 arrayIndex)
 
const T & at (size_type arrayIndex) const
 
OdArrayMemAllocsetAt (size_type arrayIndex, const T &value)
 
const T & getAt (size_type arrayIndex) const
 
T & first ()
 
const T & first () const
 
T & last ()
 
const T & last () const
 
size_type append (const T &value)
 
iterator append ()
 
OdArrayMemAllocremoveFirst ()
 
OdArrayMemAllocremoveLast ()
 
OdArrayMemAllocsetGrowLength (int growLength)
 
 OdArrayMemAlloc (size_type physicalLength, int growLength=8)
 
 OdArrayMemAlloc ()
 
 OdArrayMemAlloc (const OdArrayMemAlloc &source)
 
 ~OdArrayMemAlloc ()
 
OdArrayMemAllocoperator= (const OdArrayMemAlloc &source)
 
bool operator== (const OdArrayMemAlloc &array) const
 
OdArrayMemAllocsetAll (const T &value)
 
OdArrayMemAllocappend (const OdArrayMemAlloc &otherArray)
 
OdArrayMemAllocinsertAt (size_type arrayIndex, const T &value)
 
OdArrayMemAllocremoveAt (size_type arrayIndex)
 
OdArrayMemAllocremoveSubArray (size_type startIndex, size_type endIndex)
 
bool find (const T &value, size_type &findIndex, size_type start=0) const
 
OdArrayMemAllocsetLogicalLength (size_type logLength)
 
OdArrayMemAllocsetPhysicalLength (size_type physLength)
 
OdArrayMemAllocreverse ()
 
OdArrayMemAllocswap (size_type firstIndex, size_type secondIndex)
 
bool remove (const T &value, size_type start=0)
 

Friends

class reallocator
 

Detailed Description

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

This template class implements dynamic Array objects within DWGdirect.

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 66 of file OdArrayMemAlloc.h.

Member Typedef Documentation

◆ const_iterator

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

Definition at line 71 of file OdArrayMemAlloc.h.

◆ iterator

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

Definition at line 70 of file OdArrayMemAlloc.h.

◆ size_type

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

Definition at line 69 of file OdArrayMemAlloc.h.

Constructor & Destructor Documentation

◆ OdArrayMemAlloc() [1/3]

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

Definition at line 615 of file OdArrayMemAlloc.h.

◆ OdArrayMemAlloc() [2/3]

template<class T , class A , class Mm >
OdArrayMemAlloc< T, A, Mm >::OdArrayMemAlloc ( )
inline

Definition at line 630 of file OdArrayMemAlloc.h.

◆ OdArrayMemAlloc() [3/3]

template<class T , class A , class Mm >
OdArrayMemAlloc< T, A, Mm >::OdArrayMemAlloc ( const OdArrayMemAlloc< T, A, Mm > &  source)
inline

Definition at line 632 of file OdArrayMemAlloc.h.

◆ ~OdArrayMemAlloc()

template<class T , class A , class Mm >
OdArrayMemAlloc< T, A, Mm >::~OdArrayMemAlloc ( )
inline

Definition at line 634 of file OdArrayMemAlloc.h.

Member Function Documentation

◆ append() [1/3]

template<class T , class A , class Mm >
iterator OdArrayMemAlloc< T, A, Mm >::append ( )
inline

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

Definition at line 581 of file OdArrayMemAlloc.h.

◆ append() [2/3]

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::append ( const OdArrayMemAlloc< T, A, Mm > &  otherArray)
inline

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

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

Definition at line 687 of file OdArrayMemAlloc.h.

◆ append() [3/3]

template<class T , class A , class Mm >
size_type OdArrayMemAlloc< 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.
Returns
Returns the index of the new last element.

Definition at line 574 of file OdArrayMemAlloc.h.

◆ asArrayPtr() [1/2]

template<class T , class A , class Mm >
T * OdArrayMemAlloc< T, A, Mm >::asArrayPtr ( )
inline

Returns the data buffer of this Array object.

Definition at line 508 of file OdArrayMemAlloc.h.

◆ asArrayPtr() [2/2]

template<class T , class A , class Mm >
const T * OdArrayMemAlloc< T, A, Mm >::asArrayPtr ( ) const
inline

Returns the data buffer of this Array object.

Definition at line 498 of file OdArrayMemAlloc.h.

◆ assign()

template<class T , class A , class Mm >
void OdArrayMemAlloc< 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 358 of file OdArrayMemAlloc.h.

◆ at() [1/2]

template<class T , class A , class Mm >
T & OdArrayMemAlloc< T, A, Mm >::at ( size_type  arrayIndex)
inline

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

Parameters
arrayIndex[in] Array index.

Definition at line 523 of file OdArrayMemAlloc.h.

◆ at() [2/2]

template<class T , class A , class Mm >
const T & OdArrayMemAlloc< T, A, Mm >::at ( size_type  arrayIndex) const
inline

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

Parameters
arrayIndex[in] Array index.

Definition at line 529 of file OdArrayMemAlloc.h.

◆ begin() [1/2]

template<class T , class A , class Mm >
iterator OdArrayMemAlloc< T, A, Mm >::begin ( )
inline

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

Definition at line 209 of file OdArrayMemAlloc.h.

◆ begin() [2/2]

template<class T , class A , class Mm >
const_iterator OdArrayMemAlloc< T, A, Mm >::begin ( ) const
inline

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

Definition at line 213 of file OdArrayMemAlloc.h.

◆ capacity()

template<class T , class A , class Mm >
size_type OdArrayMemAlloc< T, A, Mm >::capacity ( ) const
inline

Returns the physical length of this Array object.

Definition at line 337 of file OdArrayMemAlloc.h.

◆ clear()

template<class T , class A , class Mm >
void OdArrayMemAlloc< T, A, Mm >::clear ( )
inline

Removes all elements from this Array object.

Definition at line 396 of file OdArrayMemAlloc.h.

◆ contains()

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

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

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

Definition at line 464 of file OdArrayMemAlloc.h.

◆ empty()

template<class T , class A , class Mm >
bool OdArrayMemAlloc< T, A, Mm >::empty ( ) const
inline

Returns true if and only if this Array is empty.

Definition at line 332 of file OdArrayMemAlloc.h.

◆ end() [1/2]

template<class T , class A , class Mm >
iterator OdArrayMemAlloc< T, A, Mm >::end ( )
inline

Returns an iterator that references the location after the last element in this Array object.

Definition at line 218 of file OdArrayMemAlloc.h.

◆ end() [2/2]

template<class T , class A , class Mm >
const_iterator OdArrayMemAlloc< T, A, Mm >::end ( ) const
inline

Returns an iterator that references the location after the last element in this Array object.

Definition at line 222 of file OdArrayMemAlloc.h.

◆ erase() [1/2]

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

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.

Definition at line 369 of file OdArrayMemAlloc.h.

◆ erase() [2/2]

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

Removes the specified element from this Array object.

Parameters
where[in] Element to remove.

Definition at line 386 of file OdArrayMemAlloc.h.

◆ find()

template<class T , class A , class Mm >
bool OdArrayMemAlloc< T, A, Mm >::find ( const T &  value,
size_type findIndex,
size_type  start = 0 
) const
inline

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

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

Definition at line 799 of file OdArrayMemAlloc.h.

◆ first() [1/2]

template<class T , class A , class Mm >
T & OdArrayMemAlloc< T, A, Mm >::first ( )
inline

Returns the first element of this Array object.

Definition at line 551 of file OdArrayMemAlloc.h.

◆ first() [2/2]

template<class T , class A , class Mm >
const T & OdArrayMemAlloc< T, A, Mm >::first ( ) const
inline

Returns the first element of this Array object.

Definition at line 555 of file OdArrayMemAlloc.h.

◆ getAt()

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

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

Parameters
arrayIndex[in] Array index.

Definition at line 545 of file OdArrayMemAlloc.h.

◆ getPtr()

template<class T , class A , class Mm >
const T * OdArrayMemAlloc< T, A, Mm >::getPtr ( ) const
inline

Returns the data buffer of this Array object.

Definition at line 503 of file OdArrayMemAlloc.h.

◆ growLength()

template<class T , class A , class Mm >
int OdArrayMemAlloc< T, A, Mm >::growLength ( ) const
inline

Returns the grow length of this Array object.

Definition at line 493 of file OdArrayMemAlloc.h.

◆ insert() [1/3]

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

Inserts range of elements into this Array object.

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

Definition at line 447 of file OdArrayMemAlloc.h.

◆ insert() [2/3]

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

Inserts an elementinto this Array object.

Parameters
before[in] Position where first element is to 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.

Definition at line 234 of file OdArrayMemAlloc.h.

◆ insert() [3/3]

template<class T , class A , class Mm >
iterator OdArrayMemAlloc< T, A, Mm >::insert ( iterator  before,
size_type  numElements,
const T &  value 
)
inline

Inserts number of elements into this Array object.

Parameters
before[in] Position where first element is to be inserted.
numElements[in] Number of elements to insert.
value[in] Value to insert.
Remarks
The range of elements may be from another Array object.

Definition at line 414 of file OdArrayMemAlloc.h.

◆ insertAt()

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

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

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

Elements starting at arrayIndex will have their indices incremented.

Returns a reference to this Array object.

Definition at line 707 of file OdArrayMemAlloc.h.

◆ isEmpty()

template<class T , class A , class Mm >
bool OdArrayMemAlloc< T, A, Mm >::isEmpty ( ) const
inline

Returns true if and only if this Array is empty.

Definition at line 478 of file OdArrayMemAlloc.h.

◆ last() [1/2]

template<class T , class A , class Mm >
T & OdArrayMemAlloc< T, A, Mm >::last ( )
inline

Returns the last element of this Array object.

Definition at line 560 of file OdArrayMemAlloc.h.

◆ last() [2/2]

template<class T , class A , class Mm >
const T & OdArrayMemAlloc< T, A, Mm >::last ( ) const
inline

Returns the last element of this Array object.

Definition at line 564 of file OdArrayMemAlloc.h.

◆ length()

template<class T , class A , class Mm >
size_type OdArrayMemAlloc< T, A, Mm >::length ( ) const
inline

Returns the number of elements in this Array object.

Definition at line 473 of file OdArrayMemAlloc.h.

◆ logicalLength()

template<class T , class A , class Mm >
size_type OdArrayMemAlloc< T, A, Mm >::logicalLength ( ) const
inline

Returns the logical length of this Array object.

Definition at line 483 of file OdArrayMemAlloc.h.

◆ operator=()

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

Definition at line 636 of file OdArrayMemAlloc.h.

◆ operator==()

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

Definition at line 646 of file OdArrayMemAlloc.h.

◆ operator[]() [1/2]

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

Definition at line 515 of file OdArrayMemAlloc.h.

◆ operator[]() [2/2]

template<class T , class A , class Mm >
const T & OdArrayMemAlloc< T, A, Mm >::operator[] ( size_type  index) const
inline
Remarks
For convenient access to the data.

Definition at line 513 of file OdArrayMemAlloc.h.

◆ physicalLength()

template<class T , class A , class Mm >
size_type OdArrayMemAlloc< T, A, Mm >::physicalLength ( ) const
inline

Returns the physical length of this Array object.

Definition at line 488 of file OdArrayMemAlloc.h.

◆ push_back()

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

Appends an element to the end of this Array object.

Definition at line 401 of file OdArrayMemAlloc.h.

◆ remove()

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

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

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

Returns true if and only if an element was removed.

Definition at line 911 of file OdArrayMemAlloc.h.

◆ removeAt()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::removeAt ( size_type  arrayIndex)
inline

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

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

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

Returns a reference to this Array object.

Definition at line 744 of file OdArrayMemAlloc.h.

◆ removeFirst()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::removeFirst ( )
inline

Removes the first element in this Array object.

Definition at line 586 of file OdArrayMemAlloc.h.

◆ removeLast()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::removeLast ( )
inline

Removes the last element in this Array object.

Definition at line 591 of file OdArrayMemAlloc.h.

◆ removeSubArray()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< 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 770 of file OdArrayMemAlloc.h.

◆ reserve()

template<class T , class A , class Mm >
void OdArrayMemAlloc< 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 345 of file OdArrayMemAlloc.h.

◆ resize() [1/2]

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

Specifies the logical length for this Array object.

Parameters
logicalLength[in] Logical length.

Definition at line 299 of file OdArrayMemAlloc.h.

◆ resize() [2/2]

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

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.

Definition at line 268 of file OdArrayMemAlloc.h.

◆ reverse()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::reverse ( )
inline

Reverses the order of the elements in this Array object.

Definition at line 857 of file OdArrayMemAlloc.h.

◆ setAll()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< 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 667 of file OdArrayMemAlloc.h.

◆ setAt()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::setAt ( size_type  arrayIndex,
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 536 of file OdArrayMemAlloc.h.

◆ setGrowLength()

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

Sets the grow length of this Array object.

Parameters
growLength[in] Grow length.

Definition at line 597 of file OdArrayMemAlloc.h.

◆ setLogicalLength()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::setLogicalLength ( size_type  logLength)
inline

Sets the logical length of this Array object.

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

Definition at line 827 of file OdArrayMemAlloc.h.

◆ setPhysicalLength()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< T, A, Mm >::setPhysicalLength ( size_type  physLength)
inline

Sets the physical length of this Array object.

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

Definition at line 840 of file OdArrayMemAlloc.h.

◆ size()

template<class T , class A , class Mm >
size_type OdArrayMemAlloc< T, A, Mm >::size ( ) const
inline

Returns the logical length of this Array object.

Definition at line 327 of file OdArrayMemAlloc.h.

◆ swap()

template<class T , class A , class Mm >
OdArrayMemAlloc & OdArrayMemAlloc< 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 884 of file OdArrayMemAlloc.h.

Friends And Related Function Documentation

◆ reallocator

template<class T , class A , class Mm >
friend class reallocator
friend

Definition at line 148 of file OdArrayMemAlloc.h.


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