This page is for an old version of Hexaly Optimizer. We recommend that you update your version and read the documentation for the latest stable release.

LSPValue Class

class

General value container.

Any value can be contained in an instance of this class (integer, double, boolean, string, LSExpression, module, map, function and also non exposed types like files or dates).

Since:10.0

Summary

Functions
getType Returns the type of the value.
isInt Returns true if the value is an integer value.
isDouble Returns true if the value is a double value.
isBool Returns true if the value is a boolean value.
isMap Returns true if the value is an LSPMap.
isModule Returns true if the value is an LSPModule.
isExpression Returns true if the value is an LSExpression.
isFunction Returns true if the value is an LSPFunction.
isString Returns true if the value is a string value.
isNil Returns true if the value is nil.
asInt Returns the value as an integer.
asDouble Returns the value as a double.
asBool Returns the value as a boolean.
asMap Returns the value as an LSPMap.
asModule Returns the value as an LSPModule.
asExpression Returns the value as a LSExpression.
asFunction Returns the value as an LSPFunction.
asString Returns the value as a string.

Functions

LSPType localsolver::modeler::LSPValue::getType()
const

Returns the type of the value.

Return:Type of the value.
See:LSPType

bool localsolver::modeler::LSPValue::isInt()
const

Returns true if the value is an integer value.

bool localsolver::modeler::LSPValue::isDouble()
const

Returns true if the value is a double value.

bool localsolver::modeler::LSPValue::isBool()
const

Returns true if the value is a boolean value.

bool localsolver::modeler::LSPValue::isMap()
const

Returns true if the value is an LSPMap.

bool localsolver::modeler::LSPValue::isModule()
const

Returns true if the value is an LSPModule.

bool localsolver::modeler::LSPValue::isExpression()
const

Returns true if the value is an LSExpression.

bool localsolver::modeler::LSPValue::isFunction()
const

Returns true if the value is an LSPFunction.

bool localsolver::modeler::LSPValue::isString()
const

Returns true if the value is a string value.

bool localsolver::modeler::LSPValue::isNil()
const

Returns true if the value is nil.

lsint localsolver::modeler::LSPValue::asInt()
const

Returns the value as an integer.

The value must be an integer.

lsdouble localsolver::modeler::LSPValue::asDouble()
const

Returns the value as a double.

The value must be a double.

bool localsolver::modeler::LSPValue::asBool()
const

Returns the value as a boolean.

The value must be a boolean.

LSPMap localsolver::modeler::LSPValue::asMap()
const

Returns the value as an LSPMap.

The value must be a map.

LSPModule localsolver::modeler::LSPValue::asModule()
const

Returns the value as an LSPModule.

The value must be a module.

LSExpression localsolver::modeler::LSPValue::asExpression()
const

Returns the value as a LSExpression.

The value must be a LSExpression.

LSPFunction localsolver::modeler::LSPValue::asFunction()
const

Returns the value as an LSPFunction.

The value must be a function.

std::string localsolver::modeler::LSPValue::asString()
const

Returns the value as a string.

The value must be a string.