Public Member Functions

openfluid::core::BooleanValue Class Reference

Inheritance diagram for openfluid::core::BooleanValue:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 BooleanValue ()
 BooleanValue (const BooleanValue &Val)
 BooleanValue (const bool &POD)
Valueoperator= (const Value &Other)
 operator bool () const
virtual ~BooleanValue ()
Type getType () const
Valueclone () const
bool & get ()
const bool & get () const
void set (const bool &Val)
void writeToStream (std::ostream &OutStm) const

Detailed Description

BooleanValue is a container for a true/false value.

See also:
Value


Example : declaration

  // declaration of a BooleanValue, initialized to false by default
  openfluid::core::BooleanValue Val1;

  // declaration of a BooleanValue, initialized to true
  openfluid::core::BooleanValue Val2(true);

Example : getting the contained value

  bool Tmp1;

  // using the get method
  Tmp1 = Val1.get();

  // or using the cast operator
  Tmp1 = Val1;

Example : setting the contained value

  // using the set method
  Val1.set(true);

Example : conversion from string

  openfluid::core::StringValue StringVal("true");

  // to BooleanValue
  Val1 = StringVal.toBooleanValue();

  // to bool
  bool BoolVal = StringVal.toBoolean();

Example : conversion to string

  std::string StdStrVal = Val1.toString();

Constructor & Destructor Documentation

openfluid::core::BooleanValue::BooleanValue ( ) [inline]

Default constructor

openfluid::core::BooleanValue::BooleanValue ( const BooleanValue Val) [inline]

Copy constructor

openfluid::core::BooleanValue::BooleanValue ( const bool &  POD) [inline]

Constructor from plain old type

virtual openfluid::core::BooleanValue::~BooleanValue ( ) [inline, virtual]

Member Function Documentation

Value* openfluid::core::BooleanValue::clone ( ) const [inline, virtual]

Reimplemented from openfluid::core::Value.

bool& openfluid::core::BooleanValue::get ( ) [inline]

Returns the boolean value as plain old type

Returns:
the boolean value
const bool& openfluid::core::BooleanValue::get ( ) const [inline]

Returns the boolean value as a const plain old type

Returns:
the boolean value
Type openfluid::core::BooleanValue::getType ( ) const [inline, virtual]
openfluid::core::BooleanValue::operator bool ( ) const [inline]

Cast operator

Value& openfluid::core::BooleanValue::operator= ( const Value ) [virtual]

Assignment operator

Reimplemented from openfluid::core::Value.

void openfluid::core::BooleanValue::set ( const bool &  Val) [inline]

Sets the plain old type boolean value

Parameters:
[in]Valthe boolean value
void openfluid::core::BooleanValue::writeToStream ( std::ostream &  OutStm) const [virtual]

Generated using Doxygen 1.7.3
Creative Commons License Creative Commons By-NC-ND license