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
TMemIn Class Reference

#include <dt.h>

Inheritance diagram for TMemIn:
Collaboration diagram for TMemIn:

List of all members.

Public Member Functions

 TMemIn (const TMem &_Mem, const int &_BfC=0)
 ~TMemIn ()
bool Eof ()
int Len () const
char GetCh ()
char PeekCh ()
int GetBf (const void *LBf, const TSize &LBfL)
void Reset ()
bool GetNextLnBf (TChA &LnChA)

Static Public Member Functions

static PSIn New (const TMem &Mem)
static PSIn New (const PMem &Mem)

Private Attributes

PMem Mem
const char * Bf
int BfC
int BfL

Detailed Description

Definition at line 158 of file dt.h.


Constructor & Destructor Documentation

TMemIn::TMemIn ( const TMem _Mem,
const int &  _BfC = 0 
)

Definition at line 315 of file dt.cpp.

Referenced by New().

                                               :
  TSBase("Input-Memory"), TSIn("Input-Memory"), Mem(), Bf(_Mem()), BfC(_BfC), BfL(_Mem.Len()){}

Here is the caller graph for this function:

TMemIn::~TMemIn ( ) [inline]

Definition at line 169 of file dt.h.

{}

Member Function Documentation

bool TMemIn::Eof ( ) [inline, virtual]

Implements TSIn.

Definition at line 171 of file dt.h.

References BfC, and BfL.

{return BfC==BfL;}
int TMemIn::GetBf ( const void *  LBf,
const TSize LBfL 
) [virtual]

Implements TSIn.

Definition at line 318 of file dt.cpp.

References Assert, Bf, BfC, and BfL.

                                                   {
  Assert(TSize(BfC+LBfL)<=TSize(BfL));
  int LBfS=0;
  for (TSize LBfC=0; LBfC<LBfL; LBfC++){
    LBfS+=(((char*)LBf)[LBfC]=Bf[BfC++]);}
  return LBfS;
}
char TMemIn::GetCh ( ) [inline, virtual]

Implements TSIn.

Definition at line 173 of file dt.h.

References Assert, Bf, BfC, and BfL.

{Assert(BfC<BfL); return Bf[BfC++];}
bool TMemIn::GetNextLnBf ( TChA LnChA) [virtual]

Implements TSIn.

Definition at line 326 of file dt.cpp.

References FailR, and TStr::Fmt().

                                   {
  // not implemented
  FailR(TStr::Fmt("TMemIn::GetNextLnBf: not implemented").CStr());
  return false;
}

Here is the call graph for this function:

int TMemIn::Len ( ) const [inline, virtual]

Implements TSIn.

Definition at line 172 of file dt.h.

References BfC, and BfL.

{return BfL-BfC;}
static PSIn TMemIn::New ( const TMem Mem) [inline, static]

Definition at line 165 of file dt.h.

References TMemIn().

Referenced by THttpRq::GetBodyAsSIn(), TMd5::GetMd5SigStr(), and TMd5Sig::TMd5Sig().

                                  {
    return PSIn(new TMemIn(Mem));}

Here is the call graph for this function:

Here is the caller graph for this function:

static PSIn TMemIn::New ( const PMem Mem) [inline, static]

Definition at line 167 of file dt.h.

References Mem, and TMemIn().

                                  {
    TMemIn* MemIn=new TMemIn(*Mem); MemIn->Mem=Mem; return PSIn(MemIn);}

Here is the call graph for this function:

char TMemIn::PeekCh ( ) [inline, virtual]

Implements TSIn.

Definition at line 174 of file dt.h.

References Assert, Bf, BfC, and BfL.

{Assert(BfC<BfL); return Bf[BfC];}
void TMemIn::Reset ( ) [inline, virtual]

Reimplemented from TSIn.

Definition at line 176 of file dt.h.

References BfC, and TSBase::Cs.

{Cs=TCs(); BfC=0;}

Member Data Documentation

const char* TMemIn::Bf [private]

Definition at line 161 of file dt.h.

Referenced by GetBf(), GetCh(), and PeekCh().

int TMemIn::BfC [private]

Definition at line 162 of file dt.h.

Referenced by Eof(), GetBf(), GetCh(), Len(), PeekCh(), and Reset().

int TMemIn::BfL [private]

Definition at line 162 of file dt.h.

Referenced by Eof(), GetBf(), GetCh(), Len(), and PeekCh().

PMem TMemIn::Mem [private]

Definition at line 160 of file dt.h.

Referenced by New().


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