Changeset 7401 for code/trunk/src/libraries/core/command/TclBind.cc
- Timestamp:
- Sep 11, 2010, 12:34:00 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/doc (added) merged: 7290-7292,7296-7300,7302-7304,7306-7312,7315-7318,7323,7325,7327,7331-7332,7334-7335,7345-7347,7352-7353,7356-7357,7361,7363-7367,7371-7375,7388
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/command/TclBind.cc
r7284 r7401 49 49 TclBind* TclBind::singletonPtr_s = 0; 50 50 51 /** 52 @brief Constructor: Initializes the Tcl-interpreter with a given data path. 53 @param datapath Path to the directory that contains the Orxonox-specific Tcl-files 54 */ 51 55 TclBind::TclBind(const std::string& datapath) 52 56 { … … 56 60 } 57 61 62 /** 63 @brief Destructor: Deletes the Tcl-interpreter. 64 */ 58 65 TclBind::~TclBind() 59 66 { … … 62 69 } 63 70 71 /** 72 @brief Defines the path to the directory that contains the Orxonox-specific Tcl-files and initializes the Tcl-interpreter accordingly. 73 */ 64 74 void TclBind::setDataPath(const std::string& datapath) 65 75 { … … 71 81 } 72 82 83 /** 84 @brief Creates and initializes the Tcl-interpreter by registering all callbacks and defining some useful functions. 85 */ 73 86 void TclBind::initializeTclInterpreter() 74 87 { … … 96 109 } 97 110 111 /** 112 @brief Creates and initializes a new Tcl-interpreter and calls the Orxonox-specific 113 init.tcl script that defines some special functions which are required by Orxonox. 114 */ 98 115 Tcl::interpreter* TclBind::createTclInterpreter() 99 116 { … … 116 133 } 117 134 135 /** 136 @brief Returns the path to the Tcl-library (not the Orxonox-specific Tcl-files). 137 */ 118 138 std::string TclBind::getTclLibraryPath() 119 139 { … … 128 148 } 129 149 150 /** 151 @brief Callback: Used to send an Orxonox-command from Tcl to the CommandExecutor and to send its result back to Tcl. 152 */ 130 153 std::string TclBind::tcl_query(Tcl::object const &args) 131 154 { … … 151 174 } 152 175 176 /** 177 @brief Callback: Used to send an Orxonox-command from Tcl to the CommandExecutor. 178 */ 153 179 void TclBind::tcl_execute(Tcl::object const &args) 154 180 { … … 162 188 } 163 189 190 /** 191 @brief Console command, executes Tcl code. Can be used to bind Tcl-commands to a key, because native 192 Tcl-commands can not be evaluated and are thus not supported by the key-binder. 193 */ 164 194 std::string TclBind::tcl(const std::string& tclcode) 165 195 { … … 182 212 } 183 213 214 /** 215 @brief Console command and implementation of the Tcl-feature "bgerror" which is called if an error 216 occurred in the background of a Tcl-script. 217 */ 184 218 void TclBind::bgerror(const std::string& error) 185 219 { … … 187 221 } 188 222 223 /** 224 @brief Executes Tcl-code and returns the return-value. 225 @param tclcode A string that contains Tcl-code 226 @param error A pointer to an integer (or NULL) that is used to write an error-code (see @ref CommandExecutorErrorCodes "CommandExecutor error codes") 227 @return Returns the return-value of the executed code (or an empty string if there's no return-value) 228 */ 189 229 std::string TclBind::eval(const std::string& tclcode, int* error) 190 230 { … … 194 234 try 195 235 { 236 // execute the code 196 237 return TclBind::getInstance().interpreter_->eval(tclcode); 197 238 }
Note: See TracChangeset
for help on using the changeset viewer.