LuciadCPillar 2024.0.08
|
Value object to store the value of an Expression and its DataType. More...
#include <luciad/expressions/ExpressionValue.h>
Public Member Functions | |
ExpressionValue (bool value) | |
Constructs the value object for a boolean value. More... | |
ExpressionValue (const char *value) | |
Constructs the value object for a text value. More... | |
ExpressionValue (const ExpressionValue &other) noexcept | |
Constructs a copy of other. More... | |
ExpressionValue (double value) | |
Constructs the value object for a number value. More... | |
ExpressionValue (ExpressionValue &&other) noexcept | |
Move-constructs a ExpressionValue instance, making it point at the same object that other was pointing to. More... | |
ExpressionValue (float value) | |
Constructs the value object for a number value. More... | |
ExpressionValue (int32_t value) | |
Constructs the value object for an integer value. More... | |
ExpressionValue (int64_t value) | |
Constructs the value object for a long integer (64 bit) value. More... | |
ExpressionValue (std::shared_ptr< Geometry > value) | |
Constructs the value object for a Geometry value. More... | |
ExpressionValue (std::string value) | |
Constructs the value object for a text value. More... | |
~ExpressionValue () | |
std::optional< double > | asDouble () const |
Returns the double value, if the value object can be converted to a double. More... | |
bool | getBoolValue () const |
Returns the boolean value, if the value object contains a boolean. More... | |
const DataType & | getDataType () const |
Returns the type of the value stored within this value object. More... | |
double | getDoubleValue () const |
Returns the double value, if the value object contains a double. More... | |
float | getFloatValue () const |
Returns the float value, if the value object contains a float. More... | |
const std::shared_ptr< Geometry > & | getGeometryValue () const |
Returns the geometry value, if the value object contains a geometry. More... | |
int32_t | getIntValue () const |
Returns the int value, if the value object contains an int. More... | |
int64_t | getLongValue () const |
Returns the long integer value, if the value object contains a long int. More... | |
const std::string & | getStringValue () const |
Returns the string value, if the value object contains a string. More... | |
ExpressionValue & | operator= (const ExpressionValue &other) |
ExpressionValue & | operator= (ExpressionValue &&other) noexcept |
bool | operator== (const ExpressionValue &other) const |
Value object to store the value of an Expression and its DataType.
Users of this value object always must check the type of value stored and then call the appropriate method to retrieve the actual value.
luciad::ExpressionValue::ExpressionValue | ( | bool | value | ) |
Constructs the value object for a boolean value.
The type of the value is luciad::DataType::getBooleanType().
value | the boolean. |
luciad::ExpressionValue::ExpressionValue | ( | float | value | ) |
Constructs the value object for a number value.
The type of the value is luciad::DataType::getFloatType().
value | the number. |
luciad::ExpressionValue::ExpressionValue | ( | double | value | ) |
Constructs the value object for a number value.
The type of the value is luciad::DataType::getDoubleType().
value | the number. |
luciad::ExpressionValue::ExpressionValue | ( | int32_t | value | ) |
Constructs the value object for an integer value.
The type of the value is luciad::DataType::getIntType().
value | the number. |
luciad::ExpressionValue::ExpressionValue | ( | int64_t | value | ) |
Constructs the value object for a long integer (64 bit) value.
The type of the value is luciad::DataType::getLongType().
value | the number. |
luciad::ExpressionValue::ExpressionValue | ( | std::string | value | ) |
Constructs the value object for a text value.
The type of the value is luciad::DataType::getStringType().
value | the text. |
luciad::ExpressionValue::ExpressionValue | ( | const char * | value | ) |
Constructs the value object for a text value.
The type of the value is luciad::DataType::getStringType().
value | the text. |
luciad::ExpressionValue::ExpressionValue | ( | std::shared_ptr< Geometry > | value | ) |
Constructs the value object for a Geometry value.
The type of the value is luciad::DataType::getGeometryType().
value | Geometry, cannot be nullptr . |
|
noexcept |
Constructs a copy of other.
other | Instance of the ExpressionValue. |
|
noexcept |
Move-constructs a ExpressionValue instance, making it point at the same object that other was pointing to.
other | Instance of the ExpressionValue. |
luciad::ExpressionValue::~ExpressionValue | ( | ) |
std::optional< double > luciad::ExpressionValue::asDouble | ( | ) | const |
Returns the double value, if the value object can be converted to a double.
bool luciad::ExpressionValue::getBoolValue | ( | ) | const |
Returns the boolean value, if the value object contains a boolean.
luciad::LogicException | when the object does not contain a boolean. |
const DataType & luciad::ExpressionValue::getDataType | ( | ) | const |
Returns the type of the value stored within this value object.
double luciad::ExpressionValue::getDoubleValue | ( | ) | const |
Returns the double value, if the value object contains a double.
luciad::LogicException | when the object does not contain a double. |
float luciad::ExpressionValue::getFloatValue | ( | ) | const |
Returns the float value, if the value object contains a float.
luciad::LogicException | when the object does not contain a float. |
const std::shared_ptr< Geometry > & luciad::ExpressionValue::getGeometryValue | ( | ) | const |
Returns the geometry value, if the value object contains a geometry.
luciad::LogicException | when the object does not contain a geometry. |
int32_t luciad::ExpressionValue::getIntValue | ( | ) | const |
Returns the int value, if the value object contains an int.
luciad::LogicException | when the object does not contain an int. |
int64_t luciad::ExpressionValue::getLongValue | ( | ) | const |
Returns the long integer value, if the value object contains a long int.
luciad::LogicException | when the object does not contain a long int. |
const std::string & luciad::ExpressionValue::getStringValue | ( | ) | const |
Returns the string value, if the value object contains a string.
luciad::LogicException | when the object does not contain a string. |
ExpressionValue & luciad::ExpressionValue::operator= | ( | const ExpressionValue & | other | ) |
|
noexcept |
bool luciad::ExpressionValue::operator== | ( | const ExpressionValue & | other | ) | const |