wlanutilities/wlansniffer/engine/client/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 
       
    21 #ifndef __WSFCLIENT_ACTIVE_WAITER_H__
       
    22 #define __WSFCLIENT_ACTIVE_WAITER_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 /**
       
    28  * CWsfActiveWaiter class,
       
    29  * an active object to replace User::WaitForRequest
       
    30  * 
       
    31  * Usage:
       
    32  * CWsfActiveWaiter* waiter = CWsfActiveWaiter::NewL();
       
    33  * CleanupStack::PushL( waiter );
       
    34  * server.AsyncFunction( waiter->iStatus );
       
    35  * if ( waiter->WaitForRequest == KErrNone )
       
    36  *      {
       
    37  *      // handle success
       
    38  *      }
       
    39  *      else 
       
    40  *      {
       
    41  *      // handle failure
       
    42  *      }
       
    43  * CleanupStack::PopAndDestroy( waiter );
       
    44  * 
       
    45  */     
       
    46 NONSHARABLE_CLASS( CWsfActiveWaiter ) : public CActive
       
    47     {
       
    48     public:
       
    49         /**
       
    50         * NewL function
       
    51         * @param  aPlugin a pointer to notifier plugin
       
    52         */
       
    53         static CWsfActiveWaiter* NewL( );
       
    54 
       
    55         /**
       
    56         * Destructor
       
    57         */    
       
    58         virtual ~CWsfActiveWaiter();          
       
    59 
       
    60         /**
       
    61         * Waits for it's TRequestStatus to be completed
       
    62         * @return Error code returned from server after request is
       
    63         * completed
       
    64         */
       
    65         TInt WaitForRequest( );
       
    66         
       
    67     protected:
       
    68         /**
       
    69         * ConstructL 
       
    70         */
       
    71         void ConstructL();
       
    72     
       
    73         /**
       
    74         * Constructor
       
    75         * @param  aPlugin a pointer to notifier plugin    
       
    76         */    
       
    77         CWsfActiveWaiter();
       
    78             
       
    79         /**
       
    80         * DoCancel from CActive
       
    81         */    
       
    82         virtual void DoCancel();
       
    83       
       
    84         /**
       
    85         * RunL from CActive
       
    86         */      
       
    87         virtual void RunL();
       
    88     
       
    89     protected:
       
    90         CActiveSchedulerWait iWait;
       
    91     };     
       
    92 
       
    93 #endif // __WSFCLIENT_ACTIVE_WAITER_H__
       
    94 
       
    95 // End of file