SNAP Library 2.0, User Reference  2013-05-13 16:33:57
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
TBlobPt Class Reference

#include <blobbs.h>

List of all members.

Public Member Functions

 TBlobPt ()
 TBlobPt (const TBlobPt &Pt)
 TBlobPt (const uchar &_Seg, const uint &_Addr, const TB8Set &_FSet1, const TB8Set &_FSet2, const TB8Set &_FSet3)
 TBlobPt (const uchar &_Seg, const uint &_Addr)
 TBlobPt (const uint &_Addr)
 TBlobPt (const int &_Addr)
 ~TBlobPt ()
 TBlobPt (TSIn &SIn)
void Save (TSOut &SOut) const
TBlobPtoperator= (const TBlobPt &Pt)
bool operator== (const TBlobPt &Pt) const
bool operator< (const TBlobPt &Pt) const
int GetMemUsed () const
int GetPrimHashCd () const
int GetSecHashCd () const
bool Empty () const
void Clr ()
void PutSeg (const uchar &_Seg)
uchar GetSeg () const
void PutAddr (const uint &_Addr)
uint GetAddr () const
void PutFlag (const int &FlagN, const bool &Val)
bool IsFlag (const int &FlagN) const
void MergeFlags (const TBlobPt &Pt)
void PutFSet (const int &FSetN, const TB8Set &FSet)
TB8Set GetFSet (const int &FSetN)
void Save (const PFRnd &FRnd) const
void SaveAddr (const PFRnd &FRnd) const
TStr GetAddrStr () const
TStr GetStr () const

Static Public Member Functions

static TBlobPt Load (const PFRnd &FRnd)
static TBlobPt LoadAddr (const PFRnd &FRnd, const uchar &Seg=0)

Public Attributes

uchar Seg
uint Addr
TB8Set FSet1
TB8Set FSet2
TB8Set FSet3

Static Public Attributes

static const int MnBlobBfL
static const int Flags = 24

Detailed Description

Definition at line 5 of file blobbs.h.


Constructor & Destructor Documentation

TBlobPt::TBlobPt ( ) [inline]

Definition at line 13 of file blobbs.h.

           :
    Seg(0), Addr(TUInt::Mx), FSet1(), FSet2(), FSet3(){}
TBlobPt::TBlobPt ( const TBlobPt Pt) [inline]

Definition at line 15 of file blobbs.h.

                            :
    Seg(Pt.Seg), Addr(Pt.Addr),
    FSet1(Pt.FSet1), FSet2(Pt.FSet2), FSet3(Pt.FSet3){}
TBlobPt::TBlobPt ( const uchar _Seg,
const uint _Addr,
const TB8Set _FSet1,
const TB8Set _FSet2,
const TB8Set _FSet3 
) [inline]

Definition at line 18 of file blobbs.h.

                                                                    :
    Seg(_Seg), Addr(_Addr), FSet1(_FSet1), FSet2(_FSet2), FSet3(_FSet3){}
TBlobPt::TBlobPt ( const uchar _Seg,
const uint _Addr 
) [inline]

Definition at line 21 of file blobbs.h.

                                               :
    Seg(_Seg), Addr(_Addr), FSet1(), FSet2(), FSet3(){}
TBlobPt::TBlobPt ( const uint _Addr) [inline]

Definition at line 23 of file blobbs.h.

                            :
    Seg(0), Addr(_Addr), FSet1(), FSet2(), FSet3(){}
TBlobPt::TBlobPt ( const int &  _Addr) [inline]

Definition at line 25 of file blobbs.h.

                           :
    Seg(0), Addr(uint(_Addr)), FSet1(), FSet2(), FSet3(){IAssert(_Addr>=0);}
TBlobPt::~TBlobPt ( ) [inline]

Definition at line 27 of file blobbs.h.

{}
TBlobPt::TBlobPt ( TSIn SIn) [inline]

Definition at line 28 of file blobbs.h.

                    {
    SIn.Load(Seg); SIn.Load(Addr);
    FSet1=TB8Set(SIn); FSet2=TB8Set(SIn); FSet3=TB8Set(SIn);}

Member Function Documentation

void TBlobPt::Clr ( ) [inline]

Definition at line 50 of file blobbs.h.

bool TBlobPt::Empty ( ) const [inline]

Definition at line 49 of file blobbs.h.

{return Addr==TUInt::Mx;}
uint TBlobPt::GetAddr ( ) const [inline]

Definition at line 54 of file blobbs.h.

{return Addr;}
TStr TBlobPt::GetAddrStr ( ) const [inline]

Definition at line 76 of file blobbs.h.

                          {
    TChA AddrChA; AddrChA+=TInt::GetStr(Seg); AddrChA+=':';
    AddrChA+=TUInt::GetStr(Addr); return AddrChA;}
TB8Set TBlobPt::GetFSet ( const int &  FSetN)

Definition at line 34 of file blobbs.cpp.

                                       {
  switch (FSetN){
    case 1: return FSet1;
    case 2: return FSet2;
    case 3: return FSet3;
    default: Fail; return TB8Set();
  }
}
int TBlobPt::GetMemUsed ( ) const [inline]

Definition at line 44 of file blobbs.h.

{return sizeof(TBlobPt);}
int TBlobPt::GetPrimHashCd ( ) const [inline]

Definition at line 46 of file blobbs.h.

{return abs(int(Addr));}
int TBlobPt::GetSecHashCd ( ) const [inline]

Definition at line 47 of file blobbs.h.

{return (abs(int(Addr))+int(Seg)*0x10);}
uchar TBlobPt::GetSeg ( ) const [inline]

Definition at line 52 of file blobbs.h.

{return Seg;}
TStr TBlobPt::GetStr ( ) const

Definition at line 43 of file blobbs.cpp.

                           {
  TChA ChA;
  ChA+='[';
  if (Empty()){
    ChA+="Null";
  } else {
    ChA+=TUInt::GetStr(uint(Seg)); ChA+=':'; ChA+=TUInt::GetStr(Addr);
    for (int FlagN=0; FlagN<Flags; FlagN++){
      if (IsFlag(FlagN)){
        ChA+='{'; ChA+=TInt::GetStr(FlagN); ChA+='}';}
    }
  }
  ChA+=']';
  return ChA;
}
bool TBlobPt::IsFlag ( const int &  FlagN) const

Definition at line 15 of file blobbs.cpp.

                                           {
  EAssert((0<=FlagN)&&(FlagN<Flags));
  switch (FlagN/8){
    case 0: return FSet1.GetBit(7-FlagN%8);
    case 1: return FSet2.GetBit(7-FlagN%8);
    case 2: return FSet3.GetBit(7-FlagN%8);
    default: Fail; return false;
  }
}
static TBlobPt TBlobPt::Load ( const PFRnd FRnd) [inline, static]

Definition at line 62 of file blobbs.h.

                                        {
    uchar Seg=FRnd->GetUCh(); uint Addr=FRnd->GetUInt();
    TB8Set B8Set1(FRnd->GetUCh()); TB8Set B8Set2(FRnd->GetUCh());
    TB8Set B8Set3(FRnd->GetUCh());
    return TBlobPt(Seg, Addr, B8Set1, B8Set2, B8Set3);}
static TBlobPt TBlobPt::LoadAddr ( const PFRnd FRnd,
const uchar Seg = 0 
) [inline, static]

Definition at line 71 of file blobbs.h.

                                                                {
    return TBlobPt(Seg, FRnd->GetUInt());}
void TBlobPt::MergeFlags ( const TBlobPt Pt) [inline]

Definition at line 57 of file blobbs.h.

                                    {
    FSet1|=Pt.FSet1; FSet2|=Pt.FSet2; FSet3|=Pt.FSet3;}
bool TBlobPt::operator< ( const TBlobPt Pt) const [inline]

Definition at line 42 of file blobbs.h.

                                          {
    return (Seg<Pt.Seg)||((Seg==Pt.Seg)&&(Addr<Pt.Addr));}
TBlobPt& TBlobPt::operator= ( const TBlobPt Pt) [inline]

Definition at line 35 of file blobbs.h.

                                       {
    if (this!=&Pt){
      Seg=Pt.Seg; Addr=Pt.Addr;
      FSet1=Pt.FSet1; FSet2=Pt.FSet2; FSet3=Pt.FSet3;}
    return *this;}
bool TBlobPt::operator== ( const TBlobPt Pt) const [inline]

Definition at line 40 of file blobbs.h.

                                           {
    return (Seg==Pt.Seg)&&(Addr==Pt.Addr);}
void TBlobPt::PutAddr ( const uint _Addr) [inline]

Definition at line 53 of file blobbs.h.

{Addr=_Addr;}
void TBlobPt::PutFlag ( const int &  FlagN,
const bool &  Val 
)

Definition at line 5 of file blobbs.cpp.

                                                      {
  EAssert((0<=FlagN)&&(FlagN<Flags));
  switch (FlagN/8){
    case 0: FSet1.SetBit(7-FlagN%8, Val); break;
    case 1: FSet2.SetBit(7-FlagN%8, Val); break;
    case 2: FSet3.SetBit(7-FlagN%8, Val); break;
    default: Fail;
  }
}
void TBlobPt::PutFSet ( const int &  FSetN,
const TB8Set FSet 
)

Definition at line 25 of file blobbs.cpp.

                                                         {
  switch (FSetN){
    case 1: FSet1=FSet; break;
    case 2: FSet2=FSet; break;
    case 3: FSet3=FSet; break;
    default: Fail;
  }
}
void TBlobPt::PutSeg ( const uchar _Seg) [inline]

Definition at line 51 of file blobbs.h.

{Seg=_Seg;}
void TBlobPt::Save ( TSOut SOut) const [inline]

Definition at line 31 of file blobbs.h.

                               {
    SOut.Save(Seg); SOut.Save(Addr);
    FSet1.Save(SOut); FSet2.Save(SOut); FSet3.Save(SOut);}
void TBlobPt::Save ( const PFRnd FRnd) const [inline]

Definition at line 67 of file blobbs.h.

                                     {
    FRnd->PutUCh(Seg); FRnd->PutUInt(Addr);
    FRnd->PutUCh(FSet1.GetUCh()); FRnd->PutUCh(FSet2.GetUCh());
    FRnd->PutUCh(FSet3.GetUCh());}
void TBlobPt::SaveAddr ( const PFRnd FRnd) const [inline]

Definition at line 73 of file blobbs.h.

                                         {
    FRnd->PutUInt(Addr);}

Member Data Documentation

Definition at line 10 of file blobbs.h.

const int TBlobPt::Flags = 24 [static]

Definition at line 8 of file blobbs.h.

Definition at line 11 of file blobbs.h.

Definition at line 11 of file blobbs.h.

Definition at line 11 of file blobbs.h.

const int TBlobPt::MnBlobBfL [static]

Definition at line 7 of file blobbs.h.

Definition at line 9 of file blobbs.h.


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