LocalSolver logo
is now
Hexaly logo

We're excited to share that we are moving forward. We're leaving behind the LocalSolver brand and transitioning to our new identity: Hexaly. This represents a leap forward in our mission to enable every organization to make better decisions faster when faced with operational and strategic challenges.

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 LSPValue

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

LSPType LSPValue::getType() const

Returns the type of the value.

Returns

Type of the value.

See

LSPType

bool LSPValue::isNil() const

Returns true if the value is nil.

bool LSPValue::isInt() const

Returns true if the value is an integer value.

bool LSPValue::isDouble() const

Returns true if the value is a double value.

bool LSPValue::isBool() const

Returns true if the value is a boolean value.

bool LSPValue::isExpression() const

Returns true if the value is an localsolver::LSExpression.

bool LSPValue::isString() const

Returns true if the value is a string value.

bool LSPValue::isMap() const

Returns true if the value is an LSPMap.

bool LSPValue::isFunction() const

Returns true if the value is an LSPFunction.

bool LSPValue::isModule() const

Returns true if the value is an LSPModule.

lsint LSPValue::asInt() const

Returns the value as an integer. The value must be an integer.

lsdouble LSPValue::asDouble() const

Returns the value as a double. The value must be a double.

bool LSPValue::asBool() const

Returns the value as a boolean. The value must be a boolean.

LSExpression LSPValue::asExpression() const

Returns the value as a localsolver::LSExpression. The value must be a LSExpression.

std::string LSPValue::asString() const

Returns the value as a string. The value must be a string.

LSPMap LSPValue::asMap() const

Returns the value as an LSPMap. The value must be a map.

LSPFunction LSPValue::asFunction() const

Returns the value as an LSPFunction. The value must be a function.

LSPModule LSPValue::asModule() const

Returns the value as an LSPModule. The value must be a module.

Overloaded operators

explicit operator LSPValue::lsint() const

Returns the value as an integer. The value must be an integer.

explicit operator LSPValue::lsdouble() const

Returns the value as a double. The value must be a double.

explicit operator LSPValue::bool_() const

Returns the value as a boolean. The value must be a boolean.

explicit operator LSPValue::LSExpression() const

Returns the value as a localsolver::LSExpression. The value must be a LSExpression.

explicit operator LSPValue::std::string() const

Returns the value as a string. The value must be a string.

explicit operator LSPValue::LSPMap() const

Returns the value as an LSPMap. The value must be a map.

explicit operator LSPValue::LSPFunction() const

Returns the value as an LSPFunction. The value must be a function.

explicit operator LSPValue::LSPModule() const

Returns the value as an LSPModule. The value must be a module.