examples/Base/IPC/ClientServer/Complex/ComplexServerCCountServer.cpp

00001 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // ComplexServer.cpp
00015 //
00016 
00017 #include "ComplexClientAndServer.h"
00018 #include "ComplexServer.h"
00019 #include <e32svr.h>
00020 #include <e32uid.h>
00021 
00022 
00023 
00024 //**********************************
00025 //CCountServer - implementations
00026 //**********************************
00027 
00031 void CCountServer::PanicServer(TCountServPanic aPanic)
00032         {
00033         _LIT(KTxtCountServer,"CountServer");
00034         User::Panic(KTxtCountServer,aPanic);
00035         }
00036 
00037 
00041 CCountServer* CCountServer::NewL(CActive::TPriority aActiveObjectPriority)
00042         {
00043         CCountServer* self=new (ELeave) CCountServer(aActiveObjectPriority);
00044         CleanupStack::PushL(self);
00045         self->ConstructL();
00046         CleanupStack::Pop();
00047         return self;
00048         }
00049 
00050 
00057 CObjectCon* CCountServer::NewContainerL()
00058         {
00059         return iContainerIndex->CreateL();
00060         }
00061         
00062         
00067 void CCountServer::RemoveContainer(CObjectCon *aCon)
00068         {
00069         iContainerIndex->Remove(aCon);  
00070         }
00071 
00072 
00083 CCountServer::CCountServer(CActive::TPriority aActiveObjectPriority)
00084         : CServer2(aActiveObjectPriority)
00085         {
00086         }
00087 
00088 
00092 void CCountServer::ConstructL()
00093         {
00094         iContainerIndex=CObjectConIx::NewL();
00095         }
00096 
00097 
00101 CCountServer::~CCountServer()
00102         {
00103         delete iContainerIndex; 
00104         }
00105 
00106 
00110 CSession2* CCountServer::NewSessionL(const TVersion &aVersion,const RMessage2& /*aMessage*/) const
00111         {
00112           // Check that the version is OK
00113         TVersion v(KCountServMajorVersionNumber,KCountServMinorVersionNumber,KCountServBuildVersionNumber);
00114         if (!User::QueryVersionSupported(v,aVersion))
00115                 User::Leave(KErrNotSupported);
00116         
00117         // CAN USE THE aMessage argument to check client's security and identity
00118         // can make use of this later but for now ignore. AH 4/5/05
00119         // the connect message is delivered via the RMessage2 object passed. 
00120         
00121           // Create the session.
00122         return new (ELeave) CCountSession;
00123         }
00124         
00125         

Generated by  doxygen 1.6.2