examples/SysLibs/ECom/InterfaceImplementation/CImplementationClassOne.cpp

00001 // Copyright (c) 1997-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 //
00015 
00016 #include "CImplementationClassOne.h"
00017 
00018 // Construction and destruction functions
00019 
00020 CImplementationClassOne* CImplementationClassOne::NewL(TAny* aInitParams)
00021         {
00022         CImplementationClassOne* self=new(ELeave) CImplementationClassOne(aInitParams);
00023         CleanupStack::PushL(self);
00024         self->ConstructL(); 
00025         CleanupStack::Pop();
00026         return self;
00027         }
00028 
00029 CImplementationClassOne::~CImplementationClassOne()
00030         {
00031         delete iDescriptor;
00032         }
00033 
00034 CImplementationClassOne::CImplementationClassOne(TAny* aInitParams)
00035 // Store input/output parameters
00036 : iInitParams((CExampleInterface::TExampleInterfaceInitParams*)aInitParams)
00037         {
00038         // See ConstructL() for initialisation completion.
00039         }
00040 
00041 void CImplementationClassOne::ConstructL()
00042 // Safely complete the initialization of the constructed object 
00043         {
00044         // Set up the data on the heap to pass back
00045         _LIT(KDescriptor, "Using Implementation One\n");
00046         iDescriptor = KDescriptor().AllocL();
00047         }
00048 
00049 
00050 // Implementation of CExampleInterface
00051 
00052 void CImplementationClassOne::DoMethodL(TDes& aString)
00053         {
00054         aString = *iDescriptor;
00055 
00056         // Set the parameter to something significant
00057         if (iInitParams)
00058                 iInitParams->integer=1;
00059         }
00060         

Generated by  doxygen 1.6.2