Changeset 3353 for code/branches/resource
- Timestamp:
- Jul 26, 2009, 1:02:22 AM (15 years ago)
- Location:
- code/branches/resource/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource/src/core/IRC.cc
r3318 r3353 57 57 try 58 58 { 59 this->interpreter_->def(" orxonox::irc::say", IRC::tcl_say, Tcl::variadic());60 this->interpreter_->def(" orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic());61 this->interpreter_->def(" orxonox::irc::action", IRC::tcl_action, Tcl::variadic());62 this->interpreter_->def(" orxonox::irc::info", IRC::tcl_info, Tcl::variadic());59 this->interpreter_->def("::orxonox::irc::say", IRC::tcl_say, Tcl::variadic()); 60 this->interpreter_->def("::orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic()); 61 this->interpreter_->def("::orxonox::irc::action", IRC::tcl_action, Tcl::variadic()); 62 this->interpreter_->def("::orxonox::irc::info", IRC::tcl_info, Tcl::variadic()); 63 63 } 64 64 catch (Tcl::tcl_error const &e) -
code/branches/resource/src/core/TclBind.cc
r3350 r3353 79 79 this->interpreter_ = this->createTclInterpreter(); 80 80 81 this->interpreter_->def(" orxonox::query", TclBind::tcl_query, Tcl::variadic());82 this->interpreter_->def(" orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());81 this->interpreter_->def("::orxonox::query", TclBind::tcl_query, Tcl::variadic()); 82 this->interpreter_->def("::orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic()); 83 83 this->interpreter_->def("execute", TclBind::tcl_execute, Tcl::variadic()); 84 this->interpreter_->def(" orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());84 this->interpreter_->def("::orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic()); 85 85 86 86 try 87 87 { 88 this->interpreter_->eval("proc query {args} { orxonox::query $args }");89 this->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery 0 $id $args }");90 this->interpreter_->eval("proc crossexecute {id args} { orxonox::crossquery 0 $id $args }");88 this->interpreter_->eval("proc query {args} { ::orxonox::query $args }"); 89 this->interpreter_->eval("proc crossquery {id args} { ::orxonox::crossquery 0 $id $args }"); 90 this->interpreter_->eval("proc crossexecute {id args} { ::orxonox::crossquery 0 $id $args }"); 91 91 this->interpreter_->eval("proc running {} { return 1 }"); 92 92 this->interpreter_->eval("set id 0"); 93 this->interpreter_->eval("rename exit tcl::exit; proc exit {} { execute exit }");93 this->interpreter_->eval("rename exit ::tcl::exit; proc exit {} { execute exit }"); 94 94 } 95 95 catch (Tcl::tcl_error const &e) -
code/branches/resource/src/core/TclThreadManager.cc
r3350 r3353 248 248 249 249 // Define the functions which are implemented in C++ 250 newbundle->interpreter_->def(" orxonox::execute", TclThreadManager::tcl_execute, Tcl::variadic());251 newbundle->interpreter_->def(" orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());252 newbundle->interpreter_->def(" orxonox::query", TclThreadManager::tcl_query, Tcl::variadic());253 newbundle->interpreter_->def(" orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());254 newbundle->interpreter_->def(" orxonox::running", TclThreadManager::tcl_running);250 newbundle->interpreter_->def("::orxonox::execute", TclThreadManager::tcl_execute, Tcl::variadic()); 251 newbundle->interpreter_->def("::orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic()); 252 newbundle->interpreter_->def("::orxonox::query", TclThreadManager::tcl_query, Tcl::variadic()); 253 newbundle->interpreter_->def("::orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic()); 254 newbundle->interpreter_->def("::orxonox::running", TclThreadManager::tcl_running); 255 255 256 256 // Create threadspecific shortcuts for the functions above 257 257 newbundle->interpreter_->def("execute", TclThreadManager::tcl_execute, Tcl::variadic()); 258 258 newbundle->interpreter_->def("crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic()); 259 newbundle->interpreter_->eval("proc query {args} { orxonox::query " + id_string + " $args }");260 newbundle->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery " + id_string + " $id $args }");261 newbundle->interpreter_->eval("proc running {} { return [ orxonox::running " + id_string + "] }");259 newbundle->interpreter_->eval("proc query {args} { ::orxonox::query " + id_string + " $args }"); 260 newbundle->interpreter_->eval("proc crossquery {id args} { ::orxonox::crossquery " + id_string + " $id $args }"); 261 newbundle->interpreter_->eval("proc running {} { return [::orxonox::running " + id_string + "] }"); 262 262 263 263 // Define a variable containing the thread id … … 265 265 266 266 // Use our own exit function to avoid shutting down the whole program instead of just the interpreter 267 newbundle->interpreter_->eval("rename exit tcl::exit");267 newbundle->interpreter_->eval("rename exit ::tcl::exit"); 268 268 newbundle->interpreter_->eval("proc exit {} { execute TclThreadManager destroy " + id_string + " }"); 269 269 270 270 // Redefine some native functions 271 newbundle->interpreter_->eval("rename while tcl::while");272 newbundle->interpreter_->eval("rename orxonox::while while");273 newbundle->interpreter_->eval("rename for tcl::for");274 newbundle->interpreter_->eval("rename orxonox::for for");271 newbundle->interpreter_->eval("rename while ::tcl::while"); 272 newbundle->interpreter_->eval("rename ::orxonox::while while"); 273 newbundle->interpreter_->eval("rename for ::tcl::for"); 274 newbundle->interpreter_->eval("rename ::orxonox::for for"); 275 275 } 276 276 catch (const Tcl::tcl_error& e)
Note: See TracChangeset
for help on using the changeset viewer.