SNAP Library 2.4, User Reference  2015-05-11 19:40:56
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 2461 of file ds.h.

Constructor & Destructor Documentation

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

Definition at line 2465 of file ds.h.

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

Definition at line 2466 of file ds.h.

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

Definition at line 2467 of file ds.h.

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

Definition at line 2468 of file ds.h.

2468 : ValV(SIn){}
TVec< TVal > ValV
Definition: ds.h:2463

Member Function Documentation

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

Definition at line 2478 of file ds.h.

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

Definition at line 2477 of file ds.h.

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

Definition at line 2479 of file ds.h.

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

Definition at line 2480 of file ds.h.

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

Definition at line 2471 of file ds.h.

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

Definition at line 2473 of file ds.h.

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

Definition at line 2474 of file ds.h.

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

Definition at line 2475 of file ds.h.

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

Definition at line 2485 of file ds.h.

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

Definition at line 2483 of file ds.h.

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

Definition at line 2484 of file ds.h.

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

Definition at line 2469 of file ds.h.

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

Definition at line 2481 of file ds.h.

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

Definition at line 2482 of file ds.h.

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

Member Data Documentation

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

Definition at line 2463 of file ds.h.


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