#include <fixedsizearray.hpp>
Public Types | |
typedef Titem_ | Titem |
Public Member Functions | |
CFixedSizeArrayT () | |
Default constructor. | |
CFixedSizeArrayT (const CFixedSizeArrayT< Titem_, Tcapacity_ > &src) | |
Copy constructor. | |
~CFixedSizeArrayT () | |
destroy remaining items and free the memory block | |
FORCEINLINE void | Clear () |
Clear (destroy) all items. | |
FORCEINLINE int | Size () 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 void | CheckIdx (int idx) const |
index validation | |
FORCEINLINE Titem & | AddNC () |
add (allocate), but don't construct item | |
FORCEINLINE Titem & | Add () |
add and construct item using default constructor | |
FORCEINLINE Titem & | operator[] (int idx) |
return item by index (non-const version) | |
FORCEINLINE const Titem & | operator[] (int idx) const |
return item by index (const version) | |
Data Fields | |
Titem_ * | m_items |
the only member of fixed size array is pointer to the block of C array of items. | |
Static Public Attributes | |
static const int | Tcapacity = Tcapacity_ |
static const int | TitemSize = sizeof(Titem_) |
static const int | ThdrSize = sizeof(CHdr) |
Protected Member Functions | |
FORCEINLINE CHdr & | Hdr () |
return reference to the array header (non-const) | |
FORCEINLINE const CHdr & | Hdr () const |
return reference to the array header (const) | |
FORCEINLINE int & | RefCnt () |
return reference to the block reference counter | |
FORCEINLINE int & | SizeRef () |
return reference to number of used items | |
Data Structures | |
struct | CHdr |
header for fixed size array More... |
Item's construction is delayed.
Definition at line 21 of file fixedsizearray.hpp.
CFixedSizeArrayT< Titem_, Tcapacity_ >::CFixedSizeArrayT | ( | ) | [inline] |
Default constructor.
Preallocate space for items and header, then initialize header.
Definition at line 41 of file fixedsizearray.hpp.
CFixedSizeArrayT< Titem_, Tcapacity_ >::CFixedSizeArrayT | ( | const CFixedSizeArrayT< Titem_, Tcapacity_ > & | src | ) | [inline] |
Copy constructor.
Preallocate space for items and header, then initialize header.
Definition at line 50 of file fixedsizearray.hpp.
Titem_* CFixedSizeArrayT< Titem_, Tcapacity_ >::m_items |
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(CHdr).
Definition at line 24 of file fixedsizearray.hpp.
Referenced by CFixedSizeArrayT< CSubArray, Tnum_blocks_ >::AddNC(), CFixedSizeArrayT< CSubArray, Tnum_blocks_ >::CFixedSizeArrayT(), CFixedSizeArrayT< CSubArray, Tnum_blocks_ >::Clear(), CFixedSizeArrayT< CSubArray, Tnum_blocks_ >::Hdr(), CFixedSizeArrayT< CSubArray, Tnum_blocks_ >::operator[](), and CFixedSizeArrayT< CSubArray, Tnum_blocks_ >::~CFixedSizeArrayT().