Orocos Real-Time Toolkit
2.8.3
|
Get the peer and object from an invocation path like a.b.c.d() . More...
#include <rtt/scripting/PeerParser.hpp>
Public Member Functions | |
PeerParser (TaskContext *c, CommonParser &cp, bool fullpath=false) | |
Create a PeerParser which starts looking for peers from a task. More... | |
void | reset () |
After reset, peer() == current context and object() == "this". More... | |
rule_t & | parser () |
The parser tries to traverse a full peer-to-object path and throws if it got stuck in the middle. More... | |
rule_t & | locator () |
The locator tries to go as far as possible in the peer-to-object path and will never throw. More... | |
TaskContext * | peer () |
Returns the last matching peer. More... | |
std::string | object () |
Returns the last matching object name. More... | |
ServicePtr | taskObject () |
Returns the last matching Service or zero if not found. More... | |
bool | foundPath () |
Returns true if the PeerParser found a valid path. More... | |
Get the peer and object from an invocation path like a.b.c.d() .
Definition at line 58 of file PeerParser.hpp.
RTT::PeerParser::PeerParser | ( | TaskContext * | c, |
CommonParser & | cp, | ||
bool | fullpath = false |
||
) |
Create a PeerParser which starts looking for peers from a task.
c | The task to start searching from. |
fullpath | Set to true if the parser() must resolve the full path. |
Definition at line 134 of file PeerParser.cpp.
References RTT::scripting::CommonParser::notassertingidentifier.
bool RTT::PeerParser::foundPath | ( | ) |
Returns true if the PeerParser found a valid path.
Will also return true if fullpath was set to false in the constructor and a partial match was made.
Definition at line 240 of file PeerParser.cpp.
rule_t & RTT::PeerParser::locator | ( | ) |
The locator tries to go as far as possible in the peer-to-object path and will never throw.
peer() and object() will contain the last valid peer found and its supposed object, attribute or value.
Definition at line 220 of file PeerParser.cpp.
Referenced by RTT::scripting::DataCallParser::DataCallParser(), and RTT::scripting::ValueParser::ValueParser().
std::string RTT::PeerParser::object | ( | ) |
Returns the last matching object name.
Definition at line 235 of file PeerParser.cpp.
Referenced by RTT::scripting::DataCallParser::DataCallParser().
rule_t & RTT::PeerParser::parser | ( | ) |
The parser tries to traverse a full peer-to-object path and throws if it got stuck in the middle.
peer() will return the target peer and object() is this or the supposed object of the peer. The parser does not check if this object exists.
Definition at line 215 of file PeerParser.cpp.
Referenced by RTT::scripting::StateGraphParser::StateGraphParser().
TaskContext * RTT::PeerParser::peer | ( | ) |
Returns the last matching peer.
Definition at line 225 of file PeerParser.cpp.
Referenced by RTT::scripting::DataCallParser::DataCallParser().
void RTT::PeerParser::reset | ( | ) |
After reset, peer() == current context and object() == "this".
Definition at line 151 of file PeerParser.cpp.
References RTT::TaskContext::getPeer(), RTT::TaskContext::hasPeer(), RTT::internal::GlobalService::Instance(), RTT::TaskContext::provides(), RTT::TaskContext::ready(), and RTT::Warning.
Referenced by RTT::scripting::DataCallParser::DataCallParser(), RTT::scripting::StateGraphParser::getParserResult(), RTT::scripting::ProgramGraphParser::parseFunction(), and RTT::scripting::ValueParser::ValueParser().
Service::shared_ptr RTT::PeerParser::taskObject | ( | ) |
Returns the last matching Service or zero if not found.
Definition at line 230 of file PeerParser.cpp.
Referenced by RTT::scripting::DataCallParser::DataCallParser(), RTT::scripting::StateGraphParser::getParserResult(), and RTT::scripting::ValueParser::ValueParser().