Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7411 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Apr 27, 2006, 11:23:55 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some command-stuff

Location:
trunk/src/lib/shell
Files:
4 edited

Legend:

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

    r7409 r7411  
    114114    if (likely(checkClass != NULL))
    115115    {
    116       printf("TEST\n");
    117116      std::vector<ShellCommand*>::const_iterator elem;
    118117      for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++)
     
    123122        }
    124123    }
    125    return NULL;
     124    return NULL;
    126125  }
    127126
     
    153152    const std::list<BaseObject*>* objectList = NULL;   //< the list of Objects stored in classID
    154153    BaseObject* objectPointer = NULL;            //< a pointer to th Object to Execute the command on
    155     bool emptyComplete = false;                  //< if the completion input is empty string. e.g ""
     154    //    bool emptyComplete = false;                  //< if the completion input is empty string. e.g ""
    156155    //  long completeType = SHELLC_NONE;           //< the Type we'd like to complete.
    157156
     
    241240  }
    242241
     242
    243243  /**
    244244   * @brief lets a command be described
  • trunk/src/lib/shell/shell_command.h

    r7409 r7411  
    6262    friend class ShellCommandClass;
    6363  public:
     64    //! an enumerator for different types the Shell parses.
     65    typedef enum {
     66      NullRecognition         = 0,
     67      ClassRecognition              = 1,
     68      ObjectRecognition             = 2,
     69      FunctionRecognition           = 4,
     70      AliasRecognition              = 8,
     71      ParameterRecognition          = 16,
     72    } RecognitionType;
     73
    6474    static bool execute (const std::string& executionString);
    6575
  • trunk/src/lib/shell/shell_command_class.cc

    r7408 r7411  
    114114    std::vector<ShellCommandClass*>::const_iterator classIT;
    115115    for (classIT = ShellCommandClass::commandClassList.begin(); classIT != ShellCommandClass::commandClassList.end(); classIT++)
    116     {
    117116      if (className == (*classIT)->className)
    118       {
    119         if ((*classIT)->classID == CL_NULL)
    120           (*classIT)->classID = ClassList::StringToID(className);
    121 
    122117        return (*classIT);
    123       }
    124     }
    125118    return NULL;
    126119  }
     
    131124   * @returns the CommandClass if found, NULL otherwise
    132125   */
    133 /*  bool ShellCommandClass::exists(const std::string& className)
     126  bool ShellCommandClass::exists(const std::string& className)
    134127  {
     128    return (ShellCommandClass::getCommandClass(className) != NULL);
     129  }
    135130
    136   }*/
     131  ClassID ShellCommandClass::getClassID()
     132  {
     133    if (this->classID == CL_NULL)
     134      this->classID = ClassList::StringToID(this->className);
     135    return this->classID;
     136  }
     137
    137138
    138139  /**
  • trunk/src/lib/shell/shell_command_class.h

    r7408 r7411  
    3030    static void unregisterAllCommands();
    3131    static const ShellCommandClass* getCommandClass(const std::string& className);
     32    ClassID getClassID();
    3233    static bool exists(const std::string& className);
    3334
     
    4546  private:
    4647    const std::string                      className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
    47     long                                   classID;                   //!< The classID of this Class
     48    ClassID                                classID;                   //!< The classID of this Class
    4849    std::vector<ShellCommand*>             commandList;               //!< A list of Commands from this Class
    4950
Note: See TracChangeset for help on using the changeset viewer.