SNAP Library 2.1, Developer 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
TBool Class Reference

#include <dt.h>

Collaboration diagram for TBool:

List of all members.

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.

Referenced by GetMemUsed().

: Val(false){}

Here is the caller graph for this function:

TBool::TBool ( const bool &  _Val) [inline]

Definition at line 898 of file dt.h.

: Val(_Val){}
TBool::TBool ( TSIn SIn) [inline, explicit]

Definition at line 900 of file dt.h.

References TSIn::Load(), and Val.

{SIn.Load(Val);}

Here is the call graph for this function:


Member Function Documentation

static TStr TBool::Get01Str ( const bool &  Val) [inline, static]

Definition at line 926 of file dt.h.

                                       {
    if (Val){return "1";} else {return "0";}}
int TBool::GetMemUsed ( ) const [inline]

Definition at line 911 of file dt.h.

References TBool().

{return sizeof(TBool);}

Here is the call graph for this function:

int TBool::GetPrimHashCd ( ) const [inline]

Definition at line 913 of file dt.h.

References Val.

{return Val;}
static bool TBool::GetRnd ( ) [inline, static]

Definition at line 916 of file dt.h.

References TRnd::GetUniDevInt(), and Rnd.

{return Rnd.GetUniDevInt(2)==1;}

Here is the call graph for this function:

int TBool::GetSecHashCd ( ) const [inline]

Definition at line 914 of file dt.h.

References Val.

{return Val;}
static TStr TBool::GetStr ( const bool &  Val) [inline, static]

Definition at line 918 of file dt.h.

References FalseStr, and TrueStr.

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

                                     {
    if (Val){return TrueStr;} else {return FalseStr;}}

Here is the caller graph for this function:

static TStr TBool::GetStr ( const TBool Bool) [inline, static]

Definition at line 920 of file dt.h.

References GetStr(), and Val.

                                       {
    return GetStr(Bool.Val);}

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().

                                        {
  return (Str==TrueStr)||(Str==YStr)||(Str==YesStr);
}

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.

                                                           {
  TStr UcStr=Str.GetUc();
  if (IsValStr(UcStr)){
    return (UcStr==TrueStr)||(UcStr==YStr)||(UcStr==YesStr);
  } else {
    return DfVal;
  }
}

Here is the call graph for this function:

static TStr TBool::GetYesNoStr ( const bool &  Val) [inline, static]

Definition at line 924 of file dt.h.

References NoStr, and YesStr.

Referenced by TEnv::GetIfArgPrefixBool().

                                          {
    if (Val){return YesStr;} else {return NoStr;}}

Here is the caller graph for this function:

static TStr TBool::GetYNStr ( const bool &  Val) [inline, static]

Definition at line 922 of file dt.h.

References NStr, and YStr.

                                       {
    if (Val){return YStr;} else {return NStr;}}
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().

                                   {
  TStr UcStr=Str.GetUc();
  return
   (UcStr==FalseStr)||(UcStr==TrueStr)||
   (UcStr==YStr)||(UcStr==NStr)||
   (UcStr==YesStr)||(UcStr==NoStr);
}

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

References TSIn::Load(), and Val.

Referenced by TAGMFast::Load(), and TStrHash< TDat, TStringPool, THashFunc >::Load().

{SIn.Load(Val);}

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.

                                                        {
  XLoadHd(Nm);
  Val=TXmlObjSer::GetBoolArg(XmlTok, "Val");
}

Here is the call graph for this function:

TBool::operator bool ( ) const [inline]

Definition at line 899 of file dt.h.

References Val.

{return Val;}
bool TBool::operator() ( ) const [inline]

Definition at line 910 of file dt.h.

References Val.

{return Val;}
bool TBool::operator< ( const TBool Bool) const [inline]

Definition at line 908 of file dt.h.

References Val.

                                          {//return Val<Bool.Val;
    return (Val==false)&&(Bool.Val==true);}
TBool& TBool::operator= ( const TBool Bool) [inline]

Definition at line 906 of file dt.h.

References Val.

{Val=Bool.Val; return *this;}
bool TBool::operator== ( const TBool Bool) const [inline]

Definition at line 907 of file dt.h.

References Val.

{return Val==Bool.Val;}
void TBool::Save ( TSOut SOut) const [inline]

Definition at line 902 of file dt.h.

References TSOut::Save(), and Val.

Referenced by TJsonVal::Save(), TPpVal::Save(), TAGMFast::Save(), TBigNet< TNodeData, IsDir >::Save(), THash< TIntPr, TEdgeInfo >::Save(), TPt< TRec >::Save(), TStrHash< TDat, TStringPool, THashFunc >::Save(), and THashSet< TInt >::Save().

{SOut.Save(Val);}

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.

                                                     {
  XSaveBETagArg(Nm, "Val", TBool::GetStr(Val));
}

Here is the call graph for this function:


Member Data Documentation

const TStr TBool::FalseStr = "F" [static]

Definition at line 890 of file dt.h.

Referenced by GetStr(), and IsValStr().

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.

Referenced by GetYesNoStr(), and IsValStr().

const TStr TBool::NStr = "N" [static]

Definition at line 892 of file dt.h.

Referenced by GetYNStr(), and IsValStr().

TRnd TBool::Rnd [static]

Definition at line 888 of file dt.h.

Referenced by GetRnd().

const TStr TBool::TrueStr = "T" [static]

Definition at line 891 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 887 of file dt.h.

const TStr TBool::YesStr = "Yes" [static]

Definition at line 895 of file dt.h.

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

const TStr TBool::YStr = "Y" [static]

Definition at line 893 of file dt.h.

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


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