SNAP Library 2.1, Developer Reference
2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
00001 00002 // String-Cache 00003 class TStrCache{ 00004 private: 00005 TStrH StrH; 00006 int Hits, Rqs; 00007 public: 00008 TStrCache(const int& ExpectedStrs=0): 00009 StrH(ExpectedStrs), Hits(0), Rqs(0){} 00010 TStrCache(const TStrCache& StrCache): 00011 StrH(StrCache.StrH), Hits(StrCache.Hits), Rqs(StrCache.Rqs){} 00012 TStrCache(TSIn& SIn): StrH(SIn), Hits(0), Rqs(0){} 00013 void Save(TSOut& SOut){StrH.Save(SOut);} 00014 00015 TStrCache& operator=(const TStrCache& StrCache){ 00016 if (this!=&StrCache){StrH=StrCache.StrH; Hits=0; Rqs=0;} return *this;} 00017 00018 void Clr(){StrH.Clr();} 00019 TStr GetStr(const TStr& Str); 00020 }; 00021