Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Hazelnp::Value Class Referenceabstract

Abstract class for values. More...

#include <Value.h>

Inheritance diagram for Hazelnp::Value:
Inheritance graph
[legend]

Public Member Functions

virtual ~Value ()
 
virtual ValueDeepcopy () const =0
 Will return a deeopopy of this object. More...
 
virtual std::string GetAsOsString () const =0
 Will return a string suitable for an std::ostream. More...
 
DATA_TYPE GetDataType () const
 Will return the data type of this value. More...
 
virtual long long int GetInt64 () const =0
 Will attempt to return the integer data (long long) More...
 
virtual int GetInt32 () const =0
 Will attempt to return the integer data (int) More...
 
virtual long double GetFloat64 () const =0
 Will attempt to return the floating-point data (long double) More...
 
virtual double GetFloat32 () const =0
 Will attempt to return the floating-point data (double) More...
 
virtual std::string GetString () const =0
 Will attempt to return the string-data. More...
 
virtual const std::vector< Value * > & GetList () const =0
 Will attempt to return the list-data. More...
 

Protected Member Functions

 Value (DATA_TYPE type)
 

Protected Attributes

DATA_TYPE type
 

Friends

std::ostream & operator<< (std::ostream &os, const Value &v)
 

Detailed Description

Abstract class for values.

Definition at line 10 of file Value.h.

Constructor & Destructor Documentation

◆ ~Value()

virtual Hazelnp::Value::~Value ( )
inlinevirtual

Definition at line 13 of file Value.h.

13 {};

◆ Value()

Value::Value ( DATA_TYPE  type)
protected

Definition at line 5 of file Value.cpp.

6  :
7  type{ type }
8 {
9  return;
10 }
DATA_TYPE type
Definition: Value.h:48

Member Function Documentation

◆ Deepcopy()

virtual Value* Hazelnp::Value::Deepcopy ( ) const
pure virtual

Will return a deeopopy of this object.

Implemented in Hazelnp::FloatValue, Hazelnp::ListValue, Hazelnp::StringValue, Hazelnp::IntValue, and Hazelnp::VoidValue.

◆ GetAsOsString()

virtual std::string Hazelnp::Value::GetAsOsString ( ) const
pure virtual

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

Implemented in Hazelnp::FloatValue, Hazelnp::ListValue, Hazelnp::StringValue, Hazelnp::IntValue, and Hazelnp::VoidValue.

◆ GetDataType()

DATA_TYPE Value::GetDataType ( ) const

Will return the data type of this value.

Definition at line 12 of file Value.cpp.

13 {
14  return type;
15 }
DATA_TYPE type
Definition: Value.h:48

◆ GetFloat32()

virtual double Hazelnp::Value::GetFloat32 ( ) const
pure virtual

Will attempt to return the floating-point data (double)

Implemented in Hazelnp::ListValue, Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::StringValue, and Hazelnp::VoidValue.

◆ GetFloat64()

virtual long double Hazelnp::Value::GetFloat64 ( ) const
pure virtual

Will attempt to return the floating-point data (long double)

Implemented in Hazelnp::ListValue, Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::StringValue, and Hazelnp::VoidValue.

◆ GetInt32()

virtual int Hazelnp::Value::GetInt32 ( ) const
pure virtual

Will attempt to return the integer data (int)

Implemented in Hazelnp::ListValue, Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::StringValue, and Hazelnp::VoidValue.

◆ GetInt64()

virtual long long int Hazelnp::Value::GetInt64 ( ) const
pure virtual

Will attempt to return the integer data (long long)

Implemented in Hazelnp::ListValue, Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::StringValue, and Hazelnp::VoidValue.

◆ GetList()

virtual const std::vector<Value*>& Hazelnp::Value::GetList ( ) const
pure virtual

Will attempt to return the list-data.

Implemented in Hazelnp::ListValue, Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::StringValue, and Hazelnp::VoidValue.

◆ GetString()

virtual std::string Hazelnp::Value::GetString ( ) const
pure virtual

Will attempt to return the string-data.

Implemented in Hazelnp::ListValue, Hazelnp::FloatValue, Hazelnp::IntValue, Hazelnp::StringValue, and Hazelnp::VoidValue.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Value v 
)
friend

Definition at line 24 of file Value.h.

25  {
26  return os << v.GetAsOsString();
27  }

Member Data Documentation

◆ type

DATA_TYPE Hazelnp::Value::type
protected

Definition at line 48 of file Value.h.


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