Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 14, 2006, 5:24:31 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: new Executor construct, that is much more typesafe, faster, and easier to extend…

Also changed the LoadParam process, and adapted ScriptEngine calls

Then at the end, some missing headers appeared, and appended them to all the cc-files again.

File:
1 edited

Legend:

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

    r9406 r9727  
    9494///////////
    9595//! @brief ExecutorClass, that can execute Functions without any parameters.
    96 template<class T> class __EXECUTOR_FUNCTIONAL_NAME(0) : public Executor
     96template<class T> class __EXECUTOR_FUNCTIONAL_NAME(0) : public Executor<const SubString>
    9797{
    9898private:
     
    106106   */
    107107  __EXECUTOR_FUNCTIONAL_NAME(0) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST )
    108       : Executor()
     108      : Executor<const SubString>(false)
    109109  {
    110110    this->functorType = Executor_Objective;
     
    132132   * @returns a new Executor that's a copy of this one.
    133133   */
    134   virtual Executor* clone() const
     134  virtual Executor<const SubString>* clone() const
    135135  {
    136136    return new __EXECUTOR_FUNCTIONAL_NAME(0)<T>(this->functionPointer);
     
    144144///////////
    145145//! @brief ExecutorClass, that can execute Functions with one parameter.
    146 template<class T, typename type0> class __EXECUTOR_FUNCTIONAL_NAME(1) : public Executor
     146template<class T, typename type0> class __EXECUTOR_FUNCTIONAL_NAME(1) : public Executor<const SubString>
    147147{
    148148private:
     
    156156   */
    157157  __EXECUTOR_FUNCTIONAL_NAME(1) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0) __EXECUTOR_FUNCTIONAL_CONST)
    158       : Executor(ExecutorParamType<type0>())
     158      : Executor<const SubString>(false, ExecutorParamType<type0>())
    159159  {
    160160    this->functorType = Executor_Objective;
     
    186186   * @returns a new Executor that's a copy of this one.
    187187   */
    188   virtual Executor* clone() const
     188  virtual Executor<const SubString>* clone() const
    189189  {
    190190    return  new __EXECUTOR_FUNCTIONAL_NAME(1)<T, type0>(this->functionPointer);
     
    196196///////////
    197197//! @brief ExecutorClass, that can execute Functions with two parameters.
    198 template<class T, typename type0, typename type1> class __EXECUTOR_FUNCTIONAL_NAME(2) : public Executor
     198template<class T, typename type0, typename type1> class __EXECUTOR_FUNCTIONAL_NAME(2) : public Executor<const SubString>
    199199{
    200200private:
     
    208208   */
    209209  __EXECUTOR_FUNCTIONAL_NAME(2) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1) __EXECUTOR_FUNCTIONAL_CONST)
    210       : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>())
     210      : Executor<const SubString>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>())
    211211  {
    212212    this->functorType = Executor_Objective;
     
    239239   * @returns a new Executor that's a copy of this one.
    240240   */
    241   virtual Executor* clone() const
     241  virtual Executor<const SubString>* clone() const
    242242  {
    243243    return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, type0, type1>(this->functionPointer);
     
    250250///////////
    251251//! @brief ExecutorClass, that can execute Functions with three parameters.
    252 template<class T, typename type0, typename type1, typename type2> class __EXECUTOR_FUNCTIONAL_NAME(3) : public Executor
     252template<class T, typename type0, typename type1, typename type2> class __EXECUTOR_FUNCTIONAL_NAME(3) : public Executor<const SubString>
    253253{
    254254private:
     
    262262   */
    263263  __EXECUTOR_FUNCTIONAL_NAME(3) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2) __EXECUTOR_FUNCTIONAL_CONST)
    264       : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>())
     264      : Executor<const SubString>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>())
    265265  {
    266266    this->functorType = Executor_Objective;
     
    295295   * @returns a new Executor that's a copy of this one.
    296296   */
    297   virtual Executor* clone() const
     297  virtual Executor<const SubString>* clone() const
    298298  {
    299299    return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, type0, type1, type2>(this->functionPointer);
     
    307307///////////
    308308//! @brief ExecutorClass, that can execute Functions with four parameters.
    309 template<class T, typename type0, typename type1, typename type2, typename type3> class __EXECUTOR_FUNCTIONAL_NAME(4) : public Executor
     309template<class T, typename type0, typename type1, typename type2, typename type3> class __EXECUTOR_FUNCTIONAL_NAME(4) : public Executor<const SubString>
    310310{
    311311private:
     
    319319   */
    320320  __EXECUTOR_FUNCTIONAL_NAME(4) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3) __EXECUTOR_FUNCTIONAL_CONST)
    321       : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), ExecutorParamType<type3>())
     321      : Executor<const SubString>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), ExecutorParamType<type3>())
    322322  {
    323323    this->functorType = Executor_Objective;
     
    354354   * @returns a new Executor that's a copy of this one.
    355355   */
    356   virtual Executor* clone() const
     356  virtual Executor<const SubString>* clone() const
    357357  {
    358358    return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, type0, type1, type2, type3>(this->functionPointer);
     
    366366///////////
    367367//! @brief ExecutorClass, that can execute Functions with five parameters.
    368 template<class T, typename type0, typename type1, typename type2, typename type3, typename type4> class __EXECUTOR_FUNCTIONAL_NAME(5) : public Executor
     368template<class T, typename type0, typename type1, typename type2, typename type3, typename type4> class __EXECUTOR_FUNCTIONAL_NAME(5) : public Executor<const SubString>
    369369{
    370370private:
     
    378378   */
    379379  __EXECUTOR_FUNCTIONAL_NAME(5) (void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0, type1, type2, type3, type4) __EXECUTOR_FUNCTIONAL_CONST)
    380       : Executor(ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), ExecutorParamType<type3>(), ExecutorParamType<type4>())
     380      : Executor<const SubString>(false, ExecutorParamType<type0>(), ExecutorParamType<type1>(), ExecutorParamType<type2>(), ExecutorParamType<type3>(), ExecutorParamType<type4>())
    381381  {
    382382    this->functorType = Executor_Objective;
     
    415415   * @returns a new Executor that's a copy of this one.
    416416   */
    417   virtual Executor* clone() const
     417  virtual Executor<const SubString>* clone() const
    418418  {
    419419    return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, type0, type1, type2, type3, type4>(this->functionPointer);
     
    427427 */
    428428#define EXECUTOR_FUNCTIONAL_CREATOR0() \
    429 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
     429template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)() __EXECUTOR_FUNCTIONAL_CONST) \
    430430{ \
    431431  return new __EXECUTOR_FUNCTIONAL_NAME(0)<T>(functionPointer); \
     
    437437 */
    438438#define EXECUTOR_FUNCTIONAL_CREATOR1(type0) \
    439 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     439template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    440440{ \
    441441  return new __EXECUTOR_FUNCTIONAL_NAME(1)<T, type0##_TYPE>(functionPointer); \
     
    448448 */
    449449#define EXECUTOR_FUNCTIONAL_CREATOR2(type0, type1) \
    450 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     450template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    451451{ \
    452452  return new __EXECUTOR_FUNCTIONAL_NAME(2)<T, type0##_TYPE, type1##_TYPE>(functionPointer); \
     
    460460 */
    461461#define EXECUTOR_FUNCTIONAL_CREATOR3(type0, type1, type2) \
    462 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     462template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    463463{ \
    464464  return new __EXECUTOR_FUNCTIONAL_NAME(3)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE>(functionPointer); \
     
    473473 */
    474474#define EXECUTOR_FUNCTIONAL_CREATOR4(type0, type1, type2, type3) \
    475 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     475template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    476476{ \
    477477  return new __EXECUTOR_FUNCTIONAL_NAME(4)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE>(functionPointer); \
     
    487487 */
    488488#define EXECUTOR_FUNCTIONAL_CREATOR5(type0, type1, type2, type3, type4) \
    489 template<class T> Executor* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
     489template<class T> Executor<const SubString>* createExecutor(void (__EXECUTOR_FUNCTIONAL_FUNCTION_POINTER)(type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE) __EXECUTOR_FUNCTIONAL_CONST) \
    490490{ \
    491491    return new __EXECUTOR_FUNCTIONAL_NAME(5)<T, type0##_TYPE, type1##_TYPE, type2##_TYPE, type3##_TYPE, type4##_TYPE>(functionPointer); \
Note: See TracChangeset for help on using the changeset viewer.