www.cemf.ir
Logical Class Reference

Holds a bool value and converts strings to bool. More...

Public Member Functions

word typeName () const
 
 Logical ()=default
 Default constructor. More...
 
 Logical (bool s)
 Construct from bool. More...
 
 Logical (const word &l)
 Construct from word. More...
 
 Logical (const char *ch)
 Construct from char string. More...
 
 Logical (const Logical &)=default
 Copy. More...
 
 Logical (Logical &&)=default
 Move. More...
 
Logicaloperator= (const Logical &)=default
 Copy assignment. More...
 
Logicaloperator= (Logical &&)=default
 Move assignment. More...
 
Logicaloperator= (const bool &b)
 Assignment with bool. More...
 
bool operator() () const
 () operator, return bool value More...
 
 operator bool () const
 Return bool value. More...
 
Logical operator! () const
 Not operator. More...
 
bool read (iIstream &is)
 
bool write (iOstream &os) const
 

Static Public Member Functions

static word TYPENAME ()
 Type info. More...
 
static bool evaluteWord (const word &l, bool &b, int &yesNoSet)
 

Private Member Functions

 Logical (bool s, int yns)
 Construct from bool and set number. More...
 

Private Attributes

bool s_ = false
 bool value More...
 
int yesNoSet_ = 0
 Set numbe of of Yes or No. More...
 

Static Private Attributes

static const word YesNo__ [4][2]
 Set of Yes or Nos. More...
 

Detailed Description

Holds a bool value and converts strings to bool.

Definition at line 39 of file Logical.hpp.

Constructor & Destructor Documentation

◆ Logical() [1/7]

Logical ( bool  s,
int  yns 
)
inlineexplicitprivate

Construct from bool and set number.

Definition at line 56 of file Logical.hpp.

◆ Logical() [2/7]

Logical ( )
inlinedefault

Default constructor.

Referenced by Logical::operator!().

+ Here is the caller graph for this function:

◆ Logical() [3/7]

Logical ( bool  s)
inlineexplicit

Construct from bool.

Definition at line 81 of file Logical.hpp.

◆ Logical() [4/7]

Logical ( const word l)

Construct from word.

Definition at line 26 of file Logical.cpp.

References pFlow::endl(), Logical::evaluteWord(), fatalErrorInFunction, fatalExit, Logical::s_, and Logical::yesNoSet_.

+ Here is the call graph for this function:

◆ Logical() [5/7]

Logical ( const char *  ch)

Construct from char string.

Definition at line 35 of file Logical.cpp.

◆ Logical() [6/7]

Logical ( const Logical )
default

Copy.

◆ Logical() [7/7]

Logical ( Logical &&  )
default

Move.

Member Function Documentation

◆ TYPENAME()

static word TYPENAME ( )
inlinestatic

Type info.

Definition at line 65 of file Logical.hpp.

Referenced by Logical::typeName().

+ Here is the caller graph for this function:

◆ typeName()

word typeName ( ) const
inline

Definition at line 70 of file Logical.hpp.

References Logical::TYPENAME().

+ Here is the call graph for this function:

◆ operator=() [1/3]

Logical& operator= ( const Logical )
default

Copy assignment.

◆ operator=() [2/3]

Logical& operator= ( Logical &&  )
default

Move assignment.

◆ operator=() [3/3]

Logical& operator= ( const bool &  b)
inline

Assignment with bool.

Definition at line 105 of file Logical.hpp.

References Logical::s_, and Logical::yesNoSet_.

◆ operator()()

bool operator() ( ) const
inline

() operator, return bool value

Definition at line 115 of file Logical.hpp.

References Logical::s_.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Return bool value.

Definition at line 121 of file Logical.hpp.

References Logical::s_.

◆ operator!()

Logical operator! ( ) const
inline

Not operator.

Definition at line 127 of file Logical.hpp.

References Logical::Logical(), Logical::s_, and Logical::yesNoSet_.

+ Here is the call graph for this function:

◆ read()

bool read ( iIstream is)

Definition at line 65 of file Logical.cpp.

References token::good(), ioErrorInFile, token::isString(), token::isWord(), IOstream::lineNumber(), IOstream::name(), IOstream::setBad(), token::stringToken(), and token::wordToken().

Referenced by pFlow::operator>>().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write()

bool write ( iOstream os) const

Definition at line 97 of file Logical.cpp.

References IOstream::check(), and FUNCTION_NAME.

Referenced by pFlow::operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ evaluteWord()

bool evaluteWord ( const word l,
bool &  b,
int &  yesNoSet 
)
static

Definition at line 41 of file Logical.cpp.

References pFlow::toUpper().

Referenced by Logical::Logical().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ s_

bool s_ = false
private

◆ yesNoSet_

int yesNoSet_ = 0
private

Set numbe of of Yes or No.

Definition at line 47 of file Logical.hpp.

Referenced by Logical::Logical(), Logical::operator!(), and Logical::operator=().

◆ YesNo__

const word YesNo__[4][2]
inlinestaticprivate
Initial value:
= { { "Yes", "No" },
{ "on", "off" },
{ "true", "false" },
{ "Ok", "No" } }

Set of Yes or Nos.

Definition at line 50 of file Logical.hpp.


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