61 #include <rtt/types/Types.hpp> 76 #include <boost/algorithm/string.hpp> 86 #if defined(HAS_READLINE) && !defined(NO_GPL) 89 #if defined(HAS_EDITLINE) 95 # if defined(_POSIX_VERSION) && defined(HAS_READLINE) && !defined(HAS_EDITLINE) 96 # define USE_SIGNALS 1 102 # include <editline/readline.h> 104 # include <readline/readline.h> 105 # include <readline/history.h> 108 #include <boost/bind.hpp> 109 #include <boost/lambda/lambda.hpp> 116 #if defined(USE_SIGNALS) && defined(OROCOS_TARGET_XENOMAI) && CONFIG_XENO_VERSION_MAJOR == 2 && CONFIG_XENO_VERSION_MINOR >= 5 118 int xeno_sigwinch_handler(
int sig, siginfo_t *si,
void *ctxt);
121 #if defined(USE_SIGNALS) && defined(OROCOS_TARGET_XENOMAI) && CONFIG_XENO_VERSION_MAJOR == 3 123 int cobalt_sigshadow_handler(
int sig, siginfo_t *si,
void *ctxt);
128 using namespace boost;
133 std::vector<std::string> TaskBrowser::candidates;
134 std::vector<std::string> TaskBrowser::completes;
135 std::vector<std::string>::iterator TaskBrowser::complete_iter;
136 std::string TaskBrowser::component;
137 std::string TaskBrowser::component_found;
138 std::string TaskBrowser::peerpath;
139 std::string TaskBrowser::text;
165 nl(std::ostream& __os)
166 {
return __os.put(__os.widen(
'\n')); }
169 #if defined(USE_READLINE) 171 #if defined(USE_SIGNALS) 173 int TaskBrowser::rl_received_signal;
174 void TaskBrowser::rl_sigwinch_handler(
int sig, siginfo_t *si,
void *ctxt) {
175 rl_received_signal = sig;
176 #if defined(OROCOS_TARGET_XENOMAI) && CONFIG_XENO_VERSION_MAJOR == 2 && CONFIG_XENO_VERSION_MINOR >= 5 177 if (xeno_sigwinch_handler(sig, si, ctxt) == 0)
179 #if defined(OROCOS_TARGET_XENOMAI) && CONFIG_XENO_VERSION_MAJOR == 3 180 if (cobalt_sigshadow_handler(sig, si, ctxt) == 0)
182 rl_resize_terminal();
185 void TaskBrowser::rl_signal_handler(
int sig, siginfo_t *si,
void *ctxt) {
186 rl_received_signal = sig;
190 rl_free_line_state();
191 rl_echo_signal_char(sig);
192 rl_received_signal = 0;
197 int TaskBrowser::rl_getc(FILE *stream)
204 rl_received_signal = 0;
205 result = ::read(fileno(stream), &c,
sizeof(
unsigned char));
207 if (result ==
sizeof(
unsigned char))
216 if (errno == EINTR && (rl_received_signal == SIGINT || rl_received_signal == SIGTERM))
217 return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
223 return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
226 #endif // USE_SIGNALS 228 char *TaskBrowser::rl_gets ()
255 if ( !macrorecording ) {
262 if (rl_set_signals() != 0)
263 cerr <<
"Error setting signals !" <<
endl;
266 line_read = readline ( p.c_str() );
269 if (rl_clear_signals() != 0)
270 cerr <<
"Error clearing signals !" <<endl;
275 if (line_read && *line_read) {
277 string s = line_read;
278 if (s !=
"quit" && ! ( history_get( where_history() ) && s ==
string(history_get( where_history() )->line) ) ) {
281 add_history (line_read);
287 char* TaskBrowser::dupstr(
const char *s )
291 rv = (
char*) malloc( strlen( s ) + 1 );
292 strncpy( rv, s, strlen(s) + 1 );
296 char *TaskBrowser::command_generator(
const char *_text,
int state )
306 complete_iter = completes.begin();
312 if ( complete_iter == completes.end() )
315 return dupstr( complete_iter->c_str() );
322 void TaskBrowser::find_completes() {
323 std::string::size_type pos;
324 std::string::size_type startpos;
325 std::string line( rl_line_buffer, rl_point );
328 if ( line.find(std::string(
"cd ")) == 0 || line.find(std::string(
"ls ")) == 0) {
331 pos = line.find(
" ");
332 startpos = line.find_last_of(
". ");
336 if ( pos+1 != line.length() )
337 peer = findPeer( line.substr(pos+1) );
343 for (RTT::TaskContext::PeerList::iterator i = v.begin(); i != v.end(); ++i) {
345 if ( !( pos+1 > startpos) )
346 path = line.substr(pos+1, startpos - pos);
348 if ( *i == line.substr(startpos+1) )
349 completes.push_back( path + *i +
".");
351 if ( startpos == std::string::npos || startpos+1 == line.length() || i->find( line.substr(startpos+1)) == 0 )
352 completes.push_back( *i );
355 if (line.find(std::string(
"cd ")) == 0)
358 v = peer->provides()->getProviderNames();
359 for (RTT::TaskContext::PeerList::iterator i = v.begin(); i != v.end(); ++i) {
361 if ( !( pos+1 > startpos) )
362 path = line.substr(pos+1, startpos - pos);
364 if ( *i == line.substr(startpos+1) )
365 completes.push_back( path + *i +
".");
367 if ( startpos == std::string::npos || startpos+1 == line.length() || i->find( line.substr(startpos+1)) == 0 )
368 completes.push_back( *i );
374 if ( line.find(std::string(
".")) == 0 ) {
376 std::vector<std::string> tbcoms;
377 tbcoms.push_back(
".loadProgram ");
378 tbcoms.push_back(
".unloadProgram ");
379 tbcoms.push_back(
".loadStateMachine ");
380 tbcoms.push_back(
".unloadStateMachine ");
381 tbcoms.push_back(
".light");
382 tbcoms.push_back(
".dark");
383 tbcoms.push_back(
".hex");
384 tbcoms.push_back(
".nohex");
385 tbcoms.push_back(
".nocolors");
386 tbcoms.push_back(
".connect");
387 tbcoms.push_back(
".record");
388 tbcoms.push_back(
".end");
389 tbcoms.push_back(
".cancel");
390 tbcoms.push_back(
".provide");
391 tbcoms.push_back(
".services");
392 tbcoms.push_back(
".typekits");
393 tbcoms.push_back(
".types");
396 for( std::vector<std::string>::iterator it = tbcoms.begin();
399 if ( it->find(line) == 0 )
400 completes.push_back( *it );
404 if ( line.find(std::string(
"list ")) == 0
405 || line.find(std::string(
"trace ")) == 0
406 || line.find(std::string(
"untrace ")) == 0) {
407 stringstream ss( line.c_str() );
411 std::vector<std::string> progs;
413 if ( context->provides()->hasService(
"scripting") ) {
415 progs = context->getProvider<
Scripting>(
"scripting")->getProgramList();
417 for( std::vector<std::string>::iterator it = progs.begin();
420 string res = lcommand + *it;
421 if ( res.find(line) == 0 )
422 completes.push_back( *it );
424 progs = context->getProvider<
Scripting>(
"scripting")->getStateMachineList();
425 for( std::vector<std::string>::iterator it = progs.begin();
428 string res = lcommand + *it;
429 if ( res.find(line) == 0 )
430 completes.push_back( *it );
436 startpos = text.find_last_of(
",( ");
437 if ( startpos == std::string::npos )
441 find_peers(startpos);
448 std::string comp = component;
458 if ( line.empty() ) {
459 completes.push_back(
"cd ");
460 completes.push_back(
"cd ..");
461 completes.push_back(
"ls");
462 completes.push_back(
"help");
463 completes.push_back(
"quit");
464 completes.push_back(
"list");
465 completes.push_back(
"trace");
466 completes.push_back(
"untrace");
467 if (taskcontext == context)
468 completes.push_back(
"leave");
470 completes.push_back(
"enter");
475 if ( !text.empty() ) {
476 if ( std::string(
"cd " ).find(text) == 0 )
477 completes.push_back(
"cd ");
478 if ( std::string(
"ls" ).find(text) == 0 )
479 completes.push_back(
"ls");
480 if ( std::string(
"cd .." ).find(text) == 0 )
481 completes.push_back(
"cd ..");
482 if ( std::string(
"help" ).find(text) == 0 )
483 completes.push_back(
"help");
484 if ( std::string(
"quit" ).find(text) == 0 )
485 completes.push_back(
"quit");
486 if ( std::string(
"list " ).find(text) == 0 )
487 completes.push_back(
"list ");
488 if ( std::string(
"trace " ).find(text) == 0 )
489 completes.push_back(
"trace ");
490 if ( std::string(
"untrace " ).find(text) == 0 )
491 completes.push_back(
"untrace ");
492 if ( std::string(
"GlobalService" ).find(text) == 0 )
493 completes.push_back(
"GlobalService");
494 if ( std::string(
"GlobalsRepository" ).find(text) == 0 )
495 completes.push_back(
"GlobalsRepository");
497 if (taskcontext == context &&
string(
"leave").find(text) == 0)
498 completes.push_back(
"leave");
500 if (context == tb &&
string(
"enter").find(text) == 0)
501 completes.push_back(
"enter");
505 void TaskBrowser::find_ops()
509 std::vector<std::string> attrs;
510 attrs = taskobject->getAttributeNames();
511 for (std::vector<std::string>::iterator i = attrs.begin(); i!= attrs.end(); ++i ) {
512 if ( i->find( component ) == 0 )
513 completes.push_back( peerpath + *i );
516 std::vector<std::string> props;
517 taskobject->properties()->list(props);
518 for (std::vector<std::string>::iterator i = props.begin(); i!= props.end(); ++i ) {
519 if ( i->find( component ) == 0 ) {
520 completes.push_back( peerpath + *i );
525 vector<string> comps = taskobject->getNames();
526 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
527 if ( i->find( component ) == 0 )
528 completes.push_back( peerpath + *i );
532 comps =
Types()->getDottedTypes();
533 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
534 if ( peerpath.empty() && i->find( component ) == 0 )
535 completes.push_back( *i );
539 comps = GlobalsRepository::Instance()->getAttributeNames();
540 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
541 if ( peerpath.empty() && i->find( component ) == 0 )
542 completes.push_back( *i );
546 comps = GlobalsRepository::Instance()->properties()->list();
547 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
548 if ( peerpath.empty() && i->find( component ) == 0 )
549 completes.push_back( *i );
552 if (component.find(
"GlobalsRepository") == 0) {
555 comps = GlobalsRepository::Instance()->getAttributeNames();
556 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
557 completes.push_back(
"GlobalsRepository." + *i );
561 comps = GlobalsRepository::Instance()->properties()->list();
562 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
563 completes.push_back(
"GlobalsRepository." + *i );
565 }
else if ( taskobject == peer->provides() && peer == context ) {
567 comps = GlobalService::Instance()->getNames();
568 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
569 if ( i->find( component ) == 0 )
570 completes.push_back( peerpath + *i );
575 if ( taskobject == peer->provides() && peer == context) {
576 comps = GlobalService::Instance()->getNames();
577 for (std::vector<std::string>::iterator i = comps.begin(); i!= comps.end(); ++i ) {
578 if ( i->find( component ) == 0 )
579 completes.push_back( peerpath + *i );
584 bool try_deeper =
false;
586 Parser parser(GlobalEngine::Instance());
587 DataSourceBase::shared_ptr result = parser.parseExpression( peerpath + component_found, context );
588 if (result && !component.empty() ) {
589 DataSource<PropertyBag>::shared_ptr bag = DataSource<PropertyBag>::narrow(result.get());
590 vector<string> members;
592 members = bag->rvalue().getPropertyNames();
595 members = result->getMemberNames();
597 for (std::vector<std::string>::iterator i = members.begin(); i!= members.end(); ++i ) {
598 if (
string( component_found +
"." + *i ).find( component ) == 0 )
599 completes.push_back( peerpath + component_found +
"." + *i );
600 if ( component_found +
"." + *i == component )
610 Parser parser(GlobalEngine::Instance());
611 DataSourceBase::shared_ptr result = parser.parseExpression( peerpath + component, context );
612 if (result && !component.empty() ) {
613 DataSource<PropertyBag>::shared_ptr bag = DataSource<PropertyBag>::narrow(result.get());
614 vector<string> members;
616 members = bag->rvalue().getPropertyNames();
619 members = result->getMemberNames();
621 for (std::vector<std::string>::iterator i = members.begin(); i!= members.end(); ++i ) {
622 if (component_found +
"." != component )
623 completes.push_back( peerpath + component +
"." + *i );
630 void TaskBrowser::find_peers( std::string::size_type startpos )
634 taskobject = context->provides();
636 std::string to_parse = text.substr(startpos);
638 std::string::size_type endpos = 0;
643 while (endpos != std::string::npos )
645 bool itemfound =
false;
646 endpos = to_parse.find(
".");
647 if ( endpos == startpos ) {
651 std::string item = to_parse.substr(startpos, endpos);
653 if ( taskobject->hasService( item ) ) {
654 taskobject = taskobject->provides(item);
657 if ( peer->hasPeer( item ) ) {
658 peer = peer->getPeer( item );
659 taskobject = peer->provides();
661 }
else if ( GlobalService::Instance()->hasService(item) ) {
662 taskobject = GlobalService::Instance()->provides(item);
666 peerpath += to_parse.substr(startpos, endpos) +
".";
667 if ( endpos != std::string::npos )
668 to_parse = to_parse.substr(endpos + 1);
676 component_found = to_parse.substr(startpos, to_parse.rfind(
"."));
678 component = to_parse.substr(startpos, std::string::npos);
693 if ( taskobject == peer->provides() ) {
695 v = peer->getPeerList();
696 for (RTT::TaskContext::PeerList::iterator i = v.begin(); i != v.end(); ++i) {
697 if ( i->find( component ) == 0 ) {
698 completes.push_back( peerpath + *i );
699 completes.push_back( peerpath + *i +
"." );
705 v = taskobject->getProviderNames();
706 for (RTT::TaskContext::PeerList::iterator i = v.begin(); i != v.end(); ++i) {
707 if ( i->find( component ) == 0 ) {
708 completes.push_back( peerpath + *i );
710 completes.push_back( peerpath + *i +
"." );
715 if ( peer == context && taskobject == peer->provides() ) {
716 v = GlobalService::Instance()->getProviderNames();
717 for (RTT::TaskContext::PeerList::iterator i = v.begin(); i != v.end(); ++i) {
718 if ( i->find( component ) == 0 ) {
719 completes.push_back( peerpath + *i );
721 completes.push_back( peerpath + *i +
"." );
729 char ** TaskBrowser::orocos_hmi_completion (
const char *text,
int start,
int end )
732 matches = (
char ** ) 0;
734 matches = rl_completion_matches ( text, &TaskBrowser::command_generator );
738 #endif // USE_READLINE 744 lastc(0), storedname(
""), storedline(-1),
747 macrorecording(false)
755 rl_catch_sigwinch = 0;
756 rl_catch_signals = 0;
757 rl_getc_function = &TaskBrowser::rl_getc;
759 rl_completion_append_character =
'\0';
760 rl_attempted_completion_function = &TaskBrowser::orocos_hmi_completion;
763 histfile = getenv(
"ORO_TB_HISTFILE");
766 if ( read_history(
histfile) != 0 ) {
767 read_history(
"~/.tb_history");
771 sa.sa_sigaction = &TaskBrowser::rl_sigwinch_handler;
772 sa.sa_flags = SA_SIGINFO | SA_RESTART;
773 sigemptyset( &sa.sa_mask );
774 sigaction(SIGWINCH, &sa, 0);
776 sa.sa_sigaction = &(TaskBrowser::rl_signal_handler);
777 sa.sa_flags = SA_SIGINFO;
778 sigaction(SIGINT, &sa, 0);
779 sigaction(SIGTERM, &sa, 0);
780 #endif // USE_SIGNALS 781 #endif // USE_READLINE 793 if ( write_history(
histfile) != 0 ) {
794 write_history(
"~/.tb_history");
820 return toupper(ps[0]);
826 return toupper(ps[0]);
831 string::size_type pos1 = str.find_first_not_of(to_trim);
832 string::size_type pos2 = str.find_last_not_of(to_trim);
833 if (pos1 == string::npos)
836 str = str.substr(pos1, pos2 - pos1 + 1);
848 " This console reader allows you to browse and manipulate TaskContexts."<<
nl<<
849 " You can type in an operation, expression, create or change variables."<<
nl;
853 cout <<
" TAB completion and HISTORY is available ('bash' like)" <<nl<<
nl;
855 cout <<
" TAB completion and history is NOT available (LGPL-version)" <<nl<<
nl;
875 for (PTrace::iterator it =
ptraces.begin(); it !=
ptraces.end(); ++it) {
878 if ( line != it->second ) {
884 for (PTrace::iterator it =
straces.begin(); it !=
straces.end(); ++it) {
886 int line = progpeer->
getProvider<
Scripting>(
"scripting")->getStateMachineLine(it->first.second);
887 if ( line != it->second ) {
900 const char*
const commandStr = rl_gets();
902 command = commandStr ? commandStr :
"quit";
905 getline(cin,command);
909 }
catch(std::exception& e) {
910 cerr <<
"The command line reader throwed a std::exception: '"<< e.what()<<
"'."<<
endl;
912 cerr <<
"The command line reader throwed an exception." <<endlog();
916 if ( command ==
"quit" ) {
920 }
else if ( command ==
"help") {
922 }
else if ( command.find(
"help ") == 0) {
923 printHelp( command.substr(command.rfind(
' ')));
924 }
else if ( command ==
"GlobalService" ) {
926 }
else if ( command ==
"GlobalsRepository" ) {
928 }
else if ( command ==
"#debug") {
930 }
else if ( command.find(
"list ") == 0 || command ==
"list" ) {
932 }
else if ( command.find(
"trace ") == 0 || command ==
"trace" ) {
934 }
else if ( command.find(
"untrace ") == 0 || command ==
"untrace" ) {
936 }
else if ( command.find(
"ls") == 0 ) {
937 std::string::size_type pos = command.find(
"ls")+2;
938 command = std::string(command, pos, command.length());
941 }
else if ( command ==
"" ) {
942 }
else if ( command.find(
"cd ..") == 0 ) {
944 }
else if ( command.find(
"enter") == 0 ) {
946 }
else if ( command.find(
"leave") == 0 ) {
948 }
else if ( command.find(
"cd ") == 0 ) {
949 std::string::size_type pos = command.find(
"cd")+2;
950 command = std::string(command, pos, command.length());
952 }
else if ( command.find(
".") == 0 ) {
953 command = std::string(command, 1, command.length());
960 }
catch(std::exception& e) {
961 cerr <<
"The command '"<<command<<
"' caused a std::exception: '"<< e.what()<<
"' and could not be completed."<<
endl;
963 cerr <<
"The command '"<<command<<
"' caused an unknown exception and could not be completed."<<
endl;
970 }
catch(std::exception& e) {
971 cerr <<
"Warning: The command caused a std::exception: '"<< e.what()<<
"' in the TaskBrowser's loop() function."<<
endl;
973 cerr <<
"Warning: The command caused an exception in the TaskBrowser's loop() function." <<
endl;
1001 log(
Error)<<
"Macro already active." <<endlog();
1005 log(
Error)<<
"Can not create a macro in a TaskContext without scripting service." <<endlog();
1008 if ( name.empty() ) {
1009 cerr <<
"Please specify a macro name." <<
endl;
1012 cout <<
"Recording macro "<< name <<
endl;
1013 cout <<
"Use program scripting syntax (do, set,...) !" << endl <<endl;
1014 cout <<
"export function "<< name<<
" {"<<endl;
1022 log(
Warning)<<
"Macro recording was not active." <<endlog();
1032 log(
Warning)<<
"Macro recording was not active." <<endlog();
1038 cout <<
"Saving file "<< fname <<endl;
1039 ofstream macrofile( fname.c_str() );
1040 macrofile <<
"/* TaskBrowser macro '"<<
macroname<<
"' */" <<endl<<endl;
1041 macrofile <<
"export function "<<
macroname<<
" {"<<endl;
1043 macrofile <<
"}"<<endl;
1046 cout <<
"Loading file "<< fname <<endl;
1052 if ( taskHistory.size() == 0)
1057 taskHistory.pop_front();
1066 for( DataFlowInterface::Ports::iterator i=ports.begin(); i != ports.end(); ++i) {
1080 const char* dbg =
"\033[01;";
1081 const char* wbg =
"\033[02;";
1083 const char* r =
"31m";
1084 const char* g =
"32m";
1085 const char* b =
"34m";
1086 const char* con =
"31m";
1087 const char* coff =
"\33[0m";
1088 const char* und =
"\33[4m";
1127 if ( this->
findPeer( c +
"." ) == 0 ) {
1128 cerr <<
"No such peer: "<< c <<
nl;
1133 cerr <<
"Already in "<< c <<
nl;
1138 cerr <<
"Can not switch to TaskBrowser." <<
nl;
1148 if (taskHistory.size() == 20 )
1149 taskHistory.pop_back();
1158 for( DataFlowInterface::Ports::iterator i=tports.begin(); i != tports.end(); ++i) {
1175 if ( !tports.empty() )
1177 for( DataFlowInterface::Ports::iterator i=tports.begin(); i != tports.end(); ++i) {
1198 bool skipref =
true;
1204 log(
Debug) <<
"No such peer : "<< c <<endlog();
1214 std::stringstream ss(act);
1218 if ( instr ==
"list" ) {
1220 log(
Error)<<
"Can not list a program in a TaskContext without scripting service." <<endlog();
1252 if ( instr ==
"trace") {
1254 log(
Error)<<
"Can not trace a program in a TaskContext without scripting service." <<endlog();
1273 cerr <<
"No such program or state machine: "<< arg <<
endl;
1278 std::vector<std::string> names;
1280 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1287 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1297 if ( instr ==
"untrace") {
1299 log(
Error)<<
"Can not untrace a program in a TaskContext without scripting service." <<endlog();
1311 std::vector<std::string> names;
1313 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1320 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1326 cerr <<
"Untracing all programs and state machines of "<<
context->
getName() <<
endl;
1332 if ( instr ==
"dark") {
1337 if ( instr ==
"light") {
1342 if ( instr ==
"nocolors") {
1347 if ( instr ==
"record") {
1351 if ( instr ==
"cancel") {
1355 if ( instr ==
"end") {
1359 if ( instr ==
"hex") {
1361 cout <<
"Switching to hex notation for output (use .nohex to revert)." <<
endl;
1364 if ( instr ==
"nohex") {
1366 cout <<
"Turning off hex notation for output." <<
endl;
1369 if ( instr ==
"provide") {
1371 cout <<
"Trying to locate service '" << arg <<
"'..."<<
endl;
1375 cout <<
"Service not found." <<endl;
1380 if (instr ==
"services") {
1381 vector<string> names = PluginLoader::Instance()->listServices();
1382 cout <<
"Available Services: ";
1383 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1389 if (instr ==
"typekits") {
1390 vector<string> names = PluginLoader::Instance()->listTypekits();
1391 cout <<
"Available Typekits: ";
1392 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1398 if (instr ==
"types") {
1399 vector<string> names = TypeInfoRepository::Instance()->getDottedTypes();
1400 cout <<
"Available data types: ";
1401 for (std::vector<std::string>::iterator it = names.begin(); it != names.end(); ++it) {
1407 cerr <<
"Unknown Browser Action : "<< act <<
endl;
1408 cerr <<
"See 'help' for valid syntax."<<endl;
1417 std::vector<std::string> strs;
1418 boost::split(strs, names, boost::is_any_of(
"."));
1421 if (strs.empty())
return serv;
1423 string component = strs.front();
1434 strs.erase( strs.begin() );
1437 while ( !strs.empty() && serv) {
1438 serv = serv->getService( strs.front() );
1440 strs.erase( strs.begin() );
1448 bool result =
false;
1452 if ( ops || GlobalService::Instance()->hasService( name ) || name ==
"GlobalService" )
1454 if ( name ==
"GlobalService" )
1455 ops = GlobalService::Instance();
1457 ops = GlobalService::Instance()->provides(name);
1460 sresult << nl <<
" Configuration Properties: ";
1462 if ( bag && bag->
size() != 0 ) {
1466 sresult << nl << setw(11)<< right <<
Types()->toDot( (*it)->getType() )<<
" " 1469 sresult<<
" ("<< (*it)->getDescription() <<
')';
1476 sresult << nl <<
" Attributes : ";
1477 std::vector<std::string> objlist = ops->getAttributeNames();
1478 if ( !objlist.empty() ) {
1481 for( std::vector<std::string>::iterator it = objlist.begin(); it != objlist.end(); ++it) {
1483 sresult << setw(11)<< right <<
Types()->toDot( pds->getType() )<<
" " 1494 vector<string> methods = ops->getNames();
1495 if ( !methods.empty() ) {
1503 sresult << nl <<
" Data Flow Ports: ";
1504 objlist = ops->getPortNames();
1505 if ( !objlist.empty() ) {
1506 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it) {
1508 bool writer =
dynamic_cast<OutputPortInterface*
>(port) ?
true :
false;
1510 sresult << nl <<
" " << ( !writer ?
" In" :
"Out");
1519 InputPortInterface* iport =
dynamic_cast<InputPortInterface*
>(port);
1521 sresult <<
" <= ( use '"<< iport->getName() <<
".read(sample)' to read a sample from this port)";
1523 OutputPortInterface* oport =
dynamic_cast<OutputPortInterface*
>(port);
1525 if ( oport->keepsLastWrittenValue()) {
1526 DataSourceBase::shared_ptr dsb = oport->getDataSource();
1530 sresult <<
" => (keepsLastWrittenValue() == false. Enable it for this port in order to see it in the TaskBrowser.)";
1538 objlist = ops->getProviderNames();
1540 if ( !objlist.empty() ) {
1541 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
1554 vector<string> methods = sr->getOperationCallerNames();
1556 std::for_each( methods.begin(), methods.end(),
sresult << lambda::_1 <<
" " );
1565 GlobalsRepository::shared_ptr globals = GlobalsRepository::Instance();
1568 sresult << nl <<
" Configuration Properties: ";
1570 if ( bag && bag->
size() != 0 ) {
1574 sresult << nl << setw(11)<< right <<
Types()->toDot( (*it)->getType() )<<
" " 1577 sresult<<
" ("<< (*it)->getDescription() <<
')';
1584 sresult << nl <<
" Attributes : ";
1585 std::vector<std::string> objlist = globals->getAttributeNames();
1586 if ( !objlist.empty() ) {
1589 for( std::vector<std::string>::iterator it = objlist.begin(); it != objlist.end(); ++it) {
1591 sresult << setw(11)<< right <<
Types()->toDot( pds->getType() )<<
" " 1617 cerr <<
"Found value..."<<
nl;
1634 cerr <<
"Trying ValueStatement..."<<
nl;
1641 assert( comm.size() != 0 );
1642 if ( comm[ comm.size() - 1 ] !=
';' ) {
1650 cerr <<
"returned (null) !"<<
nl;
1653 }
catch ( fatal_semantic_parse_exception& pe ) {
1656 cerr <<
"fatal_semantic_parse_exception: ";
1657 cerr << pe.what() <<
nl;
1659 }
catch ( syntactic_parse_exception& pe ) {
1662 cerr <<
"syntactic_parse_exception: ";
1663 cerr << pe.what() <<
nl;
1665 }
catch ( parse_exception_parser_fail &pe )
1669 cerr <<
"Ignoring ValueStatement exception :"<<
nl;
1670 cerr << pe.what() <<
nl;
1675 cerr <<
"parse_exception :";
1680 cerr <<
"Trying Expression..."<<
nl;
1687 assert( comm.size() != 0 );
1688 if ( comm[ comm.size() - 1 ] !=
';' ) {
1696 cerr <<
"returned (null) !"<<
nl;
1697 }
catch ( syntactic_parse_exception& pe ) {
1700 cerr <<
"syntactic_parse_exception :";
1701 cerr << pe.what() <<
nl;
1703 }
catch ( fatal_semantic_parse_exception& pe ) {
1706 cerr <<
"fatal_semantic_parse_exception :";
1707 cerr << pe.what() <<
nl;
1709 }
catch ( parse_exception_parser_fail &pe )
1713 cerr <<
"Ignoring Expression exception :"<<
nl;
1714 cerr << pe.what() <<
nl;
1719 cerr <<
"Ignoring Expression parse_exception :"<<
nl;
1725 std::string
prompt(
" = ");
1748 DataSource<RTT::PropertyBag>* dspbag = DataSource<RTT::PropertyBag>::narrow(ds.get());
1752 int siz = bag.getProperties().size();
1753 int wdth = siz ? (20 - (siz / 10 + 1)) : 20;
1754 sresult <<setw(0)<< siz <<setw( wdth )<<
" Properties";
1756 if ( ! bag.empty() ) {
1762 sresult <<
" ("<<(*it)->getDescription()<<
')' <<
nl;
1773 if (dsb->getMemberNames().empty() || dsb->getTypeInfo()->isStreamable() ) {
1774 if (
debug) cerr <<
"terminal item " << dsb->getTypeName() <<
nl;
1782 vector<string> names = dsb->getMemberNames();
1783 if ( find(names.begin(), names.end(),
"capacity") != names.end() &&
1784 find(names.begin(), names.end(),
"size") != names.end() ) {
1788 ValueDataSource<unsigned int>::shared_ptr index =
new ValueDataSource<unsigned int>(0);
1791 for (
int i=0; i != seq_size->get(); ++i) {
1794 sresult <<
"...("<< seq_size->get() - 10 <<
" items omitted)...";
1797 DataSourceBase::shared_ptr element = dsb->getMember(index, DataSourceBase::shared_ptr() );
1799 if (i+1 != seq_size->get())
1806 for(vector<string>::iterator it = names.begin(); it != names.end(); ) {
1808 doPrint( dsb->getMember(*it),
true);
1809 if (++it != names.end())
1821 os<<
"'"<< TaskBrowser::coloron<< TaskBrowser::underline << command << TaskBrowser::coloroff<<
"'";
1831 os<<
"<"<< TaskBrowser::coloron<< TaskBrowser::underline << command << TaskBrowser::coloroff<<
">";
1841 os<<
endl<<
"["<< TaskBrowser::coloron<< TaskBrowser::underline << command << TaskBrowser::coloroff<<
"]";
1862 cout <<
" To switch to another task, type "<<
comcol(
"cd <path-to-taskname>")<<
nl;
1863 cout <<
" and type "<<
comcol(
"cd ..")<<
" to go back to the previous task (History size is 20)."<<
nl;
1864 cout <<
" Pressing "<<
keycol(
"tab")<<
" multiple times helps you to complete your command."<<
nl;
1865 cout <<
" It is not mandatory to switch to a task to interact with it, you can type the"<<
nl;
1866 cout <<
" peer-path to the task (dot-separated) and then type command or expression :"<<
nl;
1867 cout <<
" PeerTask.OtherTask.FinalTask.countTo(3) [enter] "<<
nl;
1868 cout <<
" Where 'countTo' is a method of 'FinalTask'."<<
nl;
1869 cout <<
" The TaskBrowser starts by default 'In' the current component. In order to watch"<<
nl;
1870 cout <<
" the TaskBrowser itself, type "<<
comcol(
"leave")<<
" You will notice that it"<<
nl;
1871 cout <<
" has connected to the data ports of the visited component. Use "<<
comcol(
"enter")<<
" to enter"<<
nl;
1872 cout <<
" the visited component again. The "<<
comcol(
"cd")<<
" command works transparantly in both"<<
nl;
1876 cout <<
" To see the contents of a task, type "<<
comcol(
"ls")<<
nl;
1877 cout <<
" For a detailed argument list (and helpful info) of the object's methods, "<<
nl;
1878 cout <<
" type the name of one of the listed task objects : " <<
nl;
1879 cout <<
" this [enter]" <<nl<<
nl;
1880 cout <<
" factor( int number ) : bool" <<
nl;
1881 cout <<
" Factor a value into its primes." <<
nl;
1882 cout <<
" number : The number to factor in primes." <<
nl;
1883 cout <<
" isRunning( ) : bool" <<
nl;
1884 cout <<
" Is this RTT::TaskContext started ?" <<
nl;
1885 cout <<
" loadProgram( const& std::string Filename ) : bool" <<
nl;
1886 cout <<
" Load an Orocos Program Script from a file." <<
nl;
1887 cout <<
" Filename : An ops file." <<
nl;
1890 cout <<
" A status character shows the TaskState of a component."<<
nl;
1891 cout <<
" 'E':RunTimeError, 'S':Stopped, 'R':Running, 'U':PreOperational (Unconfigured)"<<
nl;
1892 cout <<
" 'X':Exception, 'F':FatalError" <<
nl;
1895 cout <<
" You can evaluate any script expression by merely typing it :"<<
nl;
1896 cout <<
" 1+1 [enter]" <<
nl;
1898 cout <<
" or inspect the status of a program :"<<
nl;
1899 cout <<
" myProgram.isRunning [enter]" <<
nl;
1901 cout <<
" and display the contents of complex data types (vector, array,...) :"<<
nl;
1902 cout <<
" array(6)" <<
nl;
1903 cout <<
" = {0, 0, 0, 0, 0, 0}" <<
nl;
1906 cout <<
" To change the value of a Task's attribute, type "<<
comcol(
"varname = <newvalue>")<<
nl;
1907 cout <<
" If you provided a correct assignment, the browser will inform you of the success"<<
nl;
1908 cout <<
" with the set value." <<
nl;
1911 cout <<
" An Operation is sent or called (evaluated) "<<
nl;
1912 cout <<
" immediately and print the result. An example could be :"<<
nl;
1913 cout <<
" someTask.bar.getNumberOfBeers(\"Palm\") [enter] "<<
nl;
1915 cout <<
" You can ask help on an operation by using the 'help' command: "<<
nl;
1916 cout <<
" help start"<<
nl;
1917 cout <<
" start( ) : bool"<<
nl;
1918 cout <<
" Start this TaskContext (= startHook() + updateHook() )." <<
nl;
1920 cout <<
titlecol(
"Program and scripting::StateMachine Scripts")<<
nl;
1921 cout <<
" To load a program script use the scripting service."<<
nl;
1922 cout <<
" Use "<<
comcol(
".provide scripting")<<
" to load the scripting service in a TaskContext."<<
nl;
1924 cout <<
" to see the programs operations and variables. You can manipulate each one of these"<<
nl;
1925 cout <<
" using the service object of the program."<<
nl;
1927 cout <<
" To print a program or state machine listing, use "<<
comcol(
"list progname [linenumber]")<<
nl;
1928 cout <<
" to list the contents of the current program lines being executed,"<<
nl;
1929 cout <<
" or 10 lines before or after <linenumber>. When only "<<
comcol(
"list [n]")<<
nl;
1930 cout <<
" is typed, 20 lines of the last listed program are printed from line <n> on "<<
nl;
1931 cout <<
" ( default : list next 20 lines after previous list )."<<
nl;
1933 cout <<
" To trace a program or state machine listing, use "<<
comcol(
"trace [progname]")<<
" this will"<<
nl;
1934 cout <<
" cause the TaskBrowser to list the contents of a traced program,"<<
nl;
1935 cout <<
" each time the line number of the traced program changes."<<
nl;
1936 cout <<
" Disable tracing with "<<
comcol(
"untrace [progname]")<<
""<<
nl;
1937 cout <<
" If no arguments are given to "<<
comcol(
"trace")<<
" and "<<
comcol(
"untrace")<<
", it applies to all programs."<<
nl;
1939 cout <<
" A status character shows which line is being executed."<<
nl;
1940 cout <<
" For programs : 'E':Error, 'S':Stopped, 'R':Running, 'P':Paused"<<
nl;
1941 cout <<
" For state machines : <the same as programs> + 'A':Active, 'I':Inactive"<<
nl;
1944 cout <<
" You can inform the TaskBrowser of your background color by typing "<<
comcol(
".dark")<<
nl;
1945 cout <<
" "<<
comcol(
".light")<<
", or "<<
comcol(
".nocolors")<<
" to increase readability."<<
nl;
1948 cout <<
" Use the commands "<<
comcol(
".hex") <<
" or " <<
comcol(
".nohex") <<
" to turn hexadecimal "<<
nl;
1949 cout <<
" notation of integers on or off."<<
nl;
1951 cout <<
titlecol(
"Macro Recording / RTT::Command line history")<<
nl;
1952 cout <<
" You can browse the commandline history by using the up-arrow key or press "<<
comcol(
"Ctrl r")<<
nl;
1953 cout <<
" and a search term. Hit enter to execute the current searched command."<<
nl;
1954 cout <<
" Macros can be recorded using the "<<
comcol(
".record 'macro-name'")<<
" command."<<
nl;
1955 cout <<
" You can cancel the recording by typing "<<
comcol(
".cancel")<<
" ."<<
nl;
1956 cout <<
" You can save and load the macro by typing "<<
comcol(
".end")<<
" . The macro becomes"<<
nl;
1957 cout <<
" available as a command with name 'macro-name' in the current TaskContext." <<
nl;
1958 cout <<
" While you enter the macro, it is not executed, as you must use scripting syntax which"<<
nl;
1959 cout <<
" may use loop or conditional statements, variables etc."<<
nl;
1962 cout <<
" You can instruct the TaskBrowser to connect to the ports of the current Peer by"<<
nl;
1963 cout <<
" typing "<<
comcol(
".connect [port-name]")<<
", which will temporarily create connections"<<
nl;
1964 cout <<
" to all ports if [port-name] is omitted or to the specified port otherwise."<<
nl;
1965 cout <<
" The TaskBrowser disconnects these ports when it visits another component, but the"<<
nl;
1966 cout <<
" created connection objects remain in place (this is more or less a bug)!"<<
nl;
1969 cout <<
" Use "<<
comcol(
".provide [servicename]")<<
" to load a service in a TaskContext."<<
nl;
1970 cout <<
" For example, to add XML marshalling, type: "<<
comcol(
".provide marshalling")<<
"."<<
nl;
1971 cout <<
" Use "<<
comcol(
".services")<<
" to get a list of available services."<<
nl;
1972 cout <<
" Use "<<
comcol(
".typekits")<<
" to get a list of available typekits."<<
nl;
1973 cout <<
" Use "<<
comcol(
".types")<<
" to get a list of available data types."<<
nl;
1989 if (helpstring.rfind(
'.') != string::npos )
1995 cerr<<
" help: No such operation known: '"<< helpstring <<
"'"<<
nl;
1998 cerr<<
" help: No such operation known (peer not found): '"<< helpstring <<
"'"<<
nl;
2020 if ( cl < 0 ) cl = ln;
2021 start = cl < 10 ? 1 : cl - 10;
2023 this->
listText( txtss, start, end, ln, s);
2032 if ( cl < 0 ) cl = ln;
2033 start = cl <= 10 ? 1 : cl - 10;
2035 this->
listText( txtss, start, end, ln, s);
2039 cerr <<
"Error : No such program or state machine found : "<<
progname;
2062 this->
listText( txtss, start, end, ln, s);
2073 this->
listText( txtss, start, end, ln, s);
2077 cerr <<
"Error : No such program or state machine found : "<<
storedname<<
endl;
2083 while ( start > 1 && curln != start ) {
2084 getline( txtss, line,
'\n' );
2089 while ( end > start && curln != end ) {
2090 getline( txtss, line,
'\n' );
2093 if ( curln == ln ) {
2098 cout<< setw(int(log(double(end)))) <<right << curln<< left; 2099 cout << ' ' << line <<endl; 2106 void TaskBrowser::printInfo(const std::string& peerp) 2108 // this sets this->peer to the peer given 2110 taskobject = peer->provides(); 2111 if ( !peerp.empty() && peerp != "." && this->findPeer( peerp+"." ) == 0 ) { 2112 cerr << "No such peer or object: " << peerp << endl; 2116 if ( !peer || !peer->ready()) { 2117 cout << nl << " Connection to peer "+peerp+" lost (peer->ready() == false)." <<endlog(); 2121 // sresult << *it << "["<<getTaskStatusChar(peer->getPeer(*it))<<"] "; 2124 if ( peer->provides() == taskobject ) 2125 sresult <<nl<<" Listing TaskContext "<< green << peer->getName()<<coloroff << "["<<getTaskStatusChar(peer)<<"] :"<<nl; 2127 sresult <<nl<<" Listing Service "<< green << taskobject->getName()<<coloroff<< "["<<getTaskStatusChar(peer)<<"] :"<<nl; 2129 sresult <<nl<<" Configuration Properties: "; 2130 RTT::PropertyBag* bag = taskobject->properties(); 2131 if ( bag && bag->size() != 0 ) { 2132 // Print Properties: 2133 for( RTT::PropertyBag::iterator it = bag->begin(); it != bag->end(); ++it) { 2134 base::DataSourceBase::shared_ptr pds = (*it)->getDataSource(); 2135 sresult << nl << setw(11)<< right << Types()->toDot( (*it)->getType() )<< " " 2136 << coloron <<setw(14)<<left<< (*it)->getName() << coloroff; 2137 this->printResult( pds.get(), false ); // do not recurse 2138 sresult<<" ("<< (*it)->getDescription() <<')
'; 2141 sresult << "(none)"; 2145 // Print "this" interface (without detail) and then list objects... 2146 sresult <<nl<< " Provided Interface:"; 2148 sresult <<nl<< " Attributes : "; 2149 std::vector<std::string> objlist = taskobject->getAttributeNames(); 2150 if ( !objlist.empty() ) { 2152 // Print Attributes: 2153 for( std::vector<std::string>::iterator it = objlist.begin(); it != objlist.end(); ++it) { 2154 base::DataSourceBase::shared_ptr pds = taskobject->getValue(*it)->getDataSource(); 2155 sresult << setw(11)<< right << Types()->toDot( pds->getType() )<< " " 2156 << coloron <<setw( 14 )<<left<< *it << coloroff; 2157 this->printResult( pds.get(), false ); // do not recurse 2161 sresult << coloron << "(none)"; 2164 sresult <<coloroff<<nl<< " Operations : "<<coloron; 2165 objlist = taskobject->getNames(); 2166 if ( !objlist.empty() ) { 2167 std::copy(objlist.begin(), objlist.end(), std::ostream_iterator<std::string>(sresult, " ")); 2169 sresult << "(none)"; 2171 sresult << coloroff << nl; 2173 sresult <<nl<< " Data Flow Ports: "; 2174 objlist = taskobject->getPortNames(); 2175 if ( !objlist.empty() ) { 2176 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it) { 2177 base::PortInterface* port = taskobject->getPort(*it); 2178 bool writer = dynamic_cast<OutputPortInterface*>(port) ? true : false; 2180 sresult << nl << " " << ( !writer ? 2182 // Port data type + name 2183 if ( !port->connected() ) 2184 sresult << "(U) " << setw(11)<<right<< Types()->toDot( port->getTypeInfo()->getTypeName() ); 2186 sresult << "(C) " << setw(11)<<right<< Types()->toDot( port->getTypeInfo()->getTypeName() ); 2188 << coloron <<setw( 14 )<<left<< *it << coloroff; 2190 InputPortInterface* iport = dynamic_cast<InputPortInterface*>(port); 2192 sresult << " <= ( use '"<< iport->getName() << ".read(sample)
' to read a sample from this port)"; 2194 OutputPortInterface* oport = dynamic_cast<OutputPortInterface*>(port); 2196 if ( oport->keepsLastWrittenValue()) { 2197 DataSourceBase::shared_ptr dsb = oport->getDataSource(); 2198 dsb->evaluate(); // read last written value. 2199 sresult << " => " << dsb; 2201 sresult << " => (keepsLastWrittenValue() == false. Enable it for this port in order to see it in the TaskBrowser.)"; 2204 // only show if we're connected to it
2208 InputPortInterface* iport =
dynamic_cast<InputPortInterface*
>(
ports()->
getPort(port->getName()));
2211 iport->getDataSource()->evaluate();
2214 sresult <<
" <= " << DataSourceBase::shared_ptr( iport->getDataSource());
2216 sresult <<
" => " << DataSourceBase::shared_ptr( iport->getDataSource());
2218 OutputPortInterface* oport =
dynamic_cast<OutputPortInterface*
>(
ports()->
getPort(port->getName()));
2221 DataSourceBase::shared_ptr ds = oport->getDataSource();
2226 sresult <<
" <= " << ds <<
" (sent from TaskBrowser)";
2228 sresult <<
"(no last written value kept)";
2232 sresult <<
"(TaskBrowser not connected to this port)";
2246 if ( !objlist.empty() ) {
2247 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
2257 sresult <<nl<<
" Requires Operations :";
2258 if ( !objlist.empty() ) {
2259 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
2266 sresult <<
" Requests Services :";
2267 if ( !objlist.empty() ) {
2268 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
2277 if ( !objlist.empty() ) {
2279 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
2285 if ( !objlist.empty() ) {
2287 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it)
2300 if ( !objlist.empty() )
2301 for(vector<string>::iterator it = objlist.begin(); it != objlist.end(); ++it) {
2317 std::vector<ArgumentDescription>
args;
2320 args = the_ops->getArgumentList( m );
2323 args = GlobalService::Instance()->getArgumentList( m );
2324 ops = GlobalService::Instance();
2327 for (std::vector<ArgumentDescription>::iterator it = args.begin(); it != args.end(); ++it) {
2330 if ( it+1 != args.end() )
2336 sresult <<
" " << ops->getDescription( m )<<
nl;
2337 for (std::vector<ArgumentDescription>::iterator it = args.begin(); it != args.end(); ++it)
2338 sresult <<
" "<< it->name <<
" : " << it->description <<
nl;
void loop()
Call this method from ORO_main() to process keyboard input and thus startup the TaskBrowser.
void listText(std::stringstream &txtss, int start, int end, int ln, char s)
Variable opBinary s not applicable to args
base::PortInterface & addPort(const std::string &name, base::PortInterface &port)
std::ostream & operator<<(std::ostream &os, comcol f)
virtual const types::TypeInfo * getTypeInfo() const =0
static RTT::TaskContext * taskcontext
Use colors suitable for a white background.
void evalCommand(std::string &comm)
std::ostream & operator()(std::ostream &os) const
Service::shared_ptr provides()
virtual const std::string what() const =0
void setColorTheme(ColorTheme t)
const std::string & getTypeName() const
static std::ostream & nl(std::ostream &__os)
char getProgramStatusChar(RTT::TaskContext *t, string progname)
void doPrint(RTT::base::DataSourceBase::shared_ptr ds, bool recurse)
std::deque< TaskContext * > taskHistory
std::stringstream sresult
bool loadService(const std::string &service_name)
static RTT::TaskContext * context
void printProgram(const std::string &pn, int line=-1, RTT::TaskContext *progpeer=0)
char getStateMachineStatusChar(RTT::TaskContext *t, string progname)
bool usehex
last program line number listed to screen
boost::shared_ptr< ServiceRequester > shared_ptr
const std::string & getName() const
void browserAction(std::string &act)
Use colors suitable for a dark background.
char getTaskStatusChar(RTT::TaskContext *t)
static RTT::Service::shared_ptr taskobject
OperationCaller< std::string(const std::string &)> getStateMachineText
base::DataSourceBase::shared_ptr parseValueStatement(const std::string &s, TaskContext *)
virtual bool isConfigured() const
virtual bool isRunning() const
void str_trim(string &str, char to_trim)
std::ostream & operator()(std::ostream &os) const
virtual TaskContext * getPeer(const std::string &peer_name) const
TaskBrowser(RTT::TaskContext *c)
boost::shared_ptr< Service > shared_ptr
virtual bool inException() const
virtual bool hasPeer(const std::string &peer_name) const
OperationCaller< bool(const std::string &)> hasStateMachine
void switchTaskContext(std::string &path)
ServiceRequester::shared_ptr requires()
static RTT::TaskContext * findPeer(std::string comm)
position_iterator< our_iterator_t > our_pos_iter_t
virtual void disconnect()
DataFlowInterface * ports()
virtual bool inFatalError() const
base::PortInterface * getPort(const std::string &name) const
virtual PeerList getPeerList() const
void removePort(const std::string &name)
base::DataSourceBase::shared_ptr last_expr
std::vector< std::string > PeerList
LOG4CPP_EXPORT CategoryStream & left(CategoryStream &os)
TypeInfoRepository::shared_ptr Types()
basic_ostreams & endl(basic_ostreams &s)
void printInfo(const std::string &peerpath)
void printResult(RTT::base::DataSourceBase *ds, bool recurse)
std::vector< base::PortInterface * > Ports
static std::string prompt
base::DataSourceBase::shared_ptr parseExpression(const std::string &s, TaskContext *)
boost::intrusive_ptr< DataSource< int > > shared_ptr
virtual bool inRunTimeError() const
static RTT::TaskContext * peer
static std::string coloroff
OperationCaller< std::string(const std::string &)> getProgramText
Service::shared_ptr stringToService(std::string const &names)
int storedline
last program listed to screen
static RTT::TaskContext * tb
static std::string underline
bool printService(const std::string name)
void printOperation(const std::string m, Service::shared_ptr ops)
void evaluate(std::string &comm)
bool connectPorts(TaskContext *A, TaskContext *B)
Properties::iterator iterator
boost::intrusive_ptr< DataSourceBase > shared_ptr
virtual bool connected() const =0
static const char * progname
std::ostream & operator()(std::ostream &os) const
void recordMacro(std::string name)
OperationCaller< bool(const std::string &)> hasProgram
static std::string coloron
virtual bool addPeer(TaskContext *peer, std::string alias="")
virtual const std::string & getName() const
boost::shared_ptr< ServiceType > getProvider(const std::string &name)