Inter4ql  5.2
Public Member Functions | List of all members
Inter4ql::Value Class Reference

Value class that handles different types of data. More...

#include <Value.h>

Public Member Functions

 Value (std::string s)
 constructor with constructed string value More...
 
 Value (Value *value)
 copy constructor More...
 
 Value (int i, Inter4ql::variable_type::type _type=Inter4ql::variable_type::INTEGER)
 constructor with constructed integer value More...
 
 Value (double d)
 constructor with constructed double value More...
 
 ~Value ()
 destructor More...
 
void set_value (std::string s)
 setter for string type value More...
 
void set_value (int i, Inter4ql::variable_type::type _type=Inter4ql::variable_type::INTEGER)
 setter for integer type value More...
 
void set_value (double d)
 setter for double type value More...
 
std::string get_value_string () const
 getter for a string type value More...
 
double get_value_double () const
 getter for a double type value More...
 
int get_value_int () const
 getter for an integer type value More...
 
bool is_numeric ()
 checks if value is numeric More...
 
double get_value_numeric ()
 gives numeric value More...
 
Inter4ql::variable_type::type get_type () const
 getter for a value type More...
 
bool operator== (std::string &s)
 string comparison
 
bool operator== (int &i)
 integer comparison
 
bool operator== (double &d)
 double comparison
 
bool operator== (Value &_v)
 values comparison
 
bool operator!= (Value &_v)
 values comparison
 
std::string print (bool type=true)
 returns string with value information More...
 

Detailed Description

Value class that handles different types of data.

Constructor & Destructor Documentation

◆ Value() [1/4]

Inter4ql::Value::Value ( std::string  s)
explicit

constructor with constructed string value

Parameters
svalue with a type string

◆ Value() [2/4]

Inter4ql::Value::Value ( Value value)
explicit

copy constructor

Parameters
valueobject to be copied

◆ Value() [3/4]

Inter4ql::Value::Value ( int  i,
Inter4ql::variable_type::type  _type = Inter4ql::variable_type::INTEGER 
)
explicit

constructor with constructed integer value

Parameters
ivalue with an integer type
_typetype of a value

◆ Value() [4/4]

Inter4ql::Value::Value ( double  d)
explicit

constructor with constructed double value

Parameters
dvalue with a double type

◆ ~Value()

Inter4ql::Value::~Value ( )

destructor

Member Function Documentation

◆ get_type()

Inter4ql::variable_type::type Inter4ql::Value::get_type ( ) const

getter for a value type

Returns
enumeration type (ID, VARIABLE, STRING, INT, DOUBLE)

◆ get_value_double()

double Inter4ql::Value::get_value_double ( ) const

getter for a double type value

Returns
value with a double type

◆ get_value_int()

int Inter4ql::Value::get_value_int ( ) const

getter for an integer type value

Returns
value with an integer type

◆ get_value_numeric()

double Inter4ql::Value::get_value_numeric ( )

gives numeric value

Returns
double with numeric value of this instance

◆ get_value_string()

std::string Inter4ql::Value::get_value_string ( ) const

getter for a string type value

Returns
value with a string type

◆ is_numeric()

bool Inter4ql::Value::is_numeric ( )

checks if value is numeric

Returns
is value numeric?

◆ print()

std::string Inter4ql::Value::print ( bool  type = true)

returns string with value information

Parameters
typedo we want to print information about value type?
Returns
value information packed in a std::string

◆ set_value() [1/3]

void Inter4ql::Value::set_value ( std::string  s)

setter for string type value

Parameters
svalue with a string type

◆ set_value() [2/3]

void Inter4ql::Value::set_value ( int  i,
Inter4ql::variable_type::type  _type = Inter4ql::variable_type::INTEGER 
)

setter for integer type value

Parameters
ivalue with an integer type
_typetype of a value (if we want to hardtype the value)

◆ set_value() [3/3]

void Inter4ql::Value::set_value ( double  d)

setter for double type value

Parameters
dvalue with a double type

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