#include <tables.h>
Public Types | |
enum | EGrowthRate { GROWTH_RATE = 4 } |
The chunk size by which the array is grown. More... | |
Public Methods | |
VectorOfPointersToPatternEntry (int32_t initialSize = 0) | |
Creates a vector that contains elements of PointerToPatternEntry. More... | |
VectorOfPointersToPatternEntry (const VectorOfPointersToPatternEntry& that) | |
Copy constructor. | |
~VectorOfPointersToPatternEntry () | |
Destructor. | |
const VectorOfPointersToPatternEntry& | operator= (const VectorOfPointersToPatternEntry& that) |
Assignment operator. | |
PointerToPatternEntry | operator[] (int32_t index) |
Return a modifiable smart-pointer to the contraction table at the given index. More... | |
PointerToPatternEntry | at (int32_t index) |
PatternEntry* | operator[] (int32_t index) const |
Return a pointer to the EntryPair at the given index. More... | |
PatternEntry* | at (int32_t index) const |
void | atPut ( int32_t index, PatternEntry* value) |
Sets the element at the specified index to a different value. More... | |
void | atInsert ( int32_t index, PatternEntry* value) |
Inserts a value at the specified index, sliding the rest of the elements in the array over to make room. More... | |
PatternEntry* | orphanAt (int32_t index) |
"Orphan" the pointer at the specified index. More... | |
void | clear (void) |
Remove all elements from the vector. | |
int32_t | size (void) const |
Returns the number of elements in the vector. More... | |
int32_t | indexOf (const PatternEntry* value) const |
If the specified value exists in the vector, return its index. More... | |
int32_t | lastIndexOf (const PatternEntry* value) const |
Return the index of the last occurance of value in the vector, or -1 if the vector doesn't contain value. | |
UBool | isBogus (void) const |
Checks if this vector object is valid. More... |
That is, once a value is placed an element of the vector, the vector is considered to own it and is responsible for disposing it. This will happen both when the element is changed using atPut() or through an PointerTo****, and when the vector itself is disposed.
WARNING: The caller must be careful to avoid holding onto any dangling references after the vector is disposed, and the caller must also be careful not to put the same value into more than one element in the vector (unless the value is NULL).
As with VectorOf***>, the vector grows as necessary to accommodate all elements, the size is one plus the index of the highest element that's been set, and any elements below the highest element that aren't explicitly initialized are initialized to NULL.
Definition at line 917 of file tables.h.
|
The chunk size by which the array is grown. This probably shouldn't be in the API |
|
Creates a vector that contains elements of PointerToPatternEntry.
|
|
Copy constructor.
|
|
Destructor.
|
|
|
|
|
|
Inserts a value at the specified index, sliding the rest of the elements in the array over to make room.
|
|
Sets the element at the specified index to a different value. If there was aready an object stored at this index, it is deleted.
|
|
Remove all elements from the vector.
|
|
If the specified value exists in the vector, return its index. If not, return -1. |
|
Checks if this vector object is valid.
|
|
Return the index of the last occurance of value in the vector, or -1 if the vector doesn't contain value.
|
|
Assignment operator.
|
|
Return a pointer to the EntryPair at the given index. The pointer itself cannot be modified, but the elements it points to may: const VectorOfPointersToPatternEntryfoo = ....; foo[5] = ....; // NOT ALLOWED foo[5]->getStrength(); // okThis does not do range-checking; an invalid index may cause a crash.
|
|
Return a modifiable smart-pointer to the contraction table at the given index. Assigning to this smart pointer will work, e.g. VectorOfPointersToPatternEntry foo = ....; foo[5] = ...;This does range-checking; access to elements beyond the end of the array will cause the array to grow. |
|
"Orphan" the pointer at the specified index. The array will no longer contain a reference to the object, and the caller is now responsible for deleting its storage. |
|
Returns the number of elements in the vector.
|