SNAP Library , User Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <blobbs.h>
Inherited by TGBlobBs, and TMBlobBs.
Public Member Functions | |
UndefCopyAssign (TBlobBs) | |
TBlobBs () | |
virtual | ~TBlobBs () |
TBlobBs (TSIn &) | |
void | Save (TSOut &) const |
virtual TStr | GetVersionStr () const =0 |
void | PutVersionStr (const PFRnd &FBlobBs) |
void | AssertVersionStr (const PFRnd &FBlobBs) |
TStr | GetBlobBsStateStr (const TBlobBsState &BlobBsState) |
int | GetStateStrLen () |
void | PutBlobBsStateStr (const PFRnd &FBlobBs, const TBlobBsState &State) |
void | AssertBlobBsStateStr (const PFRnd &FBlobBs, const TBlobBsState &State) |
void | PutMxSegLen (const PFRnd &FBlobBs, const int &MxSegLen) |
int | GetMxSegLen (const PFRnd &FBlobBs) |
void | GenBlockLenV (TIntV &BlockLenV) |
void | PutBlockLenV (const PFRnd &FBlobBs, const TIntV &BlockLenV) |
void | GetBlockLenV (const PFRnd &FBlobBs, TIntV &BlockLenV) |
void | GenFFreeBlobPtV (const TIntV &BlockLenV, TBlobPtV &FFreeBlobPtV) |
void | PutFFreeBlobPtV (const PFRnd &FBlobBs, const TBlobPtV &FFreeBlobPtV) |
void | GetFFreeBlobPtV (const PFRnd &FBlobBs, TBlobPtV &FFreeBlobPtV) |
void | GetAllocInfo (const int &BfL, const TIntV &BlockLenV, int &MxBfL, int &FFreeBlobPtN) |
uint | GetBeginBlobTag () |
uint | GetEndBlobTag () |
void | PutBlobTag (const PFRnd &FBlobBs, const TBlobTag &BlobTag) |
void | AssertBlobTag (const PFRnd &FBlobBs, const TBlobTag &BlobTag) |
void | PutBlobState (const PFRnd &FBlobBs, const TBlobState &State) |
TBlobState | GetBlobState (const PFRnd &FBlobBs) |
void | AssertBlobState (const PFRnd &FBlobBs, const TBlobState &State) |
void | AssertBfCsEqFlCs (const TCs &BfCs, const TCs &FCs) |
virtual TBlobPt | PutBlob (const PSIn &SIn)=0 |
TBlobPt | PutBlob (const TStr &Str) |
virtual TBlobPt | PutBlob (const TBlobPt &BlobPt, const PSIn &SIn)=0 |
virtual PSIn | GetBlob (const TBlobPt &BlobPt)=0 |
virtual void | DelBlob (const TBlobPt &BlobPt)=0 |
virtual TBlobPt | GetFirstBlobPt ()=0 |
virtual TBlobPt | FFirstBlobPt ()=0 |
virtual bool | FNextBlobPt (TBlobPt &TrvBlobPt, TBlobPt &BlobPt, PSIn &BlobSIn)=0 |
bool | FNextBlobPt (TBlobPt &TrvBlobPt, PSIn &BlobSIn) |
Static Public Member Functions | |
static PBlobBs | Load (TSIn &) |
Static Public Attributes | |
static const int | MnBlobBfL = 16 |
static const int | MxBlobFLen = 1000000000 |
static const TStr | MxSegLenVNm = "MxSegLen" |
static const TStr | BlockLenVNm = "BlockLenV" |
static const TStr | FFreeBlobPtVNm = "FFreeBlobPtV" |
Private Attributes | |
TCRef | CRef |
Friends | |
class | TPt< TBlobBs > |
TBlobBs::TBlobBs | ( | ) | [inline] |
virtual TBlobBs::~TBlobBs | ( | ) | [inline, virtual] |
TBlobBs::TBlobBs | ( | TSIn & | ) | [inline] |
void TBlobBs::AssertBfCsEqFlCs | ( | const TCs & | BfCs, |
const TCs & | FCs | ||
) |
Definition at line 205 of file blobbs.cpp.
void TBlobBs::AssertBlobBsStateStr | ( | const PFRnd & | FBlobBs, |
const TBlobBsState & | State | ||
) |
Definition at line 90 of file blobbs.cpp.
{ TStr CorrStateStr=GetBlobBsStateStr(State); bool IsOk; TStr TestStateStr=FBlobBs->GetStr(GetStateStrLen(), IsOk); if (!(IsOk && (CorrStateStr==TestStateStr))) { TExcept::ThrowFull("Error in AssertBlobBsStateStr!", TStr(__FILE__)+" line "+TInt::GetStr(__LINE__)); } }
void TBlobBs::AssertBlobState | ( | const PFRnd & | FBlobBs, |
const TBlobState & | State | ||
) |
Definition at line 201 of file blobbs.cpp.
{ EAssert(TBlobState(FBlobBs->GetCh())==State); }
void TBlobBs::AssertBlobTag | ( | const PFRnd & | FBlobBs, |
const TBlobTag & | BlobTag | ||
) |
Definition at line 185 of file blobbs.cpp.
{ switch (BlobTag){ case btBegin: EAssert(FBlobBs->GetUInt()==GetBeginBlobTag()); break; case btEnd: EAssert(FBlobBs->GetUInt()==GetEndBlobTag()); break; default: TExcept::Throw("Error asserting BlobTag"); } }
void TBlobBs::AssertVersionStr | ( | const PFRnd & | FBlobBs | ) |
Definition at line 68 of file blobbs.cpp.
virtual void TBlobBs::DelBlob | ( | const TBlobPt & | BlobPt | ) | [pure virtual] |
virtual TBlobPt TBlobBs::FFirstBlobPt | ( | ) | [pure virtual] |
virtual bool TBlobBs::FNextBlobPt | ( | TBlobPt & | TrvBlobPt, |
TBlobPt & | BlobPt, | ||
PSIn & | BlobSIn | ||
) | [pure virtual] |
bool TBlobBs::FNextBlobPt | ( | TBlobPt & | TrvBlobPt, |
PSIn & | BlobSIn | ||
) | [inline] |
Definition at line 148 of file blobbs.h.
{ TBlobPt BlobPt; return FNextBlobPt(TrvBlobPt, BlobPt, BlobSIn);}
void TBlobBs::GenBlockLenV | ( | TIntV & | BlockLenV | ) |
Definition at line 114 of file blobbs.cpp.
{ BlockLenV.Clr(); for (int P2Exp=0; P2Exp<TB4Def::MxP2Exp; P2Exp++){ BlockLenV.Add(TInt(TB4Def::GetP2(P2Exp)));} EAssert(int(BlockLenV.Last())<2000000000); {for (int Len=10; Len<100; Len+=10){BlockLenV.Add(Len);}} {for (int Len=100; Len<10000; Len+=100){BlockLenV.Add(Len);}} {for (int Len=10000; Len<100000; Len+=1000){BlockLenV.Add(Len);}} {for (int Len=100000; Len<1000000; Len+=25000){BlockLenV.Add(Len);}} {for (int Len=1000000; Len<10000000; Len+=1000000){BlockLenV.Add(Len);}} {for (int Len=10000000; Len<100000000; Len+=10000000){BlockLenV.Add(Len);}} BlockLenV.Sort(); }
void TBlobBs::GenFFreeBlobPtV | ( | const TIntV & | BlockLenV, |
TBlobPtV & | FFreeBlobPtV | ||
) |
Definition at line 148 of file blobbs.cpp.
void TBlobBs::GetAllocInfo | ( | const int & | BfL, |
const TIntV & | BlockLenV, | ||
int & | MxBfL, | ||
int & | FFreeBlobPtN | ||
) |
Definition at line 168 of file blobbs.cpp.
uint TBlobBs::GetBeginBlobTag | ( | ) | [inline] |
virtual PSIn TBlobBs::GetBlob | ( | const TBlobPt & | BlobPt | ) | [pure virtual] |
TStr TBlobBs::GetBlobBsStateStr | ( | const TBlobBsState & | BlobBsState | ) |
Definition at line 75 of file blobbs.cpp.
TBlobState TBlobBs::GetBlobState | ( | const PFRnd & | FBlobBs | ) |
Definition at line 197 of file blobbs.cpp.
{ return TBlobState(int(FBlobBs->GetCh())); }
void TBlobBs::GetBlockLenV | ( | const PFRnd & | FBlobBs, |
TIntV & | BlockLenV | ||
) |
Definition at line 138 of file blobbs.cpp.
uint TBlobBs::GetEndBlobTag | ( | ) | [inline] |
void TBlobBs::GetFFreeBlobPtV | ( | const PFRnd & | FBlobBs, |
TBlobPtV & | FFreeBlobPtV | ||
) |
Definition at line 160 of file blobbs.cpp.
{ EAssert(FBlobBs->GetStr(FFreeBlobPtVNm.Len())==FFreeBlobPtVNm); FFreeBlobPtV.Gen(FBlobBs->GetInt()); for (int FFreeBlobPtN=0; FFreeBlobPtN<FFreeBlobPtV.Len(); FFreeBlobPtN++){ FFreeBlobPtV[FFreeBlobPtN]=TBlobPt::Load(FBlobBs);} EAssert(FBlobBs->GetInt()==-1); }
virtual TBlobPt TBlobBs::GetFirstBlobPt | ( | ) | [pure virtual] |
int TBlobBs::GetMxSegLen | ( | const PFRnd & | FBlobBs | ) |
Definition at line 107 of file blobbs.cpp.
{ EAssert(FBlobBs->GetStr(MxSegLenVNm.Len())==MxSegLenVNm); return FBlobBs->GetInt(); }
int TBlobBs::GetStateStrLen | ( | ) | [inline] |
virtual TStr TBlobBs::GetVersionStr | ( | ) | const [pure virtual] |
static PBlobBs TBlobBs::Load | ( | TSIn & | ) | [inline, static] |
virtual TBlobPt TBlobBs::PutBlob | ( | const PSIn & | SIn | ) | [pure virtual] |
TBlobPt TBlobBs::PutBlob | ( | const TStr & | Str | ) | [inline] |
Definition at line 139 of file blobbs.h.
{ PSIn SIn=TStrIn::New(Str); return PutBlob(SIn);}
virtual TBlobPt TBlobBs::PutBlob | ( | const TBlobPt & | BlobPt, |
const PSIn & | SIn | ||
) | [pure virtual] |
void TBlobBs::PutBlobBsStateStr | ( | const PFRnd & | FBlobBs, |
const TBlobBsState & | State | ||
) |
Definition at line 86 of file blobbs.cpp.
{ FBlobBs->PutStr(GetBlobBsStateStr(State)); }
void TBlobBs::PutBlobState | ( | const PFRnd & | FBlobBs, |
const TBlobState & | State | ||
) |
Definition at line 193 of file blobbs.cpp.
{ FBlobBs->PutCh(char(State)); }
void TBlobBs::PutBlobTag | ( | const PFRnd & | FBlobBs, |
const TBlobTag & | BlobTag | ||
) |
Definition at line 177 of file blobbs.cpp.
{ switch (BlobTag){ case btBegin: FBlobBs->PutUInt(GetBeginBlobTag()); break; case btEnd: FBlobBs->PutUInt(GetEndBlobTag()); break; default: Fail; } }
void TBlobBs::PutBlockLenV | ( | const PFRnd & | FBlobBs, |
const TIntV & | BlockLenV | ||
) |
Definition at line 130 of file blobbs.cpp.
void TBlobBs::PutFFreeBlobPtV | ( | const PFRnd & | FBlobBs, |
const TBlobPtV & | FFreeBlobPtV | ||
) |
Definition at line 152 of file blobbs.cpp.
void TBlobBs::PutMxSegLen | ( | const PFRnd & | FBlobBs, |
const int & | MxSegLen | ||
) |
Definition at line 102 of file blobbs.cpp.
{ FBlobBs->PutStr(MxSegLenVNm); FBlobBs->PutInt(MxSegLen); }
void TBlobBs::PutVersionStr | ( | const PFRnd & | FBlobBs | ) |
Definition at line 64 of file blobbs.cpp.
{ FBlobBs->PutStr(GetVersionStr()); }
void TBlobBs::Save | ( | TSOut & | ) | const [inline] |
const TStr TBlobBs::BlockLenVNm = "BlockLenV" [static] |
TCRef TBlobBs::CRef [private] |
const TStr TBlobBs::FFreeBlobPtVNm = "FFreeBlobPtV" [static] |
const int TBlobBs::MnBlobBfL = 16 [static] |
const int TBlobBs::MxBlobFLen = 1000000000 [static] |
const TStr TBlobBs::MxSegLenVNm = "MxSegLen" [static] |