eapol/eapol_framework/eapol_symbian/eap_server/include/EapScheduler.h
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     1 /*
       
     2 * Copyright (c) 2001-2010 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 the License "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:  EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 10 %
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef EAPSCHEDULER_H_
       
    24 #define EAPSCHEDULER_H_
       
    25 
       
    26 #include "EapServerClientDef.h"
       
    27 #include "abs_eap_am_tools.h"
       
    28 #include "EapClientIf.h"
       
    29 #include <e32math.h>
       
    30 
       
    31 class CEapServer;
       
    32 
       
    33 // -------------------------------------------------------------------------
       
    34 
       
    35 class CEapScheduler
       
    36 : public CActiveScheduler
       
    37 , public EapClientIf
       
    38 {
       
    39 
       
    40 public:
       
    41 
       
    42 	EAP_FUNC_IMPORT static CEapScheduler* NewL();
       
    43 
       
    44 	EAP_FUNC_IMPORT static TInt LaunchFromClient(const TBuf<KMaxServerExe> Server);
       
    45 
       
    46 	class TServerStart
       
    47 	{
       
    48 
       
    49 	public:
       
    50 
       
    51 		TServerStart(TRequestStatus& aStatus);
       
    52 
       
    53 		TPtrC AsCommand() const;
       
    54 
       
    55 		inline TServerStart() {};
       
    56 
       
    57 		void SignalL();
       
    58 
       
    59 	private:
       
    60 
       
    61 		TThreadId iId;
       
    62 
       
    63 		TRequestStatus* iStatus;
       
    64 
       
    65 	};
       
    66 
       
    67 public:
       
    68 
       
    69 #ifdef __WINS__
       
    70     static TInt ThreadFunction(TAny* aThreadParms);
       
    71 #endif
       
    72 
       
    73     EAP_FUNC_IMPORT static TInt ThreadStart(TServerStart& aSignal);
       
    74 
       
    75     static void ConstructL(TServerStart& aStart);
       
    76 
       
    77     virtual ~CEapScheduler();
       
    78 
       
    79     void Error(TInt aError) const; // from CActiveScheduler
       
    80 
       
    81 private:
       
    82 
       
    83     CEapServer* iServer;
       
    84 
       
    85 };
       
    86 
       
    87 // -------------------------------------------------------------------------
       
    88 
       
    89 inline CEapScheduler::TServerStart::TServerStart(TRequestStatus& aStatus)
       
    90     : iId(RThread().Id())
       
    91 	, iStatus(&aStatus)
       
    92 {
       
    93 	aStatus=KRequestPending;
       
    94 }
       
    95 
       
    96 // -------------------------------------------------------------------------
       
    97 
       
    98 inline TPtrC CEapScheduler::TServerStart::AsCommand() const
       
    99 {
       
   100 	return TPtrC(reinterpret_cast<const TText*>(this),sizeof(TServerStart)/sizeof(TText));
       
   101 }
       
   102 
       
   103 // -------------------------------------------------------------------------
       
   104 
       
   105 #endif /* EAPSCHEDULER_H_ */
       
   106 
       
   107 // -------------------------------------------------------------------------
       
   108 // End of file.