sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/TC_winscw/tcwinsStaticDLL.cpp
changeset 13 c327db0664bb
equal deleted inserted replaced
12:5e7562f67577 13:c327db0664bb
       
     1 /*
       
     2 * Copyright (c) 2000-2009 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: 
       
    15 * This program creates a dll.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "tcwinsStaticDLL.h"
       
    21 #include <e32uid.h>
       
    22 #include "OstTraceDefinitions.h"
       
    23 #ifdef OST_TRACE_COMPILER_IN_USE
       
    24 #include "tcwinsStaticDLLTraces.h"
       
    25 #endif
       
    26 
       
    27 
       
    28 // construct/destruct
       
    29 
       
    30 
       
    31 extern "C" void __ARM_switch8();
       
    32 
       
    33 void sbs_test()
       
    34 	{
       
    35 	__ARM_switch8();
       
    36 	}
       
    37 
       
    38 
       
    39 EXPORT_C CMessenger* CMessenger::NewLC(CConsoleBase& aConsole, const TDesC& aString)
       
    40 	{
       
    41 	OstTrace0( TRACE_API, CMESSENGER_NEWL, "CMessenger::NewLC()" );
       
    42 	OstTrace0( TRACE_NORMAL, DUP1_CMESSENGER_NEWL, "CMessenger::NewLC()" );  
       
    43 	CMessenger* self=new (ELeave) CMessenger(aConsole);
       
    44 	CleanupStack::PushL(self);
       
    45 	self->ConstructL(aString);
       
    46 	return self;
       
    47 	}
       
    48 
       
    49 CMessenger::~CMessenger() // destruct - virtual, so no export
       
    50 	{
       
    51 	OstTrace0( TRACE_API, DUP1_CMESSENGER_CMESSENGER, "CMessenger::~CMessenger()" );
       
    52 	OstTrace0( TRACE_NORMAL, DUP2_CMESSENGER_CMESSENGER, "CMessenger::~CMessenger()" );  
       
    53 	delete iString;
       
    54 	}
       
    55 
       
    56 EXPORT_C void CMessenger::ShowMessage()
       
    57 	{
       
    58 	_LIT(KFormat1,"%S\n");
       
    59 	iConsole.Printf(KFormat1, iString); // notify completion
       
    60 	}
       
    61 
       
    62 // constructor support
       
    63 // don't export these, because used only by functions in this DLL, eg our NewLC()
       
    64 
       
    65 CMessenger::CMessenger(CConsoleBase& aConsole) // first-phase C++ constructor
       
    66 	: iConsole(aConsole)
       
    67 	{
       
    68 	}
       
    69 
       
    70 void CMessenger::ConstructL(const TDesC& aString) // second-phase constructor
       
    71 	{
       
    72 	iString=aString.AllocL(); // copy given string into own descriptor
       
    73     }
       
    74