OCL::TaskBrowser Class Reference

This component allows a text client to browse the peers of a peer RTT::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. More...

#include <TaskBrowser.hpp>

List of all members.

Public Types

enum  ColorTheme {
  nocolors, darkbg, whitebg, nocolors,
  darkbg, whitebg
}
enum  ColorTheme {
  nocolors, darkbg, whitebg, nocolors,
  darkbg, whitebg
}

Public Member Functions

void browserAction (std::string &act)
void browserAction (std::string &act)
void evalCommand (std::string &comm)
void evalCommand (std::string &comm)
void evaluate (std::string &comm)
void evaluate (std::string &comm)
void loop ()
 Call this method from ORO_main() to process keyboard input and thus startup the TaskBrowser.
void loop ()
 Call this method from ORO_main() to process keyboard input and thus startup the TaskBrowser.
void printHelp (string command)
void printHelp ()
void printHelp (string command)
void printHelp ()
void printInfo (const std::string &peerpath)
void printInfo (const std::string &peerpath)
void printOperation (const std::string m, Service::shared_ptr ops)
void printOperation (const std::string m, Service::shared_ptr ops)
void printProgram (int line=-1)
void printProgram (const std::string &pn, int line=-1, RTT::TaskContext *progpeer=0)
void printProgram (int line=-1)
void printProgram (const std::string &pn, int line=-1, RTT::TaskContext *progpeer=0)
void printResult (RTT::base::DataSourceBase *ds, bool recurse)
void printResult (RTT::base::DataSourceBase *ds, bool recurse)
bool printService (const std::string name)
bool printService (const std::string name)
void printSource (const std::string m)
void printSource (const std::string m)
void setColorTheme (ColorTheme t)
void setColorTheme (ColorTheme t)
void switchBack ()
void switchBack ()
void switchTask (RTT::TaskContext *c)
void switchTask (RTT::TaskContext *c)
void switchTaskContext (RTT::TaskContext *tc, bool store=true)
void switchTaskContext (std::string &path)
void switchTaskContext (RTT::TaskContext *tc, bool store=true)
void switchTaskContext (std::string &path)
 TaskBrowser (RTT::TaskContext *c)
 TaskBrowser (RTT::TaskContext *c)
 ~TaskBrowser ()
 ~TaskBrowser ()

Static Public Attributes

static std::string blue
static std::string coloroff
static std::string coloron
static std::string green
static std::string prompt
static std::string red
static std::string underline

Protected Member Functions

void cancelMacro ()
void cancelMacro ()
void checkPorts ()
void checkPorts ()
void doPrint (RTT::base::DataSourceBase::shared_ptr ds, bool recurse)
void doPrint (RTT::base::DataSourceBase::shared_ptr ds, bool recurse)
void endMacro ()
void endMacro ()
void enterTask ()
void enterTask ()
void leaveTask ()
void leaveTask ()
void listText (std::stringstream &txtss, int start, int end, int ln, char s)
void listText (std::stringstream &txtss, int start, int end, int ln, char s)
void recordMacro (std::string name)
void recordMacro (std::string name)
Service::shared_ptr stringToService (string const &names)
Service::shared_ptr stringToService (string const &names)

Protected Attributes

std::string macroname
bool macrorecording
std::string macrotext
std::stringstream sresult

Private Types

typedef std::map< std::pair
< RTT::TaskContext
*, std::string >, int > 
PTrace
typedef std::map< std::pair
< RTT::TaskContext
*, std::string >, int > 
PTrace

Static Private Member Functions

static RTT::TaskContext * findPeer (std::string comm)
static RTT::TaskContext * findPeer (std::string comm)

Private Attributes

RTT::internal::DataSource
< bool >::shared_ptr 
accepted
int debug
base::DataSourceBase::shared_ptr last_expr
int lastc
char * line_read
PTrace ptraces
int storedline
 last program listed to screen
std::string storedname
PTrace straces
std::deque< RTT::TaskContext * > taskHistory
bool usehex
 last program line number listed to screen

Static Private Attributes

static RTT::TaskContext * context = 0
static RTT::TaskContext * peer = 0
static RTT::TaskContext * taskcontext = 0
static RTT::Service::shared_ptr taskobject
static RTT::TaskContext * tb = 0

Detailed Description

This component allows a text client to browse the peers of a peer RTT::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.

Definition at line 86 of file install/include/orocos/ocl/TaskBrowser.hpp.


Member Typedef Documentation

typedef std::map<std::pair<RTT::TaskContext*,std::string>,int> OCL::TaskBrowser::PTrace [private]

Definition at line 112 of file taskbrowser/TaskBrowser.hpp.

typedef std::map<std::pair<RTT::TaskContext*,std::string>,int> OCL::TaskBrowser::PTrace [private]

Definition at line 112 of file install/include/orocos/ocl/TaskBrowser.hpp.


Member Enumeration Documentation

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.

nocolors 

Do not use colors.

darkbg 

Use colors suitable for a dark background.

whitebg 

Use colors suitable for a white background.

Definition at line 176 of file taskbrowser/TaskBrowser.hpp.

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.

nocolors 

Do not use colors.

darkbg 

Use colors suitable for a dark background.

whitebg 

Use colors suitable for a white background.

Definition at line 176 of file install/include/orocos/ocl/TaskBrowser.hpp.


Constructor & Destructor Documentation

OCL::TaskBrowser::TaskBrowser ( RTT::TaskContext *  c  ) 

Create a TaskBrowser which initially visits a given RTT::TaskContext c.

Definition at line 584 of file TaskBrowser.cpp.

OCL::TaskBrowser::~TaskBrowser (  ) 

Definition at line 619 of file TaskBrowser.cpp.

OCL::TaskBrowser::TaskBrowser ( RTT::TaskContext *  c  ) 

Create a TaskBrowser which initially visits a given RTT::TaskContext c.

OCL::TaskBrowser::~TaskBrowser (  ) 

Member Function Documentation

void OCL::TaskBrowser::browserAction ( std::string &  act  ) 

Execute a specific browser action, such as "loadProgram pname", "loadStateMachine smname", "unloadProgram pname", "unloadStateMachine smname"

void OCL::TaskBrowser::browserAction ( std::string &  act  ) 

Execute a specific browser action, such as "loadProgram pname", "loadStateMachine smname", "unloadProgram pname", "unloadStateMachine smname"

Definition at line 1054 of file TaskBrowser.cpp.

void OCL::TaskBrowser::cancelMacro (  )  [protected]
void OCL::TaskBrowser::cancelMacro (  )  [protected]

Definition at line 861 of file TaskBrowser.cpp.

void OCL::TaskBrowser::checkPorts (  )  [protected]
void OCL::TaskBrowser::checkPorts (  )  [protected]

Definition at line 901 of file TaskBrowser.cpp.

void OCL::TaskBrowser::doPrint ( RTT::base::DataSourceBase::shared_ptr  ds,
bool  recurse 
) [protected]
void OCL::TaskBrowser::doPrint ( RTT::base::DataSourceBase::shared_ptr  ds,
bool  recurse 
) [protected]
void OCL::TaskBrowser::endMacro (  )  [protected]
void OCL::TaskBrowser::endMacro (  )  [protected]

Definition at line 871 of file TaskBrowser.cpp.

void OCL::TaskBrowser::enterTask (  )  [protected]
void OCL::TaskBrowser::enterTask (  )  [protected]

Definition at line 819 of file TaskBrowser.cpp.

void OCL::TaskBrowser::evalCommand ( std::string &  comm  ) 

Evaluate command

void OCL::TaskBrowser::evalCommand ( std::string &  comm  ) 

Evaluate command

Definition at line 1316 of file TaskBrowser.cpp.

void OCL::TaskBrowser::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 OCL::TaskBrowser::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)".

Definition at line 1253 of file TaskBrowser.cpp.

static RTT::TaskContext* OCL::TaskBrowser::findPeer ( std::string  comm  )  [static, private]
RTT::TaskContext * OCL::TaskBrowser::findPeer ( std::string  comm  )  [static, private]

Definition at line 1030 of file TaskBrowser.cpp.

void OCL::TaskBrowser::leaveTask (  )  [protected]
void OCL::TaskBrowser::leaveTask (  )  [protected]

Definition at line 829 of file TaskBrowser.cpp.

void OCL::TaskBrowser::listText ( std::stringstream &  txtss,
int  start,
int  end,
int  ln,
char  s 
) [protected]
void OCL::TaskBrowser::listText ( std::stringstream &  txtss,
int  start,
int  end,
int  ln,
char  s 
) [protected]
void OCL::TaskBrowser::loop (  ) 

Call this method from ORO_main() to process keyboard input and thus startup the TaskBrowser.

void OCL::TaskBrowser::loop (  ) 

Call this method from ORO_main() to process keyboard input and thus startup the TaskBrowser.

Call this method from ORO_main() to process keyboard input.

Definition at line 674 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printHelp ( string  command  ) 

Print help about an operation

void OCL::TaskBrowser::printHelp (  ) 

Print the help page.

void OCL::TaskBrowser::printHelp ( string  command  ) 

Print help about an operation

Definition at line 1685 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printHelp (  ) 

Print the help page.

Definition at line 1567 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printInfo ( const std::string &  peerpath  ) 

Print info this peer or another peer at "peerpath".

void OCL::TaskBrowser::printInfo ( const std::string &  peerpath  ) 

Print info this peer or another peer at "peerpath".

Definition at line 1815 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printOperation ( const std::string  m,
Service::shared_ptr  ops 
)

Print the synopsis of an Operation

void OCL::TaskBrowser::printOperation ( const std::string  m,
Service::shared_ptr  ops 
)

Print the synopsis of an Operation

Definition at line 2021 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printProgram ( int  line = -1  ) 

Print the program listing of the last shown program centered at line line.

void OCL::TaskBrowser::printProgram ( const std::string &  pn,
int  line = -1,
RTT::TaskContext *  progpeer = 0 
)

Print a program listing of a loaded program centered at line line.

void OCL::TaskBrowser::printProgram ( int  line = -1  ) 

Print the program listing of the last shown program centered at line line.

Definition at line 1755 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printProgram ( const std::string &  pn,
int  line = -1,
RTT::TaskContext *  progpeer = 0 
)

Print a program listing of a loaded program centered at line line.

Definition at line 1712 of file TaskBrowser.cpp.

void OCL::TaskBrowser::printResult ( RTT::base::DataSourceBase *  ds,
bool  recurse 
)

Evaluate a internal::DataSource and print the result.

void OCL::TaskBrowser::printResult ( RTT::base::DataSourceBase *  ds,
bool  recurse 
)

Evaluate a internal::DataSource and print the result.

bool OCL::TaskBrowser::printService ( const std::string  name  ) 

Print the synopsis of a Service.

bool OCL::TaskBrowser::printService ( const std::string  name  ) 

Print the synopsis of a Service.

void OCL::TaskBrowser::printSource ( const std::string  m  ) 

Print the synopsis of a DataSource.

void OCL::TaskBrowser::printSource ( const std::string  m  ) 

Print the synopsis of a DataSource.

void OCL::TaskBrowser::recordMacro ( std::string  name  )  [protected]
void OCL::TaskBrowser::recordMacro ( std::string  name  )  [protected]

Definition at line 839 of file TaskBrowser.cpp.

void OCL::TaskBrowser::setColorTheme ( ColorTheme  t  ) 
void OCL::TaskBrowser::setColorTheme ( ColorTheme  t  ) 

Definition at line 918 of file TaskBrowser.cpp.

Service::shared_ptr OCL::TaskBrowser::stringToService ( string const &  names  )  [protected]
Service::shared_ptr OCL::TaskBrowser::stringToService ( string const &  names  )  [protected]

Definition at line 1257 of file TaskBrowser.cpp.

void OCL::TaskBrowser::switchBack (  ) 

Go to the previous peer in the visit history.

void OCL::TaskBrowser::switchBack (  ) 

Go to the previous peer in the visit history.

Definition at line 891 of file TaskBrowser.cpp.

void OCL::TaskBrowser::switchTask ( RTT::TaskContext *  c  ) 

Switch to a new TaskContext.

void OCL::TaskBrowser::switchTask ( RTT::TaskContext *  c  ) 

Switch to a new TaskContext.

void OCL::TaskBrowser::switchTaskContext ( RTT::TaskContext *  tc,
bool  store = true 
)

Connect the TaskBrowser to another Taskcontext.

Parameters:
tc the new Task to connect to
store set to true in order to store the current task in the history.
void OCL::TaskBrowser::switchTaskContext ( std::string &  path  ) 

Switch to a peer RTT::TaskContext using a path . For example, "mypeer.otherpeer.targetpeer".

Parameters:
path The path to the target peer.
void OCL::TaskBrowser::switchTaskContext ( RTT::TaskContext *  tc,
bool  store = true 
)

Connect the TaskBrowser to another Taskcontext.

Parameters:
tc the new Task to connect to
store set to true in order to store the current task in the history.

Definition at line 987 of file TaskBrowser.cpp.

void OCL::TaskBrowser::switchTaskContext ( std::string &  path  ) 

Switch to a peer RTT::TaskContext using a path . For example, "mypeer.otherpeer.targetpeer".

Parameters:
path The path to the target peer.

Definition at line 965 of file TaskBrowser.cpp.


Member Data Documentation

RTT::internal::DataSource< bool >::shared_ptr OCL::TaskBrowser::accepted [private]

Definition at line 98 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::blue [static]

The blue color.

Definition at line 313 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::coloroff [static]

The 'turn color off' escape sequence.

Definition at line 298 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::coloron [static]

The 'turn color on' escape sequence.

Definition at line 290 of file install/include/orocos/ocl/TaskBrowser.hpp.

static RTT::TaskContext * OCL::TaskBrowser::context = 0 [static, private]

Definition at line 96 of file install/include/orocos/ocl/TaskBrowser.hpp.

int OCL::TaskBrowser::debug [private]

Definition at line 100 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::green [static]

The green color.

Definition at line 308 of file install/include/orocos/ocl/TaskBrowser.hpp.

base::DataSourceBase::shared_ptr OCL::TaskBrowser::last_expr [private]

We store the last parsed expression in order to keep it a little longer in memory, for example, when it's an 'send()' operation call.

Definition at line 118 of file install/include/orocos/ocl/TaskBrowser.hpp.

int OCL::TaskBrowser::lastc [private]

Definition at line 103 of file install/include/orocos/ocl/TaskBrowser.hpp.

char * OCL::TaskBrowser::line_read [private]

Definition at line 102 of file install/include/orocos/ocl/TaskBrowser.hpp.

std::string OCL::TaskBrowser::macroname [protected]

Definition at line 163 of file install/include/orocos/ocl/TaskBrowser.hpp.

Definition at line 161 of file install/include/orocos/ocl/TaskBrowser.hpp.

std::string OCL::TaskBrowser::macrotext [protected]

Definition at line 162 of file install/include/orocos/ocl/TaskBrowser.hpp.

static RTT::TaskContext * OCL::TaskBrowser::peer = 0 [static, private]

Definition at line 92 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::prompt [static]

The prompt.

Definition at line 286 of file install/include/orocos/ocl/TaskBrowser.hpp.

Definition at line 113 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::red [static]

The red color.

Definition at line 303 of file install/include/orocos/ocl/TaskBrowser.hpp.

std::stringstream OCL::TaskBrowser::sresult [protected]

Definition at line 164 of file install/include/orocos/ocl/TaskBrowser.hpp.

last program listed to screen

Definition at line 106 of file install/include/orocos/ocl/TaskBrowser.hpp.

std::string OCL::TaskBrowser::storedname [private]

Definition at line 105 of file install/include/orocos/ocl/TaskBrowser.hpp.

Definition at line 114 of file install/include/orocos/ocl/TaskBrowser.hpp.

static RTT::TaskContext * OCL::TaskBrowser::taskcontext = 0 [static, private]

Definition at line 90 of file install/include/orocos/ocl/TaskBrowser.hpp.

std::deque< RTT::TaskContext * > OCL::TaskBrowser::taskHistory [private]

Definition at line 109 of file install/include/orocos/ocl/TaskBrowser.hpp.

static RTT::Service::shared_ptr OCL::TaskBrowser::taskobject [static, private]

Definition at line 97 of file install/include/orocos/ocl/TaskBrowser.hpp.

static RTT::TaskContext * OCL::TaskBrowser::tb = 0 [static, private]

Definition at line 94 of file install/include/orocos/ocl/TaskBrowser.hpp.

static std::string OCL::TaskBrowser::underline [static]

The 'underline' escape sequence.

Definition at line 294 of file install/include/orocos/ocl/TaskBrowser.hpp.

bool OCL::TaskBrowser::usehex [private]

last program line number listed to screen

Definition at line 107 of file install/include/orocos/ocl/TaskBrowser.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


ocl
Author(s): OCL Development Team
autogenerated on Fri Jan 11 09:50:53 2013