This class parses commands. More...
#include <rtt/scripting/CommandParser.hpp>
Public Member Functions | |
CommandParser (TaskContext *context, CommonParser &cp, bool as_action) | |
Create a CommandParser operating in a taskcontext. | |
bool | foundObject () |
bool | foundMethod () |
rule_t & | parser () |
ConditionInterface * | wrapCondition (ConditionInterface *) |
Each condition, which relates to this command, might be subject to wrapping. | |
ConditionInterface * | dispatchCondition () |
Return a condition evaluating to true if the command is dispatched and accepted. | |
CommandInterface * | getCommand () |
Get the parsed command. | |
ConditionInterface * | getImplTermCondition () |
The implicit termination condition associated with the command, if any. | |
void | reset () |
resets the CommandParser, use this after you've succesfully used the created command and implicit termination condition. |
This class parses commands.
Actually, it only parses call commands, and the keyword 'nothing'. Value Set Commands are parsed by the ValueChangeParser. It also takes care of checking whether a command needs to be dispatched, and otherwise wraps the generated command in an AsynchCommandDecorator.
Definition at line 57 of file CommandParser.hpp.
RTT::detail::CommandParser::CommandParser | ( | TaskContext * | context, | |
CommonParser & | cp, | |||
bool | as_action | |||
) |
Create a CommandParser operating in a taskcontext.
as_action | return an action, meaning wrap the created DispatchInterface in an DispatchAction such that execute() of the returned command does a DispatchInterface::dispatch(). |
ConditionInterface* RTT::detail::CommandParser::dispatchCondition | ( | ) |
Return a condition evaluating to true if the command is dispatched and accepted.
Return zero if not applicable. This method is needed, because the CommandParser can only save state for one command. If multiple commands are involved, this condition must be kept by the parent of this parser and used if necessary.
CommandInterface* RTT::detail::CommandParser::getCommand | ( | ) | [inline] |
Get the parsed command.
Call the reset method if you use the generated command, otherwise it will be deleted in the CommandParser's destructor..
Definition at line 136 of file CommandParser.hpp.
ConditionInterface* RTT::detail::CommandParser::getImplTermCondition | ( | ) | [inline] |
The implicit termination condition associated with the command, if any.
Ownership semantics are the same as for the getCommand() function.
Definition at line 146 of file CommandParser.hpp.