SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <xdt.h>
Public Member Functions | |
TStrCache (const int &ExpectedStrs=0) | |
TStrCache (const TStrCache &StrCache) | |
TStrCache (TSIn &SIn) | |
void | Save (TSOut &SOut) |
TStrCache & | operator= (const TStrCache &StrCache) |
void | Clr () |
TStr | GetStr (const TStr &Str) |
Private Attributes | |
TStrH | StrH |
int | Hits |
int | Rqs |
TStrCache::TStrCache | ( | const int & | ExpectedStrs = 0 | ) | [inline] |
TStrCache::TStrCache | ( | const TStrCache & | StrCache | ) | [inline] |
TStrCache::TStrCache | ( | TSIn & | SIn | ) | [inline] |
void TStrCache::Clr | ( | ) | [inline] |
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); }
void TStrCache::Save | ( | TSOut & | SOut | ) | [inline] |
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=().
TStrH TStrCache::StrH [private] |