PssMathParser  1.0.0
Parser of mathemathical expressions
 All Classes Namespaces Files Functions Variables Enumerations Macros Pages
PssMathParser::Generator Class Reference

Derived from Entity, used for intermediate steps of calcualtion. More...

#include <pssmathparser.h>

Inheritance diagram for PssMathParser::Generator:
[legend]
Collaboration diagram for PssMathParser::Generator:
[legend]

Public Member Functions

 Generator (const string &a_name, EntityType a_entityType, const Operator *a_op=nullptr, const Argument *a_arg1=nullptr, const Argument *a_arg2=nullptr, Argument *a_myArg=nullptr)
 Constructor, only constructor list. More...
 
double generateDoubleValue () const
 Returns double value generated with the generator's operator. More...
 
const string & getName () const
 Getter of the generator name. More...
 
- Public Member Functions inherited from PssMathParser::Entity
 Entity (const string &a_name, const EntityType a_type=EntityType::None)
 Constructor, just a constructor list. More...
 
 ~Entity ()
 Destructor.
 
const EntitygetEntity () const
 Returns the pointer to the Entity object. More...
 
EntityType entityType () const
 Get the EntityType of the object. More...
 

Private Attributes

const Operatorm_op
 
const Argumentm_arg1
 
const Argumentm_arg2
 
Argumentm_myArg
 

Additional Inherited Members

- Protected Attributes inherited from PssMathParser::Entity
string m_name
 
EntityType m_type
 

Detailed Description

Derived from Entity, used for intermediate steps of calcualtion.

This class is connected to argument, its objects are not defined by the user but generated as intermediate steps (arguments) that are used for generating the value of other arguments. This class has pointers to the arguments and the operator wich is used for generating its value. The Generator class doesn't store a value because it supose to produce the value upon call. The connection between the Argument and the Generator that generates it is through its names.

Constructor & Destructor Documentation

Generator::Generator ( const string &  a_name,
EntityType  a_entityType,
const Operator a_op = nullptr,
const Argument a_arg1 = nullptr,
const Argument a_arg2 = nullptr,
Argument a_myArg = nullptr 
)

Constructor, only constructor list.

Parameters
a_nameName of the Generator
a_entityTypeEntityType of the Generator
*a_opPointer to the Operator used in producing the value
*a_arg1Pointer to the first Argument used in producing the value
*a_arg2Pointer to the second Argument used in producing the value

Member Function Documentation

double Generator::generateDoubleValue ( ) const

Returns double value generated with the generator's operator.

Returns
double Double value of the generator
const string & Generator::getName ( ) const

Getter of the generator name.

This is a name that also exists in the m_argumentMap. This name connects the generator and the argument which value is generated.

Returns
string Name of the generator

Member Data Documentation

const Argument* PssMathParser::Generator::m_arg1
private

Points to the first argument

const Argument* PssMathParser::Generator::m_arg2
private

Points to the second argument

Argument* PssMathParser::Generator::m_myArg
private

Points to the generated argument

const Operator* PssMathParser::Generator::m_op
private

Points to the operator of the genrator


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