BFLibCPP 0.1
CPP Library
Loading...
Searching...
No Matches
BF::Stack< T, S > Class Template Reference

#include <stack.hpp>

Inheritance diagram for BF::Stack< T, S >:
Collaboration diagram for BF::Stack< T, S >:

Public Member Functions

 Stack ()
 
 ~Stack ()
 
int push (T object)
 
int pop ()
 
top ()
 
size ()
 
bool empty ()
 

Additional Inherited Members

- Protected Member Functions inherited from BF::List< T, int >
int deleteNode (Node *node)
 
 List ()
 
 List (const std::initializer_list< T > &list)
 
virtual ~List ()
 
int count () const
 
int add (T obj)
 
int pluckObject (T obj)
 
int deleteObjectAtIndex (int index)
 
int insertObjectAtIndex (T obj, int index)
 
void deleteAll ()
 
objectAtIndex (int index) const
 
void setDeallocateCallback (void(*callback)(T obj))
 
void setReleaseCallback (void(*callback)(T obj))
 
void setCompareCallback (int(*callback)(T a, T b))
 
Node * first () const
 
Node * last () const
 
bool contains (const T obj)
 
void print ()
 
int sort ()
 
int sort (const ListSortOptions option)
 
int shuffle ()
 
void operator= (const std::initializer_list< T > &list)
 
Iterator begin ()
 required interfaces: begin() & end()
 
Iterator end ()
 
- Protected Member Functions inherited from BF::Object
 Object ()
 
 Object (Object &obj)
 
virtual ~Object ()
 
- Static Protected Member Functions inherited from BF::Object
static void retain (Object *obj)
 
static void release (Object *obj)
 
static int retainCount (Object *obj)
 
static int retainCount (Object &obj)
 

Detailed Description

template<typename T, typename S = int>
class BF::Stack< T, S >

Has similar interface to cpp stack object

This object does not handle any memory deallocation. Caller is still responsible for maintaining every object memory that gets pushed and popped. Thus it MUST be noted all references to objects will be deleted when stack is still full when stack object gets deleted

Constructor & Destructor Documentation

◆ Stack()

template<typename T , typename S = int>
BF::Stack< T, S >::Stack ( )
inline

◆ ~Stack()

template<typename T , typename S = int>
BF::Stack< T, S >::~Stack ( )
inline

Member Function Documentation

◆ empty()

template<typename T , typename S = int>
bool BF::Stack< T, S >::empty ( )
inline
Here is the call graph for this function:

◆ pop()

template<typename T , typename S = int>
int BF::Stack< T, S >::pop ( )
inline
Here is the call graph for this function:

◆ push()

template<typename T , typename S = int>
int BF::Stack< T, S >::push ( T object)
inline
Here is the call graph for this function:

◆ size()

template<typename T , typename S = int>
S BF::Stack< T, S >::size ( )
inline
Here is the call graph for this function:

◆ top()

template<typename T , typename S = int>
T BF::Stack< T, S >::top ( )
inline
Here is the call graph for this function:

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