Public Member Functions | Private Member Functions | Private Attributes
PredicatesScript Class Reference

#include <PredicatesScript.h>

List of all members.

Public Member Functions

void addInternalFunction (string functionName)
string getName ()
string getParameter (string name)
PythonScript getPythonScript ()
string getSourceScript ()
string getTranslatedScript ()
 PredicatesScript (string script, set< string > &internalFunctions)

Private Member Functions

bool addParameter (const boost::match_results< std::string::const_iterator > &paramMatch)
void processInternalFunctions (string &script)
void processParameters (string &script)
void processPredicates (string &script)
void processTopics (string &script)

Private Attributes

set< string > _internalFunctions
string _name
map< string, string > _parameters
string _sourceScript
string _translatedScript

Detailed Description

Definition at line 22 of file PredicatesScript.h.


Constructor & Destructor Documentation

PredicatesScript::PredicatesScript ( string  script,
set< string > &  internalFunctions 
)

Parses provided predicates script to python code

Parameters:
scriptThe script
internalFunctionsInternal known function which will be replaced with appropriate wrapper

Definition at line 10 of file PredicatesScript.cpp.


Member Function Documentation

void PredicatesScript::addInternalFunction ( string  functionName) [inline]

Adds a name of internal function

Parameters:
functionName

Definition at line 69 of file PredicatesScript.h.

bool PredicatesScript::addParameter ( const boost::match_results< std::string::const_iterator > &  paramMatch) [private]

Callback method for regex param search

Parameters:
paramMatch
Returns:

Definition at line 29 of file PredicatesScript.cpp.

string PredicatesScript::getName ( ) [inline]

Returns name of the script

Returns:

Definition at line 48 of file PredicatesScript.h.

string PredicatesScript::getParameter ( string  name) [inline]

Returns parameter value by name

Parameters:
nameParameter name
Returns:

Definition at line 61 of file PredicatesScript.h.

Returns translated python script

Returns:

Definition at line 54 of file PredicatesScript.h.

string PredicatesScript::getSourceScript ( ) [inline]

Returns the source script without changes

Returns:

Definition at line 36 of file PredicatesScript.h.

Returns translated python script

Returns:

Definition at line 42 of file PredicatesScript.h.

void PredicatesScript::processInternalFunctions ( string &  script) [private]

Replaces call to known function with python wrapper (robil_lib.invoke('function_name', param1, param2, ...)

Parameters:
script

Definition at line 79 of file PredicatesScript.cpp.

void PredicatesScript::processParameters ( string &  script) [private]

Extracts all parameters from script (#! param_name param_value)

Parameters:
script

Definition at line 44 of file PredicatesScript.cpp.

void PredicatesScript::processPredicates ( string &  script) [private]

Replaces all predicates with validate.is_true(predicate)

Parameters:
script

Definition at line 58 of file PredicatesScript.cpp.

void PredicatesScript::processTopics ( string &  script) [private]

Replaces all ros topics {topic_name} with python method topic('topic_name')

Parameters:
script
Returns:

Definition at line 52 of file PredicatesScript.cpp.


Member Data Documentation

Definition at line 109 of file PredicatesScript.h.

string PredicatesScript::_name [private]

Definition at line 107 of file PredicatesScript.h.

map<string, string> PredicatesScript::_parameters [private]

Definition at line 108 of file PredicatesScript.h.

Definition at line 105 of file PredicatesScript.h.

Definition at line 106 of file PredicatesScript.h.


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


scriptable_monitor
Author(s):
autogenerated on Wed Aug 26 2015 16:21:30