SNAP Library, User Reference
2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
|
Go to the source code of this file.
Classes | |
class | TRnd |
class | TMemIn |
class | TMemOut |
class | TChA |
class | TChAIn |
class | TRStr |
class | TStr |
class | TStrIn |
class | TDbStr |
class | TVoid |
class | TBool |
class | TCh |
class | TUCh |
class | TSInt |
class | TInt |
class | TUInt |
class | TUInt64 |
class | TFlt |
class | TAscFlt |
class | TSFlt |
class | TLFlt |
class | TFltRect |
Typedefs | |
typedef TVec< TStr > | TStrV |
Functions | |
ClassHdTP (TXmlTok, PXmlTok) | |
void | Resize (const int &_MxBfL) |
bool | DoFitLen (const int &LBfL) const |
TMem (const int &_MxBfL=0) | |
static PMem | New (const int &MxBfL=0) |
TMem (const void *_Bf, const int &_BfL) | |
static PMem | New (const void *Bf, const int &BfL) |
TMem (const TMem &Mem) | |
static PMem | New (const TMem &Mem) |
static PMem | New (const PMem &Mem) |
TMem (const TStr &Str) | |
static PMem | New (const TStr &Str) |
~TMem () | |
TMem (TSIn &SIn) | |
void | Save (TSOut &SOut) const |
void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm) |
void | SaveXml (TSOut &SOut, const TStr &Nm) const |
TMem & | operator= (const TMem &Mem) |
char * | operator() () const |
TMem & | operator+= (const char &Ch) |
TMem & | operator+= (const TMem &Mem) |
TMem & | operator+= (const TStr &Str) |
TMem & | operator+= (const PSIn &SIn) |
char & | operator[] (const int &ChN) const |
int | GetMemUsed () const |
void | Gen (const int &_BfL) |
void | GenZeros (const int &_BfL) |
void | Reserve (const int &_MxBfL, const bool &DoClr=true) |
void | Del (const int &BChN, const int &EChN) |
void | Clr (const bool &DoDel=true) |
int | Len () const |
bool | Empty () const |
void | Trunc (const int &_BfL) |
void | Push (const char &Ch) |
char | Pop () |
bool | DoFitStr (const TStr &Str) const |
void | AddBf (const void *Bf, const int &BfL) |
char * | GetBf () const |
TStr | GetAsStr (const char &NewNullCh='\0') const |
PSIn | GetSIn () const |
static void | LoadMem (const PSIn &SIn, TMem &Mem) |
static void | LoadMem (const PSIn &SIn, const PMem &Mem) |
void | SaveMem (const PSOut &SOut) const |
void | Resize (uint _MxBfL) |
TStrPool (uint MxBfLen=0, uint _GrowBy=16 *1024 *1024) | |
TStrPool (TSIn &SIn, bool LoadCompact=true) | |
TStrPool (const TStrPool &Pool) | |
~TStrPool () | |
static PStrPool | New (uint _MxBfLen=0, uint _GrowBy=16 *1024 *1024) |
static PStrPool | New (TSIn &SIn) |
static PStrPool | Load (TSIn &SIn, bool LoadCompacted=true) |
void | Save (const TStr &FNm) |
uint | Size () const |
TStrPool & | operator= (const TStrPool &Pool) |
uint | AddStr (const char *Str, uint Len) |
uint | AddStr (const char *Str) |
uint | AddStr (const TStr &Str) |
TStr | GetStr (uint Offset) const |
const char * | GetCStr (uint Offset) const |
void | Clr (bool DoDel=false) |
int | Cmp (uint Offset, const char *Str) const |
static int | GetPrimHashCd (const char *CStr) |
static int | GetSecHashCd (const char *CStr) |
int | GetPrimHashCd (uint Offset) |
int | GetSecHashCd (uint Offset) |
void | Resize (const ::TSize &_MxBfL) |
TStrPool64 (::TSize _MxBfL=0,::TSize _GrowBy=16 *1024 *1024) | |
TStrPool64 (const TStrPool64 &StrPool) | |
TStrPool64 (TSIn &SIn, bool LoadCompact=true) | |
~TStrPool64 () | |
static PStrPool64 | New (::TSize MxBfL=0,::TSize GrowBy=16 *1024 *1024) |
TStrPool64 & | operator= (const TStrPool64 &StrPool) |
uint64 | Reserved () const |
int | Cmp (uint64 Offset, const char *Str) const |
TStr | GetStr (const uint64 &StrId) const |
Variables | |
ClassTP(TMem, PMem) private char * | Bf |
void TMem::AddBf | ( | const void * | Bf, |
const int & | BfL | ||
) |
int TBigStrPool::AddStr | ( | const char * | Str, |
uint | Len | ||
) |
Definition at line 1680 of file dt.cpp.
{ IAssertR(Len > 0, "String too short (length includes the null character)"); //J: if (! Len) return -1; if (Len == 1 && BfL > 0) { return 0; } // empty string Assert(Str); Assert(Len > 0); if (BfL + Len > MxBfL) Resize(BfL + Len); memcpy(Bf + BfL, Str, Len); uint Pos = BfL; BfL += Len; return Pos; }
void Clr | ( | const bool & | DoDel = true | ) |
void Clr | ( | bool | DoDel = false | ) |
void Del | ( | const int & | BChN, |
const int & | EChN | ||
) |
bool DoFitLen | ( | const int & | LBfL | ) | const |
bool TMem::DoFitStr | ( | const TStr & | Str | ) | const |
void GenZeros | ( | const int & | _BfL | ) |
int GetMemUsed | ( | ) | const |
static int GetPrimHashCd | ( | const char * | CStr | ) | [static] |
int GetPrimHashCd | ( | uint | Offset | ) |
Definition at line 806 of file dt.h.
{ Assert(Offset < BfL); if (Offset != 0) return GetPrimHashCd(Bf + Offset); else return GetPrimHashCd(""); }
static int GetSecHashCd | ( | const char * | CStr | ) | [static] |
int GetSecHashCd | ( | uint | Offset | ) |
Definition at line 808 of file dt.h.
{ Assert(Offset < BfL); if (Offset != 0) return GetSecHashCd(Bf + Offset); else return GetSecHashCd(""); }
static PMem New | ( | const int & | MxBfL = 0 | ) | [static] |
static PMem New | ( | const void * | Bf, |
const int & | BfL | ||
) | [static] |
static PMem New | ( | const PMem & | Mem | ) | [static] |
Definition at line 827 of file dt.h.
{ return PStrPool64(new TStrPool64(MxBfL, GrowBy)); }
TMem& operator+= | ( | const char & | Ch | ) |
TStrPool64& operator= | ( | const TStrPool64 & | StrPool | ) |
char * operator[] | ( | const int & | ChN | ) | const |
void Push | ( | const char & | Ch | ) |
Definition at line 128 of file dt.h.
{operator+=(Ch);}
void Reserve | ( | const int & | _MxBfL, |
const bool & | DoClr = true |
||
) |
void Resize | ( | const int & | _MxBfL | ) |
Definition at line 781 of file dt.h.
{PSOut SOut=TFOut::New(FNm); Save(*SOut);}
TMem | ( | const int & | _MxBfL = 0 | ) |
TMem | ( | const void * | _Bf, |
const int & | _BfL | ||
) |
TMem::TMem | ( | const TStr & | Str | ) |
void Trunc | ( | const int & | _BfL | ) |
TStrPool::TStrPool | ( | uint | MxBfLen = 0 , |
uint | _GrowBy = 16*1024*1024 |
||
) |
Definition at line 1648 of file dt.cpp.
: MxBfL(MxBfLen), BfL(0), GrowBy(_GrowBy), Bf(0) { //IAssert(MxBfL >= 0); IAssert(GrowBy >= 0); if (MxBfL > 0) { Bf = (char *) malloc(MxBfL); IAssertR(Bf, TStr::Fmt("Can not resize buffer to %u bytes. [Program failed to allocate more memory. Solution: Get a bigger machine.]", MxBfL).CStr()); } AddStr(""); // add an empty string at the beginning for fast future access }
TStrPool::TStrPool | ( | TSIn & | SIn, |
bool | LoadCompact = true |
||
) |
Definition at line 1654 of file dt.cpp.
: MxBfL(0), BfL(0), GrowBy(0), Bf(0) { SIn.Load(MxBfL); SIn.Load(BfL); SIn.Load(GrowBy); //IAssert(MxBfL >= BfL); IAssert(BfL >= 0); IAssert(GrowBy >= 0); if (LoadCompact) MxBfL = BfL; if (MxBfL > 0) { Bf = (char *) malloc(MxBfL); IAssertR(Bf, TStr::Fmt("Can not resize buffer to %u bytes. [Program failed to allocate more memory. Solution: Get a bigger machine.]", MxBfL).CStr()); } if (BfL > 0) SIn.LoadBf(Bf, BfL); SIn.LoadCs(); }
TStrPool64::TStrPool64 | ( | ::TSize | _MxBfL = 0 , |
::TSize | _GrowBy = 16*1024*1024 |
||
) |
TStrPool64::TStrPool64 | ( | const TStrPool64 & | StrPool | ) |
TStrPool64::TStrPool64 | ( | TSIn & | SIn, |
bool | LoadCompact = true |
||
) |
Definition at line 1729 of file dt.cpp.
: MxBfL(0), BfL(0), GrowBy(0), Bf(0) { uint64 _GrowBy, _MxBfL, _BfL; SIn.Load(_GrowBy); SIn.Load(_MxBfL); SIn.Load(_BfL); GrowBy = (::TSize)_GrowBy; MxBfL = (::TSize)_MxBfL; BfL = (::TSize)_BfL; if (LoadCompact) { MxBfL = BfL; } if (MxBfL > 0) { Bf = (char*)malloc(MxBfL); IAssert(Bf != NULL); } for (::TSize BfN = 0; BfN < _BfL; BfN++) { Bf[BfN] = SIn.GetCh(); } SIn.LoadCs(); }
~TStrPool | ( | ) |
~TStrPool64 | ( | ) |
ClassTP (TStrPool64, PStrPool64) private char* Bf |