#include <StaticArray.h>
Inherits AVRCpp::Collection::BaseArray< DataType, SizeType, DataType[array_capacity]>.
Public Member Functions | |
StaticArray () | |
Constructor. | |
bool | Resize (const SizeType size, const DataType &values=DataType()) |
Resize array to certain length. | |
bool | Add (const DataType &value) |
Add item to the end of array. | |
bool | Insert (const DataType &value, const SizeType pos) |
Insert item to the pos. | |
bool | Remove (const SizeType pos) |
Remove item at pos. | |
SizeType | GetCapacity (void) |
Return array capacity. | |
bool | IsFull (void) |
Return whether the array is full or not. | |
SizeType | GetSize (void) |
Return array size. | |
bool | IsEmpty (void) |
Return whether the array is empty or not. | |
bool | Clear () |
Clear array. | |
DataType & | At (SizeTypepos) |
Return reference of item at specified position NB! For speed purposes does not check constraints! | |
Protected Attributes | |
DataType | data |
SizeType | current_size |
Definition at line 54 of file StaticArray.h.
AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::StaticArray | ( | ) | [inline] |
bool AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::Resize | ( | const SizeType | size, | |
const DataType & | values = DataType() | |||
) | [inline] |
Resize array to certain length.
Reimplemented from AVRCpp::Collection::BaseArray< DataType, SizeType, DataType[array_capacity]>.
Definition at line 69 of file StaticArray.h.
00070 { 00071 // If new size is larger than maximum capacity then abort 00072 if (size >= array_capacity) return false; 00073 00074 return BaseArray<DataType, SizeType, DataType[array_capacity]>::Resize(size, values); 00075 }
bool AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::Add | ( | const DataType & | value | ) | [inline] |
Add item to the end of array.
Reimplemented from AVRCpp::Collection::BaseArray< DataType, SizeType, DataType[array_capacity]>.
Definition at line 80 of file StaticArray.h.
00081 { 00082 // If new size is larger than maximum capacity then abort 00083 if (this->current_size >= array_capacity) return false; 00084 00085 return BaseArray<DataType, SizeType, DataType[array_capacity]>::Add(value); 00086 }
bool AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::Insert | ( | const DataType & | value, | |
const SizeType | pos | |||
) | [inline] |
Insert item to the pos.
Reimplemented from AVRCpp::Collection::BaseArray< DataType, SizeType, DataType[array_capacity]>.
Definition at line 91 of file StaticArray.h.
00092 { 00093 // If new size is larger than maximum capacity then abort 00094 if (this->current_size >= array_capacity) return false; 00095 00096 // Check constraints 00097 if (pos > this->current_size) return false; 00098 00099 return BaseArray<DataType, SizeType, DataType[array_capacity]>::Insert(value, pos); 00100 }
bool AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::Remove | ( | const SizeType | pos | ) | [inline] |
Remove item at pos.
Reimplemented from AVRCpp::Collection::BaseArray< DataType, SizeType, DataType[array_capacity]>.
Definition at line 105 of file StaticArray.h.
00106 { 00107 return BaseArray<DataType, SizeType, DataType[array_capacity]>::Remove(pos); 00108 }
SizeType AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::GetCapacity | ( | void | ) | [inline] |
bool AVRCpp::Collection::StaticArray< DataType, SizeType, array_capacity >::IsFull | ( | void | ) | [inline] |
SizeType AVRCpp::Collection::BaseArray< DataType , SizeType , DataType >::GetSize | ( | void | ) | [inline, inherited] |
Return array size.
Definition at line 145 of file BaseArray.h.
00146 { 00147 return this->current_size; 00148 }
bool AVRCpp::Collection::BaseArray< DataType , SizeType , DataType >::IsEmpty | ( | void | ) | [inline, inherited] |
bool AVRCpp::Collection::BaseArray< DataType , SizeType , DataType >::Clear | ( | ) | [inline, inherited] |
Clear array.
Definition at line 161 of file BaseArray.h.
00162 { 00163 this->current_size = 0; 00164 00165 return true; 00166 }
DataType & AVRCpp::Collection::BaseArray< DataType , SizeType , DataType >::At | ( | SizeType | pos | ) | [inline, inherited] |
Return reference of item at specified position NB! For speed purposes does not check constraints!
Definition at line 172 of file BaseArray.h.
00173 { 00174 return this->data[pos]; 00175 }
DataType AVRCpp::Collection::BaseArray< DataType , SizeType , DataType >::data [protected, inherited] |
Definition at line 55 of file BaseArray.h.
SizeType AVRCpp::Collection::BaseArray< DataType , SizeType , DataType >::current_size [protected, inherited] |
Definition at line 56 of file BaseArray.h.
MTÜ TTÜ Robotiklubi |