vtprotocolplugins/VideoSource/inc/cactivewait.h
changeset 18 d9b6a8729acd
parent 4 6dc066157ed4
child 23 c378a0498b84
child 27 dcbddbbaf8fd
equal deleted inserted replaced
4:6dc066157ed4 18:d9b6a8729acd
     1 /*
       
     2 * Copyright (c) 2008 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:  Video Source subsystem.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_ACTIVEWAIT_H
       
    20 #define C_ACTIVEWAIT_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 #include <e32svr.h>
       
    25 /**
       
    26 *  Active waiter class for waiting any active request. When asynchronous
       
    27 *  request has been completed a given callback method will be called.
       
    28 *
       
    29 *  @lib videosource.lib
       
    30 */
       
    31 template < class R > class CVSActiveWait: public CActive
       
    32     {
       
    33     private :
       
    34     
       
    35   			typedef void ( R::*TVSActiveWaitCallback) ( TInt );  		
       
    36     
       
    37     public : // Constructors and destructor
       
    38 
       
    39         /**
       
    40         * Constructor.
       
    41         * @param "aRequester" ?description
       
    42         */
       
    43         inline CVSActiveWait( R* aRequester );
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         inline ~CVSActiveWait();
       
    49 
       
    50         /**
       
    51         * Initializes the waiter class.
       
    52         * @param "aCallback" Pointer to callback method that will be called
       
    53         * when asynchronous request has been completed.
       
    54         */
       
    55         inline void InitializeWaiter( TVSActiveWaitCallback aCallback );
       
    56 
       
    57         /**
       
    58         * Returns pointer to this active object's TRequestStatus member
       
    59         * (iStatus).
       
    60         * @return Pointer to this classes TRequestStatus member (iStatus).
       
    61         */
       
    62         inline TRequestStatus* RequestStatus();
       
    63 
       
    64         /**
       
    65         * Signals waiter with given error code.
       
    66         * @param aError Integer error code.
       
    67         */
       
    68         inline void Signal( TInt aError );
       
    69 
       
    70     private :    // Functions from base classes
       
    71 
       
    72         /**
       
    73         * From CActive. See CActive for description.
       
    74         */
       
    75         inline void RunL();
       
    76 
       
    77         /**
       
    78         * From CActive. See CActive for description.
       
    79         */
       
    80         inline void DoCancel();
       
    81 
       
    82     private :    // Data
       
    83 
       
    84         // Pointer to requester. Callback method call will be made in this
       
    85         // context.
       
    86         R* iRequester; // not owned
       
    87 
       
    88         // Pointer to callback method.
       
    89         TVSActiveWaitCallback iCallback;
       
    90     };
       
    91 
       
    92 #include "cactivewait.inl"
       
    93     
       
    94 #endif      // C_ACTIVEWAIT_H
       
    95