Public Member Functions | List of all members
openfluid::core::BooleanValue Class Reference

#include <core/BooleanValue.hpp>

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

Public Member Functions

 BooleanValue ()
 
 BooleanValue (const BooleanValue &Val)
 
 BooleanValue (const bool &POD)
 
virtual ~BooleanValue ()
 
Valueoperator= (const Value &Other)
 
 operator bool () const
 
Type getType () const
 
Valueclone () const
 
bool convert (Value &Val) const
 
bool get () const
 
void set (const bool &Val)
 
void writeToStream (std::ostream &OutStm) const
 
void writeQuotedToStream (std::ostream &OutStm) const
 
- Public Member Functions inherited from openfluid::core::SimpleValue
 SimpleValue ()
 
bool isSimple () const
 
bool isCompound () const
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()
 
virtual ~Value ()
 
bool isDoubleValue () const
 
const DoubleValueasDoubleValue () const
 
DoubleValueasDoubleValue ()
 
bool isIntegerValue () const
 
const IntegerValueasIntegerValue () const
 
IntegerValueasIntegerValue ()
 
bool isBooleanValue () const
 
const BooleanValueasBooleanValue () const
 
BooleanValueasBooleanValue ()
 
bool isStringValue () const
 
const StringValueasStringValue () const
 
StringValueasStringValue ()
 
bool isNullValue () const
 
const NullValueasNullValue () const
 
NullValueasNullValue ()
 
bool isVectorValue () const
 
const VectorValueasVectorValue () const
 
VectorValueasVectorValue ()
 
bool isMatrixValue () const
 
const MatrixValueasMatrixValue () const
 
MatrixValueasMatrixValue ()
 
bool isMapValue () const
 
const MapValueasMapValue () const
 
MapValueasMapValue ()
 
bool isTreeValue () const
 
const TreeValueasTreeValue () const
 
TreeValueasTreeValue ()
 
std::string toString () const
 

Additional Inherited Members

- Public Types inherited from openfluid::core::Value
enum  Type {
  NONE, BOOLEAN, INTEGER, DOUBLE,
  STRING, VECTOR, MATRIX, MAP,
  TREE, NULLL
}
 
- Static Public Member Functions inherited from openfluid::core::Value
static bool getValueTypeFromString (const std::string &ValueTypeString, Value::Type &ValueType)
 
static std::string getStringFromValueType (const Value::Type ValueType)
 

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
// declaration of a BooleanValue, initialized to 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 ( )
inlinevirtual

Member Function Documentation

Value* openfluid::core::BooleanValue::clone ( ) const
inlinevirtual

Reimplemented from openfluid::core::Value.

bool openfluid::core::BooleanValue::convert ( Value Val) const
virtual

Reimplemented from openfluid::core::Value.

bool openfluid::core::BooleanValue::get ( ) const
inline

Returns the boolean value as plain old type

Returns
the boolean value
Type openfluid::core::BooleanValue::getType ( ) const
inlinevirtual
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::writeQuotedToStream ( std::ostream &  OutStm) const
inlinevirtual
void openfluid::core::BooleanValue::writeToStream ( std::ostream &  OutStm) const
virtual

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