Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7419 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Apr 28, 2006, 11:47:44 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Test in Execute (first implementation)

Location:
trunk/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r7418 r7419  
    283283    SubString inputSplits(executionString, SubString::WhiteSpacesWithComma);
    284284
    285 
    286285    // if we do not have any input return
    287286    if (inputSplits.empty())
    288287      return false;
     288
     289    unsigned int paramBegin;
     290    const ShellCommand* sc;
     291    std::vector<BaseObject*> boList;
     292    sc = getCommandFromInput(inputSplits, paramBegin, &boList);
     293    if (sc != NULL)
     294    {
     295      PRINT(0)("Command %s on ", sc->getName());
     296      for(std::vector<BaseObject*>::const_iterator bo = boList.begin(); bo != boList.end(); ++bo)
     297        PRINT(0)("%s::%s\n", (*bo)->getClassName(), (*bo)->getName());
     298    }
    289299
    290300    // if we only have one input (!MUST BE AN ALIAS)
  • trunk/src/lib/util/executor/executor.h

    r7407 r7419  
    5252    // EXECUTE
    5353    /** executes a Command @param object the object to apply this to @param parameters the parameters the command takes */
    54     virtual void operator()(BaseObject* object, const std::string& parameters = "") = 0;
     54    virtual void operator()(BaseObject* object, const std::string& parameters = "") const = 0;
    5555    /** executes a Command @param object the object to apply this to @param parameters the parameters the command takes @brief here for your convenience*/
    56     void execute (BaseObject* object, const std::string& parameters = "") { (*this)(object, parameters); };
     56    void execute (BaseObject* object, const std::string& parameters = "") const { (*this)(object, parameters); };
    5757
    5858    // RETRIEVE INFORMATION
     
    256256    } fp;
    257257
    258     virtual void operator()(BaseObject* object, const std::string& parameters = "")
     258    virtual void operator()(BaseObject* object, const std::string& parameters = "") const
    259259    {
    260260      SubString sub;
     
    319319
    320320
    321     virtual void operator()(BaseObject* object, const std::string& parameters = "")
     321    virtual void operator()(BaseObject* object, const std::string& parameters = "") const
    322322    {
    323323      SubString sub;
  • trunk/src/lib/util/executor/executor_specials.h

    r7331 r7419  
    6060     * @param loadString ignored in this case
    6161     */
    62     virtual void operator()(BaseObject* object, const std::string& = "")
     62    virtual void operator()(BaseObject* object, const std::string& = "") const
    6363    {
    6464      if (object != NULL && this->element != NULL)
Note: See TracChangeset for help on using the changeset viewer.