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
4namespace 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 override;
35 };
36}
Abstract class for values.
Definition: Value.h:11
Specializations for void values.
Definition: VoidValue.h:9
const std::vector< Value * > & GetList() const override
Returns an empty list.
Definition: VoidValue.cpp:50
long double GetFloat64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:35
long long int GetInt64() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:25
std::string GetAsOsString() const override
Will return a string suitable for an std::ostream;.
Definition: VoidValue.cpp:18
std::string GetString() const override
Returns an empty string.
Definition: VoidValue.cpp:45
int GetInt32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:30
~VoidValue() override
Definition: VoidValue.h:12
double GetFloat32() const override
Throws HazelnuppValueNotConvertibleException.
Definition: VoidValue.cpp:40
Value * Deepcopy() const override
Will return a deeopopy of this object.
Definition: VoidValue.cpp:13