UT_PtrArray< utPtr > Class Template Reference

#include <UT_PtrArray.h>

List of all members.

Public Types

typedef int(* Comparator )(const utPtr *, const utPtr *)

Public Member Functions

 UT_PtrArray (unsigned int sz=0)
virtual ~UT_PtrArray ()
 UT_PtrArray (const UT_PtrArray< utPtr > &a)
void swap (UT_PtrArray< utPtr > &other)
unsigned int append (void)
unsigned int append (utPtr t)
unsigned int append (utPtr t, unsigned short checkForDup)
unsigned int insert (unsigned idx)
unsigned int insert (utPtr t, unsigned index)
unsigned int sortedInsert (utPtr t, Comparator compare)
unsigned int uniqueSortedInsert (utPtr t, Comparator compare)
bool hasSortedSubset (UT_PtrArray< utPtr > const &other, Comparator compare=(Comparator)&UTcomparePointers) const
void sortedIntersection (UT_PtrArray< utPtr > const &other, Comparator compare=(Comparator)&UTcomparePointers)
void sortedIntersection (UT_PtrArray< utPtr > const &other, UT_PtrArray< utPtr > &result, Comparator compare=(Comparator)&UTcomparePointers) const
void sortedUnion (UT_PtrArray< utPtr > const &other, Comparator compare=(Comparator)&UTcomparePointers)
void sortedUnion (UT_PtrArray< utPtr > const &other, UT_PtrArray< utPtr > &result, Comparator compare=(Comparator)&UTcomparePointers) const
unsigned int uniqueSortedInsert (utPtr t)
unsigned int heapPush (utPtr t, Comparator compare)
utPtr heapPop (Comparator compare)
utPtr heapMax () const
unsigned int concat (const UT_PtrArray< utPtr > &a)
unsigned int multipleInsert (unsigned int index, unsigned int count)
unsigned int insertAt (utPtr t, unsigned int index)
int remove (utPtr t)
int remove (unsigned int index)
int removeIndex (unsigned int index)
utPtr removeLast ()
int removeZeros ()
void sortAndRemoveDuplicates ()
int shift (unsigned int srcIdx, unsigned int destIdx, unsigned int howMany)
void move (int srcIdx, int destIdx, int howMany)
void collapse ()
void cycle (int howMany)
void reverse ()
int find (utPtr t, unsigned int s=0) const
int find (utPtr t, Comparator compare) const
int findString (const char *str) const
void sort (Comparator compare=(Comparator)&UTcomparePointers)
template<typename ComparatorBool >
void stableSort (ComparatorBool compare)
void resize (unsigned int sz, unsigned short copyFlag=1)
void resizeIfNeeded (uint sz, bool copyFlag=true)
uint capacity (void) const
int64 getMemoryUsage () const
uint entries (void) const
bool isEmpty (void) const
void entries (unsigned int ne)
void clear ()
UT_PtrArray< utPtr > & operator= (const UT_PtrArray< utPtr > &a)
int operator== (const UT_PtrArray< utPtr > &a) const
int operator!= (const UT_PtrArray< utPtr > &a) const
int isEqual (const UT_PtrArray< utPtr > &a, int(*compare)(const void *t1, const void *t2)) const
utPtr & operator() (unsigned int i)
utPtr operator() (unsigned int i) const
utPtr & operator[] (unsigned int i)
utPtr operator[] (unsigned int i) const
utPtr & last ()
utPtr last () const
unsigned int apply (int(*fcn)(utPtr t, void *d), void *d)
UT_PtrArrayRawgetRawArray ()
const UT_PtrArrayRawgetRawArray () const
utPtr * getArray (void) const

Protected Member Functions

void setSize (unsigned int sz)


Detailed Description

template<typename utPtr>
class UT_PtrArray< utPtr >

Examples:

FS/FS_Background.C, POP/POP_CircleForce.C, POP/POP_CircleForce.h, SOP/SOP_BrushHairLen.C, and SOP/SOP_BrushHairLen.h.

Definition at line 39 of file UT_PtrArray.h.


Member Typedef Documentation

template<typename utPtr>
typedef int(* UT_PtrArray< utPtr >::Comparator)(const utPtr *, const utPtr *)

Definition at line 44 of file UT_PtrArray.h.


Constructor & Destructor Documentation

template<typename utPtr>
UT_PtrArray< utPtr >::UT_PtrArray ( unsigned int  sz = 0  )  [inline, explicit]

Definition at line 49 of file UT_PtrArray.h.

template<typename utPtr>
virtual UT_PtrArray< utPtr >::~UT_PtrArray (  )  [inline, virtual]

Definition at line 53 of file UT_PtrArray.h.

template<typename utPtr>
UT_PtrArray< utPtr >::UT_PtrArray ( const UT_PtrArray< utPtr > &  a  )  [inline]

Definition at line 58 of file UT_PtrArray.h.


Member Function Documentation

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::append ( utPtr  t,
unsigned short  checkForDup 
) [inline]

Definition at line 76 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::append ( utPtr  t  )  [inline]

Definition at line 74 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::append ( void   )  [inline]

Definition at line 73 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::apply ( int(*)(utPtr t, void *d)  fcn,
void *  d 
) [inline]

Definition at line 378 of file UT_PtrArray.h.

template<typename utPtr>
uint UT_PtrArray< utPtr >::capacity ( void   )  const [inline]

Definition at line 307 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::clear ( void   )  [inline]

Definition at line 315 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::collapse (  )  [inline]

Definition at line 229 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::concat ( const UT_PtrArray< utPtr > &  a  )  [inline]

Definition at line 174 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::cycle ( int  howMany  )  [inline]

Definition at line 232 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::entries ( unsigned int  ne  )  [inline]

Definition at line 313 of file UT_PtrArray.h.

template<typename utPtr>
uint UT_PtrArray< utPtr >::entries ( void   )  const [inline]

Definition at line 309 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::find ( utPtr  t,
Comparator  compare 
) const [inline]

Definition at line 245 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::find ( utPtr  t,
unsigned int  s = 0 
) const [inline]

Definition at line 241 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::findString ( const char *  str  )  const [inline]

Definition at line 255 of file UT_PtrArray.h.

template<typename utPtr>
utPtr* UT_PtrArray< utPtr >::getArray ( void   )  const [inline]

Definition at line 385 of file UT_PtrArray.h.

template<typename utPtr>
int64 UT_PtrArray< utPtr >::getMemoryUsage ( void   )  const [inline]

Definition at line 308 of file UT_PtrArray.h.

template<typename utPtr>
const UT_PtrArrayRaw& UT_PtrArray< utPtr >::getRawArray (  )  const [inline]

Definition at line 384 of file UT_PtrArray.h.

template<typename utPtr>
UT_PtrArrayRaw& UT_PtrArray< utPtr >::getRawArray (  )  [inline]

Definition at line 383 of file UT_PtrArray.h.

template<typename utPtr>
bool UT_PtrArray< utPtr >::hasSortedSubset ( UT_PtrArray< utPtr > const &  other,
Comparator  compare = (Comparator)&UTcomparePointers 
) const [inline]

Definition at line 95 of file UT_PtrArray.h.

template<typename utPtr>
utPtr UT_PtrArray< utPtr >::heapMax (  )  const [inline]

Definition at line 169 of file UT_PtrArray.h.

template<typename utPtr>
utPtr UT_PtrArray< utPtr >::heapPop ( Comparator  compare  )  [inline]

Definition at line 162 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::heapPush ( utPtr  t,
Comparator  compare 
) [inline]

Definition at line 155 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::insert ( utPtr  t,
unsigned  index 
) [inline]

Definition at line 80 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::insert ( unsigned  idx  )  [inline]

Definition at line 79 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::insertAt ( utPtr  t,
unsigned int  index 
) [inline]

Definition at line 188 of file UT_PtrArray.h.

template<typename utPtr>
bool UT_PtrArray< utPtr >::isEmpty ( void   )  const [inline]

Definition at line 310 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::isEqual ( const UT_PtrArray< utPtr > &  a,
int(*)(const void *t1, const void *t2)  compare 
) const [inline]

Definition at line 339 of file UT_PtrArray.h.

template<typename utPtr>
utPtr UT_PtrArray< utPtr >::last (  )  const [inline]

Definition at line 369 of file UT_PtrArray.h.

template<typename utPtr>
utPtr& UT_PtrArray< utPtr >::last (  )  [inline]

Definition at line 365 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::move ( int  srcIdx,
int  destIdx,
int  howMany 
) [inline]

Definition at line 222 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::multipleInsert ( unsigned int  index,
unsigned int  count 
) [inline]

Definition at line 181 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::operator!= ( const UT_PtrArray< utPtr > &  a  )  const [inline]

Definition at line 335 of file UT_PtrArray.h.

template<typename utPtr>
utPtr UT_PtrArray< utPtr >::operator() ( unsigned int  i  )  const [inline]

Definition at line 352 of file UT_PtrArray.h.

template<typename utPtr>
utPtr& UT_PtrArray< utPtr >::operator() ( unsigned int  i  )  [inline]

Definition at line 348 of file UT_PtrArray.h.

template<typename utPtr>
UT_PtrArray<utPtr>& UT_PtrArray< utPtr >::operator= ( const UT_PtrArray< utPtr > &  a  )  [inline]

Definition at line 320 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::operator== ( const UT_PtrArray< utPtr > &  a  )  const [inline]

Definition at line 331 of file UT_PtrArray.h.

template<typename utPtr>
utPtr UT_PtrArray< utPtr >::operator[] ( unsigned int  i  )  const [inline]

Definition at line 360 of file UT_PtrArray.h.

template<typename utPtr>
utPtr& UT_PtrArray< utPtr >::operator[] ( unsigned int  i  )  [inline]

Definition at line 356 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::remove ( unsigned int  index  )  [inline]

Definition at line 199 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::remove ( utPtr  t  )  [inline]

Definition at line 198 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::removeIndex ( unsigned int  index  )  [inline]

Definition at line 200 of file UT_PtrArray.h.

template<typename utPtr>
utPtr UT_PtrArray< utPtr >::removeLast ( void   )  [inline]

Definition at line 201 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::removeZeros (  )  [inline]

Definition at line 206 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::resize ( unsigned int  sz,
unsigned short  copyFlag = 1 
) [inline]

Definition at line 295 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::resizeIfNeeded ( uint  sz,
bool  copyFlag = true 
) [inline]

Definition at line 299 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::reverse ( void   )  [inline]

Definition at line 235 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::setSize ( unsigned int  sz  )  [inline, protected]

Definition at line 390 of file UT_PtrArray.h.

template<typename utPtr>
int UT_PtrArray< utPtr >::shift ( unsigned int  srcIdx,
unsigned int  destIdx,
unsigned int  howMany 
) [inline]

Definition at line 214 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::sort ( Comparator  compare = (Comparator)&UTcomparePointers  )  [inline]

Definition at line 263 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::sortAndRemoveDuplicates (  )  [inline]

Definition at line 209 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::sortedInsert ( utPtr  t,
Comparator  compare 
) [inline]

Definition at line 85 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::sortedIntersection ( UT_PtrArray< utPtr > const &  other,
UT_PtrArray< utPtr > &  result,
Comparator  compare = (Comparator)&UTcomparePointers 
) const [inline]

Definition at line 113 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::sortedIntersection ( UT_PtrArray< utPtr > const &  other,
Comparator  compare = (Comparator)&UTcomparePointers 
) [inline]

Definition at line 104 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::sortedUnion ( UT_PtrArray< utPtr > const &  other,
UT_PtrArray< utPtr > &  result,
Comparator  compare = (Comparator)&UTcomparePointers 
) const [inline]

Definition at line 131 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::sortedUnion ( UT_PtrArray< utPtr > const &  other,
Comparator  compare = (Comparator)&UTcomparePointers 
) [inline]

Definition at line 123 of file UT_PtrArray.h.

template<typename utPtr>
template<typename ComparatorBool >
void UT_PtrArray< utPtr >::stableSort ( ComparatorBool  compare  )  [inline]

stableSort is both stable, so keeps equal elements in the same order (note this is very useful for compatibility between compilers) and templated. Either use a bool sort function or make a utility class with bool operator()(const utPtr *a, const utPtr *b) the utility class lets you bind data to avoid globals. The comparator returns true if a must occur before b in the list. For sorting ascending, this is a less than operation.

Definition at line 276 of file UT_PtrArray.h.

template<typename utPtr>
void UT_PtrArray< utPtr >::swap ( UT_PtrArray< utPtr > &  other  )  [inline]

Definition at line 60 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::uniqueSortedInsert ( utPtr  t  )  [inline]

Definition at line 148 of file UT_PtrArray.h.

template<typename utPtr>
unsigned int UT_PtrArray< utPtr >::uniqueSortedInsert ( utPtr  t,
Comparator  compare 
) [inline]

Definition at line 90 of file UT_PtrArray.h.


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

Generated on Mon Jan 28 00:49:12 2013 for HDK by  doxygen 1.5.9