[Orxonox-commit 837] r3353 - branches/resource/src/core
landauf at orxonox.net
landauf at orxonox.net
Sun Jul 26 01:02:22 CEST 2009
Author: landauf
Date: 2009-07-26 01:02:22 +0200 (Sun, 26 Jul 2009)
New Revision: 3353
Modified:
branches/resource/src/core/IRC.cc
branches/resource/src/core/TclBind.cc
branches/resource/src/core/TclThreadManager.cc
Log:
fixed some possible namespace issues
Modified: branches/resource/src/core/IRC.cc
===================================================================
--- branches/resource/src/core/IRC.cc 2009-07-25 20:16:37 UTC (rev 3352)
+++ branches/resource/src/core/IRC.cc 2009-07-25 23:02:22 UTC (rev 3353)
@@ -56,10 +56,10 @@
try
{
- this->interpreter_->def("orxonox::irc::say", IRC::tcl_say, Tcl::variadic());
- this->interpreter_->def("orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic());
- this->interpreter_->def("orxonox::irc::action", IRC::tcl_action, Tcl::variadic());
- this->interpreter_->def("orxonox::irc::info", IRC::tcl_info, Tcl::variadic());
+ this->interpreter_->def("::orxonox::irc::say", IRC::tcl_say, Tcl::variadic());
+ this->interpreter_->def("::orxonox::irc::privmsg", IRC::tcl_privmsg, Tcl::variadic());
+ this->interpreter_->def("::orxonox::irc::action", IRC::tcl_action, Tcl::variadic());
+ this->interpreter_->def("::orxonox::irc::info", IRC::tcl_info, Tcl::variadic());
}
catch (Tcl::tcl_error const &e)
{ COUT(1) << "Tcl (IRC) error: " << e.what(); }
Modified: branches/resource/src/core/TclBind.cc
===================================================================
--- branches/resource/src/core/TclBind.cc 2009-07-25 20:16:37 UTC (rev 3352)
+++ branches/resource/src/core/TclBind.cc 2009-07-25 23:02:22 UTC (rev 3353)
@@ -78,19 +78,19 @@
{
this->interpreter_ = this->createTclInterpreter();
- this->interpreter_->def("orxonox::query", TclBind::tcl_query, Tcl::variadic());
- this->interpreter_->def("orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());
+ this->interpreter_->def("::orxonox::query", TclBind::tcl_query, Tcl::variadic());
+ this->interpreter_->def("::orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());
this->interpreter_->def("execute", TclBind::tcl_execute, Tcl::variadic());
- this->interpreter_->def("orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
+ this->interpreter_->def("::orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
try
{
- this->interpreter_->eval("proc query {args} { orxonox::query $args }");
- this->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery 0 $id $args }");
- this->interpreter_->eval("proc crossexecute {id args} { orxonox::crossquery 0 $id $args }");
+ this->interpreter_->eval("proc query {args} { ::orxonox::query $args }");
+ this->interpreter_->eval("proc crossquery {id args} { ::orxonox::crossquery 0 $id $args }");
+ this->interpreter_->eval("proc crossexecute {id args} { ::orxonox::crossquery 0 $id $args }");
this->interpreter_->eval("proc running {} { return 1 }");
this->interpreter_->eval("set id 0");
- this->interpreter_->eval("rename exit tcl::exit; proc exit {} { execute exit }");
+ this->interpreter_->eval("rename exit ::tcl::exit; proc exit {} { execute exit }");
}
catch (Tcl::tcl_error const &e)
{ COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl; }
Modified: branches/resource/src/core/TclThreadManager.cc
===================================================================
--- branches/resource/src/core/TclThreadManager.cc 2009-07-25 20:16:37 UTC (rev 3352)
+++ branches/resource/src/core/TclThreadManager.cc 2009-07-25 23:02:22 UTC (rev 3353)
@@ -247,31 +247,31 @@
std::string id_string = getConvertedValue<unsigned int, std::string>(id);
// Define the functions which are implemented in C++
- newbundle->interpreter_->def("orxonox::execute", TclThreadManager::tcl_execute, Tcl::variadic());
- newbundle->interpreter_->def("orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
- newbundle->interpreter_->def("orxonox::query", TclThreadManager::tcl_query, Tcl::variadic());
- newbundle->interpreter_->def("orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());
- newbundle->interpreter_->def("orxonox::running", TclThreadManager::tcl_running);
+ newbundle->interpreter_->def("::orxonox::execute", TclThreadManager::tcl_execute, Tcl::variadic());
+ newbundle->interpreter_->def("::orxonox::crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
+ newbundle->interpreter_->def("::orxonox::query", TclThreadManager::tcl_query, Tcl::variadic());
+ newbundle->interpreter_->def("::orxonox::crossquery", TclThreadManager::tcl_crossquery, Tcl::variadic());
+ newbundle->interpreter_->def("::orxonox::running", TclThreadManager::tcl_running);
// Create threadspecific shortcuts for the functions above
newbundle->interpreter_->def("execute", TclThreadManager::tcl_execute, Tcl::variadic());
newbundle->interpreter_->def("crossexecute", TclThreadManager::tcl_crossexecute, Tcl::variadic());
- newbundle->interpreter_->eval("proc query {args} { orxonox::query " + id_string + " $args }");
- newbundle->interpreter_->eval("proc crossquery {id args} { orxonox::crossquery " + id_string + " $id $args }");
- newbundle->interpreter_->eval("proc running {} { return [orxonox::running " + id_string + "] }");
+ newbundle->interpreter_->eval("proc query {args} { ::orxonox::query " + id_string + " $args }");
+ newbundle->interpreter_->eval("proc crossquery {id args} { ::orxonox::crossquery " + id_string + " $id $args }");
+ newbundle->interpreter_->eval("proc running {} { return [::orxonox::running " + id_string + "] }");
// Define a variable containing the thread id
newbundle->interpreter_->eval("set id " + id_string);
// Use our own exit function to avoid shutting down the whole program instead of just the interpreter
- newbundle->interpreter_->eval("rename exit tcl::exit");
+ newbundle->interpreter_->eval("rename exit ::tcl::exit");
newbundle->interpreter_->eval("proc exit {} { execute TclThreadManager destroy " + id_string + " }");
// Redefine some native functions
- newbundle->interpreter_->eval("rename while tcl::while");
- newbundle->interpreter_->eval("rename orxonox::while while");
- newbundle->interpreter_->eval("rename for tcl::for");
- newbundle->interpreter_->eval("rename orxonox::for for");
+ newbundle->interpreter_->eval("rename while ::tcl::while");
+ newbundle->interpreter_->eval("rename ::orxonox::while while");
+ newbundle->interpreter_->eval("rename for ::tcl::for");
+ newbundle->interpreter_->eval("rename ::orxonox::for for");
}
catch (const Tcl::tcl_error& e)
{ newbundle->interpreter_ = 0; COUT(1) << "Tcl error while creating Tcl-interpreter (" << id << "): " << e.what() << std::endl; }
More information about the Orxonox-commit
mailing list