Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 11, 2010, 12:34:00 AM (14 years ago)
Author:
landauf
Message:

merged doc branch back to trunk

Location:
code/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/tools/ResourceCollection.cc

    r5781 r7401  
    5252    }
    5353
    54     void ResourceCollection::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     54    void ResourceCollection::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5555    {
    56         XMLPortParam(ResourceCollection, "resourceGroup", setResourceGroup, getResourceGroup, xmlElement, mode);
    57         XMLPortObject(ResourceCollection, ResourceLocation, "", addResourceLocation, getResourceLocation, xmlElement, mode);
     56        XMLPortParam(ResourceCollection, "resourceGroup", setResourceGroup, getResourceGroup, xmlelement, mode);
     57        XMLPortObject(ResourceCollection, ResourceLocation, "", addResourceLocation, getResourceLocation, xmlelement, mode);
    5858    }
    5959
  • code/trunk/src/libraries/tools/ResourceCollection.h

    r6105 r7401  
    4444        virtual ~ResourceCollection();
    4545
    46         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     46        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4747
    4848        void setResourceGroup(const std::string& resourceGroup);
  • code/trunk/src/libraries/tools/ResourceLocation.cc

    r7174 r7401  
    5656    }
    5757
    58     void ResourceLocation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     58    void ResourceLocation::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5959    {
    60         XMLPortParam(ResourceLocation, "path",        setPath,        getPath,        xmlElement, mode);
    61         XMLPortParam(ResourceLocation, "archiveType", setArchiveType, getArchiveType, xmlElement, mode);
    62         XMLPortParam(ResourceLocation, "recursive",   setRecursive,   getRecursive,   xmlElement, mode);
     60        XMLPortParam(ResourceLocation, "path",        setPath,        getPath,        xmlelement, mode);
     61        XMLPortParam(ResourceLocation, "archiveType", setArchiveType, getArchiveType, xmlelement, mode);
     62        XMLPortParam(ResourceLocation, "recursive",   setRecursive,   getRecursive,   xmlelement, mode);
    6363        if (path_.empty())
    6464            ThrowException(AbortLoading, "ResourceLocation: No path given.");
  • code/trunk/src/libraries/tools/ResourceLocation.h

    r5781 r7401  
    4646        virtual ~ResourceLocation();
    4747
    48         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     48        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4949
    5050        void setPath(const std::string& path) { path_ = path; }
  • code/trunk/src/libraries/tools/Timer.cc

    r7284 r7401  
    2727 */
    2828
     29/**
     30    @file
     31    @brief Implementation of the Timer class.
     32*/
     33
    2934#include "Timer.h"
    3035
     
    4550
    4651    /**
    47         @brief Calls a console command after 'delay' seconds.
     52        @brief Console-command: Calls another console command after @a delay seconds.
    4853        @param delay The delay in seconds
    4954        @param command The console command
     
    6065
    6166    /**
    62         @brief Executes the command.
    63         @param timer The timer to destroy after the command-execution
     67        @brief Helper function for delay(), executes the command and destroys the timer.
     68        @param timer The timer which called this function.
    6469        @param command The command to execute
    6570    */
     
    7277
    7378    /**
    74         @brief Kills all delayed commands.
     79        @brief Console-command: Kills all scheduled commands that were delayed using delay().
    7580    */
    7681    void killdelays()
     
    9297
    9398    /**
    94         @brief Constructor: Initializes the Timer with given values.
    95         @param interval The timer-interval in seconds
    96         @param bLoop If true, the function gets called every 'interval' seconds
    97         @param exeuctor A executor of the function to call
     99        @brief Constructor: Initializes and starts the timer, which will call an executor after some time.
     100        @param interval         The timer-interval in seconds
     101        @param bLoop            If true, the executor gets called every @a interval seconds
     102        @param executor         The executor that will be called
     103        @param bKillAfterCall   If true, the timer will be deleted after the executor was called
    98104    */
    99105    Timer::Timer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall)
     
    120126
    121127    /**
    122         @brief Executes the executor.
     128        @brief Calls the executor and destroys the timer if requested.
    123129    */
    124130    void Timer::run()
  • code/trunk/src/libraries/tools/Timer.h

    r7284 r7401  
    2727 */
    2828
    29 /*!
     29/**
     30    @defgroup Timer Timer
     31    @ingroup Tools
     32*/
     33
     34/**
    3035    @file
    31     @brief Definition and Implementation of the Timer class.
     36    @ingroup Timer
     37    @brief Declaration of the Timer class, used to call functions after a given time-interval.
    3238
    33     The Timer is a callback-object, calling a given function after a given time-interval.
     39    @anchor TimerExample
    3440
    35     Usage:
     41    Timer is a helper class that executes a function after a given amount of time.
     42
     43    Usage: <br>
    3644    header.h:
    37         class ClassName
    38         {
    39             public:
    40                 ClassName();
    41                 void functionName();
    42                 Timer myTimer;
    43         };
     45    @code
     46    class MyClass
     47    {
     48        public:
     49            MyClass();
     50            void functionName();
     51
     52        private:
     53            Timer myTimer;
     54    };
     55    @endcode
    4456
    4557    source.cc:
    46         #include "core/command/Executor.h"
     58    @code
     59    #include "core/command/Executor.h"
    4760
    48         ClassName::ClassName()
    49         {
    50             myTimer.setTimer(interval_in_seconds, bLoop, createExecutor(createFunctor(&ClassName::functionName, this)));
    51         }
     61    MyClass::MyClass()
     62    {
     63        myTimer.setTimer(3, false, createExecutor(createFunctor(&ClassName::myFunction, this)));
     64    }
    5265
    53         void ClassName::functionName()
    54         {
    55             whateveryouwant();
    56             something(else);
    57         }
     66    void MyClass::myFunction()
     67    {
     68        COUT(0) << "Hello World" << std::endl;
     69    }
     70    @endcode
     71
     72    The code in this example prints "Hello World" to the console, 3 seconds after creating
     73    an instance of MyClass.
    5874*/
    5975
     
    7389    void executeDelayedCommand(Timer* timer, const std::string& command);
    7490
    75     //! The Timer is a callback-object, calling a given function after a given time-interval.
     91    /**
     92        @brief Timer is a helper class that executes a function after a given amount of time.
     93
     94        @see See @ref TimerExample "Timer.h" for an example.
     95    */
    7696    class _ToolsExport Timer : public TimeFactorListener
    7797    {
     
    82102
    83103            /**
    84                 @brief Initializes the Timer with given values.
    85                 @param interval The timer-interval in seconds
    86                 @param bLoop If true, the function gets called every 'interval' seconds
    87                 @param object The object owning the timer and the function
    88                 @param executor A executor of the function to call
     104                @brief Initializes and starts the timer, which will call an executor after some time.
     105                @param interval         The timer-interval in seconds
     106                @param bLoop            If true, the executor gets called every @a interval seconds
     107                @param executor         The executor that will be called
     108                @param bKillAfterCall   If true, the timer will be deleted after the executor was called
    89109            */
    90110            void setTimer(float interval, bool bLoop, const ExecutorPtr& executor, bool bKillAfterCall = false)
     
    101121            void run();
    102122
    103             /** @brief Starts the Timer: Function-call after 'interval' seconds. */
     123            /// Re-starts the Timer: The executor will be called after @a interval seconds.
    104124            inline void startTimer()
    105125                { this->bActive_ = true; this->time_ = this->interval_; }
    106             /** @brief Stops the Timer. */
     126            /// Stops the Timer.
    107127            inline void stopTimer()
    108128                { this->bActive_ = false; this->time_ = this->interval_; }
    109             /** @brief Pauses the Timer - it will continue with the actual state if you unpause it. */
     129            /// Pauses the Timer - it will continue with the actual state if you call unpauseTimer().
    110130            inline void pauseTimer()
    111131                { this->bActive_ = false; }
    112             /** @brief Unpauses the Timer - continues with the given state. */
     132            /// Unpauses the Timer - continues with the given state.
    113133            inline void unpauseTimer()
    114134                { this->bActive_ = true; }
    115             /** @brief Returns true if the Timer is active (= not stoped, not paused). @return True = Time is active */
     135            /// Returns true if the Timer is active (neither stoped nor paused).
    116136            inline bool isActive() const
    117137                { return this->bActive_; }
    118             /** @brief Returns the remaining time until the Timer calls the function. @return The remaining time */
     138            /// Returns the remaining time until the Timer calls the executor.
    119139            inline float getRemainingTime() const
    120140                { return static_cast<float>(this->time_ / 1000000.0f); }
    121             /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */
     141            /// Increases the remaining time of the Timer by the given amount of time (in seconds).
    122142            inline void addTime(float time)
    123143                { if (time > 0.0f) this->time_ += static_cast<long long>(time * 1000000.0f); }
    124             /** @brief Decreases the remaining time of the Timer. @param time The amount of time to remove */
     144            /// Decreases the remaining time of the Timer by the given amount of time (in seconds)
    125145            inline void removeTime(float time)
    126146                { if (time > 0.0f) this->time_ -= static_cast<long long>(time * 1000000.0f); }
    127             /** @brief Sets the interval of the Timer. @param interval The interval */
     147            /// Changes the calling interval.
    128148            inline void setInterval(float interval)
    129149                { this->interval_ = static_cast<long long>(interval * 1000000.0f); }
    130             /** @brief Sets bLoop to a given value. @param bLoop True = loop */
     150            /// Defines if the timer call the executor every @a interval seconds or only once.
    131151            inline void setLoop(bool bLoop)
    132152                { this->bLoop_ = bLoop; }
     
    137157            void init();
    138158
    139             ExecutorPtr executor_;  //!< The executor of the function that should be called when the time expires
     159            ExecutorPtr executor_;  //!< The executor of the function that will be called when the time expires
    140160
    141161            long long interval_;    //!< The time-interval in micro seconds
    142             bool bLoop_;            //!< If true, the function gets called every 'interval' seconds
    143             bool bActive_;          //!< If true, the Timer ticks and calls the function if the time's up
    144             bool bKillAfterCall_;   //!< If true the timer gets deleted after it called the function
     162            bool bLoop_;            //!< If true, the executor gets called every @a interval seconds
     163            bool bActive_;          //!< If true, the Timer ticks and calls the executor if the time's up
     164            bool bKillAfterCall_;   //!< If true the timer gets deleted after it expired and called the executor
    145165
    146             long long time_;        //!< Internal variable, counting the time till the next function-call
     166            long long time_;        //!< Internal variable, counting the time untill the next executor-call
    147167    };
    148168}
Note: See TracChangeset for help on using the changeset viewer.