SNAP Library 2.1, User 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>

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.

             :
    Modified(false), Next(), Key(), FDat(), VDatBPt(){}
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.

                         {
    return sizeof(THash*)+Next.GetMemUsed()+
     Key.GetMemUsed()+FDat.GetMemUsed()+VDatBPt.GetMemUsed();}
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.

{return new TFHashKey(SIn);}
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.

                                      {
  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);
  }
}
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.

                                                 {
    if (this!=&FHashKey){
      Modified=true; Next=FHashKey.Next;
      Key=FHashKey.Key; FDat=FHashKey.FDat; VDatBPt=FHashKey.VDatBPt;}
    return *this;}
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.

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

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

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

Definition at line 20 of file fds.h.

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

Definition at line 19 of file fds.h.

template<class TKey , class TFDat , class TVDat >
bool TFHashKey< TKey, TFDat, TVDat >::Modified [private]

Definition at line 14 of file fds.h.

template<class TKey , class TFDat , class TVDat >
TBlobPt TFHashKey< TKey, TFDat, TVDat >::Next

Definition at line 18 of file fds.h.

template<class TKey , class TFDat , class TVDat >
TBlobPt TFHashKey< TKey, TFDat, TVDat >::VDatBPt

Definition at line 21 of file fds.h.


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