Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 15, 2006, 3:39:51 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: removed all the base of Executor.
Now it is purely Templated :), since it is not needed otherwise

@note: The Explicit Specializations may not be Templatet and defined in the header, that is why still there exist some cc-file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/executor/executor.cc

    r9732 r9733  
    1818#include "executor.h"
    1919
    20 
    2120template<> MT_Type ExecutorParamType<bool>() { return MT_BOOL; };
    2221template<> MT_Type ExecutorParamType<int>() { return MT_INT; };
     
    2524template<> MT_Type ExecutorParamType<char>() { return MT_CHAR; };
    2625template<> MT_Type ExecutorParamType<const std::string&>() { return MT_STRING; };
    27 
    28 
    29 
    30 /**
    31  * @brief constructs and registers a new Command
    32  * @param commandName the name of the Command
    33  * @param className the name of the class to apply this command to
    34  * @param paramCount the count of parameters this command takes
    35  */
    36 ExecutorBase::ExecutorBase(bool hasRetVal,
    37                            const MultiType& param0,
    38                            const MultiType& param1,
    39                            const MultiType& param2,
    40                            const MultiType& param3,
    41                            const MultiType& param4,
    42                            const MultiType& param5,
    43                            const MultiType& param6)
    44   : bRetVal(hasRetVal)
    45 {
    46   // What Parameters have we got
    47   this->defaultValue[0] = param0;
    48   this->defaultValue[1] = param1;
    49   this->defaultValue[2] = param2;
    50   this->defaultValue[3] = param3;
    51   this->defaultValue[4] = param4;
    52   this->defaultValue[5] = param5;
    53   this->defaultValue[6] = param6;
    54 
    55   this->paramCount = 0;
    56   for (unsigned int i = 0; i <= EXECUTOR_MAX_ARGUMENTS; i++)
    57   {
    58     if (this->defaultValue[i] == MT_NULL || i == EXECUTOR_MAX_ARGUMENTS)
    59     {
    60       this->paramCount = i;
    61       break;
    62     }
    63     else
    64       this->defaultValue[i].storeString();
    65   }
    66 }
    67 
    68 /**
    69  * clones this element into executor.
    70  * @param executor the Executor to clone
    71  */
    72 void ExecutorBase::cloning(ExecutorBase* executor) const
    73 {
    74   executor->functorType  = this->functorType;
    75   executor->paramCount   = this->paramCount;
    76   for (unsigned int i = 0; i < this->paramCount; i++)
    77     executor->defaultValue[i] =  this->defaultValue[i];
    78 }
    79 
    80 /**
    81  * @brief set the default values of the executor
    82  * @param value0 the first default value
    83  * @param value1 the second default value
    84  * @param value2 the third default value
    85  * @param value3 the fourth default value
    86  * @param value4 the fifth default value
    87  * @returns itself
    88  */
    89 void ExecutorBase::defaultValues(const MultiType& value0,
    90                                   const MultiType& value1,
    91                                   const MultiType& value2,
    92                                   const MultiType& value3,
    93                                   const MultiType& value4,
    94                                   const MultiType& value5,
    95                                   const MultiType& value6)
    96 {
    97   const MultiType* value[5];
    98   value[0] = &value0;
    99   value[1] = &value1;
    100   value[2] = &value2;
    101   value[3] = &value3;
    102   value[4] = &value4;
    103   value[5] = &value5;
    104   value[6] = &value6;
    105   for (unsigned int i = 0; i < this->paramCount; i++)
    106   {
    107     if (*value[i] != MT_NULL)
    108     {
    109       this->defaultValue[i].setValueOf(*value[i]);
    110       this->defaultValue[i].storeString();
    111     }
    112   }
    113 }
    114 
    115 /**
    116  * @brief prints out nice information about the Executor
    117  */
    118 void ExecutorBase::debug()
    119 {
    120 }
Note: See TracChangeset for help on using the changeset viewer.