SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMemIn Class Reference

#include <dt.h>

Inherits TSIn.

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)
 
- Public Member Functions inherited from TSIn
 TSIn ()
 
 TSIn (const TStr &Str)
 
virtual ~TSIn ()
 
bool IsFastMode () const
 
void SetFastMode (const bool &_FastMode)
 
void LoadCs ()
 
void LoadBf (const void *Bf, const TSize &BfL)
 
void * LoadNewBf (const int &BfL)
 
void Load (bool &Bool)
 
void Load (uchar &UCh)
 
void Load (char &Ch)
 
void Load (short &Short)
 
void Load (ushort &UShort)
 
void Load (int &Int)
 
void Load (uint &UInt)
 
void Load (int64 &Int)
 
void Load (uint64 &UInt)
 
void Load (double &Flt)
 
void Load (sdouble &SFlt)
 
void Load (ldouble &LFlt)
 
void Load (char *&CStr, const int &MxCStrLen, const int &CStrLen)
 
void Load (char *&CStr)
 
TSInoperator>> (bool &Bool)
 
TSInoperator>> (uchar &UCh)
 
TSInoperator>> (char &Ch)
 
TSInoperator>> (short &Sh)
 
TSInoperator>> (ushort &USh)
 
TSInoperator>> (int &Int)
 
TSInoperator>> (uint &UInt)
 
TSInoperator>> (int64 &Int)
 
TSInoperator>> (uint64 &UInt)
 
TSInoperator>> (float &Flt)
 
TSInoperator>> (double &Double)
 
TSInoperator>> (long double &LDouble)
 
bool GetNextLn (TStr &LnStr)
 
bool GetNextLn (TChA &LnChA)
 
- Public Member Functions inherited from TSBase
 TSBase (const TSStr &Nm)
 
virtual ~TSBase ()
 
virtual TStr GetSNm () const
 

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
 

Additional Inherited Members

- Static Public Attributes inherited from TSIn
static const TPt< TSInStdIn =PSIn(new TStdIn())
 
- Protected Attributes inherited from TSBase
TCRef CRef
 
TSStr SNm
 
TCs Cs
 

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.

315  :
316  TSBase("Input-Memory"), TSIn("Input-Memory"), Mem(), Bf(_Mem()), BfC(_BfC), BfL(_Mem.Len()){}
TSBase(const TSStr &Nm)
Definition: fl.h:50
int Len() const
Definition: dt.h:134
const char * Bf
Definition: dt.h:161
int BfC
Definition: dt.h:162
TSIn()
Definition: fl.h:65
int BfL
Definition: dt.h:162
PMem Mem
Definition: dt.h:160
TMemIn::~TMemIn ( )
inline

Definition at line 169 of file dt.h.

169 {}

Member Function Documentation

bool TMemIn::Eof ( )
inlinevirtual

Implements TSIn.

Definition at line 171 of file dt.h.

171 {return BfC==BfL;}
int BfC
Definition: dt.h:162
int BfL
Definition: dt.h:162
int TMemIn::GetBf ( const void *  LBf,
const TSize LBfL 
)
virtual

Implements TSIn.

Definition at line 318 of file dt.cpp.

318  {
319  Assert(TSize(BfC+LBfL)<=TSize(BfL));
320  int LBfS=0;
321  for (TSize LBfC=0; LBfC<LBfL; LBfC++){
322  LBfS+=(((char*)LBf)[LBfC]=Bf[BfC++]);}
323  return LBfS;
324 }
const char * Bf
Definition: dt.h:161
size_t TSize
Definition: bd.h:58
#define Assert(Cond)
Definition: bd.h:251
int BfC
Definition: dt.h:162
int BfL
Definition: dt.h:162
char TMemIn::GetCh ( )
inlinevirtual

Implements TSIn.

Definition at line 173 of file dt.h.

173 {Assert(BfC<BfL); return Bf[BfC++];}
const char * Bf
Definition: dt.h:161
#define Assert(Cond)
Definition: bd.h:251
int BfC
Definition: dt.h:162
int BfL
Definition: dt.h:162
bool TMemIn::GetNextLnBf ( TChA LnChA)
virtual

Implements TSIn.

Definition at line 326 of file dt.cpp.

326  {
327  // not implemented
328  FailR(TStr::Fmt("TMemIn::GetNextLnBf: not implemented").CStr());
329  return false;
330 }
#define FailR(Reason)
Definition: bd.h:240
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
int TMemIn::Len ( ) const
inlinevirtual

Implements TSIn.

Definition at line 172 of file dt.h.

172 {return BfL-BfC;}
int BfC
Definition: dt.h:162
int BfL
Definition: dt.h:162
static PSIn TMemIn::New ( const TMem Mem)
inlinestatic

Definition at line 165 of file dt.h.

165  {
166  return PSIn(new TMemIn(Mem));}
TMemIn(const TMem &_Mem, const int &_BfC=0)
Definition: dt.cpp:315
TPt< TSIn > PSIn
Definition: fl.h:119
static PSIn TMemIn::New ( const PMem Mem)
inlinestatic

Definition at line 167 of file dt.h.

167  {
168  TMemIn* MemIn=new TMemIn(*Mem); MemIn->Mem=Mem; return PSIn(MemIn);}
TMemIn(const TMem &_Mem, const int &_BfC=0)
Definition: dt.cpp:315
Definition: dt.h:158
TPt< TSIn > PSIn
Definition: fl.h:119
PMem Mem
Definition: dt.h:160
char TMemIn::PeekCh ( )
inlinevirtual

Implements TSIn.

Definition at line 174 of file dt.h.

174 {Assert(BfC<BfL); return Bf[BfC];}
const char * Bf
Definition: dt.h:161
#define Assert(Cond)
Definition: bd.h:251
int BfC
Definition: dt.h:162
int BfL
Definition: dt.h:162
void TMemIn::Reset ( )
inlinevirtual

Reimplemented from TSIn.

Definition at line 176 of file dt.h.

176 {Cs=TCs(); BfC=0;}
int BfC
Definition: dt.h:162
Definition: fl.h:11
TCs Cs
Definition: fl.h:44

Member Data Documentation

const char* TMemIn::Bf
private

Definition at line 161 of file dt.h.

int TMemIn::BfC
private

Definition at line 162 of file dt.h.

int TMemIn::BfL
private

Definition at line 162 of file dt.h.

PMem TMemIn::Mem
private

Definition at line 160 of file dt.h.


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