|
Base Module
VST 3.6.6
SDK for developing VST Plug-in
|
Template array base class. More...
#include <tarray.h>
Inheritance diagram for TArrayBase< T >:Public Member Functions | |
| TArrayBase (int32 initSize=0, int32 delta=kDefaultDelta) | |
| ~TArrayBase () | |
| TArrayBase< T > & | operator= (const TArrayBase< T > &) |
| void | delta (int32 d) |
| Set delta value. More... | |
| int32 | delta () const |
| Get delta value. More... | |
| void | enableExponentialGroth (bool state) |
| Instead of using delta, always double the array size. More... | |
| bool | hasExponentialGroth () const |
| bool | resize (int32 newSize) |
| Resize the array. More... | |
| virtual int32 | total () const |
| Return number of items. More... | |
| virtual bool | isEmpty () const |
| Is container empty? More... | |
| virtual bool | add (const T &) |
| Add item to container. More... | |
| virtual bool | remove (const T &) |
| Remove equal item. More... | |
| virtual bool | remove (const TIterator< T > &) |
| Remove item at current iterator position. More... | |
| virtual bool | removeAt (int32 index) |
| Remove item at given index. More... | |
| virtual void | removeAll () |
| Remove all items from list. More... | |
| bool | removeRange (int32 from, int32 to) |
| Remove items from index 'from' to index 'to'. More... | |
| virtual T & | at (int32) const |
| Get item at index. More... | |
| virtual T & | lookup (const T &item) const |
| Searches for the item equal to the specified item in the list and returns the first occurrence. More... | |
| virtual bool | contains (const T &item) const |
| See if container has equal item. More... | |
| virtual int32 | occurrences (const T &item) const |
| Count occurrences of equal items. More... | |
| virtual TIterator< T > * | newIterator () const |
| Create container iterator instance. More... | |
| virtual int32 | shouldGo (const T &item) const =0 |
| Get index for potential item. More... | |
| virtual int32 | index (const T &item) const =0 |
| Get index of item. More... | |
| T & | first () const |
| T & | last () const |
Public Member Functions inherited from TContainer< T > | |
| TContainer () | |
| TContainer (const TContainer< T > &) | |
| virtual | ~TContainer () |
| bool | operator== (const TContainer< T > &) const |
| bool | operator!= (const TContainer< T > &) const |
| virtual TContainer< T > * | newInstance () const =0 |
| Create a copy of this container. More... | |
| T & | operator[] (int32) const |
| "[]" indexing operator returns the item at the specified index. More... | |
| virtual int32 | size () const |
| Returns the container size. More... | |
| TContainer< T > * | lookupAll (const T &item) const |
| Allocate and returns a container with all items in this container equal to the specified item. More... | |
| bool | addAllFrom (const TContainer< T > &container) |
| Adds all the items from the specified container to this container. More... | |
| bool | addNewFrom (const TContainer< T > &container) |
| Adds the items from the specified container to this container that are not in this container already. More... | |
| T & | error () const |
| Access error object. More... | |
Static Public Attributes | |
| static const int32 | kDefaultDelta = 10 |
| static const int32 | kExponentialDelta = -1 |
Protected Member Functions | |
| int32 | indexSorted (const T &) const |
| int32 | indexUnsorted (const T &) const |
| int32 | shouldGoSorted (const T &) const |
| Get index for potential item. More... | |
| int32 | shouldGoUnsorted (const T &) const |
| Get index for potential item. More... | |
| void | doQuickSort () |
| bool | doInsertAt (int32 index, const T &) |
| Insert item at index. More... | |
Protected Member Functions inherited from TContainer< T > | |
| void | copy (const TContainer< T > &container) |
| Internal copy method. Copies the contents of the specified container into this container. More... | |
Static Protected Member Functions | |
| static int | cmpData (const void *, const void *) |
| Quick sort compare function. More... | |
Protected Attributes | |
| int32 | _delta |
| Delta value. More... | |
| int32 | _total |
| Number of items. More... | |
| T * | _entries |
| Array of "T" pointers. More... | |
Protected Attributes inherited from TContainer< T > | |
| T | errorObject |
| Object used as return value when methods returning a T& fail. More... | |
| int32 | _size |
| Container size. More... | |
Template array base class.
| TArrayBase | ( | int32 | sz = 0, |
| int32 | dt = kDefaultDelta |
||
| ) |
"TArrayBase" is the default constructor.
| sz | : initial size of array |
| dt | : initial delta value for automatic growing. |
| ~TArrayBase | ( | ) |
| TArrayBase< T > & operator= | ( | const TArrayBase< T > & | arr | ) |
"=" assignment operator copies the specified array into this array.
| void delta | ( | int32 | dt | ) |
Set delta value.
"delta" sets a new delta value for automatic growing.
| int32 delta | ( | ) | const |
Get delta value.
"delta" returns the current delta value.
|
inline |
Instead of using delta, always double the array size.
|
inline |
| bool resize | ( | int32 | newsize | ) |
Resize the array.
"resize" resizes the storage allocated for this array.
|
virtual |
Return number of items.
"total" returns the number of items in this array.
Reimplemented from TContainer< T >.
|
virtual |
Is container empty?
"isEmpty" returns whether or not this array has any items in it.
Reimplemented from TContainer< T >.
|
virtual |
|
virtual |
Remove equal item.
"remove" removes the first occurrence of an item equal to the specified item in the array.
Implements TContainer< T >.
|
virtual |
Remove item at current iterator position.
"remove" removes the item pointed to by the specified iterator.
Implements TContainer< T >.
|
virtual |
Remove item at given index.
"removeAt" removes the item at the specified index.
Implements TContainer< T >.
|
virtual |
Remove all items from list.
"removeAll" sets the number of items in this array to zero.
Implements TContainer< T >.
| bool removeRange | ( | int32 | from, |
| int32 | to | ||
| ) |
Remove items from index 'from' to index 'to'.
"removeRange" removes all items in the specified index range including the index boundaries
| from | : start index |
| to | end index |
|
virtual |
Get item at index.
"at" returns the item at the specified index.
Reimplemented from TContainer< T >.
|
virtual |
Searches for the item equal to the specified item in the list and returns the first occurrence.
"lookup" returns the first occurrence of the item equal to the specified item in the array.
Reimplemented from TContainer< T >.
|
virtual |
See if container has equal item.
"contains" checks the array for an item equal to the input.
Reimplemented from TContainer< T >.
|
virtual |
Count occurrences of equal items.
"occurrences" counts the number of occurrences of items equal to the specified item.
Reimplemented from TContainer< T >.
|
virtual |
Create container iterator instance.
"newIterator" creates and returns a new array iterator.
Implements TContainer< T >.
|
pure virtual |
Get index for potential item.
Implemented in TSortableArray< T >, TOrderedArray< T >, TArray< T >, TArray< Rect >, TArray< TAssociation< K, O > >, TArray< Block >, TArray< void * >, and TArray< FObjectBlock * >.
|
pure virtual |
Get index of item.
Implemented in TSortableArray< T >, TOrderedArray< T >, TArray< T >, TArray< Rect >, TArray< TAssociation< K, O > >, TArray< Block >, TArray< void * >, and TArray< FObjectBlock * >.
|
inline |
|
inline |
|
staticprotected |
Quick sort compare function.
"cmpData" is called by the standard library qsort function for sorting the array into ascending order.
|
protected |
"indexSorted" returns the index of the first occurrence of an item equal to the specified item.
|
protected |
"indexUnsorted" returns the index of the first occurrence of an item equal to the specified item.
|
protected |
Get index for potential item.
"shouldGoSorted" returns the index for a potential insert/add operation using ">", "<", and "==" operators
|
protected |
Get index for potential item.
"shouldGoUnsorted" returns the index for a potential insert/add operation
|
protected |
"quickSort" uses the standard library to perform a quick sort on this array.
|
protected |
Insert item at index.
inserts the specified item at the specified index shifting the other items to make room.
|
static |
|
static |
|
protected |
Delta value.
|
protected |
Number of items.
|
protected |
Array of "T" pointers.