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
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 881 of file dt.h.

Constructor & Destructor Documentation

TBool::TBool ( )
inline

Definition at line 897 of file dt.h.

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

Definition at line 898 of file dt.h.

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

Definition at line 900 of file dt.h.

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

Member Function Documentation

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

Definition at line 926 of file dt.h.

926  {
927  if (Val){return "1";} else {return "0";}}
bool Val
Definition: dt.h:883
int TBool::GetMemUsed ( ) const
inline

Definition at line 911 of file dt.h.

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

Definition at line 913 of file dt.h.

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

Definition at line 916 of file dt.h.

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

Definition at line 914 of file dt.h.

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

Definition at line 918 of file dt.h.

918  {
919  if (Val){return TrueStr;} else {return FalseStr;}}
static const TStr FalseStr
Definition: dt.h:890
bool Val
Definition: dt.h:883
static const TStr TrueStr
Definition: dt.h:891
static TStr TBool::GetStr ( const TBool Bool)
inlinestatic

Definition at line 920 of file dt.h.

920  {
921  return GetStr(Bool.Val);}
bool Val
Definition: dt.h:883
static TStr GetStr(const bool &Val)
Definition: dt.h:918
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:893
static const TStr YesStr
Definition: dt.h:895
static const TStr TrueStr
Definition: dt.h:891
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:493
static const TStr YStr
Definition: dt.h:893
static const TStr YesStr
Definition: dt.h:895
static bool IsValStr(const TStr &Str)
Definition: dt.cpp:1842
Definition: dt.h:412
static const TStr TrueStr
Definition: dt.h:891
static TStr TBool::GetYesNoStr ( const bool &  Val)
inlinestatic

Definition at line 924 of file dt.h.

924  {
925  if (Val){return YesStr;} else {return NoStr;}}
static const TStr NoStr
Definition: dt.h:894
bool Val
Definition: dt.h:883
static const TStr YesStr
Definition: dt.h:895
static TStr TBool::GetYNStr ( const bool &  Val)
inlinestatic

Definition at line 922 of file dt.h.

922  {
923  if (Val){return YStr;} else {return NStr;}}
static const TStr YStr
Definition: dt.h:893
bool Val
Definition: dt.h:883
static const TStr NStr
Definition: dt.h:892
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:894
TStr GetUc() const
Definition: dt.h:493
static const TStr YStr
Definition: dt.h:893
static const TStr FalseStr
Definition: dt.h:890
static const TStr YesStr
Definition: dt.h:895
static const TStr NStr
Definition: dt.h:892
Definition: dt.h:412
static const TStr TrueStr
Definition: dt.h:891
void TBool::Load ( TSIn SIn)
inline

Definition at line 901 of file dt.h.

901 {SIn.Load(Val);}
void Load(bool &Bool)
Definition: fl.h:84
bool Val
Definition: dt.h:883
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:883
TBool::operator bool ( ) const
inline

Definition at line 899 of file dt.h.

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

Definition at line 910 of file dt.h.

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

Definition at line 908 of file dt.h.

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

Definition at line 906 of file dt.h.

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

Definition at line 907 of file dt.h.

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

Definition at line 902 of file dt.h.

902 {SOut.Save(Val);}
bool Val
Definition: dt.h:883
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:883
static TStr GetStr(const bool &Val)
Definition: dt.h:918

Member Data Documentation

const TStr TBool::FalseStr ="F"
static

Definition at line 890 of file dt.h.

const bool TBool::Mn =0
static

Definition at line 885 of file dt.h.

const bool TBool::Mx =1
static

Definition at line 886 of file dt.h.

const TStr TBool::NoStr ="No"
static

Definition at line 894 of file dt.h.

const TStr TBool::NStr ="N"
static

Definition at line 892 of file dt.h.

TRnd TBool::Rnd
static

Definition at line 888 of file dt.h.

const TStr TBool::TrueStr ="T"
static

Definition at line 891 of file dt.h.

bool TBool::Val

Definition at line 883 of file dt.h.

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

Definition at line 887 of file dt.h.

const TStr TBool::YesStr ="Yes"
static

Definition at line 895 of file dt.h.

const TStr TBool::YStr ="Y"
static

Definition at line 893 of file dt.h.


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