Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
IntValue.h
Go to the documentation of this file.
1 #pragma once
2 #include "Value.h"
3 
4 namespace Hazelnp
5 {
8  class IntValue : public Value
9  {
10  public:
11  IntValue(const long long int& value);
12  ~IntValue() override {};
13 
15  Value* Deepcopy() const override;
16 
18  std::string GetAsOsString() const override;
19 
21  const long long int& GetValue() const;
22 
23  operator long long int() const;
24  operator int() const;
25 
26 
28  long long int GetInt64() const override;
30  int GetInt32() const override;
31 
33  long double GetFloat64() const override;
35  double GetFloat32() const override;
36 
38  std::string GetString() const override;
39 
41  const std::vector<Value*>& GetList() const override;
42 
43  private:
44  long long int value;
45  };
46 }
Hazelnp::IntValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: IntValue.cpp:20
Hazelnp
Definition: DataType.h:4
Hazelnp::IntValue
Specializations for integer values (uses long long int)
Definition: IntValue.h:8
Hazelnp::IntValue::GetFloat32
double GetFloat32() const override
Will return the data as a double.
Definition: IntValue.cpp:59
Hazelnp::IntValue::~IntValue
~IntValue() override
Definition: IntValue.h:12
Hazelnp::IntValue::IntValue
IntValue(const long long int &value)
Definition: IntValue.cpp:7
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
Hazelnp::IntValue::GetInt32
int GetInt32() const override
Will return the data as an int.
Definition: IntValue.cpp:49
Hazelnp::IntValue::GetList
const std::vector< Value * > & GetList() const override
Throws HazelnuppValueNotConvertibleException.
Definition: IntValue.cpp:72
Hazelnp::IntValue::GetFloat64
long double GetFloat64() const override
Will return the data as a long double.
Definition: IntValue.cpp:54
Hazelnp::IntValue::GetString
std::string GetString() const override
Will return the data as a string.
Definition: IntValue.cpp:64
Hazelnp::IntValue::GetInt64
long long int GetInt64() const override
Will return the data as a long long int.
Definition: IntValue.cpp:44
Hazelnp::IntValue::GetValue
const long long int & GetValue() const
Will return the raw value.
Definition: IntValue.cpp:27
Hazelnp::IntValue::Deepcopy
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: IntValue.cpp:15
Value.h