TaskBrowser Class Reference

#include <TaskBrowser.hpp>

Inheritance diagram for TaskBrowser:

TaskContext OperationInterface TaskCore List of all members.

Detailed Description

This component allows a text client to browse the peers of a peer TaskContext and execute commands.

If your console does not support colors or you want a different prompt, the member variables which control these 'escape sequences' are public and may be changed. The TaskBrowser is most commonly used with its loop() method, but prior to/after calling loop(), you can invoke some other commands, to control what is displayed or to execute a fixed set of commands prior to showng the prompt.


Public Types

 nocolors
 Do not use colors.
 darkbg
 Use colors suitable for a dark background.
 whitebg
 Use colors suitable for a white background.
enum  ColorTheme { nocolors, darkbg, whitebg }
 The kinds of color themes the TaskBrowser supports. More...

Public Member Functions

void setColorTheme (ColorTheme t)
void switchTaskContext (std::string &path)
 Switch to a peer TaskContext using a path .
void switchTaskContext (RTT::TaskContext *tc)
 Connect the TaskBrowser to another Taskcontext.
void switchBack ()
 Go to the previous peer in the visit history.
void browserAction (std::string &act)
 Execute a specific browser action, such as "loadProgram pname", "loadStateMachine smname", "unloadProgram pname", "unloadStateMachine smname".
void printResult (RTT::DataSourceBase *ds, bool recurse)
 Evaluate a DataSource and print the result.
void printHelp ()
 Print the help page.
void printInfo (const std::string &peerpath)
 Print info this peer or another peer at "peerpath".
void printCommand (const std::string c, OperationInterface *ops)
 Print the synopsis of a command.
void printSource (const std::string m)
 Print the synopsis of a DataSource.
void printMethod (const std::string m, OperationInterface *ops)
 Print the synopsis of a Method.
void printEvent (const std::string m, RTT::EventService *ops)
 Print the synopsis of an Event.
void printProgram (const std::string &pn, int line=-1)
 Print a program listing of a loaded program centered at line line.
void printProgram (int line=-1)
 Print the program listing of the last shown program centered at line line.
 TaskBrowser (RTT::TaskContext *c)
 Create a TaskBrowser which initially visits a given TaskContext c.
void loop ()
 Call this method from ORO_main() to process keyboard input.
void evaluate (std::string &comm)
 Execute/evaluate a string which may be a command, method, expression etc.
void switchTask (RTT::TaskContext *c)
 Switch to a new TaskContext.
void evalCommand (std::string &comm)
 Evaluate command.

Static Public Attributes

static std::string prompt
 The prompt.
static std::string coloron
 The 'turn color on' escape sequence.
static std::string underline
 The 'underline' escape sequence.
static std::string coloroff
 The 'turn color off' escape sequence.
static std::string red
 The red color.
static std::string green
 The green color.
static std::string blue
 The blue color.

Protected Member Functions

void listText (std::stringstream &txtss, int start, int end, int ln, char s)
void doPrint (RTT::DataSourceBase *ds, bool recurse)
void enterTask ()
void leaveTask ()


Member Enumeration Documentation

enum ColorTheme

The kinds of color themes the TaskBrowser supports.

Enumerator:
nocolors  Do not use colors.
darkbg  Use colors suitable for a dark background.
whitebg  Use colors suitable for a white background.


Member Function Documentation

void evaluate ( std::string &  comm  ) 

Execute/evaluate a string which may be a command, method, expression etc.

The string does not need the script prefixes such as 'do', 'set', etc. For example "x = 1 + 1" or "myobject.doStuff(1, 2, true)".

void switchTaskContext ( std::string &  path  ) 

Switch to a peer TaskContext using a path .

For example, "mypeer.otherpeer.targetpeer".

Parameters:
path The path to the target peer.


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 16:56:50 2006 for orocos-ocl by  doxygen 1.4.7