SNAP Library 2.1, User 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
TPt< TRec > Class Template Reference

#include <bd.h>

List of all members.

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 459 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.

: Addr(NULL){}
template<class TRec>
TPt< TRec >::TPt ( const TPt< TRec > &  Pt) [inline]

Definition at line 477 of file bd.h.

: Addr(Pt.Addr){MkRef();}
template<class TRec>
TPt< TRec >::TPt ( TRec *  _Addr) [inline]

Definition at line 478 of file bd.h.

: Addr(_Addr){MkRef();}
template<class TRec>
TPt< TRec >::~TPt ( ) [inline]

Definition at line 480 of file bd.h.

{UnRef();}
template<class TRec>
TPt< TRec >::TPt ( TSIn SIn) [explicit]

Definition at line 6 of file xmlser.h.

                       :
    Addr(NULL){TBool IsNull(SIn);
    if (!IsNull){TPt Pt=TRec::Load(SIn); Addr=Pt.Addr; MkRef();}}
template<class TRec>
TPt< TRec >::TPt ( TSIn SIn,
void *  ThisPt 
) [explicit]

Definition at line 11 of file xmlser.h.

                                     :
    Addr(NULL){TBool IsNull(SIn);
    if (!IsNull){TPt Pt=TRec::Load(SIn, ThisPt); Addr=Pt.Addr; MkRef();}}

Member Function Documentation

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

Definition at line 509 of file bd.h.

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

Definition at line 502 of file bd.h.

{UnRef(); Addr=NULL;}
template<class TRec>
bool TPt< TRec >::Empty ( ) const [inline]

Definition at line 501 of file bd.h.

{ return Addr==NULL;}
template<class TRec>
int TPt< TRec >::GetPrimHashCd ( ) const [inline]

Definition at line 506 of file bd.h.

{return Addr->GetPrimHashCd();}
template<class TRec>
int TPt< TRec >::GetRefs ( ) const [inline]

Definition at line 503 of file bd.h.

                      {
    if (Addr==NULL){return -1;} else {return Addr->CRef.GetRefs();}}
template<class TRec>
int TPt< TRec >::GetSecHashCd ( ) const [inline]

Definition at line 507 of file bd.h.

{return Addr->GetSecHashCd();}
template<class TRec >
void TPt< TRec >::LoadXml ( const TPt< TXmlTok > &  XmlTok,
const TStr Nm 
)

Definition at line 21 of file xmlser.h.

                                                                 {
  XLoadHd(Nm);
  bool NullP=TXmlObjSer::GetBoolArg(XmlTok, "Null");
  if (NullP){
    Addr=NULL;
  } else {
    Addr=new TRec(); MkRef();
    Addr->LoadXml(XmlTok, "-");
  }
}
template<class TRec>
void TPt< TRec >::MkRef ( ) const [inline, private]

Definition at line 464 of file bd.h.

                     {
    if (Addr!=NULL){
      Addr->CRef.MkRef();
    }
  }
template<class TRec>
static TPt TPt< TRec >::New ( ) [inline, static]

Definition at line 479 of file bd.h.

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

Definition at line 490 of file bd.h.

{return *Addr!=*Pt.Addr;}
template<class TRec>
TRec* TPt< TRec >::operator() ( ) const [inline]

Definition at line 497 of file bd.h.

{return Addr;}
template<class TRec>
TRec& TPt< TRec >::operator* ( ) const [inline]

Definition at line 494 of file bd.h.

{Assert(Addr!=NULL); return *Addr;}
template<class TRec>
TRec* TPt< TRec >::operator-> ( ) const [inline]

Definition at line 493 of file bd.h.

{Assert(Addr!=NULL); return Addr;}
template<class TRec>
bool TPt< TRec >::operator< ( const TPt< TRec > &  Pt) const [inline]

Definition at line 491 of file bd.h.

{return *Addr<*Pt.Addr;}
template<class TRec>
TPt& TPt< TRec >::operator= ( const TPt< TRec > &  Pt) [inline]

Definition at line 487 of file bd.h.

                               {
    if (this!=&Pt){Pt.MkRef(); UnRef(); Addr=Pt.Addr;} return *this;}
template<class TRec>
bool TPt< TRec >::operator== ( const TPt< TRec > &  Pt) const [inline]

Definition at line 489 of file bd.h.

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

Definition at line 495 of file bd.h.

                                          {
    Assert(Addr!=NULL); return Addr[RecN];}
template<class TRec >
void TPt< TRec >::Save ( TSOut SOut) const

Definition at line 16 of file xmlser.h.

                                      {
    if (Addr==NULL){TBool(true).Save(SOut);}
    else {TBool(false).Save(SOut); Addr->Save(SOut);}}
template<class TRec >
void TPt< TRec >::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 33 of file xmlser.h.

                                                         {
  if (Addr==NULL){
    XSaveBETagArg(Nm, "Null", TBool::GetStr(true));
  } else {
    XSaveHdArg(Nm, "Null", TBool::GetStr(false));
    Addr->SaveXml(SOut, "-");
  }
}
template<class TRec>
void TPt< TRec >::UnRef ( ) const [inline, private]

Definition at line 469 of file bd.h.

                     {
    if (Addr!=NULL){
      Addr->CRef.UnRef();
      if (Addr->CRef.NoRef()){delete Addr;}
    }
  }

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: