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

#include <OdLinkedArray.h>

Classes

class  const_iterator
 
class  iterator
 

Public Types

typedef A::size_type size_type
 

Public Member Functions

 OdLinkedArray (OdUInt32 pageSize=0x10)
 
 ~OdLinkedArray ()
 
void reserve (size_type)
 
void clear ()
 
removeLast ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator find (const T &val)
 
const_iterator find (const T &val) const
 
bool contains (const T &val) const
 
void resize (size_type newSize)
 
iterator insert (iterator before, const T &val=T())
 
remove (iterator at)
 
void append (const T &value)
 
iterator append ()
 
T & first ()
 
const T & first () const
 
T & last ()
 
const T & last () const
 
bool empty () const
 
size_type size () const
 
void freeExtra ()
 

Detailed Description

template<class T, class A = OdObjectsAllocator<T>>
class OdLinkedArray< T, A >

This template class implements dynamic Array objects with memory pre-allocation by pages of provided size and tree-like links to neighboring elements within the ODA Platform.

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. Page Size – The number of elements of sequntually allocated memory buffers (pages) to store elements while Array automatically grows.

<group Other_Classes>

Definition at line 39 of file OdLinkedArray.h.

Member Typedef Documentation

◆ size_type

template<class T , class A = OdObjectsAllocator<T>>
typedef A::size_type OdLinkedArray< T, A >::size_type

Definition at line 42 of file OdLinkedArray.h.

Constructor & Destructor Documentation

◆ OdLinkedArray()

template<class T , class A = OdObjectsAllocator<T>>
OdLinkedArray< T, A >::OdLinkedArray ( OdUInt32  pageSize = 0x10)
inline

Constructor

Parameters
pageSize[in] Length of memory buffers which stores elements.

Definition at line 219 of file OdLinkedArray.h.

◆ ~OdLinkedArray()

template<class T , class A = OdObjectsAllocator<T>>
OdLinkedArray< T, A >::~OdLinkedArray ( )
inline

Definition at line 233 of file OdLinkedArray.h.

Member Function Documentation

◆ append() [1/2]

template<class T , class A = OdObjectsAllocator<T>>
iterator OdLinkedArray< T, A >::append ( )
inline

Appends a new uninitialized element to the end of this Array object and returns iterator, which references added element.

Definition at line 656 of file OdLinkedArray.h.

◆ append() [2/2]

template<class T , class A = OdObjectsAllocator<T>>
void OdLinkedArray< T, A >::append ( const T &  value)
inline

Appends a provided element to the end of this Array object.

Definition at line 641 of file OdLinkedArray.h.

◆ begin() [1/2]

template<class T , class A = OdObjectsAllocator<T>>
iterator OdLinkedArray< T, A >::begin ( )
inline

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

Definition at line 440 of file OdLinkedArray.h.

◆ begin() [2/2]

template<class T , class A = OdObjectsAllocator<T>>
const_iterator OdLinkedArray< T, A >::begin ( ) const
inline

Returns a const_iterator that references the first element in this Array object.

Definition at line 447 of file OdLinkedArray.h.

◆ clear()

template<class T , class A = OdObjectsAllocator<T>>
void OdLinkedArray< T, A >::clear ( )
inline

Removes all elements from this Array object.

Definition at line 246 of file OdLinkedArray.h.

◆ contains()

template<class T , class A = OdObjectsAllocator<T>>
bool OdLinkedArray< T, A >::contains ( const T &  val) const
inline

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

Parameters
val[in] Value for which to search.

Definition at line 501 of file OdLinkedArray.h.

◆ empty()

template<class T , class A = OdObjectsAllocator<T>>
bool OdLinkedArray< T, A >::empty ( ) const
inline

Returns true if and only if this Array is empty.

Definition at line 687 of file OdLinkedArray.h.

◆ end() [1/2]

template<class T , class A = OdObjectsAllocator<T>>
iterator OdLinkedArray< T, A >::end ( )
inline

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

Definition at line 454 of file OdLinkedArray.h.

◆ end() [2/2]

template<class T , class A = OdObjectsAllocator<T>>
const_iterator OdLinkedArray< T, A >::end ( ) const
inline

Returns a const_iterator that references the location after the last element in this Array object.

Definition at line 461 of file OdLinkedArray.h.

◆ find() [1/2]

template<class T , class A = OdObjectsAllocator<T>>
iterator OdLinkedArray< T, A >::find ( const T &  val)
inline

Searches the specified value inside this Array object.

Parameters
val[in] Value for which to search.
Returns
Returns an iterator to found element.

Definition at line 471 of file OdLinkedArray.h.

◆ find() [2/2]

template<class T , class A = OdObjectsAllocator<T>>
const_iterator OdLinkedArray< T, A >::find ( const T &  val) const
inline

Searches the specified value inside this Array object.

Parameters
val[in] Value for which to search.
Returns
Returns an iterator to found element.

Definition at line 487 of file OdLinkedArray.h.

◆ first() [1/2]

template<class T , class A = OdObjectsAllocator<T>>
T & OdLinkedArray< T, A >::first ( )
inline

Returns the first element of this Array object.

Definition at line 663 of file OdLinkedArray.h.

◆ first() [2/2]

template<class T , class A = OdObjectsAllocator<T>>
const T & OdLinkedArray< T, A >::first ( ) const
inline

Returns the first element of this Array object (const reference).

Definition at line 669 of file OdLinkedArray.h.

◆ freeExtra()

template<class T , class A = OdObjectsAllocator<T>>
void OdLinkedArray< T, A >::freeExtra ( )
inline

Removes excessive elements in internal buffer of this Array object.

Definition at line 713 of file OdLinkedArray.h.

◆ insert()

template<class T , class A = OdObjectsAllocator<T>>
iterator OdLinkedArray< T, A >::insert ( iterator  before,
const T &  val = T() 
)
inline

Inserts an element into this Array object.

Parameters
before[in] Position where first element is to be inserted.
val[in] Value to insert.

Definition at line 573 of file OdLinkedArray.h.

◆ last() [1/2]

template<class T , class A = OdObjectsAllocator<T>>
T & OdLinkedArray< T, A >::last ( )
inline

Returns the last element of this Array object.

Definition at line 675 of file OdLinkedArray.h.

◆ last() [2/2]

template<class T , class A = OdObjectsAllocator<T>>
const T & OdLinkedArray< T, A >::last ( ) const
inline

Returns the last element of this Array object (const reference).

Definition at line 681 of file OdLinkedArray.h.

◆ remove()

template<class T , class A = OdObjectsAllocator<T>>
T OdLinkedArray< T, A >::remove ( iterator  at)
inline

Removes the specified element from this Array object.

Parameters
at[in] Element to remove.

Definition at line 613 of file OdLinkedArray.h.

◆ removeLast()

template<class T , class A = OdObjectsAllocator<T>>
T OdLinkedArray< T, A >::removeLast ( )
inline

Removes the last element in this Array object.

Definition at line 263 of file OdLinkedArray.h.

◆ reserve()

template<class T , class A = OdObjectsAllocator<T>>
void OdLinkedArray< T, A >::reserve ( size_type  )
inline

For compatibility with other array types. Sets the physical length of this Array object to the specified reserve length if the reserve length is greater than its physical length.

Definition at line 241 of file OdLinkedArray.h.

◆ resize()

template<class T , class A = OdObjectsAllocator<T>>
void OdLinkedArray< T, A >::resize ( size_type  newSize)
inline

Specifies the logical length for this Array object.

Parameters
newSize[in] Logical length.

Definition at line 510 of file OdLinkedArray.h.

◆ size()

template<class T , class A = OdObjectsAllocator<T>>
size_type OdLinkedArray< T, A >::size ( ) const
inline

Returns the logical length of this Array object.

Definition at line 693 of file OdLinkedArray.h.


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