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 // CPP file demonstrating Extension DLL pattern 00015 // This file contains the original implementation of the CNumberStore function. 00016 // This file has _not_ been modified in order to add public extension functions. 00017 // The only extension is to add the private "DoMultiplyNumbers" function which is 00018 // deliberately "private" to stop code calling it. It must be called through the 00019 // public "MultiplyNumbers" function which is available in the extension dll. 00020 // 00021 00022 00023 #include <NumberStore.h> 00024 00025 00026 00027 //This constant is defined in the CPP to demonstrate an intrusive change; 00028 //DoMultiplyNumbers must be implemented in this DLL in order to see this const 00029 const TInt KMagicMultiplyer=2; 00030 00031 //Function implementations of all _original_ functions 00032 00033 EXPORT_C CNumberStore::CNumberStore () 00034 { 00035 } 00036 00037 EXPORT_C CNumberStore::CNumberStore (TInt aNumber1, TInt aNumber2) 00038 { 00039 SetNumber1(aNumber1); 00040 SetNumber2(aNumber2); 00041 } 00042 00043 EXPORT_C void CNumberStore::SetNumber1 (TInt aNumber1) 00044 { 00045 iNumber1=aNumber1; 00046 } 00047 00048 EXPORT_C void CNumberStore::SetNumber2 (TInt aNumber2) 00049 { 00050 iNumber2=aNumber2; 00051 } 00052 00053 EXPORT_C TInt CNumberStore::Number1 () const 00054 { 00055 return iNumber1; 00056 } 00057 00058 EXPORT_C TInt CNumberStore::Number2 () const 00059 { 00060 return iNumber2; 00061 } 00062 00067 EXPORT_C TInt CNumberStore::DoMultiplyNumbers() const 00068 { 00069 return (iNumber1*iNumber2*KMagicMultiplyer); 00070 }