ListValue Class Reference

Specializations for list values (uses std::vector<Value*>) More...

`#include <ListValue.h>`

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

## Public Member Functions

| ListValue ()
| ~ListValue () 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...
void | AddValue (const Value *value)
| Will add this value to the list. More...
const std::vector< Value * > & | GetValue () const
| Will return the raw value. More...
| operator std::vector< Value * > () const
long long int | GetInt64 () const override
| Throws HazelnuppValueNotConvertibleException. More...
int | GetInt32 () const override
| Throws HazelnuppValueNotConvertibleException. More...
long double | GetFloat64 () const override
| Throws HazelnuppValueNotConvertibleException. More...
double | GetFloat32 () const override
| Throws HazelnuppValueNotConvertibleException. More...
std::string | GetString () const override
| Throws HazelnuppValueNotConvertibleException. More...
const std::vector< Value * > & | GetList () const override
| Will return this values list. 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 list values (uses std::vector<Value*>)

Definition at line 7 of file ListValue.h.

## Constructor & Destructor Documentation

## ListValue()

ListValue::ListValue | ( |  | ) |

Definition at line 5 of file ListValue.cpp.

:
Value(DATA_TYPE::LIST)
{
return;
}

## ~ListValue()

ListValue::~ListValue | ( |  | ) |

override

Definition at line 11 of file ListValue.cpp.

{
for (Value* val : value)
delete val;
value.clear();
return;
}

## Member Function Documentation

## AddValue()

void ListValue::AddValue | ( | const Value * | value | ) |

Will add this value to the list.

Definition at line 31 of file ListValue.cpp.

{
this->value.emplace_back(value->Deepcopy());
return;
}

## Deepcopy()

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

overridevirtual

Will return a deeopopy of this object.

Implements Value.

Definition at line 21 of file ListValue.cpp.

{
ListValue* newList = new ListValue();
for (const Value* val : value)
newList->AddValue(val);
return newList;
}

## GetAsOsString()

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

overridevirtual

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

Implements Value.

Definition at line 42 of file ListValue.cpp.

{
std::stringstream ss;
ss << "ListValue: [";
for (const Value* val : value)
{
ss << *val;
if (val != value.back())
ss << ", ";
}
ss << "]";
return ss.str();
}

## GetFloat32()

double ListValue::GetFloat32 | ( |  | ) | const

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Value.

Definition at line 82 of file ListValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetFloat64()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Value.

Definition at line 77 of file ListValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetInt32()

int ListValue::GetInt32 | ( |  | ) | const

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Value.

Definition at line 72 of file ListValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetInt64()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Value.

Definition at line 67 of file ListValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetList()

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

overridevirtual

Will return this values list.

Implements Value.

Definition at line 92 of file ListValue.cpp.

{
return value;
}

## GetString()

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

overridevirtual

Throws HazelnuppValueNotConvertibleException.

Implements Value.

Definition at line 87 of file ListValue.cpp.

{
throw HazelnuppValueNotConvertibleException();
}

## GetValue()

const std::vector< Value * > & ListValue::GetValue | ( |  | ) | const

Will return the raw value.

Definition at line 37 of file ListValue.cpp.

{
return value;
}

## operator std::vector< Value * >()

ListValue::operator std::vector< Value * > | ( |  | ) | const

Definition at line 60 of file ListValue.cpp.

{
return value;
}

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

- Hazelnupp/ListValue.h
- Hazelnupp/ListValue.cpp

ListValue::AddValue
void AddValue(const Value *value)
Will add this value to the list.
Definition: ListValue.cpp:31
ListValue
Specializations for list values (uses std::vector<Value*>)
Definition: ListValue.h:7
DATA_TYPE::LIST
@ LIST
ListValue::ListValue
ListValue()
Definition: ListValue.cpp:5
Value
Abstract class for values.
Definition: Value.h:8
Value::Deepcopy
virtual Value * Deepcopy() const =0
Will return a deeopopy of this object.
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
Value::Value
Value(DATA_TYPE type)
Definition: Value.cpp:3