Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2009, 10:48:47 PM (15 years ago)
Author:
landauf
Message:

Realized Timer doesn't have to be a template, hence merged TimerBase, Timer and StaticTimer.
Removed the object pointer from Timer for memberfunctions, use createFunctor(f, object) instead.

Location:
code/branches/core5/src/orxonox
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/controllers/AIController.cc

    r5738 r5831  
    4444        RegisterObject(AIController);
    4545
    46         this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
     46        this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&AIController::action, this)));
    4747    }
    4848
  • code/branches/core5/src/orxonox/controllers/AIController.h

    r5738 r5831  
    5050
    5151        private:
    52             Timer<AIController> actionTimer_;
     52            Timer actionTimer_;
    5353    };
    5454}
  • code/branches/core5/src/orxonox/controllers/WaypointPatrolController.cc

    r5738 r5831  
    4545        this->alertnessradius_ = 500;
    4646
    47         this->patrolTimer_.setTimer(rnd(), true, this, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy)));
     47        this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy, this)));
    4848    }
    4949
  • code/branches/core5/src/orxonox/controllers/WaypointPatrolController.h

    r5738 r5831  
    6161            int team_;
    6262            float alertnessradius_;
    63             Timer<WaypointPatrolController> patrolTimer_;
     63            Timer patrolTimer_;
    6464    };
    6565}
  • code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.cc

    r5806 r5831  
    4242        RegisterObject(TeamBaseMatch);
    4343
    44         this->scoreTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::winPoints)));
    45         this->outputTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::showPoints)));
     44        this->scoreTimer_.setTimer(10, true, createExecutor(createFunctor(&TeamBaseMatch::winPoints, this)));
     45        this->outputTimer_.setTimer(10, true, createExecutor(createFunctor(&TeamBaseMatch::showPoints, this)));
    4646
    4747        this->pointsTeam1_ = 0;
  • code/branches/core5/src/orxonox/gametypes/TeamBaseMatch.h

    r5738 r5831  
    6565
    6666            std::set<TeamBaseMatchBase*> bases_;
    67             Timer<TeamBaseMatch> scoreTimer_;
    68             Timer<TeamBaseMatch> outputTimer_;
     67            Timer scoreTimer_;
     68            Timer outputTimer_;
    6969
    7070            //points for each team
  • code/branches/core5/src/orxonox/graphics/FadingBillboard.cc

    r5738 r5831  
    103103        {
    104104            this->changedirection_ = 1;
    105             this->turnonofftimer_.setTimer(this->turnontime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
     105            this->turnonofftimer_.setTimer(this->turnontime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
    106106
    107107            if (this->isVisible())
     
    111111        {
    112112            this->changedirection_ = -1;
    113             this->turnonofftimer_.setTimer(this->turnofftime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
     113            this->turnonofftimer_.setTimer(this->turnofftime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
    114114        }
    115115    }
     
    126126            this->fadedColour_ = ColourValue::ZERO;
    127127            this->getBillboardSet().setColour(this->fadedColour_);
    128             this->turnonofftimer_.setTimer(this->postprocessingtime_, false, this, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff)));
     128            this->turnonofftimer_.setTimer(this->postprocessingtime_, false, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff, this)));
    129129        }
    130130        this->changedirection_ = 0;
  • code/branches/core5/src/orxonox/graphics/FadingBillboard.h

    r5738 r5831  
    7474            float turnofftime_;
    7575            float postprocessingtime_;
    76             Timer<FadingBillboard> turnonofftimer_;
     76            Timer turnonofftimer_;
    7777            char changedirection_;
    7878            ColourValue fadedColour_;
  • code/branches/core5/src/orxonox/graphics/ParticleSpawner.cc

    r5801 r5831  
    9696            return;
    9797
    98         this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
     98        this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this)));
    9999    }
    100100
     
    103103        this->setActive(true);
    104104        if (this->lifetime_ != 0)
    105             this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));
     105            this->timer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner, this)));
    106106    }
    107107
     
    116116
    117117            if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
    118                 this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
     118                this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner, this)));
    119119        }
    120120        else if (this->bLoop_)
    121121        {
    122             this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
     122            this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this)));
    123123        }
    124124    }
  • code/branches/core5/src/orxonox/graphics/ParticleSpawner.h

    r5791 r5831  
    8989            void destroyParticleSpawner();
    9090
    91             Timer<ParticleSpawner> timer_;
     91            Timer timer_;
    9292
    9393            bool  bSuppressStart_;
  • code/branches/core5/src/orxonox/pickup/DroppedItem.cc

    r5801 r5831  
    7676        if (this->timeToLive_ > 0)
    7777        {
    78             ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback));
    79             this->timer_.setTimer(this->timeToLive_, false, this, exec, false);
     78            this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false);
    8079        }
    8180    }
  • code/branches/core5/src/orxonox/pickup/DroppedItem.h

    r5738 r5831  
    7777        BaseItem* item_;
    7878
    79         Timer<DroppedItem> timer_;
     79        Timer timer_;
    8080    };
    8181}
  • code/branches/core5/src/orxonox/pickup/ModifierPickup.cc

    r5801 r5831  
    101101            if (this->duration_ > 0.0f)
    102102            {
    103                 ExecutorMember<ModifierPickup>* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback));
     103                Executor* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback, this));
    104104                executor->setDefaultValues(pawn);
    105                 this->timer_.setTimer(this->duration_, false, this, executor);
     105                this->timer_.setTimer(this->duration_, false, executor);
    106106            }
    107107
  • code/branches/core5/src/orxonox/pickup/ModifierPickup.h

    r5738 r5831  
    129129
    130130        void timerCallback(Pawn* pawn);     //!< Method called when the timer runs out.
     131       
    131132    private:
    132133        float getAdditiveModifier(ModifierType::Value type) const;               //!< Get the additive modifier for a given ModifierType.
     
    138139        std::map<ModifierType::Value, float> multiplicativeModifiers_;           //!< Map of multiplicative modifiers, indexed by ModifierType.
    139140
    140         float duration_;                                                        //!< Duration of this pickup's effect (0 for unlimited).
    141         Timer<ModifierPickup> timer_;                                           //!< Timer used if the pickup's effect has a time limit.
     141        float duration_;                                                         //!< Duration of this pickup's effect (0 for unlimited).
     142        Timer timer_;                                                            //!< Timer used if the pickup's effect has a time limit.
    142143    };
    143144}
  • code/branches/core5/src/orxonox/pickup/PickupSpawner.cc

    r5801 r5831  
    166166                    if (this->respawnTime_ > 0.0f)
    167167                    {
    168                         ExecutorMember<PickupSpawner>* executor = createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback));
    169                         this->respawnTimer_.setTimer(this->respawnTime_, false, this, executor);
     168                        this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
    170169
    171170                        this->setActive(false);
  • code/branches/core5/src/orxonox/pickup/PickupSpawner.h

    r5738 r5831  
    114114
    115115        float respawnTime_;                     //!< Time after which this gets re-actived.
    116         Timer<PickupSpawner> respawnTimer_;     //!< Timer used for re-activating.
     116        Timer respawnTimer_;                    //!< Timer used for re-activating.
    117117    };
    118118}
  • code/branches/core5/src/orxonox/weaponsystem/Munition.cc

    r5738 r5831  
    461461        if (bUseReloadTime && (munition->reloadTime_ > 0 || munition->bStackMunition_))
    462462        {
    463             ExecutorMember<Magazine>* executor = createExecutor(createFunctor(&Magazine::loaded));
     463            Executor* executor = createExecutor(createFunctor(&Magazine::loaded, this));
    464464            executor->setDefaultValues(munition);
    465465
    466             this->loadTimer_.setTimer(munition->reloadTime_, false, this, executor);
     466            this->loadTimer_.setTimer(munition->reloadTime_, false, executor);
    467467        }
    468468        else
  • code/branches/core5/src/orxonox/weaponsystem/Munition.h

    r5738 r5831  
    4747
    4848                unsigned int munition_;
    49                 Timer<Magazine> loadTimer_;
     49                Timer loadTimer_;
    5050                bool bLoaded_;
    5151
  • code/branches/core5/src/orxonox/weaponsystem/Weapon.cc

    r5801 r5831  
    5050        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
    5151
    52         this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&Weapon::reloaded)));
     52        this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&Weapon::reloaded, this)));
    5353        this->reloadTimer_.stopTimer();
    5454    }
  • code/branches/core5/src/orxonox/weaponsystem/Weapon.h

    r5738 r5831  
    7171            std::multimap<unsigned int, WeaponMode*> weaponmodes_;
    7272
    73             Timer<Weapon> reloadTimer_;
     73            Timer reloadTimer_;
    7474            bool bReloading_;
    7575            unsigned int reloadingWeaponmode_;
  • code/branches/core5/src/orxonox/weaponsystem/WeaponMode.cc

    r5738 r5831  
    5757        this->bParallelReload_ = true;
    5858
    59         this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&WeaponMode::reloaded)));
     59        this->reloadTimer_.setTimer(0.0f, false, createExecutor(createFunctor(&WeaponMode::reloaded, this)));
    6060        this->reloadTimer_.stopTimer();
    6161
  • code/branches/core5/src/orxonox/weaponsystem/WeaponMode.h

    r5814 r5831  
    150150            std::string munitionname_;
    151151
    152             Timer<WeaponMode> reloadTimer_;
     152            Timer reloadTimer_;
    153153            bool bReloading_;
    154154    };
  • code/branches/core5/src/orxonox/worldentities/BigExplosion.cc

    r5801 r5831  
    9090            this->setVelocity(velocity);
    9191
    92             this->destroyTimer_.setTimer(rnd(2, 4), false, this, createExecutor(createFunctor(&BigExplosion::stop)));
     92            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
    9393        }
    9494        this->registerVariables();
     
    329329        {
    330330            this->bStop_ = true;
    331             this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&BigExplosion::destroy)));
     331            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&BigExplosion::destroy, this)));
    332332        }
    333333    }
  • code/branches/core5/src/orxonox/worldentities/BigExplosion.h

    r5791 r5831  
    9898
    9999            LODParticle::Value    LOD_;
    100             Timer<BigExplosion>   destroyTimer_;
     100            Timer                 destroyTimer_;
    101101    };
    102102}
  • code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc

    r5801 r5831  
    7979            this->setVelocity(velocity);
    8080
    81             this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop)));
     81            this->destroyTimer_.setTimer(rnd(1, 2), false, createExecutor(createFunctor(&ExplosionChunk::stop, this)));
    8282        }
    8383
     
    132132        {
    133133            this->bStop_ = true;
    134             this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));
     134            this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionChunk::destroy, this)));
    135135        }
    136136    }
  • code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h

    r5791 r5831  
    6060            ParticleInterface*    smoke_;
    6161            LODParticle::Value    LOD_;
    62             Timer<ExplosionChunk> destroyTimer_;
     62            Timer                destroyTimer_;
    6363    };
    6464}
  • code/branches/core5/src/orxonox/worldentities/MovableEntity.cc

    r5801 r5831  
    9898    void MovableEntity::clientConnected(unsigned int clientID)
    9999    {
    100         this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)));
     100        this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, createExecutor(createFunctor(&MovableEntity::resynchronize, this)));
    101101    }
    102102
     
    110110        {
    111111            // Resynchronise every few seconds because we only work with velocities (no positions)
    112             continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
    113                 true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);
     112            continuousResynchroTimer_ = new Timer(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
     113                true, createExecutor(createFunctor(&MovableEntity::resynchronize, this)), false);
    114114        }
    115115
  • code/branches/core5/src/orxonox/worldentities/MovableEntity.h

    r5738 r5831  
    9696            Quaternion overwrite_orientation_;
    9797
    98             Timer<MovableEntity> resynchronizeTimer_;
    99             Timer<MovableEntity>* continuousResynchroTimer_;
     98            Timer resynchronizeTimer_;
     99            Timer* continuousResynchroTimer_;
    100100
    101101            Pawn* owner_;
Note: See TracChangeset for help on using the changeset viewer.