GCC Middle and Back End API Reference
|
#include <vec.h>
Public Types | |
using | pop_ret_type |
Public Member Functions | |
vec ()=default | |
vec (const vec &)=default | |
vec (vnull) | |
~vec ()=default | |
vec & | operator= (const vec &)=default |
template<size_t N> | |
vec (auto_vec< T, N > &)=delete | |
template<size_t N> | |
void | operator= (auto_vec< T, N > &)=delete |
void | create (unsigned nelems CXX_MEM_STAT_INFO) |
void | release (void) |
bool | exists (void) const |
bool | is_empty (void) const |
unsigned | allocated (void) const |
unsigned | length (void) const |
T * | address (void) |
const T * | address (void) const |
T * | begin () |
const T * | begin () const |
T * | end () |
const T * | end () const |
const T & | operator[] (unsigned ix) const |
bool | operator!= (const vec &other) const |
bool | operator== (const vec &other) const |
T & | operator[] (unsigned ix) |
T & | last (void) |
bool | space (int nelems) const |
bool | iterate (unsigned ix, T *p) const |
bool | iterate (unsigned ix, T **p) const |
vec | copy (ALONE_CXX_MEM_STAT_INFO) const |
bool | reserve (unsigned, bool=false CXX_MEM_STAT_INFO) |
bool | reserve_exact (unsigned CXX_MEM_STAT_INFO) |
void | splice (const vec &) |
void | safe_splice (const vec &CXX_MEM_STAT_INFO) |
T * | quick_push (const T &) |
T * | safe_push (const T &CXX_MEM_STAT_INFO) |
pop_ret_type | pop (void) |
void | truncate (unsigned) |
void | safe_grow (unsigned, bool=false CXX_MEM_STAT_INFO) |
void | safe_grow_cleared (unsigned, bool=false CXX_MEM_STAT_INFO) |
void | quick_grow (unsigned) |
void | quick_grow_cleared (unsigned) |
void | quick_insert (unsigned, const T &) |
void | safe_insert (unsigned, const T &CXX_MEM_STAT_INFO) |
void | ordered_remove (unsigned) |
void | unordered_remove (unsigned) |
void | block_remove (unsigned, unsigned) |
void | qsort (int(*)(const void *, const void *)) |
void | sort (int(*)(const void *, const void *, void *), void *) |
void | stablesort (int(*)(const void *, const void *, void *), void *) |
T * | bsearch (const void *key, int(*compar)(const void *, const void *)) |
T * | bsearch (const void *key, int(*compar)(const void *, const void *, void *), void *) |
unsigned | lower_bound (T, bool(*)(const T &, const T &)) const |
bool | contains (const T &search) const |
void | reverse (void) |
bool | using_auto_storage () const |
Data Fields | |
vec< T, va_heap, vl_embed > * | m_vec |
|
delete |
References NULL.
|
inline |
Remove LEN elements starting at the IXth. Ordering is retained. This is an O(N) operation due to memmove.
|
inline |
Search the contents of the sorted vector with a binary search. CMP is the comparison function to pass to bsearch.
References NULL.
|
inline |
Search the contents of the sorted vector with a binary search. CMP is the comparison function to pass to bsearch.
References NULL.
Return true if SEARCH is an element of V. Note that this is O(N) in the size of the vector and so should be used with care.
|
inline |
Return a copy of this vector.
References ALONE_PASS_MEM_STAT.
|
inline |
Create the internal vector and reserve NELEMS for it. This is exactly like vec::reserve, but the internal vector is unconditionally allocated from scratch. The old one, if it existed, is lost.
References NULL, and PASS_MEM_STAT.
|
inline |
Return iteration condition and update *PTR to point to the IX'th element of this vector. Use this to iterate over the elements of a vector as follows, for (ix = 0; v->iterate (ix, &ptr); ix++) continue; This variant is for vectors of objects.
Return iteration condition and update PTR to point to the IX'th element of this vector. Use this to iterate over the elements of a vector as follows, for (ix = 0; v.iterate (ix, &ptr); ix++) continue;
|
inline |
Find and return the first position in which OBJ could be inserted without changing the ordering of this vector. LESSTHAN is a function that returns true if the first argument is strictly less than the second.
|
inline |
|
delete |
|
default |
|
inline |
Remove an element from the IXth position of this vector. Ordering of remaining elements is preserved. This is an O(N) operation due to a memmove.
|
inline |
Pop and return a reference to the last element off the end of the vector. If T has non-trivial destructor, this method just pops last element and returns void.
|
inline |
Sort the contents of this vector with qsort. CMP is the comparison function to pass to qsort.
Same as vec::safe_grow but without reallocation of the internal vector. If the vector cannot be extended, a runtime assertion will be triggered.
References gcc_checking_assert.
Same as vec::quick_grow_cleared but without reallocation of the internal vector. If the vector cannot be extended, a runtime assertion will be triggered.
References gcc_checking_assert.
|
inline |
Insert an element, OBJ, at the IXth position of this vector. There must be sufficient space.
Push OBJ (a new element) onto the end of the vector. There must be sufficient space in the vector. Return a pointer to the slot where OBJ was inserted.
Free the memory occupied by the embedded vector.
References va_heap::release().
|
inline |
Ensure that the vector has at least RESERVE slots available (if EXACT is false), or exactly RESERVE slots available (if EXACT is true). This may create additional headroom if EXACT is false. Note that this can cause the embedded vector to be reallocated. Returns true iff reallocation actually occurred.
References NULL, PASS_MEM_STAT, va_heap::reserve(), and vec_copy_construct().
|
inline |
Ensure that this vector has exactly NELEMS slots available. This will not create additional headroom. Note this can cause the embedded vector to be reallocated. Returns true iff reallocation actually occurred.
References PASS_MEM_STAT.
Reverse content of the vector.
References i.
|
inline |
Grow the vector to a specific length. LEN must be as long or longer than the current length. The new elements are uninitialized. Reallocate the internal vector, if needed.
References gcc_checking_assert, and PASS_MEM_STAT.
|
inline |
Grow the embedded vector to a specific length. LEN must be as long or longer than the current length. The new elements are initialized to zero. Reallocate the internal vector, if needed.
References gcc_checking_assert, and PASS_MEM_STAT.
|
inline |
Insert an element, OBJ, at the IXth position of the vector. Reallocate the embedded vector, if necessary.
References PASS_MEM_STAT.
|
inline |
Push a new element OBJ onto the end of this vector. Reallocates the embedded vector, if needed. Return a pointer to the slot where OBJ was inserted.
References PASS_MEM_STAT.
|
inline |
Copy the elements in SRC to the end of this vector as if by memcpy. SRC and this vector must be allocated with the same mechanism. If there is not enough headroom in this vector, it will be reallocated as needed.
|
inline |
Sort the contents of this vector with qsort. CMP is the comparison function to pass to qsort.
|
inline |
Copy the elements from SRC to the end of this vector as if by memcpy. SRC and this vector must be allocated with the same memory allocation mechanism. This vector is assumed to have sufficient headroom available.
|
inline |
Sort the contents of this vector with gcc_stablesort_r. CMP is the comparison function to pass to qsort.
Set the length of the vector to LEN. The new length must be less than or equal to the current length. This is an O(1) operation.
References gcc_checking_assert.
Remove an element from the IXth position of this vector. Ordering of remaining elements is destroyed. This is an O(1) operation.