FloatValue.h
Go to the documentation of this file.
#pragma once
#include "Value.h"
#include <ostream>
namespace Hazelnp
{
class FloatValue : public Value
{
public:
FloatValue(const long double& value);
~FloatValue() override {};
Value* Deepcopy() const override;
std::string GetAsOsString() const override;
const long double& GetValue() const;
operator long double() const;
operator double() const;
long long int GetInt64() const override;
int GetInt32() const override;
long double GetFloat64() const override;
double GetFloat32() const override;
std::string GetString() const override;
const std::vector<Value*>& GetList() const override;
private:
long double value;
};
}
Hazelnp::FloatValue::GetFloat64
long double GetFloat64() const override
Will return the data as a long double.
Definition: FloatValue.cpp:54
Hazelnp
Definition: DataType.h:3
Hazelnp::FloatValue::~FloatValue
~FloatValue() override
Definition: FloatValue.h:13
Hazelnp::FloatValue::GetString
std::string GetString() const override
Will return the data as a string.
Definition: FloatValue.cpp:64
Hazelnp::FloatValue::GetList
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: FloatValue.cpp:72
Hazelnp::FloatValue::GetInt64
long long int GetInt64() const override
Will return the data as a long long int.
Definition: FloatValue.cpp:44
Hazelnp::FloatValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: FloatValue.cpp:20
Hazelnp::FloatValue::GetValue
const long double & GetValue() const
Will return the raw value.
Definition: FloatValue.cpp:27
Hazelnp::FloatValue
Specializations for floating point values (uses long double)
Definition: FloatValue.h:9
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
Hazelnp::FloatValue::Deepcopy
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: FloatValue.cpp:15
Hazelnp::FloatValue::GetFloat32
double GetFloat32() const override
Will return the data as a double.
Definition: FloatValue.cpp:59
Hazelnp::FloatValue::FloatValue
FloatValue(const long double &value)
Definition: FloatValue.cpp:7
Value.h
Hazelnp::FloatValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: FloatValue.cpp:49