#include <fixedsizearray.hpp>
Public Member Functions | |
FixedSizeArray () | |
Default constructor. | |
FixedSizeArray (const FixedSizeArray< T, C > &src) | |
Copy constructor. | |
~FixedSizeArray () | |
destroy remaining items and free the memory block | |
FORCEINLINE void | Clear () |
Clear (destroy) all items. | |
FORCEINLINE uint | Length () const |
return number of used items | |
FORCEINLINE bool | IsFull () const |
return true if array is full | |
FORCEINLINE bool | IsEmpty () const |
return true if array is empty | |
FORCEINLINE T * | Append () |
add (allocate), but don't construct item | |
FORCEINLINE T * | AppendC () |
add and construct item using default constructor | |
FORCEINLINE T & | operator[] (uint index) |
return item by index (non-const version) | |
FORCEINLINE const T & | operator[] (uint index) const |
return item by index (const version) | |
Protected Member Functions | |
FORCEINLINE ArrayHeader & | Hdr () |
return reference to the array header (non-const) | |
FORCEINLINE const ArrayHeader & | Hdr () const |
return reference to the array header (const) | |
FORCEINLINE uint & | RefCnt () |
return reference to the block reference counter | |
FORCEINLINE uint & | SizeRef () |
return reference to number of used items | |
Protected Attributes | |
T * | data |
the only member of fixed size array is pointer to the block of C array of items. | |
Static Protected Attributes | |
static const uint | Tsize = sizeof(T) |
static const uint | HeaderSize = sizeof(ArrayHeader) |
Data Structures | |
struct | ArrayHeader |
header for fixed size array More... |
Item's construction is delayed.
Definition at line 22 of file fixedsizearray.hpp.
FixedSizeArray< T, C >::FixedSizeArray | ( | ) | [inline] |
Default constructor.
Preallocate space for items and header, then initialize header.
Definition at line 50 of file fixedsizearray.hpp.
FixedSizeArray< T, C >::FixedSizeArray | ( | const FixedSizeArray< T, C > & | src | ) | [inline] |
Copy constructor.
Preallocate space for items and header, then initialize header.
Definition at line 59 of file fixedsizearray.hpp.
T* FixedSizeArray< T, C >::data [protected] |
the only member of fixed size array is pointer to the block of C array of items.
Header can be found on the offset -sizeof(ArrayHeader).
Definition at line 37 of file fixedsizearray.hpp.
Referenced by FixedSizeArray< FixedSizeArray, N >::Append(), FixedSizeArray< FixedSizeArray, N >::Clear(), FixedSizeArray< FixedSizeArray, N >::FixedSizeArray(), FixedSizeArray< FixedSizeArray, N >::Hdr(), FixedSizeArray< FixedSizeArray, N >::operator[](), and FixedSizeArray< FixedSizeArray, N >::~FixedSizeArray().