AlgoPlus v0.1.0
Loading...
Searching...
No Matches
stack_list< T >::Iterator Class Reference

Iterator class. More...

#include <stack_list.h>

Public Member Functions

 Iterator (const std::shared_ptr< node > &s) noexcept
 Construct a new Iterator object.
 
Iteratoroperator= (std::shared_ptr< node > current)
 = operator for Iterator type
 
Iteratoroperator++ ()
 operator ++ for type Iterator
 
Iterator operator++ (int)
 operator ++ for type Iterator
 
bool operator!= (const Iterator &it)
 operator != for type Iterator
 
operator* ()
 operator * for type Iterator
 
 stack_list (std::vector< T > v={}) noexcept
 Construct a new stack list object.
 
 stack_list (const stack_list &s)
 Copy constructor for stack list class.
 
stack_listoperator= (const stack_list &s)
 operator = for stack list class
 
void clear ()
 clear function
 
size_t size ()
 size functon
 
void push (T key)
 push function
 
top ()
 top function
 
void pop ()
 pop function removes the top of the stack
 
Iterator begin ()
 pointer to the top of the stack
 
Iterator end ()
 pointer to the end of the stack
 

Detailed Description

template<typename T>
class stack_list< T >::Iterator

Iterator class.

Constructor & Destructor Documentation

◆ Iterator()

template<typename T>
stack_list< T >::Iterator::Iterator ( const std::shared_ptr< node > & s)
inlineexplicitnoexcept

Construct a new Iterator object.

Parameters
sstack_list pointer

Member Function Documentation

◆ begin()

Iterator stack_list< T >::begin ( )
inline

pointer to the top of the stack

Returns
Iterator

◆ end()

Iterator stack_list< T >::end ( )
inline

pointer to the end of the stack

Returns
Iterator

◆ operator!=()

template<typename T>
bool stack_list< T >::Iterator::operator!= ( const Iterator & it)
inline

operator != for type Iterator

Parameters
itconst Iterator
Returns
true if curr_root == it.curr_root
false otherwise

◆ operator*()

template<typename T>
T stack_list< T >::Iterator::operator* ( )
inline

operator * for type Iterator

Returns
T the value of the node

◆ operator++() [1/2]

template<typename T>
Iterator & stack_list< T >::Iterator::operator++ ( )
inline

operator ++ for type Iterator

Returns
Iterator&

◆ operator++() [2/2]

template<typename T>
Iterator stack_list< T >::Iterator::operator++ ( int )
inline

operator ++ for type Iterator

Returns
Iterator

◆ operator=() [1/2]

stack_list & stack_list< T >::operator= ( const stack_list & s)
inline

operator = for stack list class

Parameters
sthe stack we want to copy
Returns
stack_list&

◆ operator=() [2/2]

template<typename T>
Iterator & stack_list< T >::Iterator::operator= ( std::shared_ptr< node > current)
inline

= operator for Iterator type

Parameters
currentsmart pointer of type node
Returns
Iterator&

◆ push()

void stack_list< T >::push ( T key)
inline

push function

Parameters
keythe key to be pushed

◆ size()

size_t stack_list< T >::size ( )
inline

size functon

Returns
size_t the size of the stack

◆ stack_list() [1/2]

stack_list< T >::stack_list ( const stack_list & s)
inlineexplicit

Copy constructor for stack list class.

Parameters
sthe stack we want to copy

◆ stack_list() [2/2]

stack_list< T >::stack_list ( std::vector< T > v = {})
inlineexplicitnoexcept

Construct a new stack list object.

Parameters
vinitializer vector

◆ top()

T stack_list< T >::top ( )
inline

top function

Returns
T the top of the stack

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