|
|
PBAT_HOST_DEVICE | Stack () |
| | Construct empty Stack.
|
| |
| PBAT_HOST_DEVICE void | Push (T value) |
| | Add element to the stack.
|
| |
| PBAT_HOST_DEVICE T | Pop () |
| | Remove the top element from the stack.
|
| |
| PBAT_HOST_DEVICE T const & | Top () const |
| | Get the top element of the stack.
|
| |
| PBAT_HOST_DEVICE auto | Size () const |
| | Get the number of elements in the stack.
|
| |
| PBAT_HOST_DEVICE bool | IsEmpty () const |
| | Check if the stack is empty.
|
| |
| PBAT_HOST_DEVICE bool | IsFull () const |
| | Check if the stack is full.
|
| |
|
PBAT_HOST_DEVICE void | Clear () |
| | Clear the stack.
|
| |
| PBAT_HOST_DEVICE T & | operator[] (auto i) |
| | Access element at index i.
|
| |
| PBAT_HOST_DEVICE T const & | operator[] (auto i) const |
| | Read-only access element at index i.
|
| |
| PBAT_HOST_DEVICE T * | begin () |
| | Pointer to the beginning of the stack.
|
| |
| PBAT_HOST_DEVICE T * | end () |
| | Pointer to the end of the stack.
|
| |
template<class T, auto kCapacity = 64>
class pbat::common::Stack< T, kCapacity >
Fixed-size stack implementation.
- Template Parameters
-
| T | Type of the elements in the stack |
| kCapacity | Maximum number of elements in the stack |