| Leonetienne/Hazelnupp Simple, easy to use, command line parameter interface

VoidValue.h
Go to the documentation of this file.
1 #pragma once
2 #include "Value.h"
3
4 namespace Hazelnp
5 {
6 /** Specializations for void values. These house no value whatsoever, but only communicate information by merely existing.
7 */
8 class VoidValue : public Value
9 {
10 public:
11 VoidValue();
12 ~VoidValue() override {};
13
14 //! Will return a deeopopy of this object
15 Value* Deepcopy() const override;
16
17 //! Will return a string suitable for an std::ostream;
18 std::string GetAsOsString() const override;
19
20 //! Throws HazelnuppValueNotConvertibleException
21 long long int GetInt64() const override;
22 //! Throws HazelnuppValueNotConvertibleException
23 int GetInt32() const override;
24
25 //! Throws HazelnuppValueNotConvertibleException
26 long double GetFloat64() const override;
27 //! Throws HazelnuppValueNotConvertibleException
28 double GetFloat32() const override;
29
30 //! Returns an empty string
31 std::string GetString() const override;
32
33 //! Returns an empty list
34 const std::vector<Value*>& GetList() const;
35 };
36 }
Hazelnp
Definition: CmdArgsInterface.h:7
Hazelnp::VoidValue::GetInt64
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:25
Hazelnp::VoidValue::~VoidValue
~VoidValue() override
Definition: VoidValue.h:12
Hazelnp::VoidValue::GetFloat64
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:35
Hazelnp::VoidValue::GetAsOsString
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: VoidValue.cpp:18
Hazelnp::Value
Abstract class for values.
Definition: Value.h:10
Hazelnp::VoidValue::GetList
const std::vector< Value * > & GetList() const
Returns an empty list.
Definition: VoidValue.cpp:50
Hazelnp::VoidValue::GetInt32
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:30
Hazelnp::VoidValue::Deepcopy
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: VoidValue.cpp:13
Hazelnp::VoidValue
Specializations for void values.
Definition: VoidValue.h:8
Hazelnp::VoidValue::GetString
std::string GetString() const override
Returns an empty string.
Definition: VoidValue.cpp:45
Hazelnp::VoidValue::GetFloat32
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:40
Hazelnp::VoidValue::VoidValue
VoidValue()
Definition: VoidValue.cpp:6
Value.h