os/persistentdata/loggingservices/rfilelogger/Logger/te_RFileLogger/src/Te_RFileLoggerSuiteServer.cpp
Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
15 // in the process of the client. The client initialises the server by calling the
16 // one and only ordinal.
21 @file Te_RFileLoggerSuiteServer.cpp
24 #include "Te_RFileLoggerSuiteServer.h"
25 #include "addfield_logStep.h"
26 #include "conn_closeStep.h"
28 _LIT(KServerName,"Te_RFileLoggerSuite");
29 CTe_RFileLoggerSuite* CTe_RFileLoggerSuite::NewL()
31 * @return - Instance of the test server
32 * Same code for Secure and non-secure variants
33 * Called inside the MainL() function to create and start the
34 * CTestServer derived server.
37 CTe_RFileLoggerSuite * server = new (ELeave) CTe_RFileLoggerSuite();
38 CleanupStack::PushL(server);
39 // CServer base class call which can be either StartL or ConstructL,
40 // the later will permit Server Logging.
42 server->StartL(KServerName);
43 //server->ConstructL(KServerName);
44 CleanupStack::Pop(server);
49 // Secure variants much simpler
50 // For EKA2, just an E32Main and a MainL()
54 * Much simpler, uses the new Rendezvous() call to sync with the client
57 // Leave the hooks in for platform security
58 #if (defined __DATA_CAGING__)
59 RProcess().DataCaging(RProcess::EDataCagingOn);
60 RProcess().DataCaging(RProcess::ESecureApiOn);
62 CActiveScheduler* sched=NULL;
63 sched=new(ELeave) CActiveScheduler;
64 CActiveScheduler::Install(sched);
65 CTe_RFileLoggerSuite* server = NULL;
66 // Create the CTestServer derived server
67 TRAPD(err,server = CTe_RFileLoggerSuite::NewL());
70 // Sync with the client and enter the active scheduler
71 RProcess::Rendezvous(KErrNone);
80 GLDEF_C TInt E32Main()
82 * @return - Standard Epoc error code on process exit
84 * Process entry point. Called by client using RProcess API
88 CTrapCleanup* cleanup = CTrapCleanup::New();
100 CTestStep* CTe_RFileLoggerSuite::CreateTestStep(const TDesC& aStepName)
102 * @return - A CTestStep derived instance
103 * Secure and non-secure variants
104 * Implementation of CTestServer pure virtual
107 CTestStep* testStep = NULL;
108 // They are created "just in time" when the worker thread is created
109 // More test steps can be added below
110 if(aStepName == Kaddfield_logStep)
111 testStep = new Caddfield_logStep();
112 else if(aStepName == Kconn_closeStep)
113 testStep = new Cconn_closeStep();