Manual for OpenFLUID 2.1.11

Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
openfluid::core::Value Class Referenceabstract

#include <core/Value.hpp>

Public Types

enum  Type {
  NONE, BOOLEAN, INTEGER, DOUBLE,
  STRING, VECTOR, MATRIX, MAP,
  TREE, NULLL
}
 

Public Member Functions

 Value ()=default
 
 Value (const Value &)=default
 
 Value (Value &&)=default
 
virtual Value & operator= (const Value &)
 
virtual Value & operator= (Value &&)
 
virtual ~Value ()=default
 
virtual Type getType () const =0
 
virtual Value * clone () const
 
virtual bool convert (Value &) const
 
virtual bool isSimple () const =0
 
virtual bool isCompound () const =0
 
virtual void writeToStream (std::ostream &OutStm) const =0
 
virtual void writeQuotedToStream (std::ostream &OutStm) const =0
 
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
 

Static Public Member Functions

static bool getValueTypeFromString (const std::string &ValueTypeString, Value::Type &ValueType)
 
static std::string getStringFromValueType (const Value::Type ValueType)
 

Friends

std::ostream & operator<< (std::ostream &OutStm, const Value &Val)
 
Inheritance diagram for openfluid::core::Value:
Inheritance graph
[legend]

Member Enumeration Documentation

◆ Type

Enumerator
NONE 
BOOLEAN 
INTEGER 
DOUBLE 
STRING 
VECTOR 
MATRIX 
MAP 
TREE 
NULLL 

Constructor & Destructor Documentation

◆ Value() [1/3]

openfluid::core::Value::Value ( )
default

◆ Value() [2/3]

openfluid::core::Value::Value ( const Value &  )
default

◆ Value() [3/3]

openfluid::core::Value::Value ( Value &&  )
default

◆ ~Value()

virtual openfluid::core::Value::~Value ( )
virtualdefault

Member Function Documentation

◆ asBooleanValue() [1/2]

BooleanValue& openfluid::core::Value::asBooleanValue ( )

Returns the value as a BooleanValue if the value is of the BooleanValue type

Returns
the value as a BooleanValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the BooleanValue type

◆ asBooleanValue() [2/2]

const BooleanValue& openfluid::core::Value::asBooleanValue ( ) const

Returns the value as a constant BooleanValue if the value is of the BooleanValue type

Returns
the value as a constant BooleanValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the BooleanValue type

◆ asDoubleValue() [1/2]

DoubleValue& openfluid::core::Value::asDoubleValue ( )

Returns the value as a DoubleValue if the value is of the DoubleValue type

Returns
the value as a DoubleValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the DoubleValue type

◆ asDoubleValue() [2/2]

const DoubleValue& openfluid::core::Value::asDoubleValue ( ) const

Returns the value as a constant DoubleValue if the value is of the DoubleValue type

Returns
the value as a constant DoubleValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the DoubleValue type

◆ asIntegerValue() [1/2]

IntegerValue& openfluid::core::Value::asIntegerValue ( )

Returns the value as a IntegerValue if the value is of the IntegerValue type

Returns
the value as a IntegerValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the IntegerValue type

◆ asIntegerValue() [2/2]

const IntegerValue& openfluid::core::Value::asIntegerValue ( ) const

Returns the value as a constant IntegerValue if the value is of the IntegerValue type

Returns
the value as a constant IntegerValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the IntegerValue type

◆ asMapValue() [1/2]

MapValue& openfluid::core::Value::asMapValue ( )

Returns the value as a MapValue if the value is of the MapValue type

Returns
the value as a MapValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the MapValue type

◆ asMapValue() [2/2]

const MapValue& openfluid::core::Value::asMapValue ( ) const

Returns the value as a constant MapValue if the value is of the MapValue type

Returns
the value as a constant MapValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the MapValue type

◆ asMatrixValue() [1/2]

MatrixValue& openfluid::core::Value::asMatrixValue ( )

Returns the value as a MatrixValue if the value is of the MatrixValue type

Returns
the value as a MatrixValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the MatrixValue type

◆ asMatrixValue() [2/2]

const MatrixValue& openfluid::core::Value::asMatrixValue ( ) const

Returns the value as a constant MatrixValue if the value is of the MatrixValue type

Returns
the value as a constant MatrixValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the MatrixValue type

◆ asNullValue() [1/2]

NullValue& openfluid::core::Value::asNullValue ( )

Returns the value as a NullValue if the value is of the NullValue type

Returns
the value as a NullValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the NullValue type

◆ asNullValue() [2/2]

const NullValue& openfluid::core::Value::asNullValue ( ) const

Returns the value as a constant NullValue if the value is of the NullValue type

Returns
the value as a constant NullValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the NullValue type

◆ asStringValue() [1/2]

StringValue& openfluid::core::Value::asStringValue ( )

Returns the value as a StringValue if the value is of the StringValue type

Returns
the value as a StringValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the StringValue type

◆ asStringValue() [2/2]

const StringValue& openfluid::core::Value::asStringValue ( ) const

Returns the value as a constant StringValue if the value is of the StringValue type

Returns
the value as a constant StringValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the StringValue type

◆ asTreeValue() [1/2]

TreeValue& openfluid::core::Value::asTreeValue ( )

Returns the value as a TreeValue if the value is of the TreeValue type

Returns
the value as a TreeValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the TreeValue type

◆ asTreeValue() [2/2]

const TreeValue& openfluid::core::Value::asTreeValue ( ) const

Returns the value as a constant TreeValue if the value is of the TreeValue type

Returns
the value as a constant TreeValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the TreeValue type

◆ asVectorValue() [1/2]

VectorValue& openfluid::core::Value::asVectorValue ( )

Returns the value as a VectorValue if the value is of the VectorValue type

Returns
the value as a VectorValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the VectorValue type

◆ asVectorValue() [2/2]

const VectorValue& openfluid::core::Value::asVectorValue ( ) const

Returns the value as a constant VectorValue if the value is of the VectorValue type

Returns
the value as a constant VectorValue
Exceptions
openfluid::base::FrameworkExceptionif the value is not of the VectorValue type

◆ clone()

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

◆ convert()

virtual bool openfluid::core::Value::convert ( Value &  ) const
inlinevirtual

◆ getStringFromValueType()

static std::string openfluid::core::Value::getStringFromValueType ( const Value::Type  ValueType)
static

Returns the name of the type corresponding to the given type

Parameters
[in]ValueTypeThe value type
Returns
the type name

◆ getType()

virtual Type openfluid::core::Value::getType ( ) const
pure virtual

◆ getValueTypeFromString()

static bool openfluid::core::Value::getValueTypeFromString ( const std::string &  ValueTypeString,
Value::Type &  ValueType 
)
static

Gets the value type ciorresponding to the name of the type

Parameters
[in]ValueTypeStringThe type name as a string
[out]ValueTypeThe value type
Returns
false if the type name does not exist or is misspelled, true otherwise

◆ isBooleanValue()

bool openfluid::core::Value::isBooleanValue ( ) const
inline

Returns true if the value is a BooleanValue

◆ isCompound()

virtual bool openfluid::core::Value::isCompound ( ) const
pure virtual

◆ isDoubleValue()

bool openfluid::core::Value::isDoubleValue ( ) const
inline

Returns true if the Value is a DoubleValue

◆ isIntegerValue()

bool openfluid::core::Value::isIntegerValue ( ) const
inline

Returns true if the value is an IntegerValue

◆ isMapValue()

bool openfluid::core::Value::isMapValue ( ) const
inline

Returns true if the value is a MapValue

◆ isMatrixValue()

bool openfluid::core::Value::isMatrixValue ( ) const
inline

Returns true if the value is a MatrixValue

◆ isNullValue()

bool openfluid::core::Value::isNullValue ( ) const
inline

Returns true if the value is a NullValue

◆ isSimple()

virtual bool openfluid::core::Value::isSimple ( ) const
pure virtual

◆ isStringValue()

bool openfluid::core::Value::isStringValue ( ) const
inline

Returns true if the value is a StringValue

◆ isTreeValue()

bool openfluid::core::Value::isTreeValue ( ) const
inline

Returns true if the value is a TreeValue

◆ isVectorValue()

bool openfluid::core::Value::isVectorValue ( ) const
inline

Returns true if the value is a VectorValue

◆ operator=() [1/2]

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

◆ operator=() [2/2]

virtual Value& openfluid::core::Value::operator= ( Value &&  )
inlinevirtual

◆ toString()

std::string openfluid::core::Value::toString ( ) const

Returns the value as a string

◆ writeQuotedToStream()

virtual void openfluid::core::Value::writeQuotedToStream ( std::ostream &  OutStm) const
pure virtual

◆ writeToStream()

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

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  OutStm,
const Value &  Val 
)
friend

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