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

#include <dt.h>

Public Member Functions

 TBool ()
 
 TBool (const bool &_Val)
 
 operator bool () const
 
 TBool (TSIn &SIn)
 
void Load (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
void LoadXml (const PXmlTok &XmlTok, const TStr &Nm)
 
void SaveXml (TSOut &SOut, const TStr &Nm) const
 
TBooloperator= (const TBool &Bool)
 
bool operator== (const TBool &Bool) const
 
bool operator< (const TBool &Bool) const
 
bool operator() () const
 
int GetMemUsed () const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 

Static Public Member Functions

static bool GetRnd ()
 
static TStr GetStr (const bool &Val)
 
static TStr GetStr (const TBool &Bool)
 
static TStr GetYNStr (const bool &Val)
 
static TStr GetYesNoStr (const bool &Val)
 
static TStr Get01Str (const bool &Val)
 
static bool IsValStr (const TStr &Str)
 
static bool GetValFromStr (const TStr &Str)
 
static bool GetValFromStr (const TStr &Str, const bool &DfVal)
 

Public Attributes

bool Val
 

Static Public Attributes

static const bool Mn =0
 
static const bool Mx =1
 
static const int Vals =TBool::Mx-TBool::Mn+1
 
static TRnd Rnd
 
static const TStr FalseStr ="F"
 
static const TStr TrueStr ="T"
 
static const TStr NStr ="N"
 
static const TStr YStr ="Y"
 
static const TStr NoStr ="No"
 
static const TStr YesStr ="Yes"
 

Detailed Description

Definition at line 974 of file dt.h.

Constructor & Destructor Documentation

TBool::TBool ( )
inline

Definition at line 990 of file dt.h.

990 : Val(false){}
bool Val
Definition: dt.h:976
TBool::TBool ( const bool &  _Val)
inline

Definition at line 991 of file dt.h.

991 : Val(_Val){}
bool Val
Definition: dt.h:976
TBool::TBool ( TSIn SIn)
inlineexplicit

Definition at line 993 of file dt.h.

993 {SIn.Load(Val);}
void Load(bool &Bool)
Definition: fl.h:84
bool Val
Definition: dt.h:976

Member Function Documentation

static TStr TBool::Get01Str ( const bool &  Val)
inlinestatic

Definition at line 1019 of file dt.h.

1019  {
1020  if (Val){return "1";} else {return "0";}}
bool Val
Definition: dt.h:976
int TBool::GetMemUsed ( ) const
inline

Definition at line 1004 of file dt.h.

1004 {return sizeof(TBool);}
TBool()
Definition: dt.h:990
int TBool::GetPrimHashCd ( ) const
inline

Definition at line 1006 of file dt.h.

1006 {return Val;}
bool Val
Definition: dt.h:976
static bool TBool::GetRnd ( )
inlinestatic

Definition at line 1009 of file dt.h.

1009 {return Rnd.GetUniDevInt(2)==1;}
static TRnd Rnd
Definition: dt.h:981
int GetUniDevInt(const int &Range=0)
Definition: dt.cpp:39
int TBool::GetSecHashCd ( ) const
inline

Definition at line 1007 of file dt.h.

1007 {return Val;}
bool Val
Definition: dt.h:976
static TStr TBool::GetStr ( const bool &  Val)
inlinestatic

Definition at line 1011 of file dt.h.

1011  {
1012  if (Val){return TrueStr;} else {return FalseStr;}}
static const TStr FalseStr
Definition: dt.h:983
bool Val
Definition: dt.h:976
static const TStr TrueStr
Definition: dt.h:984
static TStr TBool::GetStr ( const TBool Bool)
inlinestatic

Definition at line 1013 of file dt.h.

1013  {
1014  return GetStr(Bool.Val);}
bool Val
Definition: dt.h:976
static TStr GetStr(const bool &Val)
Definition: dt.h:1011
bool TBool::GetValFromStr ( const TStr Str)
static

Definition at line 1850 of file dt.cpp.

1850  {
1851  return (Str==TrueStr)||(Str==YStr)||(Str==YesStr);
1852 }
static const TStr YStr
Definition: dt.h:986
static const TStr YesStr
Definition: dt.h:988
static const TStr TrueStr
Definition: dt.h:984
bool TBool::GetValFromStr ( const TStr Str,
const bool &  DfVal 
)
static

Definition at line 1854 of file dt.cpp.

1854  {
1855  TStr UcStr=Str.GetUc();
1856  if (IsValStr(UcStr)){
1857  return (UcStr==TrueStr)||(UcStr==YStr)||(UcStr==YesStr);
1858  } else {
1859  return DfVal;
1860  }
1861 }
TStr GetUc() const
Definition: dt.h:496
static const TStr YStr
Definition: dt.h:986
static const TStr YesStr
Definition: dt.h:988
static bool IsValStr(const TStr &Str)
Definition: dt.cpp:1842
Definition: dt.h:412
static const TStr TrueStr
Definition: dt.h:984
static TStr TBool::GetYesNoStr ( const bool &  Val)
inlinestatic

Definition at line 1017 of file dt.h.

1017  {
1018  if (Val){return YesStr;} else {return NoStr;}}
static const TStr NoStr
Definition: dt.h:987
bool Val
Definition: dt.h:976
static const TStr YesStr
Definition: dt.h:988
static TStr TBool::GetYNStr ( const bool &  Val)
inlinestatic

Definition at line 1015 of file dt.h.

1015  {
1016  if (Val){return YStr;} else {return NStr;}}
static const TStr YStr
Definition: dt.h:986
bool Val
Definition: dt.h:976
static const TStr NStr
Definition: dt.h:985
bool TBool::IsValStr ( const TStr Str)
static

Definition at line 1842 of file dt.cpp.

1842  {
1843  TStr UcStr=Str.GetUc();
1844  return
1845  (UcStr==FalseStr)||(UcStr==TrueStr)||
1846  (UcStr==YStr)||(UcStr==NStr)||
1847  (UcStr==YesStr)||(UcStr==NoStr);
1848 }
static const TStr NoStr
Definition: dt.h:987
TStr GetUc() const
Definition: dt.h:496
static const TStr YStr
Definition: dt.h:986
static const TStr FalseStr
Definition: dt.h:983
static const TStr YesStr
Definition: dt.h:988
static const TStr NStr
Definition: dt.h:985
Definition: dt.h:412
static const TStr TrueStr
Definition: dt.h:984
void TBool::Load ( TSIn SIn)
inline

Definition at line 994 of file dt.h.

994 {SIn.Load(Val);}
void Load(bool &Bool)
Definition: fl.h:84
bool Val
Definition: dt.h:976
void TBool::LoadXml ( const PXmlTok XmlTok,
const TStr Nm 
)

Definition at line 1833 of file dt.cpp.

1833  {
1834  XLoadHd(Nm);
1835  Val=TXmlObjSer::GetBoolArg(XmlTok, "Val");
1836 }
#define XLoadHd(Nm)
Definition: bd.h:312
static bool GetBoolArg(const PXmlTok &XmlTok, const TStr &Nm)
Definition: xml.cpp:59
bool Val
Definition: dt.h:976
TBool::operator bool ( ) const
inline

Definition at line 992 of file dt.h.

992 {return Val;}
bool Val
Definition: dt.h:976
bool TBool::operator() ( ) const
inline

Definition at line 1003 of file dt.h.

1003 {return Val;}
bool Val
Definition: dt.h:976
bool TBool::operator< ( const TBool Bool) const
inline

Definition at line 1001 of file dt.h.

1001  {//return Val<Bool.Val;
1002  return (Val==false)&&(Bool.Val==true);}
bool Val
Definition: dt.h:976
TBool& TBool::operator= ( const TBool Bool)
inline

Definition at line 999 of file dt.h.

999 {Val=Bool.Val; return *this;}
bool Val
Definition: dt.h:976
bool TBool::operator== ( const TBool Bool) const
inline

Definition at line 1000 of file dt.h.

1000 {return Val==Bool.Val;}
bool Val
Definition: dt.h:976
void TBool::Save ( TSOut SOut) const
inline

Definition at line 995 of file dt.h.

995 {SOut.Save(Val);}
bool Val
Definition: dt.h:976
void Save(const bool &Bool)
Definition: fl.h:173
void TBool::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 1838 of file dt.cpp.

1838  {
1839  XSaveBETagArg(Nm, "Val", TBool::GetStr(Val));
1840 }
#define XSaveBETagArg(Nm, ArgNm, ArgVal)
Definition: bd.h:327
bool Val
Definition: dt.h:976
static TStr GetStr(const bool &Val)
Definition: dt.h:1011

Member Data Documentation

const TStr TBool::FalseStr ="F"
static

Definition at line 983 of file dt.h.

const bool TBool::Mn =0
static

Definition at line 978 of file dt.h.

const bool TBool::Mx =1
static

Definition at line 979 of file dt.h.

const TStr TBool::NoStr ="No"
static

Definition at line 987 of file dt.h.

const TStr TBool::NStr ="N"
static

Definition at line 985 of file dt.h.

TRnd TBool::Rnd
static

Definition at line 981 of file dt.h.

const TStr TBool::TrueStr ="T"
static

Definition at line 984 of file dt.h.

bool TBool::Val

Definition at line 976 of file dt.h.

const int TBool::Vals =TBool::Mx-TBool::Mn+1
static

Definition at line 980 of file dt.h.

const TStr TBool::YesStr ="Yes"
static

Definition at line 988 of file dt.h.

const TStr TBool::YStr ="Y"
static

Definition at line 986 of file dt.h.


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