SNAP Library 2.3, Developer Reference  2014-06-16 11:58:46
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
TFHashKey< TKey, TFDat, TVDat > Class Template Reference

#include <fds.h>

Collaboration diagram for TFHashKey< TKey, TFDat, TVDat >:

Public Types

typedef TPt< TFHashKey< TKey,
TFDat, TVDat > > 
PFHashKey
 
typedef TFHash< TKey, TFDat,
TVDat > 
THash
 

Public Member Functions

 TFHashKey ()
 
 TFHashKey (const TBlobPt &_Next, const TKey &_Key, const TFDat &_FDat, const TBlobPt &_VDatBPt=TBlobPt())
 
 ~TFHashKey ()
 
 TFHashKey (TSIn &SIn)
 
void Save (TSOut &SOut)
 
TFHashKeyoperator= (const TFHashKey &FHashKey)
 
int GetMemUsed () const
 
void PutModified (const bool &_Modified)
 
void OnDelFromCache (const TBlobPt &BlobPt, void *RefToBs)
 

Static Public Member Functions

static PFHashKey Load (TSIn &SIn)
 

Public Attributes

TBlobPt Next
 
TKey Key
 
TFDat FDat
 
TBlobPt VDatBPt
 

Private Attributes

TCRef CRef
 
bool Modified
 

Friends

class TPt< TFHashKey< TKey, TFDat, TVDat > >
 

Detailed Description

template<class TKey, class TFDat, class TVDat>
class TFHashKey< TKey, TFDat, TVDat >

Definition at line 11 of file fds.h.

Member Typedef Documentation

template<class TKey , class TFDat , class TVDat >
typedef TPt<TFHashKey<TKey, TFDat, TVDat> > TFHashKey< TKey, TFDat, TVDat >::PFHashKey

Definition at line 16 of file fds.h.

template<class TKey , class TFDat , class TVDat >
typedef TFHash<TKey, TFDat, TVDat> TFHashKey< TKey, TFDat, TVDat >::THash

Definition at line 17 of file fds.h.

Constructor & Destructor Documentation

template<class TKey , class TFDat , class TVDat >
TFHashKey< TKey, TFDat, TVDat >::TFHashKey ( )
inline

Definition at line 23 of file fds.h.

Referenced by TFHashKey< TKey, TFDat, TVDat >::Load().

23  :
24  Modified(false), Next(), Key(), FDat(), VDatBPt(){}
bool Modified
Definition: fds.h:14
TKey Key
Definition: fds.h:19
TBlobPt VDatBPt
Definition: fds.h:21
TFDat FDat
Definition: fds.h:20
TBlobPt Next
Definition: fds.h:18

Here is the caller graph for this function:

template<class TKey , class TFDat , class TVDat >
TFHashKey< TKey, TFDat, TVDat >::TFHashKey ( const TBlobPt _Next,
const TKey &  _Key,
const TFDat &  _FDat,
const TBlobPt _VDatBPt = TBlobPt() 
)
inline

Definition at line 25 of file fds.h.

26  :
27  Modified(false), Next(_Next), Key(_Key), FDat(_FDat), VDatBPt(_VDatBPt){}
bool Modified
Definition: fds.h:14
TKey Key
Definition: fds.h:19
TBlobPt VDatBPt
Definition: fds.h:21
TFDat FDat
Definition: fds.h:20
TBlobPt Next
Definition: fds.h:18
template<class TKey , class TFDat , class TVDat >
TFHashKey< TKey, TFDat, TVDat >::~TFHashKey ( )
inline

Definition at line 28 of file fds.h.

28 {}
template<class TKey , class TFDat , class TVDat >
TFHashKey< TKey, TFDat, TVDat >::TFHashKey ( TSIn SIn)
inline

Definition at line 29 of file fds.h.

29  :
30  Modified(false), Next(SIn), Key(SIn), FDat(SIn), VDatBPt(SIn){}
bool Modified
Definition: fds.h:14
TKey Key
Definition: fds.h:19
TBlobPt VDatBPt
Definition: fds.h:21
TFDat FDat
Definition: fds.h:20
TBlobPt Next
Definition: fds.h:18

Member Function Documentation

template<class TKey , class TFDat , class TVDat >
int TFHashKey< TKey, TFDat, TVDat >::GetMemUsed ( ) const
inline

Definition at line 40 of file fds.h.

References TFHashKey< TKey, TFDat, TVDat >::FDat, TBlobPt::GetMemUsed(), TFHashKey< TKey, TFDat, TVDat >::Key, TFHashKey< TKey, TFDat, TVDat >::Next, and TFHashKey< TKey, TFDat, TVDat >::VDatBPt.

40  {
41  return sizeof(THash*)+Next.GetMemUsed()+
42  Key.GetMemUsed()+FDat.GetMemUsed()+VDatBPt.GetMemUsed();}
TKey Key
Definition: fds.h:19
TBlobPt VDatBPt
Definition: fds.h:21
int GetMemUsed() const
Definition: blobbs.h:44
TFDat FDat
Definition: fds.h:20
Definition: hash.h:88
TBlobPt Next
Definition: fds.h:18

Here is the call graph for this function:

template<class TKey , class TFDat , class TVDat >
static PFHashKey TFHashKey< TKey, TFDat, TVDat >::Load ( TSIn SIn)
inlinestatic

Definition at line 31 of file fds.h.

References TFHashKey< TKey, TFDat, TVDat >::TFHashKey().

31 {return new TFHashKey(SIn);}
TFHashKey()
Definition: fds.h:23

Here is the call graph for this function:

template<class TKey , class TFDat , class TVDat >
void TFHashKey< TKey, TFDat, TVDat >::OnDelFromCache ( const TBlobPt BlobPt,
void *  RefToBs 
)

Definition at line 52 of file fds.h.

References fhbtKey, TFHash< TKey, TFDat, TVDat >::GetHashBBs(), TMOut::GetSIn(), IAssert, TBlobBs::PutBlob(), TPt< TRec >::Save(), and TInt::Save().

53  {
54  if (Modified){
55  // prepare hash table object
56  THash* FHash=(THash*)RefToBs;
57  // save the key
58  TMOut MOut; TInt(int(fhbtKey)).Save(MOut); Save(MOut);
59  TBlobPt NewBlobPt=FHash->GetHashBBs()->PutBlob(BlobPt, MOut.GetSIn());
60  // blob-pointer for key should not change
61  IAssert(NewBlobPt==BlobPt);
62  }
63 }
#define IAssert(Cond)
Definition: bd.h:262
void Save(TSOut &SOut) const
Definition: dt.h:1057
PSIn GetSIn(const bool &IsCut=true, const int &CutBfL=-1)
Definition: fl.cpp:666
void Save(TSOut &SOut)
Definition: fds.h:32
bool Modified
Definition: fds.h:14
Definition: dt.h:1041
Definition: fl.h:417
Definition: fds.h:6
Definition: blobbs.h:5
Definition: hash.h:88

Here is the call graph for this function:

template<class TKey , class TFDat , class TVDat >
TFHashKey& TFHashKey< TKey, TFDat, TVDat >::operator= ( const TFHashKey< TKey, TFDat, TVDat > &  FHashKey)
inline

Definition at line 35 of file fds.h.

References TFHashKey< TKey, TFDat, TVDat >::FDat, TFHashKey< TKey, TFDat, TVDat >::Key, TFHashKey< TKey, TFDat, TVDat >::Modified, TFHashKey< TKey, TFDat, TVDat >::Next, and TFHashKey< TKey, TFDat, TVDat >::VDatBPt.

35  {
36  if (this!=&FHashKey){
37  Modified=true; Next=FHashKey.Next;
38  Key=FHashKey.Key; FDat=FHashKey.FDat; VDatBPt=FHashKey.VDatBPt;}
39  return *this;}
bool Modified
Definition: fds.h:14
TKey Key
Definition: fds.h:19
TBlobPt VDatBPt
Definition: fds.h:21
TFDat FDat
Definition: fds.h:20
TBlobPt Next
Definition: fds.h:18
template<class TKey , class TFDat , class TVDat >
void TFHashKey< TKey, TFDat, TVDat >::PutModified ( const bool &  _Modified)
inline

Definition at line 44 of file fds.h.

References TFHashKey< TKey, TFDat, TVDat >::Modified.

44 {Modified=_Modified;}
bool Modified
Definition: fds.h:14
template<class TKey , class TFDat , class TVDat >
void TFHashKey< TKey, TFDat, TVDat >::Save ( TSOut SOut)
inline

Definition at line 32 of file fds.h.

References TFHashKey< TKey, TFDat, TVDat >::FDat, TFHashKey< TKey, TFDat, TVDat >::Key, TFHashKey< TKey, TFDat, TVDat >::Next, TBlobPt::Save(), and TFHashKey< TKey, TFDat, TVDat >::VDatBPt.

32  {
33  Next.Save(SOut); Key.Save(SOut); FDat.Save(SOut); VDatBPt.Save(SOut);}
TKey Key
Definition: fds.h:19
TBlobPt VDatBPt
Definition: fds.h:21
TFDat FDat
Definition: fds.h:20
TBlobPt Next
Definition: fds.h:18
void Save(TSOut &SOut) const
Definition: blobbs.h:31

Here is the call graph for this function:

Friends And Related Function Documentation

template<class TKey , class TFDat , class TVDat >
friend class TPt< TFHashKey< TKey, TFDat, TVDat > >
friend

Definition at line 48 of file fds.h.

Member Data Documentation

template<class TKey , class TFDat , class TVDat >
TCRef TFHashKey< TKey, TFDat, TVDat >::CRef
private

Definition at line 13 of file fds.h.

template<class TKey , class TFDat , class TVDat >
TFDat TFHashKey< TKey, TFDat, TVDat >::FDat
template<class TKey , class TFDat , class TVDat >
TKey TFHashKey< TKey, TFDat, TVDat >::Key
template<class TKey , class TFDat , class TVDat >
bool TFHashKey< TKey, TFDat, TVDat >::Modified
private
template<class TKey , class TFDat , class TVDat >
TBlobPt TFHashKey< TKey, TFDat, TVDat >::Next
template<class TKey , class TFDat , class TVDat >
TBlobPt TFHashKey< TKey, TFDat, TVDat >::VDatBPt

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