wlanutilities/wlansniffer/model/inc/wsfactivewaiter.h
branchRCL_3
changeset 25 f28ada11abbf
parent 0 56b72877c1cb
equal deleted inserted replaced
24:63be7eb3fc78 25:f28ada11abbf
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Declaration of CWsfActiveWaiter
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __WSFSERVER_ACTIVE_WAITER_H__
       
    21 #define __WSFSERVER_ACTIVE_WAITER_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 /**
       
    27  * CWsfActiveWaiter class,
       
    28  * an active object to replace User::WaitForRequest
       
    29  * 
       
    30  * Usage:
       
    31  * CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewL();
       
    32  * CleanupStack::PushL( waiter );
       
    33  * server.AsyncFunction( waiter->iStatus );
       
    34  * if ( waiter->WaitForRequest == KErrNone )
       
    35  *      {
       
    36  *      // handle success
       
    37  *      }
       
    38  *      else 
       
    39  *      {
       
    40  *      // handle failure
       
    41  *      }
       
    42  * CleanupStack::PopAndDestroy( waiter );
       
    43  * 
       
    44  */     
       
    45 NONSHARABLE_CLASS( CWsfActiveWaiter ) : public CActive
       
    46     {
       
    47     public:
       
    48         /**
       
    49         * NewL function
       
    50         * @param  aPlugin a pointer to notifier plugin
       
    51         */
       
    52         static CWsfActiveWaiter* NewL( );
       
    53 
       
    54         /**
       
    55         * Destructor
       
    56         */    
       
    57         virtual ~CWsfActiveWaiter();          
       
    58 
       
    59         /**
       
    60         * Waits for it's TRequestStatus to be completed
       
    61         * @return Error code returned from server after request is
       
    62         * completed
       
    63         */
       
    64         TInt WaitForRequest( );
       
    65         
       
    66     protected:
       
    67         /**
       
    68         * ConstructL 
       
    69         */
       
    70         void ConstructL();
       
    71     
       
    72         /**
       
    73         * Constructor
       
    74         * @param  aPlugin a pointer to notifier plugin    
       
    75         */    
       
    76         CWsfActiveWaiter();
       
    77             
       
    78         /**
       
    79         * DoCancel from CActive
       
    80         */    
       
    81         virtual void DoCancel();
       
    82       
       
    83         /**
       
    84         * RunL from CActive
       
    85         */      
       
    86         virtual void RunL();
       
    87     
       
    88     protected:
       
    89         CActiveSchedulerWait iWait;
       
    90     };     
       
    91 
       
    92 #endif // __WSFSERVER_ACTIVE_WAITER_H__
       
    93 
       
    94 // End of file