Skip to content

iox::cxx::stack🔗

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

#include <iceoryx_hoofs/cxx/stack.hpp>

Public Functions🔗

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

Detailed Description🔗

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

stack implementation with a simple push pop interface

Template Parameters:

  • T type which the stack contains
  • Capacity the capacity of the stack

Public Functions Documentation🔗

function pop🔗

cxx::optional< T > pop()

returns the last pushed element when the stack contains elements otherwise a cxx::nullopt

function push🔗

template <typename... Targs>
bool push(
    Targs &&... args
)

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

Parameters:

  • args arguments which will be perfectly forwarded to the constructor of T

Return: true if the push was successful, otherwise false

function size🔗

uint64_t size() const

returns the stack size

function capacity🔗

static constexpr uint64_t capacity()

returns the stack capacity


Updated on 2 April 2022 at 16:37:47 CEST