Public Member Functions | Private Types | Private Member Functions | Private Attributes
RTT::scripting::PeerParser Class Reference

#include <PeerParser.hpp>

List of all members.

Public Member Functions

bool foundPath ()
rule_t & locator ()
std::string object ()
rule_t & parser ()
TaskContextpeer ()
 PeerParser (TaskContext *c, CommonParser &cp, bool fullpath=false)
void reset ()
ServicePtr taskObject ()

Private Types

enum  PeerErrors { peer_not_found }

Private Member Functions

RTT_HIDE void done ()
RTT_HIDE error_status handle_no_peer (scanner_t const &scan, parser_error< PeerErrors, iter_t > &e)
RTT_HIDE void locatepeer (iter_t begin, iter_t end)
RTT_HIDE void seenobjectname (iter_t begin, iter_t end)

Private Attributes

TaskContext_peer
boost::iterator_difference
< iter_t >::type 
advance_on_error
std::queue< std::string > callqueue
CommonParsercommonparser
TaskContextcontext
ServicePtr mcurobject
bool mfoundpath
bool mfullpath
std::string mlastobject
guard< PeerErrorsmy_guard
rule_t peerlocator
rule_t peerpath

Detailed Description

Get the peer and object from an invocation path like a.b.c.d() .

Definition at line 58 of file PeerParser.hpp.


Member Enumeration Documentation

Enumerator:
peer_not_found 

Definition at line 73 of file PeerParser.hpp.


Constructor & Destructor Documentation

RTT::PeerParser::PeerParser ( TaskContext c,
CommonParser cp,
bool  fullpath = false 
)

Create a PeerParser which starts looking for peers from a task.

Parameters:
cThe task to start searching from.
fullpathSet to true if the parser() must resolve the full path.

Definition at line 134 of file PeerParser.cpp.


Member Function Documentation

void RTT::PeerParser::done ( ) [private]

Definition at line 70 of file PeerParser.cpp.

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.

error_status RTT::PeerParser::handle_no_peer ( scanner_t const &  scan,
parser_error< PeerErrors, iter_t > &  e 
) [private]

Definition at line 57 of file PeerParser.cpp.

void RTT::PeerParser::locatepeer ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 170 of file PeerParser.cpp.

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.

std::string RTT::PeerParser::object ( )

Returns the last matching object name.

Definition at line 235 of file PeerParser.cpp.

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.

Returns the last matching peer.

Definition at line 225 of file PeerParser.cpp.

After reset, peer() == current context and object() == "this".

Definition at line 151 of file PeerParser.cpp.

void RTT::PeerParser::seenobjectname ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 162 of file PeerParser.cpp.

Returns the last matching Service or zero if not found.

Definition at line 230 of file PeerParser.cpp.


Member Data Documentation

Definition at line 66 of file PeerParser.hpp.

boost::iterator_difference<iter_t>::type RTT::scripting::PeerParser::advance_on_error [private]

set by locatepeer, read by handle_no_peer

Definition at line 79 of file PeerParser.hpp.

std::queue<std::string> RTT::scripting::PeerParser::callqueue [private]

Definition at line 62 of file PeerParser.hpp.

Definition at line 60 of file PeerParser.hpp.

Definition at line 65 of file PeerParser.hpp.

Definition at line 63 of file PeerParser.hpp.

Definition at line 67 of file PeerParser.hpp.

Definition at line 67 of file PeerParser.hpp.

Definition at line 64 of file PeerParser.hpp.

Definition at line 74 of file PeerParser.hpp.

Definition at line 61 of file PeerParser.hpp.

Definition at line 61 of file PeerParser.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Sep 9 2016 04:02:20