Orocos Real-Time Toolkit
2.6.0
|
This class is responsible for parsing constant definitions, variable definitions, variable change instructions, and alias definitions. More...
#include <rtt/scripting/ValueChangeParser.hpp>
Public Member Functions | |
ValueChangeParser (TaskContext *tc, CommonParser &cp, Service::shared_ptr storage, ExecutionEngine *caller) | |
Create a ValueChangeParser which operates and stores values in a task. | |
void | clear () |
Clear assignCommands(), definedValues() and definedNames(). | |
void | store (Service::shared_ptr other) |
Store allDefinedNames() in a service. | |
void | load (Service::shared_ptr source) |
Loads all defined names from a service. | |
base::ActionInterface * | assignCommand () |
This base::ActionInterface holds the command assigning a value to a variable that should be included in the program. | |
std::vector < base::ActionInterface * > | assignCommands () |
base::AttributeBase * | lastDefinedValue () |
std::vector < base::AttributeBase * > | definedValues () |
std::string | lastDefinedName () |
std::vector< std::string > | definedNames () |
std::vector< std::string > | allDefinedNames () |
rule_t & | parser () |
Returns the full parser, as it is used most. | |
rule_t & | constantDefinitionParser () |
the parser that parses definitions of constants. | |
rule_t & | variableDefinitionParser () |
the parser that parses variable definitions, don't forget to check assignCommand after a variable definition is parsed. | |
rule_t & | aliasDefinitionParser () |
The parser that parses alias definitions. | |
rule_t & | paramDefinitionParser () |
The parser that parses state context parameter definitions. | |
rule_t & | bareDefinitionParser () |
The parser that parses a bare variable definition. | |
void | reset () |
Completely clear all data and erase all parsed definitions from the taskcontext given in the constructor. |
This class is responsible for parsing constant definitions, variable definitions, variable change instructions, and alias definitions.
. It stores these in the ValueParser in the ParseContext, and parses values using ExpressionParser..
Definition at line 60 of file ValueChangeParser.hpp.
RTT::ValueChangeParser::ValueChangeParser | ( | TaskContext * | tc, |
CommonParser & | cp, | ||
Service::shared_ptr | storage, | ||
ExecutionEngine * | caller | ||
) |
Create a ValueChangeParser which operates and stores values in a task.
Use definedvalues() to get the values added to tc, use store() to store the added values in another task context as well. After reset(), tc will be cleared of all the stored values. tc is thus used as a temporary storage container. If you want the new added values in a different storage container, use the storage argument. Defaults to tc->provides() if set to null.
Definition at line 73 of file ValueChangeParser.cpp.
rule_t & RTT::ValueChangeParser::aliasDefinitionParser | ( | ) |
The parser that parses alias definitions.
This does not work via an assignment, and it is not necessary to check assignCommand() after this..
Definition at line 367 of file ValueChangeParser.cpp.
Referenced by RTT::scripting::StateGraphParser::StateGraphParser().
This base::ActionInterface holds the command assigning a value to a variable that should be included in the program.
After a constant definition, variable definition or variable assignment is parsed, you should check it, and include it in your program if it is non-zero.
Definition at line 157 of file ValueChangeParser.hpp.
rule_t & RTT::ValueChangeParser::bareDefinitionParser | ( | ) |
The parser that parses a bare variable definition.
These do not get initialised where they are defined, so it is not necessary to check assignCommand() after this...
Definition at line 382 of file ValueChangeParser.cpp.
void RTT::ValueChangeParser::clear | ( | ) |
Clear assignCommands(), definedValues() and definedNames().
Does not delete any variables or commands.
Definition at line 333 of file ValueChangeParser.cpp.
Referenced by reset().
rule_t & RTT::ValueChangeParser::constantDefinitionParser | ( | ) |
the parser that parses definitions of constants.
Do not forget to check assignCommand after a constant definition is parsed..
Definition at line 362 of file ValueChangeParser.cpp.
Referenced by RTT::scripting::StateGraphParser::StateGraphParser().
void RTT::ValueChangeParser::load | ( | Service::shared_ptr | source | ) |
Loads all defined names from a service.
Just like store(), but works the other way around and allows you to pre-defined some variables. This function removes all these variables from 'source'
Definition at line 313 of file ValueChangeParser.cpp.
rule_t & RTT::ValueChangeParser::paramDefinitionParser | ( | ) |
The parser that parses state context parameter definitions.
These do not get initialised where they are defined, so it is not necessary to check assignCommand() after this...
Definition at line 377 of file ValueChangeParser.cpp.
Referenced by RTT::scripting::StateGraphParser::StateGraphParser().
rule_t & RTT::ValueChangeParser::parser | ( | ) |
Returns the full parser, as it is used most.
The individual sub-parsers are below.
Definition at line 357 of file ValueChangeParser.cpp.
void RTT::ValueChangeParser::store | ( | Service::shared_ptr | other | ) |
Store allDefinedNames() in a service.
This allows you to retrieve all parsed variable declarations.
Definition at line 299 of file ValueChangeParser.cpp.
rule_t & RTT::ValueChangeParser::variableDefinitionParser | ( | ) |
the parser that parses variable definitions, don't forget to check assignCommand after a variable definition is parsed.
Definition at line 372 of file ValueChangeParser.cpp.
Referenced by RTT::scripting::StateGraphParser::StateGraphParser().