SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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
TStrHash< TDat, TStringPool, THashFunc > Class Template Reference

#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 Save (TSOut &SOut, bool PoolToo=true) const
 
void SetPool (const PStringPool &StrPool)
 
PStringPool GetPool () const
 
TStrHashoperator= (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< THKeyDatTHKeyDatV
 

Private Member Functions

uint GetNextPrime (const uint &Val) const
 
void Resize ()
 
const THKeyDatGetHashKeyDat (const int &KeyId) const
 
THKeyDatGetHashKeyDat (const int &KeyId)
 

Private Attributes

TIntV PortV
 
THKeyDatV KeyDatV
 
TBool AutoSizeP
 
TInt FFreeKeyId
 
TInt FreeKeys
 
PStringPool Pool
 

Detailed Description

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
class TStrHash< TDat, TStringPool, THashFunc >

Definition at line 729 of file hash.h.

Member Typedef Documentation

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
typedef TPt<TStringPool> TStrHash< TDat, TStringPool, THashFunc >::PStringPool

Definition at line 732 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
typedef THashKeyDat<TInt, TDat> TStrHash< TDat, TStringPool, THashFunc >::THKeyDat
private

Definition at line 734 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
typedef TVec<THKeyDat> TStrHash< TDat, TStringPool, THashFunc >::THKeyDatV
private

Definition at line 736 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
typedef TPair<TInt, TDat> TStrHash< TDat, TStringPool, THashFunc >::TKeyDatP
private

Definition at line 735 of file hash.h.

Constructor & Destructor Documentation

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TStrHash< TDat, TStringPool, THashFunc >::TStrHash ( )
inline

Definition at line 750 of file hash.h.

750 : PortV(), KeyDatV(), AutoSizeP(true), FFreeKeyId(-1), FreeKeys(0), Pool() { }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TStrHash< TDat, TStringPool, THashFunc >::TStrHash ( const PStringPool StrPool)
inline

Definition at line 751 of file hash.h.

751 : PortV(), KeyDatV(), AutoSizeP(true), FFreeKeyId(-1), FreeKeys(0), Pool(StrPool) { }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TStrHash< TDat, TStringPool, THashFunc >::TStrHash ( const int &  Ports,
const bool &  _AutoSizeP = false,
const PStringPool StrPool = PStringPool() 
)
inline

Definition at line 752 of file hash.h.

752  :
753  PortV(Ports), KeyDatV(Ports, 0), AutoSizeP(_AutoSizeP), FFreeKeyId(-1), FreeKeys(0), Pool(StrPool) { PortV.PutAll(-1); }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1166
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TStrHash< TDat, TStringPool, THashFunc >::TStrHash ( const TStrHash< TDat, TStringPool, THashFunc > &  Hash)
inline

Definition at line 754 of file hash.h.

754  : PortV(Hash.PortV), KeyDatV(Hash.KeyDatV), AutoSizeP(Hash.AutoSizeP),
755  FFreeKeyId(Hash.FFreeKeyId), FreeKeys(Hash.FreeKeys), Pool() {
756  if (! Hash.Pool.Empty()) { Pool=PStringPool(new TStringPool(*Hash.Pool)); } }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
bool Empty() const
Definition: bd.h:501
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
TPt< TStringPool > PStringPool
Definition: hash.h:732
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TStrHash< TDat, TStringPool, THashFunc >::TStrHash ( TSIn SIn,
bool  PoolToo = true 
)
inline

Definition at line 757 of file hash.h.

757 : PortV(SIn), KeyDatV(SIn), AutoSizeP(SIn), FFreeKeyId(SIn), FreeKeys(SIn){ SIn.LoadCs(); if (PoolToo) Pool = PStringPool(SIn); }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
void LoadCs()
Definition: fl.cpp:28
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
TPt< TStringPool > PStringPool
Definition: hash.h:732

Member Function Documentation

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::AddDat ( const char *  Key,
const TDat &  Dat 
)
inline

Definition at line 780 of file hash.h.

780 { const int KeyId = AddKey(Key); KeyDatV[KeyId].Dat = Dat; return KeyId; }
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::AddDat ( const TStr Key,
const TDat &  Dat 
)
inline

Definition at line 781 of file hash.h.

781 { const int KeyId = AddKey(Key.CStr()); KeyDatV[KeyId].Dat = Dat; return KeyId; }
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
char * CStr()
Definition: dt.h:476
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::AddDat ( const TChA Key,
const TDat &  Dat 
)
inline

Definition at line 782 of file hash.h.

782 { const int KeyId = AddKey(Key.CStr()); KeyDatV[KeyId].Dat = Dat; return KeyId; }
char * CStr()
Definition: dt.h:255
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::AddDat ( const char *  Key)
inline

Definition at line 783 of file hash.h.

783 { return KeyDatV[AddKey(Key)].Dat; }
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::AddDat ( const TStr Key)
inline

Definition at line 784 of file hash.h.

784 { return KeyDatV[AddKey(Key.CStr())].Dat; }
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
char * CStr()
Definition: dt.h:476
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::AddDat ( const TChA Key)
inline

Definition at line 785 of file hash.h.

785 { return KeyDatV[AddKey(Key.CStr())].Dat; }
char * CStr()
Definition: dt.h:255
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::AddDatId ( const char *  Key)
inline

Definition at line 786 of file hash.h.

786 { const int KeyId = AddKey(Key); return KeyDatV[KeyId].Dat = KeyId; }
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::AddDatId ( const TStr Key)
inline

Definition at line 787 of file hash.h.

787 { const int KeyId = AddKey(Key.CStr()); return KeyDatV[KeyId].Dat = KeyId; }
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
char * CStr()
Definition: dt.h:476
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::AddDatId ( const TChA Key)
inline

Definition at line 788 of file hash.h.

788 { const int KeyId = AddKey(Key.CStr()); return KeyDatV[KeyId].Dat = KeyId; }
char * CStr()
Definition: dt.h:255
THKeyDatV KeyDatV
Definition: hash.h:738
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat , class TStringPool , class THashFunc >
int TStrHash< TDat, TStringPool, THashFunc >::AddKey ( const char *  Key)

Definition at line 896 of file hash.h.

896  {
897  if (Pool.Empty()) Pool = TStringPool::New();
898  if ((AutoSizeP && KeyDatV.Len() > PortV.Len()) || PortV.Empty()) Resize();
899  const int PortN = abs(THashFunc::GetPrimHashCd(Key) % PortV.Len());
900  const int HashCd = abs(THashFunc::GetSecHashCd(Key));
901  int PrevKeyId = -1;
902  int KeyId = PortV[PortN];
903  while (KeyId != -1 && ! (KeyDatV[KeyId].HashCd == HashCd && Pool->Cmp(KeyDatV[KeyId].Key, Key) == 0)) {
904  PrevKeyId = KeyId; KeyId = KeyDatV[KeyId].Next; }
905  if (KeyId == -1) {
906  const int StrId = Pool->AddStr(Key);
907  if (FFreeKeyId == -1) {
908  KeyId = KeyDatV.Add(THKeyDat(-1, HashCd, StrId));
909  } else {
910  KeyId = FFreeKeyId;
911  FFreeKeyId = KeyDatV[FFreeKeyId].Next;
912  FreeKeys--;
913  KeyDatV[KeyId] = THKeyDat(-1, HashCd, StrId);
914  }
915  if (PrevKeyId == -1) PortV[PortN] = KeyId;
916  else KeyDatV[PrevKeyId].Next = KeyId;
917  }
918  return KeyId;
919 }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
bool Empty() const
Definition: bd.h:501
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:542
THKeyDatV KeyDatV
Definition: hash.h:738
void Resize()
Definition: hash.h:859
TBool AutoSizeP
Definition: hash.h:739
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::AddKey ( const TStr Key)
inline

Definition at line 778 of file hash.h.

778 { return AddKey(Key.CStr()); }
int AddKey(const char *Key)
Definition: hash.h:896
char * CStr()
Definition: dt.h:476
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::AddKey ( const TChA Key)
inline

Definition at line 779 of file hash.h.

779 { return AddKey(Key.CStr()); }
char * CStr()
Definition: dt.h:255
int AddKey(const char *Key)
Definition: hash.h:896
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::Empty ( ) const
inline

Definition at line 769 of file hash.h.

769 {return ! Len(); }
int Len() const
Definition: hash.h:770
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::FFirstKeyId ( ) const
inline

Definition at line 834 of file hash.h.

834 {return 0-1;}
template<class TDat , class TStringPool , class THashFunc >
bool TStrHash< TDat, TStringPool, THashFunc >::FNextKeyId ( int &  KeyId) const

Definition at line 933 of file hash.h.

933  {
934  do KeyId++; while (KeyId < KeyDatV.Len() && KeyDatV[KeyId].HashCd == -1);
935  return KeyId < KeyDatV.Len();
936 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDat ( const char *  Key) const
inline

Definition at line 807 of file hash.h.

807 { return KeyDatV[GetKeyId(Key)].Dat; }
THKeyDatV KeyDatV
Definition: hash.h:738
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDat ( const TStr Key) const
inline

Definition at line 808 of file hash.h.

808 { return GetDat(Key.CStr()); }
char * CStr()
Definition: dt.h:476
const TDat & GetDat(const char *Key) const
Definition: hash.h:807
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDat ( const char *  Key)
inline

Definition at line 809 of file hash.h.

809 { return KeyDatV[GetKeyId(Key)].Dat; }
THKeyDatV KeyDatV
Definition: hash.h:738
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDat ( const TStr Key)
inline

Definition at line 810 of file hash.h.

810 { return GetDat(Key.CStr()); }
char * CStr()
Definition: dt.h:476
const TDat & GetDat(const char *Key) const
Definition: hash.h:807
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDat ( const TChA Key)
inline

Definition at line 811 of file hash.h.

811 { return GetDat(Key.CStr()); }
char * CStr()
Definition: dt.h:255
const TDat & GetDat(const char *Key) const
Definition: hash.h:807
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDatId ( const int &  KeyId)
inline

Definition at line 812 of file hash.h.

812 { return KeyDatV[KeyId].Dat; }
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::GetDatId ( const int &  KeyId) const
inline

Definition at line 813 of file hash.h.

813 { return KeyDatV[KeyId].Dat; }
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat, class TStringPool , class THashFunc >
void TStrHash< TDat, TStringPool, THashFunc >::GetDatKeyPrV ( TVec< TPair< TDat, TStr > > &  DatKeyPrV) const

Definition at line 974 of file hash.h.

974  {
975  DatKeyPrV.Gen(Len(), 0);
976  TStr Str; TDat Dat;
977  int KeyId = FFirstKeyId();
978  while (FNextKeyId(KeyId)){
979  GetKeyDat(KeyId, Str, Dat);
980  DatKeyPrV.Add(TPair<TDat, TStr>(Dat, Str));
981  }
982 }
int FFirstKeyId() const
Definition: hash.h:834
int Len() const
Definition: hash.h:770
bool FNextKeyId(int &KeyId) const
Definition: hash.h:933
void GetKeyDat(const int &KeyId, int &KeyO, TDat &Dat) const
Definition: hash.h:814
Definition: ds.h:32
Definition: dt.h:412
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
template<class TDat, class TStringPool , class THashFunc >
void TStrHash< TDat, TStringPool, THashFunc >::GetDatV ( TVec< TDat > &  DatV) const

Definition at line 955 of file hash.h.

955  {
956  DatV.Gen(Len(), 0);
957  int KeyId = FFirstKeyId();
958  while (FNextKeyId(KeyId))
959  DatV.Add(GetHashKeyDat(KeyId).Dat);
960 }
int FFirstKeyId() const
Definition: hash.h:834
int Len() const
Definition: hash.h:770
bool FNextKeyId(int &KeyId) const
Definition: hash.h:933
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const THKeyDat& TStrHash< TDat, TStringPool, THashFunc >::GetHashKeyDat ( const int &  KeyId) const
inlineprivate

Definition at line 745 of file hash.h.

745  {
746  const THKeyDat& KeyDat = KeyDatV[KeyId]; Assert(KeyDat.HashCd != -1); return KeyDat; }
#define Assert(Cond)
Definition: bd.h:251
THKeyDatV KeyDatV
Definition: hash.h:738
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
THKeyDat& TStrHash< TDat, TStringPool, THashFunc >::GetHashKeyDat ( const int &  KeyId)
inlineprivate

Definition at line 747 of file hash.h.

747  {
748  THKeyDat& KeyDat = KeyDatV[KeyId]; Assert(KeyDat.HashCd != -1); return KeyDat; }
#define Assert(Cond)
Definition: bd.h:251
THKeyDatV KeyDatV
Definition: hash.h:738
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const char* TStrHash< TDat, TStringPool, THashFunc >::GetKey ( const int &  KeyId) const
inline

Definition at line 821 of file hash.h.

821 { return Pool->GetCStr(GetHashKeyDat(KeyId).Key); }
PStringPool Pool
Definition: hash.h:741
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyDat ( const int &  KeyId,
int &  KeyO,
TDat &  Dat 
) const
inline

Definition at line 814 of file hash.h.

814 { const THKeyDat& KeyDat = GetHashKeyDat(KeyId); KeyO = KeyDat.Key; Dat = KeyDat.Dat; }
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyDat ( const int &  KeyId,
const char *&  Key,
TDat &  Dat 
) const
inline

Definition at line 815 of file hash.h.

815 { const THKeyDat& KeyDat = GetHashKeyDat(KeyId); Key = KeyFromOfs(KeyDat.Key); Dat = KeyDat.Dat; }
const char * KeyFromOfs(const int &KeyO) const
Definition: hash.h:823
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyDat ( const int &  KeyId,
TStr Key,
TDat &  Dat 
) const
inline

Definition at line 816 of file hash.h.

816 { const THKeyDat& KeyDat = GetHashKeyDat(KeyId); Key = KeyFromOfs(KeyDat.Key); Dat = KeyDat.Dat;}
const char * KeyFromOfs(const int &KeyO) const
Definition: hash.h:823
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyDat ( const int &  KeyId,
TChA Key,
TDat &  Dat 
) const
inline

Definition at line 817 of file hash.h.

817 { const THKeyDat& KeyDat = GetHashKeyDat(KeyId); Key = KeyFromOfs(KeyDat.Key); Dat = KeyDat.Dat;}
const char * KeyFromOfs(const int &KeyO) const
Definition: hash.h:823
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool , class THashFunc >
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyDatPrV ( TVec< TPair< TStr, TDat > > &  KeyDatPrV) const

Definition at line 963 of file hash.h.

963  {
964  KeyDatPrV.Gen(Len(), 0);
965  TStr Str; TDat Dat;
966  int KeyId = FFirstKeyId();
967  while (FNextKeyId(KeyId)){
968  GetKeyDat(KeyId, Str, Dat);
969  KeyDatPrV.Add(TPair<TStr, TDat>(Str, Dat));
970  }
971 }
int FFirstKeyId() const
Definition: hash.h:834
int Len() const
Definition: hash.h:770
bool FNextKeyId(int &KeyId) const
Definition: hash.h:933
void GetKeyDat(const int &KeyId, int &KeyO, TDat &Dat) const
Definition: hash.h:814
Definition: ds.h:32
Definition: dt.h:412
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
template<class TDat , class TStringPool , class THashFunc >
int TStrHash< TDat, TStringPool, THashFunc >::GetKeyId ( const char *  Key) const

Definition at line 922 of file hash.h.

922  {
923  if (PortV.Empty()) return -1;
924  const int PortN = abs(THashFunc::GetPrimHashCd(Key) % PortV.Len());
925  const int Hc = abs(THashFunc::GetSecHashCd(Key));
926  int KeyId = PortV[PortN];
927  while (KeyId != -1 && ! (KeyDatV[KeyId].HashCd == Hc && Pool->Cmp(KeyDatV[KeyId].Key, Key) == 0))
928  KeyId = KeyDatV[KeyId].Next;
929  return KeyId;
930 }
PStringPool Pool
Definition: hash.h:741
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TIntV PortV
Definition: hash.h:737
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:542
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::GetKeyId ( const TStr Key) const
inline

Definition at line 820 of file hash.h.

820 { return GetKeyId(Key.CStr()); }
char * CStr()
Definition: dt.h:476
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::GetKeyOfs ( const int &  KeyId) const
inline

Definition at line 822 of file hash.h.

822 { return GetHashKeyDat(KeyId).Key; } // pool string id
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
TKey Key
Definition: hash.h:11
template<class TDat , class TStringPool , class THashFunc >
void TStrHash< TDat, TStringPool, THashFunc >::GetKeyV ( TVec< TStr > &  KeyV) const

Definition at line 939 of file hash.h.

939  {
940  KeyV.Gen(Len(), 0);
941  int KeyId = FFirstKeyId();
942  while (FNextKeyId(KeyId))
943  KeyV.Add(GetKey(KeyId));
944 }
int FFirstKeyId() const
Definition: hash.h:834
int Len() const
Definition: hash.h:770
bool FNextKeyId(int &KeyId) const
Definition: hash.h:933
const char * GetKey(const int &KeyId) const
Definition: hash.h:821
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
::TSize TStrHash< TDat, TStringPool, THashFunc >::GetMemUsed ( ) const
inline

Definition at line 794 of file hash.h.

794  {
795  int64 MemUsed = sizeof(bool)+2*sizeof(int);
796  MemUsed += int64(PortV.Reserved()) * int64(sizeof(TInt));
797  for (int KeyDatN = 0; KeyDatN < KeyDatV.Len(); KeyDatN++) {
798  MemUsed += int64(2 * sizeof(TInt));
799  MemUsed += int64(KeyDatV[KeyDatN].Key.GetMemUsed());
800  MemUsed += int64(KeyDatV[KeyDatN].Dat.GetMemUsed());
801  }
802  // printf("TStrHash: Memory used for hash table: %s\n", TUInt64::GetStr(MemUsed).CStr());
803  MemUsed += 8 + Pool->GetMemUsed();
804  return ::TSize(MemUsed/1000);
805  }
TSizeTy Reserved() const
Returns the size of allocated storage capacity.
Definition: ds.h:549
PStringPool Pool
Definition: hash.h:741
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TIntV PortV
Definition: hash.h:737
TSizeTy GetMemUsed() const
Returns the memory footprint (the number of bytes) of the vector.
Definition: ds.h:483
size_t TSize
Definition: bd.h:58
THKeyDatV KeyDatV
Definition: hash.h:738
Definition: dt.h:1044
long long int64
Definition: bd.h:27
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::GetMxKeyIds ( ) const
inline

Definition at line 774 of file hash.h.

774 { return KeyDatV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat , class TStringPool , class THashFunc >
uint TStrHash< TDat, TStringPool, THashFunc >::GetNextPrime ( const uint Val) const
private

Definition at line 847 of file hash.h.

847  {
848  uint *f = (uint *) TIntH::HashPrimeT, *m, *l = (uint *) TIntH::HashPrimeT + (int) TIntH::HashPrimes;
849  int h, len = (int)TIntH::HashPrimes;
850  while (len > 0) {
851  h = len >> 1; m = f + h;
852  if (*m < Val) { f = m; f++; len = len - h - 1; }
853  else len = h;
854  }
855  return f == l ? *(l - 1) : *f;
856 }
unsigned int uint
Definition: bd.h:11
static const unsigned int HashPrimeT[HashPrimes]
Definition: hash.h:91
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
PStringPool TStrHash< TDat, TStringPool, THashFunc >::GetPool ( ) const
inline

Definition at line 765 of file hash.h.

765 { return Pool; }
PStringPool Pool
Definition: hash.h:741
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::GetPorts ( ) const
inline

Definition at line 772 of file hash.h.

772 { return PortV.Len(); }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TIntV PortV
Definition: hash.h:737
template<class TDat , class TStringPool , class THashFunc >
void TStrHash< TDat, TStringPool, THashFunc >::GetStrIdV ( TIntV StrIdV) const

Definition at line 947 of file hash.h.

947  {
948  StrIdV.Gen(Len(), 0);
949  int KeyId = FFirstKeyId();
950  while (FNextKeyId(KeyId))
951  StrIdV.Add(GetKeyOfs(KeyId));
952 }
int GetKeyOfs(const int &KeyId) const
Definition: hash.h:822
int FFirstKeyId() const
Definition: hash.h:834
int Len() const
Definition: hash.h:770
bool FNextKeyId(int &KeyId) const
Definition: hash.h:933
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsAutoSize ( ) const
inline

Definition at line 773 of file hash.h.

773 { return AutoSizeP; }
TBool AutoSizeP
Definition: hash.h:739
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKey ( const char *  Key) const
inline

Definition at line 825 of file hash.h.

825 { return GetKeyId(Key) != -1; }
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKey ( const TStr Key) const
inline

Definition at line 826 of file hash.h.

826 { return GetKeyId(Key.CStr()) != -1; }
char * CStr()
Definition: dt.h:476
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKey ( const TChA Key) const
inline

Definition at line 827 of file hash.h.

827 { return GetKeyId(Key.CStr()) != -1; }
char * CStr()
Definition: dt.h:255
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKey ( const char *  Key,
int &  KeyId 
) const
inline

Definition at line 828 of file hash.h.

828 { KeyId = GetKeyId(Key); return KeyId != -1; }
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKeyGetDat ( const char *  Key,
TDat &  Dat 
) const
inline

Definition at line 829 of file hash.h.

829 { const int KeyId = GetKeyId(Key); if (KeyId != -1) { Dat = KeyDatV[KeyId].Dat; return true; } else return false; }
THKeyDatV KeyDatV
Definition: hash.h:738
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKeyGetDat ( const TStr Key,
TDat &  Dat 
) const
inline

Definition at line 830 of file hash.h.

830 { const int KeyId = GetKeyId(Key.CStr()); if (KeyId != -1) { Dat = KeyDatV[KeyId].Dat; return true; } else return false; }
THKeyDatV KeyDatV
Definition: hash.h:738
char * CStr()
Definition: dt.h:476
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKeyGetDat ( const TChA Key,
TDat &  Dat 
) const
inline

Definition at line 831 of file hash.h.

831 { const int KeyId = GetKeyId(Key.CStr()); if (KeyId != -1) { Dat = KeyDatV[KeyId].Dat; return true; } else return false; }
char * CStr()
Definition: dt.h:255
THKeyDatV KeyDatV
Definition: hash.h:738
int GetKeyId(const char *Key) const
Definition: hash.h:922
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKeyId ( const int &  KeyId) const
inline

Definition at line 832 of file hash.h.

832 { return 0 <= KeyId && KeyId < KeyDatV.Len() && KeyDatV[KeyId].HashCd != -1; }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
bool TStrHash< TDat, TStringPool, THashFunc >::IsKeyIdEqKeyN ( ) const
inline

Definition at line 775 of file hash.h.

775 {return ! FreeKeys; }
TInt FreeKeys
Definition: hash.h:740
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const char* TStrHash< TDat, TStringPool, THashFunc >::KeyFromOfs ( const int &  KeyO) const
inline

Definition at line 823 of file hash.h.

823 { return Pool->GetCStr(KeyO); }
PStringPool Pool
Definition: hash.h:741
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::Len ( ) const
inline

Definition at line 770 of file hash.h.

770 { return KeyDatV.Len() - FreeKeys; }
TInt FreeKeys
Definition: hash.h:740
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::Load ( TSIn SIn,
bool  PoolToo = true 
)
inline

Definition at line 759 of file hash.h.

759  { PortV.Load(SIn); KeyDatV.Load(SIn); AutoSizeP.Load(SIn); FFreeKeyId.Load(SIn);
760  FreeKeys.Load(SIn); SIn.LoadCs(); if (PoolToo) Pool = PStringPool(SIn); }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
void Load(TSIn &SIn)
Definition: dt.h:901
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
void Load(TSIn &SIn)
Definition: ds.h:895
void LoadCs()
Definition: fl.cpp:28
void Load(TSIn &SIn)
Definition: dt.h:1059
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
TPt< TStringPool > PStringPool
Definition: hash.h:732
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::operator() ( const char *  Key) const
inline

Definition at line 792 of file hash.h.

792 { return GetDat(Key);}
const TDat & GetDat(const char *Key) const
Definition: hash.h:807
template<class TDat , class TStringPool , class THashFunc >
TStrHash< TDat, TStringPool, THashFunc > & TStrHash< TDat, TStringPool, THashFunc >::operator= ( const TStrHash< TDat, TStringPool, THashFunc > &  Hash)

Definition at line 882 of file hash.h.

882  {
883  if (this != &Hash) {
884  PortV = Hash.PortV;
885  KeyDatV = Hash.KeyDatV;
886  AutoSizeP = Hash.AutoSizeP;
887  FFreeKeyId = Hash.FFreeKeyId;
888  FreeKeys = Hash.FreeKeys;
889  if (! Hash.Pool.Empty()) Pool = PStringPool(new TStringPool(*Hash.Pool));
890  else Pool = NULL;
891  }
892  return *this;
893 }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
bool Empty() const
Definition: bd.h:501
TInt FFreeKeyId
Definition: hash.h:740
TIntV PortV
Definition: hash.h:737
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
TPt< TStringPool > PStringPool
Definition: hash.h:732
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
const TDat& TStrHash< TDat, TStringPool, THashFunc >::operator[] ( const int &  KeyId) const
inline

Definition at line 790 of file hash.h.

790 {return GetHashKeyDat(KeyId).Dat;}
TDat Dat
Definition: hash.h:12
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TDat& TStrHash< TDat, TStringPool, THashFunc >::operator[] ( const int &  KeyId)
inline

Definition at line 791 of file hash.h.

791 {return GetHashKeyDat(KeyId).Dat;}
TDat Dat
Definition: hash.h:12
const THKeyDat & GetHashKeyDat(const int &KeyId) const
Definition: hash.h:745
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::Pack ( )
inline

Definition at line 843 of file hash.h.

843 {KeyDatV.Pack();}
THKeyDatV KeyDatV
Definition: hash.h:738
void Pack()
Reduces vector capacity (frees memory) to match its size.
Definition: ds.h:1005
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
int TStrHash< TDat, TStringPool, THashFunc >::Reserved ( ) const
inline

Definition at line 771 of file hash.h.

771 { return KeyDatV.Reserved(); }
TSizeTy Reserved() const
Returns the size of allocated storage capacity.
Definition: ds.h:549
THKeyDatV KeyDatV
Definition: hash.h:738
template<class TDat , class TStringPool , class THashFunc >
void TStrHash< TDat, TStringPool, THashFunc >::Resize ( )
private

Definition at line 859 of file hash.h.

859  {
860  // resize & initialize port vector
861  if (PortV.Empty()) { PortV.Gen(17); PortV.PutAll(-1); }
862  else
863  if (AutoSizeP && KeyDatV.Len() > 3 * PortV.Len()) {
864  const int NxPrime = GetNextPrime(KeyDatV.Len());
865  //printf("%s resize PortV: %d -> %d, Len: %d\n", GetTypeNm(*this).CStr(), PortV.Len(), NxPrime, Len());
866  PortV.Gen(NxPrime); PortV.PutAll(-1); }
867  else
868  return;
869  // rehash keys
870  const int NPorts = PortV.Len();
871  for (int i = 0; i < KeyDatV.Len(); i++) {
872  THKeyDat& KeyDat = KeyDatV[i];
873  if (KeyDat.HashCd != -1) {
874  const int Port = abs(THashFunc::GetPrimHashCd(Pool->GetCStr(KeyDat.Key)) % NPorts);
875  KeyDat.Next = PortV[Port];
876  PortV[Port] = i;
877  }
878  }
879 }
PStringPool Pool
Definition: hash.h:741
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
TIntV PortV
Definition: hash.h:737
bool Empty() const
Tests whether the vector is empty.
Definition: ds.h:542
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1166
THKeyDatV KeyDatV
Definition: hash.h:738
uint GetNextPrime(const uint &Val) const
Definition: hash.h:847
TBool AutoSizeP
Definition: hash.h:739
void Gen(const TSizeTy &_Vals)
Constructs a vector (an array) of _Vals elements.
Definition: ds.h:495
THashKeyDat< TInt, TDat > THKeyDat
Definition: hash.h:734
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::Save ( TSOut SOut,
bool  PoolToo = true 
) const
inline

Definition at line 761 of file hash.h.

761  { PortV.Save(SOut); KeyDatV.Save(SOut);
762  AutoSizeP.Save(SOut); FFreeKeyId.Save(SOut); FreeKeys.Save(SOut); SOut.SaveCs(); if (PoolToo) Pool.Save(SOut); }
PStringPool Pool
Definition: hash.h:741
TInt FreeKeys
Definition: hash.h:740
void Save(TSOut &SOut) const
Definition: dt.h:1060
TInt FFreeKeyId
Definition: hash.h:740
void Save(TSOut &SOut) const
Definition: dt.h:902
TIntV PortV
Definition: hash.h:737
void Save(TSOut &SOut) const
Definition: ds.h:903
void SaveCs()
Definition: fl.h:171
THKeyDatV KeyDatV
Definition: hash.h:738
TBool AutoSizeP
Definition: hash.h:739
void Save(TSOut &SOut) const
Definition: xmlser.h:16
template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
void TStrHash< TDat, TStringPool, THashFunc >::SetPool ( const PStringPool StrPool)
inline

Definition at line 764 of file hash.h.

764 { IAssert(Pool.Empty() || Pool->Empty()); Pool = StrPool; }
#define IAssert(Cond)
Definition: bd.h:262
PStringPool Pool
Definition: hash.h:741
bool Empty() const
Definition: bd.h:501

Member Data Documentation

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TBool TStrHash< TDat, TStringPool, THashFunc >::AutoSizeP
private

Definition at line 739 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TInt TStrHash< TDat, TStringPool, THashFunc >::FFreeKeyId
private

Definition at line 740 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TInt TStrHash< TDat, TStringPool, THashFunc >::FreeKeys
private

Definition at line 740 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
THKeyDatV TStrHash< TDat, TStringPool, THashFunc >::KeyDatV
private

Definition at line 738 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
PStringPool TStrHash< TDat, TStringPool, THashFunc >::Pool
private

Definition at line 741 of file hash.h.

template<class TDat, class TStringPool = TStrPool, class THashFunc = TDefaultHashFunc<TStr>>
TIntV TStrHash< TDat, TStringPool, THashFunc >::PortV
private

Definition at line 737 of file hash.h.


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