SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TSStack< TVal > Class Template Reference

#include <ds.h>

Public Member Functions

 TSStack ()
 
 TSStack (const int &MxVals)
 
 TSStack (const TSStack &Stack)
 
 TSStack (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
TSStackoperator= (const TSStack &Stack)
 
bool operator== (const TSStack &Stack) const
 
const TVal & operator[] (const int &ValN) const
 
TVal & operator[] (const int &ValN)
 
bool Empty ()
 
void Clr (const bool &DoDel=false)
 
bool IsIn (const TVal &Val) const
 
int Len ()
 
TVal & Top ()
 
const TVal & Top () const
 
void Push ()
 
void Push (const TVal &Val)
 
void Pop ()
 

Private Attributes

TVec< TVal > ValV
 

Detailed Description

template<class TVal>
class TSStack< TVal >

Definition at line 2575 of file ds.h.

Constructor & Destructor Documentation

template<class TVal>
TSStack< TVal >::TSStack ( )
inline

Definition at line 2579 of file ds.h.

2579 : ValV(){}
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
TSStack< TVal >::TSStack ( const int &  MxVals)
inline

Definition at line 2580 of file ds.h.

2580 : ValV(MxVals, 0){}
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
TSStack< TVal >::TSStack ( const TSStack< TVal > &  Stack)
inline

Definition at line 2581 of file ds.h.

2581 : ValV(Stack.ValV){}
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
TSStack< TVal >::TSStack ( TSIn SIn)
inlineexplicit

Definition at line 2582 of file ds.h.

2582 : ValV(SIn){}
TVec< TVal > ValV
Definition: ds.h:2577

Member Function Documentation

template<class TVal>
void TSStack< TVal >::Clr ( const bool &  DoDel = false)
inline

Definition at line 2592 of file ds.h.

2592 {ValV.Clr(DoDel);}
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
bool TSStack< TVal >::Empty ( )
inline

Definition at line 2591 of file ds.h.

2591 {return ValV.Len()==0;}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
bool TSStack< TVal >::IsIn ( const TVal &  Val) const
inline

Definition at line 2593 of file ds.h.

2593 {return ValV.IsIn(Val);}
bool IsIn(const TVal &Val) const
Checks whether element Val is a member of the vector.
Definition: ds.h:828
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
int TSStack< TVal >::Len ( )
inline

Definition at line 2594 of file ds.h.

2594 {return ValV.Len();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
TSStack& TSStack< TVal >::operator= ( const TSStack< TVal > &  Stack)
inline

Definition at line 2585 of file ds.h.

2585  {
2586  if (this!=&Stack){ValV=Stack.ValV;} return *this;}
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
bool TSStack< TVal >::operator== ( const TSStack< TVal > &  Stack) const
inline

Definition at line 2587 of file ds.h.

2587 {return this==&Stack;}
template<class TVal>
const TVal& TSStack< TVal >::operator[] ( const int &  ValN) const
inline

Definition at line 2588 of file ds.h.

2588 {return ValV[ValV.Len()-ValN-1];}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
TVal& TSStack< TVal >::operator[] ( const int &  ValN)
inline

Definition at line 2589 of file ds.h.

2589 {return ValV[ValV.Len()-ValN-1];}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
void TSStack< TVal >::Pop ( )
inline

Definition at line 2599 of file ds.h.

2599 {Assert(0<ValV.Len()); ValV.DelLast();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
#define Assert(Cond)
Definition: bd.h:251
void DelLast()
Removes the last element of the vector.
Definition: ds.h:665
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
void TSStack< TVal >::Push ( )
inline

Definition at line 2597 of file ds.h.

2597 {ValV.Add();}
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
void TSStack< TVal >::Push ( const TVal &  Val)
inline

Definition at line 2598 of file ds.h.

2598 {ValV.Add(Val);}
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
void TSStack< TVal >::Save ( TSOut SOut) const
inline

Definition at line 2583 of file ds.h.

2583 {ValV.Save(SOut);}
void Save(TSOut &SOut) const
Definition: ds.h:954
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
TVal& TSStack< TVal >::Top ( )
inline

Definition at line 2595 of file ds.h.

2595 {Assert(0<ValV.Len()); return ValV.Last();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
#define Assert(Cond)
Definition: bd.h:251
const TVal & Last() const
Returns a reference to the last element of the vector.
Definition: ds.h:579
TVec< TVal > ValV
Definition: ds.h:2577
template<class TVal>
const TVal& TSStack< TVal >::Top ( ) const
inline

Definition at line 2596 of file ds.h.

2596 {Assert(0<ValV.Len()); return ValV.Last();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
#define Assert(Cond)
Definition: bd.h:251
const TVal & Last() const
Returns a reference to the last element of the vector.
Definition: ds.h:579
TVec< TVal > ValV
Definition: ds.h:2577

Member Data Documentation

template<class TVal>
TVec<TVal> TSStack< TVal >::ValV
private

Definition at line 2577 of file ds.h.


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