NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class implements a single function definition. It is managed by the Define class. More...
#include <define.hpp>
Public Member Functions | |
FunctionDefinition (const std::string &_sDefinitionString="") | |
Constructor of the FunctionDefinition class. Creates a definition from the passed definition string. More... | |
FunctionDefinition & | operator= (const FunctionDefinition &) |
Assignment operator overload for the Function definition class. More... | |
std::string | parse (const std::string &_sArgList) |
This member function parses the call to the contained function definition and returns a function definition string containing the passed values. More... | |
std::string | exportFunction () const |
This member function creates the save string used for writing to the definition file. More... | |
bool | importFunction (const std::string &_sExportedString) |
This member function imports a previously exported definition string and distributes its contents along the member variables. More... | |
std::string | getDefinition () const |
This member function returns the definition of the function without the appended parameters. More... | |
bool | appendComment (const std::string &_sComment) |
This member function appends a comment, which might be set after the definition. More... | |
Public Attributes | |
std::string | sName |
std::string | sSignature |
std::string | sDefinitionString |
std::string | sParsedDefinitionString |
std::string | sComment |
std::vector< std::string > | vArguments |
Private Member Functions | |
bool | decodeDefinition () |
This private member function decodes the definition in the private member variable "sDefinitionString" into single fields. More... | |
bool | splitAndValidateArguments () |
This private member function validates the arguments of the function definition. More... | |
bool | convertToValues () |
This private member function converts the selected of the passed variables into their values. More... | |
bool | replaceArgumentOccurences () |
This private member function replaces all occurences of the passed arguments with the corresponding new placeholders. More... | |
This class implements a single function definition. It is managed by the Define class.
Definition at line 42 of file define.hpp.
FunctionDefinition::FunctionDefinition | ( | const std::string & | _sDefinitionString = "" | ) |
Constructor of the FunctionDefinition class. Creates a definition from the passed definition string.
_sDefinitionString | const string& |
Definition at line 37 of file define.cpp.
References decodeDefinition(), and sDefinitionString.
bool FunctionDefinition::appendComment | ( | const std::string & | _sComment | ) |
This member function appends a comment, which might be set after the definition.
_sComment | const string& |
Definition at line 250 of file define.cpp.
References findParameter(), getArgAtPos(), sComment, and sDefinitionString.
|
private |
This private member function converts the selected of the passed variables into their values.
Definition at line 422 of file define.cpp.
References checkDelimiter(), mu::ParserBase::Eval(), findParameter(), getArgAtPos(), NumeReKernel::getInstance(), NumeReKernel::getParser(), Settings::getPrecision(), NumeReKernel::getSettings(), mu::ParserBase::GetUsedVar(), sDefinitionString, mu::ParserBase::SetExpr(), sParsedDefinitionString, and toString().
Referenced by decodeDefinition().
|
private |
This private member function decodes the definition in the private member variable "sDefinitionString" into single fields.
Definition at line 302 of file define.cpp.
References convertToValues(), findParameter(), SyntaxError::FUNCTION_NAMES_MUST_NOT_CONTAIN_SIGN, getArgAtPos(), getMatchingParenthesis(), SyntaxError::invalid_position, isMultiValue(), SyntaxError::NO_NUMBER_AT_POS_1, replaceArgumentOccurences(), sComment, sDefinitionString, sName, sParsedDefinitionString, splitAndValidateArguments(), sSignature, and StripSpaces().
Referenced by FunctionDefinition().
string FunctionDefinition::exportFunction | ( | ) | const |
This member function creates the save string used for writing to the definition file.
Definition at line 173 of file define.cpp.
References sDefinitionString, sName, sParsedDefinitionString, and vArguments.
string FunctionDefinition::getDefinition | ( | ) | const |
This member function returns the definition of the function without the appended parameters.
Definition at line 278 of file define.cpp.
References sDefinitionString, and StripSpaces().
Referenced by FunctionDefinitionManager::defineFunc().
bool FunctionDefinition::importFunction | ( | const std::string & | _sExportedString | ) |
This member function imports a previously exported definition string and distributes its contents along the member variables.
_sExportedString | const string& |
Definition at line 195 of file define.cpp.
References findParameter(), getArgAtPos(), getMatchingParenthesis(), sComment, sDefinitionString, sName, sParsedDefinitionString, sSignature, StripSpaces(), and vArguments.
Referenced by FunctionDefinitionManager::load().
FunctionDefinition & FunctionDefinition::operator= | ( | const FunctionDefinition & | _def | ) |
Assignment operator overload for the Function definition class.
_def | const FunctionDefinition& |
Definition at line 54 of file define.cpp.
References sComment, sDefinitionString, sName, sParsedDefinitionString, sSignature, and vArguments.
string FunctionDefinition::parse | ( | const std::string & | _sArgList | ) |
This member function parses the call to the contained function definition and returns a function definition string containing the passed values.
_sArgList | const string& |
Definition at line 77 of file define.cpp.
References getNextArgument(), SyntaxError::invalid_position, sDefinitionString, sParsedDefinitionString, StripSpaces(), SyntaxError::TOO_MANY_ARGS_FOR_DEFINE, and vArguments.
|
private |
This private member function replaces all occurences of the passed arguments with the corresponding new placeholders.
Definition at line 465 of file define.cpp.
References checkDelimiter(), sParsedDefinitionString, and vArguments.
Referenced by decodeDefinition().
|
private |
This private member function validates the arguments of the function definition.
Definition at line 373 of file define.cpp.
References SyntaxError::ELLIPSIS_MUST_BE_LAST_ARG, SyntaxError::FUNCTION_ARGS_MUST_NOT_CONTAIN_SIGN, getMatchingParenthesis(), getNextArgument(), SyntaxError::invalid_position, sDefinitionString, StripSpaces(), and vArguments.
Referenced by decodeDefinition().
std::string FunctionDefinition::sComment |
Definition at line 49 of file define.hpp.
Referenced by appendComment(), decodeDefinition(), importFunction(), and operator=().
std::string FunctionDefinition::sDefinitionString |
Definition at line 47 of file define.hpp.
Referenced by appendComment(), convertToValues(), decodeDefinition(), exportFunction(), FunctionDefinition(), getDefinition(), importFunction(), operator=(), parse(), and splitAndValidateArguments().
std::string FunctionDefinition::sName |
Definition at line 45 of file define.hpp.
Referenced by decodeDefinition(), FunctionDefinitionManager::defineFunc(), exportFunction(), importFunction(), FunctionDefinitionManager::load(), and operator=().
std::string FunctionDefinition::sParsedDefinitionString |
Definition at line 48 of file define.hpp.
Referenced by convertToValues(), decodeDefinition(), exportFunction(), importFunction(), operator=(), parse(), and replaceArgumentOccurences().
std::string FunctionDefinition::sSignature |
Definition at line 46 of file define.hpp.
Referenced by decodeDefinition(), importFunction(), and operator=().
std::vector<std::string> FunctionDefinition::vArguments |
Definition at line 50 of file define.hpp.
Referenced by exportFunction(), importFunction(), operator=(), parse(), replaceArgumentOccurences(), and splitAndValidateArguments().