Manual for OpenFLUID 2.1.11

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

Detailed Description

IntegerValue is a container for a signed long integer value.

See also
Value

Example : declaration

// declaration of an IntegerValue, initialized to 0 by default
// declaration of an IntegerValue, initialized to 35

Example : getting the contained value

long 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(-10199);

Example : conversion from string

// to IntegerValue
StringVal.toIntegerValue(Val1);
// to long
long LongVal;
StringVal.toInteger(LongVal);

Example : conversion to string

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

#include <core/IntegerValue.hpp>

Public Member Functions

 IntegerValue ()
 
 IntegerValue (const IntegerValue &Val)
 
 IntegerValue (IntegerValue &&Val)
 
 IntegerValue (const long &POD)
 
IntegerValue & operator= (const Value &Other) override
 
IntegerValue & operator= (Value &&Other) override
 
IntegerValue & operator= (const IntegerValue &Other)=default
 
IntegerValue & operator= (IntegerValue &&Other)=default
 
virtual ~IntegerValue ()=default
 
 operator long () const
 
Type getType () const override
 
Value * clone () const override
 
bool convert (Value &Val) const override
 
long get () const
 
void set (const long &Val)
 
void writeToStream (std::ostream &OutStm) const override
 
void writeQuotedToStream (std::ostream &OutStm) const override
 
- Public Member Functions inherited from openfluid::core::SimpleValue
bool isSimple () const override
 
bool isCompound () const override
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()=default
 
 Value (const Value &)=default
 
 Value (Value &&)=default
 
virtual ~Value ()=default
 
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)
 
Inheritance diagram for openfluid::core::IntegerValue:
Inheritance graph
[legend]
Collaboration diagram for openfluid::core::IntegerValue:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ IntegerValue() [1/4]

openfluid::core::IntegerValue::IntegerValue ( )
inline

Default constructor

◆ IntegerValue() [2/4]

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

Copy constructor

◆ IntegerValue() [3/4]

openfluid::core::IntegerValue::IntegerValue ( IntegerValue &&  Val)
inline

Copy constructor

◆ IntegerValue() [4/4]

openfluid::core::IntegerValue::IntegerValue ( const long &  POD)
inline

Constructor from plain old type

◆ ~IntegerValue()

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

Member Function Documentation

◆ clone()

Value* openfluid::core::IntegerValue::clone ( ) const
inlineoverridevirtual

Reimplemented from openfluid::core::Value.

◆ convert()

bool openfluid::core::IntegerValue::convert ( Value &  Val) const
overridevirtual

Reimplemented from openfluid::core::Value.

◆ get()

long openfluid::core::IntegerValue::get ( ) const
inline

Returns the integer value as a plain old type

Returns
the integer value

◆ getType()

Type openfluid::core::IntegerValue::getType ( ) const
inlineoverridevirtual

◆ operator long()

openfluid::core::IntegerValue::operator long ( ) const
inline

Cast operator

◆ operator=() [1/4]

IntegerValue& openfluid::core::IntegerValue::operator= ( const IntegerValue &  Other)
default

◆ operator=() [2/4]

IntegerValue& openfluid::core::IntegerValue::operator= ( const Value &  )
overridevirtual

Assignment operator

Reimplemented from openfluid::core::Value.

◆ operator=() [3/4]

IntegerValue& openfluid::core::IntegerValue::operator= ( IntegerValue &&  Other)
default

◆ operator=() [4/4]

IntegerValue& openfluid::core::IntegerValue::operator= ( Value &&  )
overridevirtual

Move operator

Reimplemented from openfluid::core::Value.

◆ set()

void openfluid::core::IntegerValue::set ( const long &  Val)
inline

Sets the plain old type long integer value

Parameters
[in]Valthe long integer value

◆ writeQuotedToStream()

void openfluid::core::IntegerValue::writeQuotedToStream ( std::ostream &  OutStm) const
inlineoverridevirtual

◆ writeToStream()

void openfluid::core::IntegerValue::writeToStream ( std::ostream &  OutStm) const
overridevirtual

The documentation for this class was generated from the following file:
openfluid::core::Value::toString
std::string toString() const
openfluid::core::IntegerValue::get
long get() const
Definition: IntegerValue.hpp:145
openfluid::core::IntegerValue::set
void set(const long &Val)
Definition: IntegerValue.hpp:154
openfluid::core::IntegerValue
Definition: IntegerValue.hpp:79
openfluid::core::StringValue
Definition: StringValue.hpp:76