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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TFHashKey< TKey, TFDat, TVDat > Class Template Reference

#include <fds.h>

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

List of all members.

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().

             :
    Modified(false), Next(), Key(), FDat(), VDatBPt(){}

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.

                                                                           :
    Modified(false), Next(_Next), Key(_Key), FDat(_FDat), VDatBPt(_VDatBPt){}
template<class TKey , class TFDat , class TVDat >
TFHashKey< TKey, TFDat, TVDat >::~TFHashKey ( ) [inline]

Definition at line 28 of file fds.h.

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

Definition at line 29 of file fds.h.

                      :
    Modified(false), Next(SIn), Key(SIn), FDat(SIn), VDatBPt(SIn){}

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.

                         {
    return sizeof(THash*)+Next.GetMemUsed()+
     Key.GetMemUsed()+FDat.GetMemUsed()+VDatBPt.GetMemUsed();}

Here is the call graph for this function:

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

Definition at line 31 of file fds.h.

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

{return new TFHashKey(SIn);}

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().

                                      {
  if (Modified){
    // prepare hash table object
    THash* FHash=(THash*)RefToBs;
    // save the key
    TMOut MOut; TInt(int(fhbtKey)).Save(MOut); Save(MOut);
    TBlobPt NewBlobPt=FHash->GetHashBBs()->PutBlob(BlobPt, MOut.GetSIn());
    // blob-pointer for key should not change
    IAssert(NewBlobPt==BlobPt);
  }
}

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]
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.

{Modified=_Modified;}
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.

                        {
    Next.Save(SOut); Key.Save(SOut); FDat.Save(SOut); VDatBPt.Save(SOut);}

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: