SNAP Library 2.3, User Reference  2014-06-16 11:58:46
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
TStrCache Class Reference

#include <xdt.h>

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.

8  :
9  StrH(ExpectedStrs), Hits(0), Rqs(0){}
int Hits
Definition: xdt.h:6
TStrH StrH
Definition: xdt.h:5
int Rqs
Definition: xdt.h:6
TStrCache::TStrCache ( const TStrCache StrCache)
inline

Definition at line 10 of file xdt.h.

10  :
11  StrH(StrCache.StrH), Hits(StrCache.Hits), Rqs(StrCache.Rqs){}
int Hits
Definition: xdt.h:6
TStrH StrH
Definition: xdt.h:5
int Rqs
Definition: xdt.h:6
TStrCache::TStrCache ( TSIn SIn)
inline

Definition at line 12 of file xdt.h.

12 : StrH(SIn), Hits(0), Rqs(0){}
int Hits
Definition: xdt.h:6
TStrH StrH
Definition: xdt.h:5
int Rqs
Definition: xdt.h:6

Member Function Documentation

void TStrCache::Clr ( )
inline

Definition at line 18 of file xdt.h.

18 {StrH.Clr();}
TStrH StrH
Definition: xdt.h:5
void Clr(const bool &DoDel=true, const int &NoDelLim=-1, const bool &ResetDat=true)
Definition: hash.h:315
TStr TStrCache::GetStr ( const TStr Str)

Definition at line 3 of file xdt.cpp.

3  {
4  int StrId=-1; Rqs++;
5  if (!StrH.IsKey(Str, StrId)){
6  StrId=StrH.AddKey(Str);}
7  else {Hits++;}
8  return StrH.GetKey(StrId);
9 }
int Hits
Definition: xdt.h:6
TStrH StrH
Definition: xdt.h:5
int Rqs
Definition: xdt.h:6
int AddKey(const TKey &Key)
Definition: hash.h:327
bool IsKey(const TKey &Key) const
Definition: hash.h:216
const TKey & GetKey(const int &KeyId) const
Definition: hash.h:210
TStrCache& TStrCache::operator= ( const TStrCache StrCache)
inline

Definition at line 15 of file xdt.h.

15  {
16  if (this!=&StrCache){StrH=StrCache.StrH; Hits=0; Rqs=0;} return *this;}
int Hits
Definition: xdt.h:6
TStrH StrH
Definition: xdt.h:5
int Rqs
Definition: xdt.h:6
void TStrCache::Save ( TSOut SOut)
inline

Definition at line 13 of file xdt.h.

13 {StrH.Save(SOut);}
void Save(TSOut &SOut) const
Definition: hash.h:141
TStrH StrH
Definition: xdt.h:5

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.

TStrH TStrCache::StrH
private

Definition at line 5 of file xdt.h.


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