timeouttimer.h

来自「Symbian 手机网络通信程序 sockets-vc」· C头文件 代码 · 共 89 行

H
89
字号
/* Copyright (c) 2004, Nokia. All rights reserved */


#ifndef __TIMEOUTTIMER_H__
#define __TIMEOUTTIMER_H__

// INCLUDES
#include <e32base.h>

// FORWARD DECLARATIONS
class MTimeOutNotifier;

// CLASS DECLARATION
/**
* CTimeOutTimer
*  This class will notify an object after a specified timeout.
*/
class CTimeOutTimer : public CTimer
    {
    public: // Constructors and destructors

        /**
        * NewL.
        * Two-phased constructor.
        * Creates a CTimeOutTimer object using two phase construction,
        * and returns a pointer to the created object.
        * @param aPriority Priority to use for this timer.
        * @param aTimeOutNotify Object to notify of timeout event.
        * @return A pointer to the created instance of CTimeOutTimer.
        */
        static CTimeOutTimer* NewL( const TInt aPriority,
                                    MTimeOutNotifier& aTimeOutNotify );

        /**
        * NewLC.
        * Two-phased constructor.
        * Creates a CTimeOutTimer object using two phase construction,
        * and returns a pointer to the created object.
        * @param aPriority Priority to use for this timer.
        * @param aTimeOutNotify Object to notify of timeout event.
        * @return A pointer to the created instance of CTimeOutTimer.
        */
        static CTimeOutTimer* NewLC( const TInt aPriority,
                                     MTimeOutNotifier& aTimeOutNotify );

        /**
        * ~CTimeOutTimer.
        * Destructor.
        * Destroys the object and release all memory objects.
        */
        virtual ~CTimeOutTimer();

    protected: // Functions from base classes

        /**
        * From CActive, RunL.
        * Called when operation completes.
        */
        void RunL();

    private: // Constructors and destructors

        /**
        * CTimeOutTimer.
        * C++ default constructor.
        * Performs the first phase of two phase construction.
        * @param aPriority Priority to use for this timer.
        * @param aTimeOutNotify An observer to notify.
        */
        CTimeOutTimer( const TInt aPriority,
                       MTimeOutNotifier& aTimeOutNotify );

        /**
        * ConstructL.
        * 2nd phase constructor.
        */
        void ConstructL();

    private: // Data

        /**
        * iNotify, the observer for this objects events.
        */
        MTimeOutNotifier& iNotify;
    };

#endif // __TIMEOUTTIMER_H__

// End of File

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?