SNAP Library 2.0, User Reference  2013-05-13 16:33:57
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>

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.

{StrH.Clr();}
TStr TStrCache::GetStr ( const TStr Str)

Definition at line 3 of file xdt.cpp.

                                     {
  int StrId=-1; Rqs++;
  if (!StrH.IsKey(Str, StrId)){
    StrId=StrH.AddKey(Str);}
  else {Hits++;}
  return StrH.GetKey(StrId);
}
TStrCache& TStrCache::operator= ( const TStrCache StrCache) [inline]

Definition at line 15 of file xdt.h.

                                                 {
    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.

{StrH.Save(SOut);}

Member Data Documentation

int TStrCache::Hits [private]

Definition at line 6 of file xdt.h.

int TStrCache::Rqs [private]

Definition at line 6 of file xdt.h.

Definition at line 5 of file xdt.h.


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