SNAP Library, Developer Reference
2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
|
Go to the source code of this file.
typedef THash<TStr, TStrIntKdV> TStrStrIntKdVH |
typedef THash<TStr, TStrIntPrV> TStrStrIntPrVH |
typedef TStrHash<TIntV> TStrToIntVSH |
int AddStr | ( | const char * | Str | ) |
Definition at line 684 of file hash.h.
References AddStr(), TStr::CStr(), and TStr::Len().
void Clr | ( | bool | DoDel = false | ) |
int Cmp | ( | const int & | StrId, |
const char * | Str | ||
) | const |
bool Empty | ( | ) | const |
const char* GetCStr | ( | const int & | StrId | ) | const |
Definition at line 688 of file hash.h.
References Assert, Bf, TStr::CStr(), TStr::GetNullStr(), GetStrs(), and IdOffV.
{ Assert(StrId < GetStrs()); if (StrId == 0) return TStr::GetNullStr().CStr(); else return (Bf + (TSize)IdOffV[StrId]); }
const char* GetCStrFromOffset | ( | const TSize & | Offset | ) | const |
Definition at line 693 of file hash.h.
References Assert, Bf, TStr::CStr(), and TStr::GetNullStr().
{ Assert(Offset < BfL); if (Offset == 0) return TStr::GetNullStr().CStr(); else return Bf + Offset; }
static int GetPrimHashCd | ( | const char * | CStr | ) | [static] |
int GetPrimHashCd | ( | const int & | StrId | ) |
Definition at line 702 of file hash.h.
References Assert, Bf, GetPrimHashCd(), GetStrs(), and IdOffV.
{ Assert(StrId < GetStrs()); if (StrId != 0) return GetPrimHashCd(Bf + (TSize)IdOffV[StrId]); else return GetPrimHashCd(""); }
static int GetSecHashCd | ( | const char * | CStr | ) | [static] |
int GetSecHashCd | ( | const int & | StrId | ) |
Definition at line 704 of file hash.h.
References Assert, Bf, GetSecHashCd(), GetStrs(), and IdOffV.
{ Assert(StrId < GetStrs()); if (StrId != 0) return GetSecHashCd(Bf + (TSize)IdOffV[StrId]); else return GetSecHashCd(""); }
TStr GetStrFromOffset | ( | const TSize & | Offset | ) | const |
Definition at line 691 of file hash.h.
References Assert, Bf, and TStr::GetNullStr().
{ Assert(Offset < BfL); if (Offset == 0) return TStr::GetNullStr(); else return TStr(Bf + Offset); }
int GetStrs | ( | ) | const |
Definition at line 675 of file hash.h.
References IdOffV.
Referenced by Cmp(), GetCStr(), GetPrimHashCd(), GetSecHashCd(), and GetStr().
{ return IdOffV.Len(); }
Definition at line 671 of file hash.h.
References TBigStrPool().
{ return PBigStrPool(new TBigStrPool(SIn, LoadCompacted)); }
Definition at line 668 of file hash.h.
References TBigStrPool().
{ return PBigStrPool(new TBigStrPool(_MxBfLen, _GrowBy)); }
Definition at line 669 of file hash.h.
References TBigStrPool().
{ return new TBigStrPool(SIn); }
Definition at line 670 of file hash.h.
References TFIn::New(), and TBigStrPool().
{ PSIn SIn = TFIn::New(fileName); return new TBigStrPool(*SIn); }
TBigStrPool& operator= | ( | const TBigStrPool & | Pool | ) |
Definition at line 330 of file bits.h.
References Addr, B4T, Bf, DecileV, DefP, Fail, Flt, FSet1, FSet2, FSet3, LastB4Mask, Mean, Median, Mn, Mx, PercentileV, Quart1, Quart3, TSOut::Save(), TB8Set::Save(), TVec< TVal >::Save(), TStr::Save(), TBool::Save(), TInt::Save(), TFlt::Save(), TAscFlt::Save(), TSOut::SaveBf(), SDev, Seg, SErr, Str, SumW, UnusableVal, UsableP, ValL, Vals, ValSumW, ValType, ValV, ValWgtV, and Vari.
Referenced by TFHashKey< TKey, TFDat, TVDat >::OnDelFromCache(), and Save().
{ SOut.Save(B4s); SOut.Save(Bits); SOut.SaveBf(&LastB4Mask, sizeof(TB4Def::TB4)); SOut.SaveBf(B4T, B4s*sizeof(TB4Def::TB4));}
TBigStrPool::TBigStrPool | ( | TSize | MxBfLen = 0 , |
uint | _GrowBy = 16*1024*1024 |
||
) |
Definition at line 18 of file hash.cpp.
References AddStr(), Bf, and IAssert.
Referenced by Load(), and New().
: MxBfL(MxBfLen), BfL(0), GrowBy(_GrowBy), Bf(0) { //IAssert(MxBfL >= 0); IAssert(GrowBy >= 0); if (MxBfL > 0) { Bf = (char *) malloc(MxBfL); IAssert(Bf); } AddStr(""); // add empty string }
TBigStrPool::TBigStrPool | ( | TSIn & | SIn, |
bool | LoadCompact = true |
||
) |
Definition at line 24 of file hash.cpp.
References Bf, GrowBy, IAssert, IdOffV, TSIn::Load(), TSIn::LoadBf(), TSIn::LoadCs(), and TSizeMx.
: MxBfL(0), BfL(0), GrowBy(0), Bf(0) { uint64 Tmp; SIn.Load(Tmp); IAssert(Tmp <= uint64(TSizeMx)); MxBfL=TSize(Tmp); SIn.Load(Tmp); IAssert(Tmp <= uint64(TSizeMx)); BfL=TSize(Tmp); SIn.Load(GrowBy); IAssert(MxBfL >= BfL); IAssert(BfL >= 0); IAssert(GrowBy >= 0); if (LoadCompact) MxBfL = BfL; if (MxBfL > 0) { Bf = (char *) malloc(MxBfL); IAssert(Bf); } if (BfL > 0) { SIn.LoadBf(Bf, BfL); } SIn.LoadCs(); int NStr=0; SIn.Load(NStr); IdOffV.Gen(NStr, 0); for (int i = 0; i < NStr; i++) { SIn.Load(Tmp); IAssert(Tmp <= uint64(TSizeMx)); IdOffV.Add(TSize(Tmp)); } }
TBigStrPool | ( | const TBigStrPool & | Pool | ) |
~TBigStrPool | ( | ) |
ClassTP (TBigStrPool, PBigStrPool) private uint GrowBy |
Definition at line 653 of file hash.h.
Referenced by TVecPool< TVal >::AddEmptyV(), TVecPool< TVal >::AddV(), New(), TVecPool< TVal >::operator=(), TVecPool< TVal >::Save(), TBigStrPool(), TStrPool(), and TStrPool64().
Definition at line 658 of file hash.h.
Referenced by Cmp(), GetCStr(), GetPrimHashCd(), GetSecHashCd(), GetStr(), GetStrs(), and TBigStrPool().