Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
Public Member Functions | List of all members
Hazelnp::IntValue Class Reference

Specializations for integer values (uses long long int) More...

#include <IntValue.h>

Inheritance diagram for Hazelnp::IntValue:
Inheritance graph
[legend]
Collaboration diagram for Hazelnp::IntValue:
Collaboration graph
[legend]

Public Member Functions

 IntValue (const long long int &value)
 
 ~IntValue () override
 
ValueDeepcopy () const override
 Will return a deeopopy of this object. More...
 
std::string GetAsOsString () const override
 Will return a string suitable for an std::ostream;. More...
 
const long long int & GetValue () const
 Will return the raw value. More...
 
 operator long long int () const
 
 operator int () const
 
long long int GetInt64 () const override
 Will return the data as a long long int. More...
 
int GetInt32 () const override
 Will return the data as an int. More...
 
long double GetFloat64 () const override
 Will return the data as a long double. More...
 
double GetFloat32 () const override
 Will return the data as a double. More...
 
std::string GetString () const override
 Will return the data as a string. More...
 
const std::vector< Value * > & GetList () const override
 Throws HazelnuppValueNotConvertibleException. More...
 
- Public Member Functions inherited from Hazelnp::Value
virtual ~Value ()
 
DATA_TYPE GetDataType () const
 Will return the data type of this value. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Hazelnp::Value
 Value (DATA_TYPE type)
 
- Protected Attributes inherited from Hazelnp::Value
DATA_TYPE type
 

Detailed Description

Specializations for integer values (uses long long int)

Definition at line 8 of file IntValue.h.

Constructor & Destructor Documentation

◆ IntValue()

IntValue::IntValue ( const long long int &  value)

Definition at line 7 of file IntValue.cpp.

8  :
10  value { value }
11 {
12  return;
13 }

◆ ~IntValue()

Hazelnp::IntValue::~IntValue ( )
inlineoverride

Definition at line 12 of file IntValue.h.

12 {};

Member Function Documentation

◆ Deepcopy()

Value * IntValue::Deepcopy ( ) const
overridevirtual

Will return a deeopopy of this object.

Implements Hazelnp::Value.

Definition at line 15 of file IntValue.cpp.

16 {
17  return new IntValue(value);
18 }

◆ GetAsOsString()

std::string IntValue::GetAsOsString ( ) const
overridevirtual

Will return a string suitable for an std::ostream;.

Implements Hazelnp::Value.

Definition at line 20 of file IntValue.cpp.

21 {
22  std::stringstream ss;
23  ss << "IntValue: " << value;
24  return ss.str();
25 }

◆ GetFloat32()

double IntValue::GetFloat32 ( ) const
overridevirtual

Will return the data as a double.

Implements Hazelnp::Value.

Definition at line 59 of file IntValue.cpp.

60 {
61  return (double)value;
62 }

◆ GetFloat64()

long double IntValue::GetFloat64 ( ) const
overridevirtual

Will return the data as a long double.

Implements Hazelnp::Value.

Definition at line 54 of file IntValue.cpp.

55 {
56  return (long double)value;
57 }

◆ GetInt32()

int IntValue::GetInt32 ( ) const
overridevirtual

Will return the data as an int.

Implements Hazelnp::Value.

Definition at line 49 of file IntValue.cpp.

50 {
51  return (int)value;
52 }

◆ GetInt64()

long long int IntValue::GetInt64 ( ) const
overridevirtual

Will return the data as a long long int.

Implements Hazelnp::Value.

Definition at line 44 of file IntValue.cpp.

45 {
46  return value;
47 }

◆ GetList()

const std::vector< Value * > & IntValue::GetList ( ) const
overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Hazelnp::Value.

Definition at line 72 of file IntValue.cpp.

73 {
75 }

◆ GetString()

std::string IntValue::GetString ( ) const
overridevirtual

Will return the data as a string.

Implements Hazelnp::Value.

Definition at line 64 of file IntValue.cpp.

65 {
66  std::stringstream ss;
67  ss << value;
68 
69  return ss.str();
70 }

◆ GetValue()

const long long int & IntValue::GetValue ( ) const

Will return the raw value.

Definition at line 27 of file IntValue.cpp.

28 {
29  return value;
30 }

◆ operator int()

IntValue::operator int ( ) const

Definition at line 37 of file IntValue.cpp.

38 {
39  return (int)value;
40 }

◆ operator long long int()

IntValue::operator long long int ( ) const

Definition at line 32 of file IntValue.cpp.

33 {
34  return value;
35 }

The documentation for this class was generated from the following files:
Hazelnp::IntValue::IntValue
IntValue(const long long int &value)
Definition: IntValue.cpp:7
Hazelnp::Value::Value
Value(DATA_TYPE type)
Definition: Value.cpp:5
Hazelnp::DATA_TYPE::INT
@ INT
Hazelnp::HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:38