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

#include <core/DoubleValue.hpp>

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

Public Member Functions

 DoubleValue ()
 
 DoubleValue (const DoubleValue &Val)
 
 DoubleValue (const double &POD)
 
virtual ~DoubleValue ()
 
Value & operator= (const Value &Other)
 
 operator double () const
 
Type getType () const
 
Value * clone () const
 
bool convert (Value &Val) const
 
double get () const
 
void set (const double &Val)
 
void writeToStream (std::ostream &OutStm) const
 
void writeQuotedToStream (std::ostream &OutStm) const
 
- Public Member Functions inherited from openfluid::core::SimpleValue
 SimpleValue ()
 
virtual ~SimpleValue ()
 
bool isSimple () const
 
bool isCompound () const
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()=default
 
virtual ~Value ()
 
bool isDoubleValue () const
 
const DoubleValue & asDoubleValue () const
 
DoubleValue & asDoubleValue ()
 
bool isIntegerValue () const
 
const IntegerValue & asIntegerValue () const
 
IntegerValue & asIntegerValue ()
 
bool isBooleanValue () const
 
const BooleanValue & asBooleanValue () const
 
BooleanValue & asBooleanValue ()
 
bool isStringValue () const
 
const StringValue & asStringValue () const
 
StringValue & asStringValue ()
 
bool isNullValue () const
 
const NullValue & asNullValue () const
 
NullValue & asNullValue ()
 
bool isVectorValue () const
 
const VectorValue & asVectorValue () const
 
VectorValue & asVectorValue ()
 
bool isMatrixValue () const
 
const MatrixValue & asMatrixValue () const
 
MatrixValue & asMatrixValue ()
 
bool isMapValue () const
 
const MapValue & asMapValue () const
 
MapValue & asMapValue ()
 
bool isTreeValue () const
 
const TreeValue & asTreeValue () const
 
TreeValue & asTreeValue ()
 
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

DoubleValue is a container for a signed double precision floating point value.

See also
Value


Example : declaration

// declaration of a DoubleValue, initialized to 0.0 by default
// declaration of a DoubleValue, initialized to 1.357

Example : getting the contained value

double 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(101.99);

Example : conversion from string

openfluid::core::StringValue StringVal("57.33");
// to DoubleValue
Val1 = StringVal.toDoubleValue();
// to double
double DblVal = StringVal.toDouble();

Example : conversion to string

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

Constructor & Destructor Documentation

◆ DoubleValue() [1/3]

openfluid::core::DoubleValue::DoubleValue ( )
inline

Default constructor

◆ DoubleValue() [2/3]

openfluid::core::DoubleValue::DoubleValue ( const DoubleValue &  Val)
inline

Copy constructor

◆ DoubleValue() [3/3]

openfluid::core::DoubleValue::DoubleValue ( const double &  POD)
inline

Constructor from plain old type

◆ ~DoubleValue()

virtual openfluid::core::DoubleValue::~DoubleValue ( )
inlinevirtual

Member Function Documentation

◆ clone()

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

Reimplemented from openfluid::core::Value.

◆ convert()

bool openfluid::core::DoubleValue::convert ( Value &  Val) const
virtual

Reimplemented from openfluid::core::Value.

◆ get()

double openfluid::core::DoubleValue::get ( ) const
inline

Returns the double value as plain old type

Returns
the double value

◆ getType()

Type openfluid::core::DoubleValue::getType ( ) const
inlinevirtual

◆ operator double()

openfluid::core::DoubleValue::operator double ( ) const
inline

Cast operator

◆ operator=()

Value& openfluid::core::DoubleValue::operator= ( const Value &  )
virtual

Assignment operator

Reimplemented from openfluid::core::Value.

◆ set()

void openfluid::core::DoubleValue::set ( const double &  Val)
inline

Sets the plain old type double value

Parameters
[in]Valthe double value

◆ writeQuotedToStream()

void openfluid::core::DoubleValue::writeQuotedToStream ( std::ostream &  OutStm) const
inlinevirtual

◆ writeToStream()

void openfluid::core::DoubleValue::writeToStream ( std::ostream &  OutStm) const
virtual

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