cbsref/csyrefplugins/csy27010/inc/timeouter.h
changeset 44 8b72faa1200f
equal deleted inserted replaced
39:2473f5e227f9 44:8b72faa1200f
       
     1 //
       
     2 // * Copyright 2004 Neusoft America Inc.
       
     3 // * All rights reserved.
       
     4 // * This component and the accompanying materials are made available
       
     5 // * under the terms of the Eclipse Public License v1.0
       
     6 // * which accompanies this distribution, and is available
       
     7 // * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // *
       
     9 // * Contributors:
       
    10 // * Keith Collins (Neusoft America Inc.)  original software development and additional code and modifications.
       
    11 // * Thomas Gahagen (Neusoft America Inc.)  additional code and modifications.
       
    12 // * Zhen Yuan (Neusoft America Inc.)  additional code and modifications.
       
    13 // *
       
    14 // * Description:  This file defines CActiveTimeouter, a very simple timeout class. 
       
    15 // *               It is an active timeout-class used by clients to get asynchronous timeouts.
       
    16 // *               The observer derives from the MTimeoutObserver class	and calls the Start 
       
    17 // *               function to start the timer. When and if the timeout occurs the TimedOut 
       
    18 // *               function on the observer will be called.
       
    19 // *               MTimeoutObserver is an abstract mixin class implemented by a class that is 
       
    20 // *               interested in timeouts generated by CActiveTimeouter.
       
    21 //
       
    22 
       
    23 // timeouter.h
       
    24 
       
    25 /** @file timeouter.h
       
    26  *
       
    27  */
       
    28 
       
    29 #ifndef TIMEOUTER_H__
       
    30 #define TIMEOUTER_H__
       
    31 
       
    32 #include <e32base.h>
       
    33 #include "etools.h"
       
    34 
       
    35 
       
    36 class MTimeoutObserver
       
    37 	{
       
    38 public:
       
    39 	// called by CActiveTimeouter when the timeout happens
       
    40 	virtual void TimedOut() = 0;
       
    41 	};
       
    42 
       
    43 /** @class CActiveTimeouter Timeouter.h "Timeouter.h"
       
    44  *  @brief  Class CActiveTimeouter is an active object that is used
       
    45  *  to detect and report a timeout condition.
       
    46  */
       
    47 class CActiveTimeouter : public CTimer
       
    48 	{
       
    49 public:
       
    50 	static CActiveTimeouter* NewL(MTimeoutObserver& aObserver);
       
    51 	~CActiveTimeouter();
       
    52 	void Start(const TTimeIntervalMicroSeconds32& aTimeIntervalMicroSeconds32);
       
    53 	void Stop();
       
    54 
       
    55 private:
       
    56 	CActiveTimeouter(MTimeoutObserver& aObserver);
       
    57 
       
    58 private: // from CTimer
       
    59 	void RunL();
       
    60 
       
    61 private: // owned
       
    62 	CLASSNAMEDECL(CActiveTimeouter)          
       
    63 
       
    64 private: // unowned
       
    65 	MTimeoutObserver& iTheTimeoutObserver;    
       
    66 	};
       
    67 
       
    68 #endif // TIMEOUTER_H__