SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 2509 of file ds.h.

Constructor & Destructor Documentation

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

Definition at line 2513 of file ds.h.

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

Definition at line 2514 of file ds.h.

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

Definition at line 2515 of file ds.h.

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

Definition at line 2516 of file ds.h.

2516 : ValV(SIn){}
TVec< TVal > ValV
Definition: ds.h:2511

Member Function Documentation

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

Definition at line 2526 of file ds.h.

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

Definition at line 2525 of file ds.h.

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

Definition at line 2527 of file ds.h.

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

Definition at line 2528 of file ds.h.

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

Definition at line 2519 of file ds.h.

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

Definition at line 2521 of file ds.h.

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

Definition at line 2522 of file ds.h.

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

Definition at line 2523 of file ds.h.

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

Definition at line 2533 of file ds.h.

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

Definition at line 2531 of file ds.h.

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

Definition at line 2532 of file ds.h.

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

Definition at line 2517 of file ds.h.

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

Definition at line 2529 of file ds.h.

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

Definition at line 2530 of file ds.h.

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

Member Data Documentation

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

Definition at line 2511 of file ds.h.


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