SNAP Library , Developer Reference  2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TStrCache Class Reference

#include <xdt.h>

Collaboration diagram for TStrCache:

List of all members.

Public Member Functions

 TStrCache (const int &ExpectedStrs=0)
 TStrCache (const TStrCache &StrCache)
 TStrCache (TSIn &SIn)
void Save (TSOut &SOut)
TStrCacheoperator= (const TStrCache &StrCache)
void Clr ()
TStr GetStr (const TStr &Str)

Private Attributes

TStrH StrH
int Hits
int Rqs

Detailed Description

Definition at line 3 of file xdt.h.


Constructor & Destructor Documentation

TStrCache::TStrCache ( const int &  ExpectedStrs = 0) [inline]

Definition at line 8 of file xdt.h.

                                      :
    StrH(ExpectedStrs), Hits(0), Rqs(0){}
TStrCache::TStrCache ( const TStrCache StrCache) [inline]

Definition at line 10 of file xdt.h.

                                      :
    StrH(StrCache.StrH), Hits(StrCache.Hits), Rqs(StrCache.Rqs){}
TStrCache::TStrCache ( TSIn SIn) [inline]

Definition at line 12 of file xdt.h.

: StrH(SIn), Hits(0), Rqs(0){}

Member Function Documentation

void TStrCache::Clr ( ) [inline]

Definition at line 18 of file xdt.h.

References THash< TKey, TDat, THashFunc >::Clr(), and StrH.

{StrH.Clr();}

Here is the call graph for this function:

TStr TStrCache::GetStr ( const TStr Str)

Definition at line 3 of file xdt.cpp.

References THash< TKey, TDat, THashFunc >::AddKey(), THash< TKey, TDat, THashFunc >::GetKey(), Hits, THash< TKey, TDat, THashFunc >::IsKey(), Rqs, and StrH.

                                     {
  int StrId=-1; Rqs++;
  if (!StrH.IsKey(Str, StrId)){
    StrId=StrH.AddKey(Str);}
  else {Hits++;}
  return StrH.GetKey(StrId);
}

Here is the call graph for this function:

TStrCache& TStrCache::operator= ( const TStrCache StrCache) [inline]

Definition at line 15 of file xdt.h.

References Hits, Rqs, and StrH.

                                                 {
    if (this!=&StrCache){StrH=StrCache.StrH; Hits=0; Rqs=0;} return *this;}
void TStrCache::Save ( TSOut SOut) [inline]

Definition at line 13 of file xdt.h.

References THash< TKey, TDat, THashFunc >::Save(), and StrH.

{StrH.Save(SOut);}

Here is the call graph for this function:


Member Data Documentation

int TStrCache::Hits [private]

Definition at line 6 of file xdt.h.

Referenced by GetStr(), and operator=().

int TStrCache::Rqs [private]

Definition at line 6 of file xdt.h.

Referenced by GetStr(), and operator=().

Definition at line 5 of file xdt.h.

Referenced by Clr(), GetStr(), operator=(), and Save().


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