SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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>

Collaboration diagram for TBool:

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

Constructor & Destructor Documentation

TBool::TBool ( )
inline

Definition at line 987 of file dt.h.

Referenced by GetMemUsed().

987 : Val(false){}
bool Val
Definition: dt.h:973

Here is the caller graph for this function:

TBool::TBool ( const bool &  _Val)
inline

Definition at line 988 of file dt.h.

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

Definition at line 990 of file dt.h.

References TSIn::Load(), and Val.

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

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 1016 of file dt.h.

1016  {
1017  if (Val){return "1";} else {return "0";}}
bool Val
Definition: dt.h:973
int TBool::GetMemUsed ( ) const
inline

Definition at line 1001 of file dt.h.

References TBool().

1001 {return sizeof(TBool);}
TBool()
Definition: dt.h:987

Here is the call graph for this function:

int TBool::GetPrimHashCd ( ) const
inline

Definition at line 1003 of file dt.h.

References Val.

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

Definition at line 1006 of file dt.h.

References TRnd::GetUniDevInt(), and Rnd.

1006 {return Rnd.GetUniDevInt(2)==1;}
static TRnd Rnd
Definition: dt.h:978
int GetUniDevInt(const int &Range=0)
Definition: dt.cpp:39

Here is the call graph for this function:

int TBool::GetSecHashCd ( ) const
inline

Definition at line 1004 of file dt.h.

References Val.

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

Definition at line 1008 of file dt.h.

References FalseStr, and TrueStr.

Referenced by TXmlTok::AddArg(), TEnv::GetIfArgPrefixBool(), GetStr(), TSOut::PutBool(), TOLx::PutBool(), TPt< TRec >::SaveXml(), and SaveXml().

1008  {
1009  if (Val){return TrueStr;} else {return FalseStr;}}
static const TStr FalseStr
Definition: dt.h:980
bool Val
Definition: dt.h:973
static const TStr TrueStr
Definition: dt.h:981

Here is the caller graph for this function:

static TStr TBool::GetStr ( const TBool Bool)
inlinestatic

Definition at line 1010 of file dt.h.

References GetStr(), and Val.

1010  {
1011  return GetStr(Bool.Val);}
bool Val
Definition: dt.h:973
static TStr GetStr(const bool &Val)
Definition: dt.h:1008

Here is the call graph for this function:

bool TBool::GetValFromStr ( const TStr Str)
static

Definition at line 1850 of file dt.cpp.

References TrueStr, YesStr, and YStr.

Referenced by TEnv::GetIfArgPrefixBool(), and TILx::GetSym().

1850  {
1851  return (Str==TrueStr)||(Str==YStr)||(Str==YesStr);
1852 }
static const TStr YStr
Definition: dt.h:983
static const TStr YesStr
Definition: dt.h:985
static const TStr TrueStr
Definition: dt.h:981

Here is the caller graph for this function:

bool TBool::GetValFromStr ( const TStr Str,
const bool &  DfVal 
)
static

Definition at line 1854 of file dt.cpp.

References TStr::GetUc(), IsValStr(), TrueStr, YesStr, and YStr.

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:983
static const TStr YesStr
Definition: dt.h:985
static bool IsValStr(const TStr &Str)
Definition: dt.cpp:1842
Definition: dt.h:412
static const TStr TrueStr
Definition: dt.h:981

Here is the call graph for this function:

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

Definition at line 1014 of file dt.h.

References NoStr, and YesStr.

Referenced by TEnv::GetIfArgPrefixBool().

1014  {
1015  if (Val){return YesStr;} else {return NoStr;}}
static const TStr NoStr
Definition: dt.h:984
bool Val
Definition: dt.h:973
static const TStr YesStr
Definition: dt.h:985

Here is the caller graph for this function:

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

Definition at line 1012 of file dt.h.

References NStr, and YStr.

1012  {
1013  if (Val){return YStr;} else {return NStr;}}
static const TStr YStr
Definition: dt.h:983
bool Val
Definition: dt.h:973
static const TStr NStr
Definition: dt.h:982
bool TBool::IsValStr ( const TStr Str)
static

Definition at line 1842 of file dt.cpp.

References FalseStr, TStr::GetUc(), NoStr, NStr, TrueStr, YesStr, and YStr.

Referenced by TILx::GetSym(), and GetValFromStr().

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:984
TStr GetUc() const
Definition: dt.h:493
static const TStr YStr
Definition: dt.h:983
static const TStr FalseStr
Definition: dt.h:980
static const TStr YesStr
Definition: dt.h:985
static const TStr NStr
Definition: dt.h:982
Definition: dt.h:412
static const TStr TrueStr
Definition: dt.h:981

Here is the call graph for this function:

Here is the caller graph for this function:

void TBool::Load ( TSIn SIn)
inline

Definition at line 991 of file dt.h.

References TSIn::Load(), and Val.

Referenced by TAGMFast::Load(), TCoda::Load(), TStrHash< TInt, TBigStrPool >::Load(), and TStrHash< TInt, TBigStrPool >::LoadShM().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void TBool::LoadXml ( const PXmlTok XmlTok,
const TStr Nm 
)

Definition at line 1833 of file dt.cpp.

References TXmlObjSer::GetBoolArg(), Val, and XLoadHd.

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:973

Here is the call graph for this function:

TBool::operator bool ( ) const
inline

Definition at line 989 of file dt.h.

References Val.

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

Definition at line 1000 of file dt.h.

References Val.

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

Definition at line 998 of file dt.h.

References Val.

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

Definition at line 996 of file dt.h.

References Val.

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

Definition at line 997 of file dt.h.

References Val.

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

Definition at line 992 of file dt.h.

References TSOut::Save(), and Val.

Referenced by TJsonVal::Save(), TAGMFast::Save(), TCoda::Save(), TBigNet< TNodeData, IsDir >::Save(), THash< TPair, THash >::Save(), TCrossNet::Save(), TPt< TRec >::Save(), TStrHash< TInt, TBigStrPool >::Save(), and THashSet< TInt >::Save().

992 {SOut.Save(Val);}
bool Val
Definition: dt.h:973
void Save(const bool &Bool)
Definition: fl.h:173

Here is the call graph for this function:

Here is the caller graph for this function:

void TBool::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 1838 of file dt.cpp.

References GetStr(), Val, and XSaveBETagArg.

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

Here is the call graph for this function:

Member Data Documentation

const TStr TBool::FalseStr ="F"
static

Definition at line 980 of file dt.h.

Referenced by GetStr(), and IsValStr().

const bool TBool::Mn =0
static

Definition at line 975 of file dt.h.

const bool TBool::Mx =1
static

Definition at line 976 of file dt.h.

const TStr TBool::NoStr ="No"
static

Definition at line 984 of file dt.h.

Referenced by GetYesNoStr(), and IsValStr().

const TStr TBool::NStr ="N"
static

Definition at line 982 of file dt.h.

Referenced by GetYNStr(), and IsValStr().

TRnd TBool::Rnd
static

Definition at line 978 of file dt.h.

Referenced by GetRnd().

const TStr TBool::TrueStr ="T"
static

Definition at line 981 of file dt.h.

Referenced by TXmlTok::GetBoolArgVal(), GetStr(), GetValFromStr(), and IsValStr().

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

Definition at line 977 of file dt.h.

const TStr TBool::YesStr ="Yes"
static

Definition at line 985 of file dt.h.

Referenced by GetValFromStr(), GetYesNoStr(), and IsValStr().

const TStr TBool::YStr ="Y"
static

Definition at line 983 of file dt.h.

Referenced by GetValFromStr(), GetYNStr(), and IsValStr().


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