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

getType

Returns the type of the value.

isNil

Returns true if the value is nil.

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.

isExpression

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

isString

Returns true if the value is a string value.

isMap

Returns true if the value is an LSPMap.

isFunction

Returns true if the value is an LSPFunction.

isModule

Returns true if the value is an LSPModule.

asInt

Returns the value as an integer.

asDouble

Returns the value as a double.

asBool

Returns the value as a boolean.

asExpression

Returns the value as a localsolver::LSExpression.

asString

Returns the value as a string.

asMap

Returns the value as an LSPMap.

asFunction

Returns the value as an LSPFunction.

asModule

Returns the value as an LSPModule.

Overloaded operators

lsint

Returns the value as an integer.

lsdouble

Returns the value as a double.

bool_

Returns the value as a boolean.

LSExpression

Returns the value as a localsolver::LSExpression.

string

Returns the value as a string.

LSPMap

Returns the value as an LSPMap.

LSPFunction

Returns the value as an LSPFunction.

LSPModule

Returns the value as an LSPModule.

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.