ON_ObjectArray< T > Class Template Reference

ON_Object array is used to store lists of classes that are derived from ON_Object. It differs from ON_ClassArray in that the virtual ON_Object::MemoryRelocate function is called when growing the dynamic array requires changing the location of the memory buffer used to store the elements in the array. More...

#include <opennurbs_array.h>

Inheritance diagram for ON_ObjectArray< T >:
ON_ClassArray< T >

Public Member Functions

 ON_ObjectArray ()
 Class ON_ObjectArray<> More...
 
 ON_ObjectArray (size_t)
 
 ON_ObjectArray (const ON_ObjectArray< T > &)
 
 ~ON_ObjectArray ()
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
bool HeapSort (int(*)(const T *, const T *))
 
ON_ObjectArray< T > & operator= (const ON_ObjectArray< T > &)
 
bool QuickSort (int(*)(const T *, const T *))
 Sorts the array using the heap sort algorithm. More...
 
T * Realloc (T *, int)
 low level memory managment /////////////////////////////////////// More...
 
- Public Member Functions inherited from ON_ClassArray< T >
 ON_ClassArray () ON_NOEXCEPT
 construction //////////////////////////////////////////////////////// More...
 
 ON_ClassArray (size_t)
 
 ON_ClassArray (const ON_ClassArray< T > &)
 Copy constructor. More...
 
virtual ~ON_ClassArray ()
 
void Append (const T &)
 
void Append (int, const T *)
 
T & AppendNew ()
 array operations //////////////////////////////////////////////////// More...
 
T * Array ()
 
const T * Array () const
 
T * At (int)
 At(index) returns nullptr if index < 0 or index >= count. More...
 
T * At (unsigned int)
 
T * At (ON__INT64)
 
T * At (ON__UINT64)
 
const T * At (int) const
 
const T * At (unsigned int) const
 
const T * At (ON__INT64) const
 
const T * At (ON__UINT64) const
 
int BinarySearch (const T *, int(*)(const T *, const T *)) const
 
int BinarySearch (const T *, int(*)(const T *, const T *), int) const
 
int Capacity () const
 
int Count () const
 query /////////////////////////////////////////////////////////////// More...
 
void Destroy ()
 
void EmergencyDestroy (void)
 emergency bailout /////////////////////////////////////////////////// More...
 
void Empty ()
 
T * First ()
 
const T * First () const
 
void Insert (int, const T &)
 Insert called with a reference uses operator =. More...
 
T * KeepArray ()
 
T * Last ()
 
const T * Last () const
 
int NewCapacity () const
 
 operator const T * () const
 
 operator T* ()
 
ON_ClassArray< T > & operator= (const ON_ClassArray< T > &)
 Assignment operator. More...
 
T & operator[] (int)
 
T & operator[] (unsigned int)
 
T & operator[] (ON__INT64)
 
T & operator[] (ON__UINT64)
 
const T & operator[] (int) const
 
const T & operator[] (unsigned int) const
 
const T & operator[] (ON__INT64) const
 
const T & operator[] (ON__UINT64) const
 
bool Permute (const int *)
 
void Remove ()
 
void Remove (int)
 
T * Reserve (size_t)
 memory managment ///////////////////////////////////////////////// More...
 
void Reverse ()
 
int Search (const T *, int(*)(const T *, const T *)) const
 
void SetArray (T *)
 Do not use this version of SetArray(). Use the one that takes a pointer, count and capacity: SetArray(pointer,count,capacity) More...
 
void SetArray (T *, int, int)
 Expert user tool to set the memory used by the dyanmic array. More...
 
T * SetCapacity (size_t)
 
void SetCount (int)
 low level memory managment ////////////////////////////////////////// More...
 
void Shrink ()
 
unsigned int SizeOfArray () const
 
unsigned int SizeOfElement () const
 
bool Sort (ON::sort_algorithm sort_algorithm, int *, int(*)(const T *, const T *)) const
 Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified. More...
 
bool Sort (ON::sort_algorithm sort_algorithm, int *, int(*)(const T *, const T *, void *), void *) const
 Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified. More...
 
void Swap (int, int)
 
unsigned int UnsignedCount () const
 
void Zero ()
 

Additional Inherited Members

- Protected Member Functions inherited from ON_ClassArray< T >
void ConstructDefaultElement (T *)
 
void DestroyElement (T &)
 
void Move (int, int, int)
 implimentation ////////////////////////////////////////////////////// More...
 
- Protected Attributes inherited from ON_ClassArray< T >
T * m_a
 
int m_capacity
 
int m_count
 

Detailed Description

template<class T>
class ON_ObjectArray< T >

ON_Object array is used to store lists of classes that are derived from ON_Object. It differs from ON_ClassArray in that the virtual ON_Object::MemoryRelocate function is called when growing the dynamic array requires changing the location of the memory buffer used to store the elements in the array.

Constructor & Destructor Documentation

◆ ON_ObjectArray() [1/3]

template<class T >
ON_ObjectArray< T >::ON_ObjectArray ( )

Class ON_ObjectArray<>

◆ ~ON_ObjectArray()

template<class T >
ON_ObjectArray< T >::~ON_ObjectArray ( )

◆ ON_ObjectArray() [2/3]

template<class T >
ON_ObjectArray< T >::ON_ObjectArray ( size_t  c)

◆ ON_ObjectArray() [3/3]

template<class T>
ON_ObjectArray< T >::ON_ObjectArray ( const ON_ObjectArray< T > &  src)

Member Function Documentation

◆ DataCRC()

template<class T >
ON__UINT32 ON_ObjectArray< T >::DataCRC ( ON__UINT32  current_remainder) const

◆ HeapSort()

template<class T>
bool ON_ObjectArray< T >::HeapSort ( int(*)(const T *, const T *)  compar)
virtual

Reimplemented from ON_ClassArray< T >.

◆ operator=()

template<class T>
ON_ObjectArray< T > & ON_ObjectArray< T >::operator= ( const ON_ObjectArray< T > &  src)

◆ QuickSort()

template<class T>
bool ON_ObjectArray< T >::QuickSort ( int(*)(const T *, const T *)  compar)
virtual

Sorts the array using the heap sort algorithm.

Reimplemented from ON_ClassArray< T >.

◆ Realloc()

template<class T>
T * ON_ObjectArray< T >::Realloc ( T *  ptr,
int  capacity 
)
virtual

low level memory managment ///////////////////////////////////////

Class ON_ClassArray<>

construction ////////////////////////////////////////////////////////

Reimplemented from ON_ClassArray< T >.