| 
    SNAP Library 2.0, Developer Reference
    2013-05-13 16:33:57
    
   SNAP, a general purpose, high performance system for analysis and manipulation of large networks 
   | 
  
  
  
 
Fast Queue used by the TBreathFS (uses memcpy to move objects TVal around).  
 More...
#include <gbase.h>

Public Member Functions | |
| TSnapQueue () | |
| TSnapQueue (const int &MxVals) | |
| Constructor that reserves enough memory for a queue with MxVals elements.   | |
| TSnapQueue (const int &MxVals, const int &MaxFirst) | |
| TSnapQueue (const TSnapQueue &Queue) | |
| TSnapQueue (TSIn &SIn) | |
| Constructor that loads the queue from a (binary) stream SIn.   | |
| void | Save (TSOut &SOut) const | 
| Saves the queue to a (binary) stream SOut.   | |
| TSnapQueue & | operator= (const TSnapQueue &Queue) | 
| const TVal & | operator[] (const int &ValN) const | 
| Returns the value of the ValN element in the queue, but does not remove the element.   | |
| void | Clr (const bool &DoDel=true) | 
| Deletes all elements from the queue.   | |
| void | Gen (const int &MxVals, const int &MaxFirst=1024) | 
| bool | Empty () const | 
| Tests whether the queue is empty (contains no elements).   | |
| int | Len () const | 
| Returns the number of elements in the queue.   | |
| int | GetFirst () const | 
| Returns the location of the first element in the queue.   | |
| int | GetLast () const | 
| Returns the location of the last element in the queue.   | |
| int | Reserved () const | 
| const TVal & | Top () const | 
| Returns the value of the first element in the queue, but does not remove the element.   | |
| void | Pop () | 
| Removes the first element from the queue.   | |
| void | Push (const TVal &Val) | 
| Adds an element at the end of the queue.   | |
Private Attributes | |
| TInt | MxFirst | 
| TInt | First | 
| TInt | Last | 
| TVec< TVal > | ValV | 
Fast Queue used by the TBreathFS (uses memcpy to move objects TVal around). 
| TSnapQueue< TVal >::TSnapQueue | ( | ) |  [inline] | 
        
| TSnapQueue< TVal >::TSnapQueue | ( | const int & | MxVals | ) |  [inline] | 
        
| TSnapQueue< TVal >::TSnapQueue | ( | const int & | MxVals, | 
| const int & | MaxFirst | ||
| ) |  [inline] | 
        
| TSnapQueue< TVal >::TSnapQueue | ( | const TSnapQueue< TVal > & | Queue | ) |  [inline] | 
        
| TSnapQueue< TVal >::TSnapQueue | ( | TSIn & | SIn | ) |  [inline, explicit] | 
        
| void TSnapQueue< TVal >::Clr | ( | const bool & | DoDel = true | ) |  [inline] | 
        
| bool TSnapQueue< TVal >::Empty | ( | ) |  const [inline] | 
        
| void TSnapQueue< TVal >::Gen | ( | const int & | MxVals, | 
| const int & | MaxFirst = 1024  | 
        ||
| ) |  [inline] | 
        
| int TSnapQueue< TVal >::GetFirst | ( | ) |  const [inline] | 
        
| int TSnapQueue< TVal >::GetLast | ( | ) |  const [inline] | 
        
| int TSnapQueue< TVal >::Len | ( | ) |  const [inline] | 
        
Returns the number of elements in the queue.
Definition at line 160 of file gbase.h.
Referenced by TSnapQueue< int >::Push().

| TSnapQueue& TSnapQueue< TVal >::operator= | ( | const TSnapQueue< TVal > & | Queue | ) |  [inline] | 
        
| const TVal& TSnapQueue< TVal >::operator[] | ( | const int & | ValN | ) |  const [inline] | 
        
| void TSnapQueue< TVal >::Pop | ( | ) |  [inline] | 
        
| void TSnapQueue< TVal >::Push | ( | const TVal & | Val | ) |  [inline] | 
        
Adds an element at the end of the queue.
Definition at line 173 of file gbase.h.
Referenced by TSnap::GetNodeWcc(), TSnap::GetTreeSig(), and TSnap::IsWeaklyConn().
                             {
    if (First>0 && (First > MxFirst || ValV.Len() == ValV.Reserved()) && ! ValV.Empty()) {
      //printf("[move cc queue.Len:%d-->%d]", ValV.Len(),Len()); TExeTm Tm;
      memmove(ValV.BegI(), ValV.GetI(First), sizeof(TVal)*Len());
      ValV.Del(Len(), ValV.Len()-1);  Last-=First;  First=0;
      //printf("[%s]\n", Tm.GetStr()); fflush(stdout);
    }
    //if (ValV.Len() == ValV.Reserved()){ printf("[resizeCCQ]"); fflush(stdout); }
    Last++;  ValV.Add(Val);
  }

| int TSnapQueue< TVal >::Reserved | ( | ) |  const [inline] | 
        
| void TSnapQueue< TVal >::Save | ( | TSOut & | SOut | ) |  const [inline] | 
        
| const TVal& TSnapQueue< TVal >::Top | ( | ) |  const [inline] | 
        
TInt TSnapQueue< TVal >::First [private] | 
        
Definition at line 133 of file gbase.h.
Referenced by TSnapQueue< int >::Clr(), TSnapQueue< int >::Empty(), TSnapQueue< int >::Gen(), TSnapQueue< int >::GetFirst(), TSnapQueue< int >::Len(), TSnapQueue< int >::operator=(), TSnapQueue< int >::operator[](), TSnapQueue< int >::Pop(), TSnapQueue< int >::Push(), TSnapQueue< int >::Save(), and TSnapQueue< int >::Top().
TInt TSnapQueue< TVal >::Last [private] | 
        
Definition at line 133 of file gbase.h.
Referenced by TSnapQueue< int >::Clr(), TSnapQueue< int >::Empty(), TSnapQueue< int >::Gen(), TSnapQueue< int >::GetLast(), TSnapQueue< int >::Len(), TSnapQueue< int >::operator=(), TSnapQueue< int >::Pop(), TSnapQueue< int >::Push(), and TSnapQueue< int >::Save().
TInt TSnapQueue< TVal >::MxFirst [private] | 
        
Definition at line 132 of file gbase.h.
Referenced by TSnapQueue< int >::Gen(), TSnapQueue< int >::operator=(), TSnapQueue< int >::Push(), and TSnapQueue< int >::Save().
TVec<TVal> TSnapQueue< TVal >::ValV [private] | 
        
Definition at line 134 of file gbase.h.
Referenced by TSnapQueue< int >::Clr(), TSnapQueue< int >::Gen(), TSnapQueue< int >::operator=(), TSnapQueue< int >::operator[](), TSnapQueue< int >::Pop(), TSnapQueue< int >::Push(), TSnapQueue< int >::Reserved(), TSnapQueue< int >::Save(), and TSnapQueue< int >::Top().