iceoryx_hoofs 2.0.3
Public Member Functions | Static Public Member Functions | List of all members
iox::cxx::stack< T, Capacity > Class Template Reference

stack implementation with a simple push pop interface More...

#include <iceoryx_hoofs/cxx/stack.hpp>

Public Member Functions

cxx::optional< T > pop () noexcept
 returns the last pushed element when the stack contains elements otherwise a cxx::nullopt
 
template<typename... Targs>
bool push (Targs &&... args) noexcept
 pushed an element into the stack by forwarding all arguments to the constructor of T More...
 
uint64_t size () const noexcept
 returns the stack size
 

Static Public Member Functions

static constexpr uint64_t capacity () noexcept
 returns the stack capacity
 

Detailed Description

template<typename T, uint64_t Capacity>
class iox::cxx::stack< T, Capacity >

stack implementation with a simple push pop interface

Template Parameters
Ttype which the stack contains
Capacitythe capacity of the stack

Member Function Documentation

◆ push()

template<typename T , uint64_t Capacity>
template<typename... Targs>
bool iox::cxx::stack< T, Capacity >::push ( Targs &&...  args)
noexcept

pushed an element into the stack by forwarding all arguments to the constructor of T

Parameters
[in]argsarguments which will be perfectly forwarded to the constructor of T
Returns
true if the push was successful, otherwise false

The documentation for this class was generated from the following file: