CatapultServer
v0.5.0.1 (Elephant)
|
Compact array-based stack that allocates memory dynamically only when it is not empty. More...
Classes | |
class | const_iterator |
Public Member Functions | |
CompactArrayStack () | |
Creates an empty stack. More... | |
CompactArrayStack (const CompactArrayStack &stack) | |
Copy constructor that makes a deep copy of stack. More... | |
CompactArrayStack (CompactArrayStack &&stack) | |
Move constructor that move constructs a stack from stack. More... | |
CompactArrayStack & | operator= (const CompactArrayStack &stack) |
Assignment operator that makes a deep copy of stack. More... | |
CompactArrayStack & | operator= (CompactArrayStack &&stack) |
Move assignment operator that assigns stack. More... | |
size_t | size () const |
Gets number of non-default values contained in the stack. More... | |
const_iterator | begin () const |
Returns a const iterator to the first element of the underlying container. More... | |
const_iterator | end () const |
Returns a const iterator to the element following the last element of the underlying container. More... | |
const T & | peek () const |
Returns a const reference to the element on the top of the stack. More... | |
T & | peek () |
Returns a reference to the element on the top of the stack. More... | |
void | push (const T &value) |
Pushes value onto the stack. More... | |
void | pop () |
Pops the top value from the stack. More... | |
Private Member Functions | |
void | shiftLeft () |
void | shiftRight () |
Private Attributes | |
std::unique_ptr< std::array< T, N > > | m_pArray |
size_t | m_size |
Compact array-based stack that allocates memory dynamically only when it is not empty.
|
inline |
Creates an empty stack.
|
inline |
Copy constructor that makes a deep copy of stack.
|
inline |
Move constructor that move constructs a stack from stack.
|
inline |
Returns a const iterator to the first element of the underlying container.
|
inline |
Returns a const iterator to the element following the last element of the underlying container.
|
inline |
Move assignment operator that assigns stack.
|
inline |
Assignment operator that makes a deep copy of stack.
|
inline |
Returns a reference to the element on the top of the stack.
|
inline |
Returns a const reference to the element on the top of the stack.
|
inline |
Pops the top value from the stack.
|
inline |
Pushes value onto the stack.
|
inlineprivate |
|
inlineprivate |
|
inline |
Gets number of non-default values contained in the stack.
|
private |
|
private |