|
| FArray () |
| Default constructor - the array size is zero.
|
|
| FArray (size_type s, const T &t=T()) |
|
template<uint64 S2> |
| FArray (const FArray< T, S2 > &f) |
| Copy constructor, valid for FArrays of the same data type but different stack lengths.
|
|
| FArray (const FArray< T, S > &f) |
| Specialized copy constructor, for the special case of when the stack lengths are the same.
|
|
| FArray (std::initializer_list< T > l) |
|
| ~FArray () |
| Destructor.
|
|
const FArray< T, S > & | operator= (const FArray< T, S > &f) |
|
template<uint64 S2> |
const FArray< T, S > & | operator= (const FArray< T, S2 > &f) |
| Assignment operator, valid for FArrays of the same data type but different stack lengths.
|
|
template<uint64 S2> |
bool | operator== (const FArray< T, S2 > &f) const |
|
size_type | size () const |
|
size_type | stackSize () const |
| Returns the size of the array pre-allocated on the stack.
|
|
size_type | allocated () const |
|
bool | empty () const |
|
T * | data () |
|
const T * | data () const |
|
T & | front () |
|
const T & | front () const |
|
T & | back () |
|
const T & | back () const |
|
size_type | find (const T &t) const |
|
size_type | capacity () const |
|
void | push_back (const T &t) |
| Adds a new element to the end of the array, increasing the array size by one.
|
|
T * | emplace_back () |
|
T * | emplace_n_back (uint64 n) |
|
void | pop_back () |
| Removes the last element in the array. The results are undefined if the array is of zero length.
|
|
void | resize (size_type i, const T &t=T()) |
|
iterator | insert (size_type i, const T &t) |
|
void | put (size_type i, const T &t) |
| Adds a value to the array, first making certain it is big enough to hold it.
|
|
template<class C > |
void | append (const C &in) |
| Appends the contents of one FArray onto another.
|
|
iterator | insert (iterator it, const T &t) |
|
bool | remove (size_type i) |
|
size_type | removeAll (const T &t) |
|
void | clear () |
|
void | reset () |
|
void | clip () |
|
iterator | begin () |
|
const_iterator | begin () const |
|
const_iterator | constBegin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
const_iterator | constEnd () const |
|
T & | at (size_type i) |
|
const T & | at (size_type i) const |
|
T & | operator[] (size_type i) |
|
const T & | operator[] (size_type i) const |
|
T | value (int i, const T &t=T()) const |
|
T | value (uint32 i, const T &t=T()) const |
|
T | value (uint64 i, const T &t=T()) const |
|
template<typename T, uint64 S = 32>
class FArray< T, S >
An array class that attempts to minimize unnecessary heap access.
T is the data type.
S is the stack length.
This class attempts to provide a speed-optimized array for use in plot generation.
It does this in two ways.
First, it attempts to minimize heap churn by not deallocating memory.
Second, it has a second template argument that indicates how much memory to create ON THE STACK. Only if the array size needs to exceed S, does it actually use memory from the heap.