stif/TestServer/inc/TestServerEvent.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 2009 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: This file contains the header file of the event 
       
    15 * interface.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef TESTSERVEREVENT_H
       
    20 #define TESTSERVEREVENT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <StifTestEventInterface.h>
       
    24 
       
    25 // CONSTANTS
       
    26 // None
       
    27 
       
    28 // MACROS
       
    29 // None
       
    30 
       
    31 // DATA TYPES
       
    32 // None
       
    33 
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 // None
       
    37 
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CTestExecution;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 
       
    45 // DESCRIPTION
       
    46 // Interface class for the test system.
       
    47 class TEvent
       
    48     :public TEventIf
       
    49     {
       
    50     public: // Enumerations
       
    51         // None
       
    52 
       
    53     private: // Enumerations
       
    54         // None
       
    55 
       
    56     public:  // Constructors and destructor
       
    57         /**
       
    58         * C++ default constructor.
       
    59         */
       
    60         TEvent( TThreadId aThreadId );
       
    61         
       
    62         /**
       
    63         * C++ destructor.
       
    64         */
       
    65         ~TEvent();
       
    66 
       
    67     public: // New functions
       
    68         
       
    69         /**
       
    70         * Set event.
       
    71         */
       
    72         void Set( TEventType aEventType );
       
    73         
       
    74        	/** 
       
    75         * Check event status.
       
    76         */ 
       
    77         TBool EventPending();
       
    78         
       
    79         /** 
       
    80         * Check waiting status.
       
    81         */ 
       
    82         TBool WaitEventPending();
       
    83         
       
    84         /**
       
    85         * First phase of waiting.
       
    86         */
       
    87 		TInt SetWaitPending( TRequestStatus* aStatus = NULL );
       
    88 
       
    89         /**
       
    90         * Wait event.
       
    91         */
       
    92         void Wait();
       
    93         
       
    94         /**
       
    95         * Complete pending wait.
       
    96         */
       
    97 		void CompletePendingWait( TInt aError );
       
    98 
       
    99         /**
       
   100         * Release event. Completes conceivably pending unset.
       
   101         */
       
   102         void Release();
       
   103         
       
   104         /**
       
   105         * Unset event. Unset blocks until Release is called 
       
   106         * (i.e. iUnsetMessage is compeled from release).
       
   107         */
       
   108         TInt Unset( const RMessage2& aMessage, CTestExecution* aExecution );
       
   109         
       
   110         /**
       
   111         * Get TRequestStatus of the event.
       
   112         */ 
       
   113         const TRequestStatus* RequestStatus() const { return iReq; }; 
       
   114 
       
   115     public: // Functions from base classes
       
   116         // None
       
   117         
       
   118     protected:  // New functions
       
   119         // None
       
   120         
       
   121     protected:  // Functions from base classes
       
   122         // None
       
   123         
       
   124     private:
       
   125         // None
       
   126         
       
   127 	public:   //Data
       
   128 	    // None
       
   129         
       
   130 	protected:  // Data
       
   131         // None
       
   132         
       
   133     private:    // Data
       
   134         /**
       
   135         * Request status.
       
   136         */
       
   137         TRequestStatus* iReq; 
       
   138         TRequestStatus iRequestStatus;
       
   139         
       
   140         /**
       
   141         * Thread id.
       
   142         */
       
   143         TThreadId iThread;
       
   144 
       
   145         /**
       
   146         * Unset message.
       
   147         */
       
   148         RMessage2 iUnsetMessage;
       
   149 
       
   150         /**
       
   151         * Flag for state event status.
       
   152         */
       
   153         TBool iEventPending;
       
   154         /**
       
   155         * Flag for indicating that iReq is owned by us.
       
   156         */
       
   157         TBool iOwnReq;
       
   158         
       
   159         /**
       
   160         * Execution object. Is non-NULL if unset is pending.
       
   161         */ 
       
   162         CTestExecution* iExecution;
       
   163         
       
   164     public:     // Friend classes
       
   165         // None
       
   166 
       
   167     protected:  // Friend classes
       
   168         // None
       
   169 
       
   170     private:    // Friend classes
       
   171         // None
       
   172     };
       
   173 
       
   174 #endif      // TESTSERVEREVENT_H
       
   175 
       
   176 // End of File