Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7331 in orxonox.OLD for trunk/src/lib/util/executor/executor.h


Ignore:
Timestamp:
Apr 18, 2006, 4:48:37 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: small improved functoid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor.h

    r7300 r7331  
    3434 *  Default Values
    3535 *  Functions with up to 5 parameters (more seems useless)
    36  *  Functions with many types (see functor_list.h)
     36 *  Functions with many types (@see functor_list.h)
    3737 */
    3838class Executor: public BaseObject
     
    4343    virtual Executor* clone () const = 0;
    4444
     45    // SETTING up the EXECUTOR
    4546    Executor* defaultValues(const MultiType& value0 = MT_NULL, const MultiType& value1 = MT_NULL,
    4647                            const MultiType& value2 = MT_NULL, const MultiType& value3 = MT_NULL,
    4748                            const MultiType& value4 = MT_NULL);
    4849
     50    // EXECUTE
    4951    /** executes a Command @param object the object to apply this to @param parameters the parameters the command takes */
    50     virtual void execute (BaseObject* object, const std::string& parameters = "") = 0;
    51 
     52    virtual void operator()(BaseObject* object, const std::string& parameters = "") = 0;
     53    /** executes a Command @param object the object to apply this to @param parameters the parameters the command takes @brief here for your convenience*/
     54    void execute (BaseObject* object, const std::string& parameters = "") { (*this)(object, parameters); };
     55
     56    // RETRIEVE INFORMATION
    5257    /** @returns the Type of this Function (either static or objective) */
    5358    inline long getType() const { return this->functorType; };
     
    6570
    6671  protected:
    67     long                        functorType;      //!< The type of Function we've got (either static or objective).
     72    short                       functorType;      //!< The type of Function we've got (either static or objective).
    6873    unsigned int                paramCount;       //!< the count of parameters.
    6974    MultiType                   defaultValue[5];  //!< Default Values.
     
    7277///////////////////////////////////////////////////
    7378///////////////////////////////////////////////////
    74 
    75 /////////////////////////////////
    76 // MACRO DEFINITION EXTENSIONS //
    77 /////////////////////////////////
    78 //! where to chek for default BOOL values
    79 #define   l_BOOL_DEFGRAB(i)         this->defaultValue[i].getBool()
    80 //! where to chek for default INT values
    81 #define   l_INT_DEFGRAB(i)          this->defaultValue[i].getInt()
    82 //! where to chek for default UINT values
    83 #define   l_UINT_DEFGRAB(i)         (unsigned int)this->defaultValue[i].getInt()
    84 //! where to chek for default LONG values
    85 #define   l_LONG_DEFGRAB(i)         (long)this->defaultValue[i].getInt()
    86 //! where to chek for default FLOAT values
    87 #define   l_FLOAT_DEFGRAB(i)        this->defaultValue[i].getFloat()
    88 //! where to chek for default STRING values
    89 #define   l_STRING_DEFGRAB(i)       this->defaultValue[i].getString()
    90 //! where to chek for default CSTRING values
    91 #define   l_CSTRING_DEFGRAB(i)      this->defaultValue[i].getCString()
    9279
    9380//////////////////////////
     
    267254    } fp;
    268255
    269     virtual void execute (BaseObject* object, const std::string& parameters = "")
     256    virtual void operator()(BaseObject* object, const std::string& parameters = "")
    270257    {
    271258      SubString sub;
     
    330317
    331318
    332     virtual void execute (BaseObject* object, const std::string& parameters = "")
     319    virtual void operator()(BaseObject* object, const std::string& parameters = "")
    333320    {
    334321      SubString sub;
Note: See TracChangeset for help on using the changeset viewer.