IntValue Class Reference

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

`#include <IntValue.h>`

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

## Public Member Functions

| IntValue (const long long int &value)
| ~IntValue () override
Value * | Deepcopy () 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 Value
virtual | ~Value ()
DATA_TYPE | GetDataType () const
| Will return the data type of this value. More...

## Additional Inherited Members

Protected Member Functions inherited from Value
| Value (DATA_TYPE type)
Protected Attributes inherited from Value
DATA_TYPE | type

## Detailed Description

Specializations for integer values (uses long long int)

Definition at line 6 of file IntValue.h.

## Constructor & Destructor Documentation

## IntValue()

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

Definition at line 5 of file IntValue.cpp.

:
Value(DATA_TYPE::INT),
value { value }
{
return;
}

## ~IntValue()

IntValue::~IntValue | ( |  | ) |

inlineoverride

Definition at line 10 of file IntValue.h.

{};

## Member Function Documentation

## Deepcopy()

Value * IntValue::Deepcopy | ( |  | ) | const

overridevirtual

Will return a deeopopy of this object.

Implements Value.

Definition at line 13 of file IntValue.cpp.

{
return new IntValue(value);
}

## GetAsOsString()

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

overridevirtual

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

Implements Value.

Definition at line 18 of file IntValue.cpp.

{
std::stringstream ss;
ss << "IntValue: " << value;
return ss.str();
}

## GetFloat32()

double IntValue::GetFloat32 | ( |  | ) | const

overridevirtual

Will return the data as a double.

Implements Value.

Definition at line 57 of file IntValue.cpp.

{
return (double)value;
}

## GetFloat64()

long double IntValue::GetFloat64 | ( |  | ) | const

overridevirtual

Will return the data as a long double.

Implements Value.

Definition at line 52 of file IntValue.cpp.

{
return (long double)value;
}

## GetInt32()

int IntValue::GetInt32 | ( |  | ) | const

overridevirtual

Will return the data as an int.

Implements Value.

Definition at line 47 of file IntValue.cpp.

{
return (int)value;
}

## GetInt64()

long long int IntValue::GetInt64 | ( |  | ) | const

overridevirtual

Will return the data as a long long int.

Implements Value.

Definition at line 42 of file IntValue.cpp.

{
return value;
}

## GetList()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Value.

Definition at line 70 of file IntValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetString()

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

overridevirtual

Will return the data as a string.

Implements Value.

Definition at line 62 of file IntValue.cpp.

{
std::stringstream ss;
ss << value;
return ss.str();
}

## GetValue()

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

Will return the raw value.

Definition at line 25 of file IntValue.cpp.

{
return value;
}

## operator int()

IntValue::operator int | ( |  | ) | const

Definition at line 35 of file IntValue.cpp.

{
return (int)value;
}

## operator long long int()

IntValue::operator long long int | ( |  | ) | const

Definition at line 30 of file IntValue.cpp.

{
return value;
}

The documentation for this class was generated from the following files:

- Hazelnupp/IntValue.h
- Hazelnupp/IntValue.cpp

HazelnuppValueNotConvertibleException
Gets thrown when an attempt is made to retrieve the wrong data type from a value, when the value not ...
Definition: HazelnuppException.h:33
DATA_TYPE::INT
@ INT
IntValue::IntValue
IntValue(const long long int &value)
Definition: IntValue.cpp:5
Value::Value
Value(DATA_TYPE type)
Definition: Value.cpp:3