Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SafeStack< T > Class Template Reference

#include <ored/scripting/safestack.hpp>

+ Collaboration diagram for SafeStack< T >:

Public Member Functions

const T & top () const
 
T & top ()
 
pop ()
 
bool empty () const
 
std::stack< T >::size_type size () const
 
void push (const T &t)
 
void push (T &&t)
 
template<typename... Args>
void emplace (Args &&... t)
 
void swap (const SafeStack< T > &other)
 

Private Attributes

std::stack< T > stack_
 

Detailed Description

template<typename T>
class ore::data::SafeStack< T >

Definition at line 33 of file safestack.hpp.

Member Function Documentation

◆ top() [1/2]

const T & top ( ) const

Definition at line 35 of file safestack.hpp.

35{ return stack_.top(); }
std::stack< T > stack_
Definition: safestack.hpp:53
+ Here is the caller graph for this function:

◆ top() [2/2]

T & top ( )

Definition at line 36 of file safestack.hpp.

36 {
37 QL_REQUIRE(!stack_.empty(), "SafeStack::top(): empty stack");
38 return stack_.top();
39 }

◆ pop()

T pop ( )

Definition at line 40 of file safestack.hpp.

40 {
41 T v(std::move(top()));
42 stack_.pop();
43 return v;
44 }
const T & top() const
Definition: safestack.hpp:35
+ Here is the call graph for this function:

◆ empty()

bool empty ( ) const

Definition at line 45 of file safestack.hpp.

45{ return stack_.empty(); }

◆ size()

std::stack< T >::size_type size ( ) const

Definition at line 46 of file safestack.hpp.

46{ return stack_.size(); }

◆ push() [1/2]

void push ( const T &  t)

Definition at line 47 of file safestack.hpp.

47{ stack_.push(t); }

◆ push() [2/2]

void push ( T &&  t)

Definition at line 48 of file safestack.hpp.

48{ stack_.push(std::forward<T>(t)); }

◆ emplace()

void emplace ( Args &&...  t)

Definition at line 49 of file safestack.hpp.

49{ stack_.emplace(std::forward<Args>(t)...); }

◆ swap()

void swap ( const SafeStack< T > &  other)

Definition at line 50 of file safestack.hpp.

50{ stack_.swap(other.stack_); }

Member Data Documentation

◆ stack_

std::stack<T> stack_
private

Definition at line 53 of file safestack.hpp.