SNAP Library 4.0, Developer Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <hash.h>
Public Types | |
typedef TPt< TStringPool > | PStringPool |
Public Member Functions | |
TStrHash () | |
TStrHash (const PStringPool &StrPool) | |
TStrHash (const int &Ports, const bool &_AutoSizeP=false, const PStringPool &StrPool=PStringPool()) | |
TStrHash (const TStrHash &Hash) | |
TStrHash (TSIn &SIn, bool PoolToo=true) | |
void | Load (TSIn &SIn, bool PoolToo=true) |
void | LoadShM (TShMIn &ShMIn, bool SharedPool=true) |
Load hash from shared memory. If shared pool is true load pool from shared memory. More... | |
void | Save (TSOut &SOut, bool PoolToo=true) const |
void | SetPool (const PStringPool &StrPool) |
PStringPool | GetPool () const |
TStrHash & | operator= (const TStrHash &Hash) |
bool | Empty () const |
int | Len () const |
int | Reserved () const |
int | GetPorts () const |
bool | IsAutoSize () const |
int | GetMxKeyIds () const |
bool | IsKeyIdEqKeyN () const |
int | AddKey (const char *Key) |
int | AddKey (const TStr &Key) |
int | AddKey (const TChA &Key) |
int | AddDat (const char *Key, const TDat &Dat) |
int | AddDat (const TStr &Key, const TDat &Dat) |
int | AddDat (const TChA &Key, const TDat &Dat) |
TDat & | AddDat (const char *Key) |
TDat & | AddDat (const TStr &Key) |
TDat & | AddDat (const TChA &Key) |
TDat & | AddDatId (const char *Key) |
TDat & | AddDatId (const TStr &Key) |
TDat & | AddDatId (const TChA &Key) |
const TDat & | operator[] (const int &KeyId) const |
TDat & | operator[] (const int &KeyId) |
const TDat & | operator() (const char *Key) const |
::TSize | GetMemUsed () const |
const TDat & | GetDat (const char *Key) const |
const TDat & | GetDat (const TStr &Key) const |
TDat & | GetDat (const char *Key) |
const TDat & | GetDat (const TStr &Key) |
const TDat & | GetDat (const TChA &Key) |
TDat & | GetDatId (const int &KeyId) |
const TDat & | GetDatId (const int &KeyId) const |
void | GetKeyDat (const int &KeyId, int &KeyO, TDat &Dat) const |
void | GetKeyDat (const int &KeyId, const char *&Key, TDat &Dat) const |
void | GetKeyDat (const int &KeyId, TStr &Key, TDat &Dat) const |
void | GetKeyDat (const int &KeyId, TChA &Key, TDat &Dat) const |
int | GetKeyId (const char *Key) const |
int | GetKeyId (const TStr &Key) const |
const char * | GetKey (const int &KeyId) const |
int | GetKeyOfs (const int &KeyId) const |
const char * | KeyFromOfs (const int &KeyO) const |
bool | IsKey (const char *Key) const |
bool | IsKey (const TStr &Key) const |
bool | IsKey (const TChA &Key) const |
bool | IsKey (const char *Key, int &KeyId) const |
bool | IsKeyGetDat (const char *Key, TDat &Dat) const |
bool | IsKeyGetDat (const TStr &Key, TDat &Dat) const |
bool | IsKeyGetDat (const TChA &Key, TDat &Dat) const |
bool | IsKeyId (const int &KeyId) const |
int | FFirstKeyId () const |
bool | FNextKeyId (int &KeyId) const |
void | GetKeyV (TVec< TStr > &KeyV) const |
void | GetStrIdV (TIntV &StrIdV) const |
void | GetDatV (TVec< TDat > &DatV) const |
void | GetKeyDatPrV (TVec< TPair< TStr, TDat > > &KeyDatPrV) const |
void | GetDatKeyPrV (TVec< TPair< TDat, TStr > > &DatKeyPrV) const |
void | Pack () |
Private Types | |
typedef THashKeyDat< TInt, TDat > | THKeyDat |
typedef TPair< TInt, TDat > | TKeyDatP |
typedef TVec< THKeyDat > | THKeyDatV |
Private Member Functions | |
uint | GetNextPrime (const uint &Val) const |
void | Resize () |
const THKeyDat & | GetHashKeyDat (const int &KeyId) const |
THKeyDat & | GetHashKeyDat (const int &KeyId) |
Private Attributes | |
TIntV | PortV |
THKeyDatV | KeyDatV |
TBool | AutoSizeP |
TInt | FFreeKeyId |
TInt | FreeKeys |
PStringPool | Pool |
typedef TPt<TStringPool> TStrHash< TDat, TStringPool, THashFunc >::PStringPool |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 809 of file hash.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 858 of file hash.h.
Referenced by TSnap::LoadConnListStr().
|
inline |
|
inline |
int TStrHash< TDat, TStringPool, THashFunc >::AddKey | ( | const char * | Key | ) |
Definition at line 968 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::AddDat(), TStrHash< TInt, TBigStrPool >::AddDatId(), TTableContext::AddStr(), TTable::AddStrVal(), TTable::ChangeContext(), TTable::ColConcat(), TTable::ColConcatConst(), TCoda::DumpMemberships(), TSnap::LoadEdgeListStr(), TAGMUtil::LoadEdgeListStr(), TTimeNENet::LoadEdgeTm(), and TTable::StoreStrCol().
|
inline |
Definition at line 850 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::AddKey().
|
inline |
Definition at line 851 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::AddKey().
|
inline |
|
inline |
bool TStrHash< TDat, TStringPool, THashFunc >::FNextKeyId | ( | int & | KeyId | ) | const |
|
inline |
Definition at line 879 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::operator()().
|
inline |
Definition at line 880 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetDat().
|
inline |
|
inline |
Definition at line 882 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetDat().
|
inline |
Definition at line 883 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetDat().
|
inline |
|
inline |
void TStrHash< TDat, TStringPool, THashFunc >::GetDatKeyPrV | ( | TVec< TPair< TDat, TStr > > & | DatKeyPrV | ) | const |
Definition at line 1046 of file hash.h.
void TStrHash< TDat, TStringPool, THashFunc >::GetDatV | ( | TVec< TDat > & | DatV | ) | const |
Definition at line 1027 of file hash.h.
References TVec< TVal, TSizeTy >::Add(), and TVec< TVal, TSizeTy >::Gen().
|
inlineprivate |
Definition at line 797 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetKey(), TStrHash< TInt, TBigStrPool >::GetKeyDat(), TStrHash< TInt, TBigStrPool >::GetKeyOfs(), and TStrHash< TInt, TBigStrPool >::operator[]().
|
inlineprivate |
|
inline |
Definition at line 893 of file hash.h.
Referenced by TTable::BuildGraph(), TCesna::DisplayAttrs(), TCoda::DumpMemberships(), TCesnaUtil::DumpNIDAttrHToNIDK(), TTable::GetContextKey(), TTableContext::GetStr(), TTable::GetStr(), TTable::GetStrVal(), and TAGMUtil::LoadEdgeListStr().
|
inline |
Definition at line 886 of file hash.h.
|
inline |
Definition at line 887 of file hash.h.
|
inline |
Definition at line 888 of file hash.h.
|
inline |
Definition at line 889 of file hash.h.
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyDatPrV | ( | TVec< TPair< TStr, TDat > > & | KeyDatPrV | ) | const |
Definition at line 1035 of file hash.h.
int TStrHash< TDat, TStringPool, THashFunc >::GetKeyId | ( | const char * | Key | ) | const |
Definition at line 994 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetDat(), TStrHash< TInt, TBigStrPool >::IsKey(), TStrHash< TInt, TBigStrPool >::IsKeyGetDat(), TAGMUtil::LoadCmtyVV(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), and TTable::StoreStrCol().
|
inline |
Definition at line 892 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetKeyId().
|
inline |
Definition at line 894 of file hash.h.
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyV | ( | TVec< TStr > & | KeyV | ) | const |
Definition at line 1011 of file hash.h.
References TVec< TVal, TSizeTy >::Add(), and TVec< TVal, TSizeTy >::Gen().
|
inline |
Definition at line 866 of file hash.h.
Referenced by TTable::GetContextMemUsedKB().
|
inline |
|
private |
Definition at line 919 of file hash.h.
References THash< TInt, TInt >::HashPrimes, and THash< TInt, TInt >::HashPrimeT.
|
inline |
|
inline |
void TStrHash< TDat, TStringPool, THashFunc >::GetStrIdV | ( | TIntV & | StrIdV | ) | const |
Definition at line 1019 of file hash.h.
References TVec< TVal, TSizeTy >::Add(), and TVec< TVal, TSizeTy >::Gen().
|
inline |
|
inline |
Definition at line 897 of file hash.h.
Referenced by TStrUtil::CountWords(), TAGMUtil::LoadCmtyVV(), and TCesnaUtil::LoadNIDAttrHFromNIDKH().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 904 of file hash.h.
Referenced by TCesnaUtil::DumpNIDAttrHToNIDK().
|
inline |
|
inline |
Definition at line 895 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetKeyDat().
|
inline |
Definition at line 842 of file hash.h.
Referenced by TCesna::DisplayAttrs(), TCoda::DumpMemberships(), TStrHash< TInt, TBigStrPool >::Empty(), TAGMUtil::LoadEdgeListStr(), TCesnaUtil::LoadNIDAttrHFromNIDKH(), and TTable::PrintContextSize().
|
inline |
Definition at line 811 of file hash.h.
Referenced by TTableContext::Load().
|
inline |
Load hash from shared memory. If shared pool is true load pool from shared memory.
Definition at line 815 of file hash.h.
Referenced by TTableContext::LoadShM().
|
inline |
TStrHash< TDat, TStringPool, THashFunc > & TStrHash< TDat, TStringPool, THashFunc >::operator= | ( | const TStrHash< TDat, TStringPool, THashFunc > & | Hash | ) |
Definition at line 954 of file hash.h.
References TStrHash< TDat, TStringPool, THashFunc >::AutoSizeP, TPt< TRec >::Empty(), TStrHash< TDat, TStringPool, THashFunc >::FFreeKeyId, TStrHash< TDat, TStringPool, THashFunc >::FreeKeys, TStrHash< TDat, TStringPool, THashFunc >::KeyDatV, TStrHash< TDat, TStringPool, THashFunc >::Pool, and TStrHash< TDat, TStringPool, THashFunc >::PortV.
|
inline |
Definition at line 862 of file hash.h.
|
inline |
Definition at line 863 of file hash.h.
|
inline |
Definition at line 915 of file hash.h.
Referenced by TAGMUtil::LoadEdgeListStr().
|
inline |
Definition at line 843 of file hash.h.
Referenced by TTable::PrintContextSize().
|
private |
Definition at line 931 of file hash.h.
References THashKeyDat< TKey, TDat >::HashCd, THashKeyDat< TKey, TDat >::Key, and THashKeyDat< TKey, TDat >::Next.
|
inline |
|
inline |
|
private |
Definition at line 791 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::IsAutoSize(), TStrHash< TInt, TBigStrPool >::Load(), TStrHash< TInt, TBigStrPool >::LoadShM(), TStrHash< TDat, TStringPool, THashFunc >::operator=(), and TStrHash< TInt, TBigStrPool >::Save().
|
private |
Definition at line 792 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::Load(), TStrHash< TInt, TBigStrPool >::LoadShM(), TStrHash< TDat, TStringPool, THashFunc >::operator=(), and TStrHash< TInt, TBigStrPool >::Save().
|
private |
Definition at line 792 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::IsKeyIdEqKeyN(), TStrHash< TInt, TBigStrPool >::Len(), TStrHash< TInt, TBigStrPool >::Load(), TStrHash< TInt, TBigStrPool >::LoadShM(), TStrHash< TDat, TStringPool, THashFunc >::operator=(), and TStrHash< TInt, TBigStrPool >::Save().
|
private |
Definition at line 790 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::AddDat(), TStrHash< TInt, TBigStrPool >::AddDatId(), TStrHash< TInt, TBigStrPool >::GetDat(), TStrHash< TInt, TBigStrPool >::GetDatId(), TStrHash< TInt, TBigStrPool >::GetHashKeyDat(), TStrHash< TInt, TBigStrPool >::GetMemUsed(), TStrHash< TInt, TBigStrPool >::GetMxKeyIds(), TStrHash< TInt, TBigStrPool >::IsKeyGetDat(), TStrHash< TInt, TBigStrPool >::IsKeyId(), TStrHash< TInt, TBigStrPool >::Len(), TStrHash< TInt, TBigStrPool >::Load(), TStrHash< TInt, TBigStrPool >::LoadShM(), TStrHash< TDat, TStringPool, THashFunc >::operator=(), TStrHash< TInt, TBigStrPool >::Pack(), TStrHash< TInt, TBigStrPool >::Reserved(), and TStrHash< TInt, TBigStrPool >::Save().
|
private |
Definition at line 793 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetKey(), TStrHash< TInt, TBigStrPool >::GetMemUsed(), TStrHash< TInt, TBigStrPool >::GetPool(), TStrHash< TInt, TBigStrPool >::KeyFromOfs(), TStrHash< TInt, TBigStrPool >::Load(), TStrHash< TInt, TBigStrPool >::LoadShM(), TStrHash< TDat, TStringPool, THashFunc >::operator=(), TStrHash< TInt, TBigStrPool >::Save(), TStrHash< TInt, TBigStrPool >::SetPool(), and TStrHash< TInt, TBigStrPool >::TStrHash().
|
private |
Definition at line 789 of file hash.h.
Referenced by TStrHash< TInt, TBigStrPool >::GetMemUsed(), TStrHash< TInt, TBigStrPool >::GetPorts(), TStrHash< TInt, TBigStrPool >::Load(), TStrHash< TInt, TBigStrPool >::LoadShM(), TStrHash< TDat, TStringPool, THashFunc >::operator=(), TStrHash< TInt, TBigStrPool >::Save(), and TStrHash< TInt, TBigStrPool >::TStrHash().