SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TPt< TRec > Class Template Reference

#include <bd.h>

Public Types

typedef TRec TObj
 

Public Member Functions

 TPt ()
 
 TPt (const TPt &Pt)
 
 TPt (TRec *_Addr)
 
 ~TPt ()
 
 TPt (TSIn &SIn)
 
 TPt (TSIn &SIn, void *ThisPt)
 
void Save (TSOut &SOut) const
 
void LoadXml (const TPt< TXmlTok > &XmlTok, const TStr &Nm)
 
void SaveXml (TSOut &SOut, const TStr &Nm) const
 
TPtoperator= (const TPt &Pt)
 
bool operator== (const TPt &Pt) const
 
bool operator!= (const TPt &Pt) const
 
bool operator< (const TPt &Pt) const
 
TRec * operator-> () const
 
TRec & operator* () const
 
TRec & operator[] (const int &RecN) const
 
TRec * operator() () const
 
bool Empty () const
 
void Clr ()
 
int GetRefs () const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 
TPt< TRec > Clone ()
 

Static Public Member Functions

static TPt New ()
 

Private Member Functions

void MkRef () const
 
void UnRef () const
 

Private Attributes

TRec * Addr
 

Detailed Description

template<class TRec>
class TPt< TRec >

Definition at line 196 of file bd.h.

Member Typedef Documentation

template<class TRec>
typedef TRec TPt< TRec >::TObj

Definition at line 461 of file bd.h.

Constructor & Destructor Documentation

template<class TRec>
TPt< TRec >::TPt ( )
inline

Definition at line 476 of file bd.h.

476 : Addr(NULL){}
TRec * Addr
Definition: bd.h:463
template<class TRec>
TPt< TRec >::TPt ( const TPt< TRec > &  Pt)
inline

Definition at line 477 of file bd.h.

477 : Addr(Pt.Addr){MkRef();}
void MkRef() const
Definition: bd.h:464
TRec * Addr
Definition: bd.h:463
template<class TRec>
TPt< TRec >::TPt ( TRec *  _Addr)
inline

Definition at line 478 of file bd.h.

478 : Addr(_Addr){MkRef();}
void MkRef() const
Definition: bd.h:464
TRec * Addr
Definition: bd.h:463
template<class TRec>
TPt< TRec >::~TPt ( )
inline

Definition at line 480 of file bd.h.

480 {UnRef();}
void UnRef() const
Definition: bd.h:469
template<class TRec>
TPt< TRec >::TPt ( TSIn SIn)
explicit

Definition at line 6 of file xmlser.h.

6  :
7  Addr(NULL){TBool IsNull(SIn);
8  if (!IsNull){TPt Pt=TRec::Load(SIn); Addr=Pt.Addr; MkRef();}}
void MkRef() const
Definition: bd.h:464
TRec * Addr
Definition: bd.h:463
Definition: bd.h:196
Definition: dt.h:974
template<class TRec>
TPt< TRec >::TPt ( TSIn SIn,
void *  ThisPt 
)
explicit

Definition at line 11 of file xmlser.h.

11  :
12  Addr(NULL){TBool IsNull(SIn);
13  if (!IsNull){TPt Pt=TRec::Load(SIn, ThisPt); Addr=Pt.Addr; MkRef();}}
void MkRef() const
Definition: bd.h:464
TRec * Addr
Definition: bd.h:463
Definition: bd.h:196
Definition: dt.h:974

Member Function Documentation

template<class TRec>
TPt<TRec> TPt< TRec >::Clone ( )
inline

Definition at line 509 of file bd.h.

509 {return MkClone(*this);}
template<class TRec>
void TPt< TRec >::Clr ( )
inline

Definition at line 502 of file bd.h.

502 {UnRef(); Addr=NULL;}
TRec * Addr
Definition: bd.h:463
void UnRef() const
Definition: bd.h:469
template<class TRec>
bool TPt< TRec >::Empty ( ) const
inline

Definition at line 501 of file bd.h.

501 { return Addr==NULL;}
TRec * Addr
Definition: bd.h:463
template<class TRec>
int TPt< TRec >::GetPrimHashCd ( ) const
inline

Definition at line 506 of file bd.h.

506 {return Addr->GetPrimHashCd();}
TRec * Addr
Definition: bd.h:463
template<class TRec>
int TPt< TRec >::GetRefs ( ) const
inline

Definition at line 503 of file bd.h.

503  {
504  if (Addr==NULL){return -1;} else {return Addr->CRef.GetRefs();}}
TRec * Addr
Definition: bd.h:463
template<class TRec>
int TPt< TRec >::GetSecHashCd ( ) const
inline

Definition at line 507 of file bd.h.

507 {return Addr->GetSecHashCd();}
TRec * Addr
Definition: bd.h:463
template<class TRec >
void TPt< TRec >::LoadXml ( const TPt< TXmlTok > &  XmlTok,
const TStr Nm 
)

Definition at line 21 of file xmlser.h.

21  {
22  XLoadHd(Nm);
23  bool NullP=TXmlObjSer::GetBoolArg(XmlTok, "Null");
24  if (NullP){
25  Addr=NULL;
26  } else {
27  Addr=new TRec(); MkRef();
28  Addr->LoadXml(XmlTok, "-");
29  }
30 }
#define XLoadHd(Nm)
Definition: bd.h:312
static bool GetBoolArg(const PXmlTok &XmlTok, const TStr &Nm)
Definition: xml.cpp:59
void MkRef() const
Definition: bd.h:464
TRec * Addr
Definition: bd.h:463
template<class TRec>
void TPt< TRec >::MkRef ( ) const
inlineprivate

Definition at line 464 of file bd.h.

464  {
465  if (Addr!=NULL){
466  Addr->CRef.MkRef();
467  }
468  }
TRec * Addr
Definition: bd.h:463
template<class TRec>
static TPt TPt< TRec >::New ( )
inlinestatic

Definition at line 479 of file bd.h.

479 {return TObj::New();}
template<class TRec>
bool TPt< TRec >::operator!= ( const TPt< TRec > &  Pt) const
inline

Definition at line 490 of file bd.h.

490 {return *Addr!=*Pt.Addr;}
TRec * Addr
Definition: bd.h:463
template<class TRec>
TRec* TPt< TRec >::operator() ( ) const
inline

Definition at line 497 of file bd.h.

497 {return Addr;}
TRec * Addr
Definition: bd.h:463
template<class TRec>
TRec& TPt< TRec >::operator* ( ) const
inline

Definition at line 494 of file bd.h.

494 {Assert(Addr!=NULL); return *Addr;}
#define Assert(Cond)
Definition: bd.h:251
TRec * Addr
Definition: bd.h:463
template<class TRec>
TRec* TPt< TRec >::operator-> ( ) const
inline

Definition at line 493 of file bd.h.

493 {Assert(Addr!=NULL); return Addr;}
#define Assert(Cond)
Definition: bd.h:251
TRec * Addr
Definition: bd.h:463
template<class TRec>
bool TPt< TRec >::operator< ( const TPt< TRec > &  Pt) const
inline

Definition at line 491 of file bd.h.

491 {return *Addr<*Pt.Addr;}
TRec * Addr
Definition: bd.h:463
template<class TRec>
TPt& TPt< TRec >::operator= ( const TPt< TRec > &  Pt)
inline

Definition at line 487 of file bd.h.

487  {
488  if (this!=&Pt){Pt.MkRef(); UnRef(); Addr=Pt.Addr;} return *this;}
void MkRef() const
Definition: bd.h:464
TRec * Addr
Definition: bd.h:463
void UnRef() const
Definition: bd.h:469
template<class TRec>
bool TPt< TRec >::operator== ( const TPt< TRec > &  Pt) const
inline

Definition at line 489 of file bd.h.

489 {return *Addr==*Pt.Addr;}
TRec * Addr
Definition: bd.h:463
template<class TRec>
TRec& TPt< TRec >::operator[] ( const int &  RecN) const
inline

Definition at line 495 of file bd.h.

495  {
496  Assert(Addr!=NULL); return Addr[RecN];}
#define Assert(Cond)
Definition: bd.h:251
TRec * Addr
Definition: bd.h:463
template<class TRec >
void TPt< TRec >::Save ( TSOut SOut) const

Definition at line 16 of file xmlser.h.

16  {
17  if (Addr==NULL){TBool(true).Save(SOut);}
18  else {TBool(false).Save(SOut); Addr->Save(SOut);}}
void Save(TSOut &SOut) const
Definition: dt.h:995
TRec * Addr
Definition: bd.h:463
Definition: dt.h:974
template<class TRec >
void TPt< TRec >::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 33 of file xmlser.h.

33  {
34  if (Addr==NULL){
35  XSaveBETagArg(Nm, "Null", TBool::GetStr(true));
36  } else {
37  XSaveHdArg(Nm, "Null", TBool::GetStr(false));
38  Addr->SaveXml(SOut, "-");
39  }
40 }
#define XSaveBETagArg(Nm, ArgNm, ArgVal)
Definition: bd.h:327
#define XSaveHdArg(Nm, ArgNm, ArgVal)
Definition: bd.h:321
TRec * Addr
Definition: bd.h:463
static TStr GetStr(const bool &Val)
Definition: dt.h:1011
template<class TRec>
void TPt< TRec >::UnRef ( ) const
inlineprivate

Definition at line 469 of file bd.h.

469  {
470  if (Addr!=NULL){
471  Addr->CRef.UnRef();
472  if (Addr->CRef.NoRef()){delete Addr;}
473  }
474  }
TRec * Addr
Definition: bd.h:463

Member Data Documentation

template<class TRec>
TRec* TPt< TRec >::Addr
private

Definition at line 463 of file bd.h.


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