tracefw/tracecompiler/test/TracesInHeadersApps/singlemmp_diffnames/dll/src/HelloTraceExample.cpp
changeset 56 aa2539c91954
parent 54 a151135b0cf9
child 60 e54443a6878c
child 62 1c2bb2fc7c87
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
     1 /*
       
     2 * Copyright (c) 2010 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 "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 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "HelloTraceExample.h"
       
    20 #include "HelloTraceTypes.h"
       
    21 #include "HelloTraceInterface.h"
       
    22 #include "HelloTraceFn.h"
       
    23 #include "HelloTracePanic.h"
       
    24 
       
    25 #include "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "HelloTraceExampleTraces.h"
       
    28 #endif
       
    29 
       
    30 EXPORT_C void HelloTraceExample::JustTypes()
       
    31     {
       
    32     OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_JUSTTYPES, "*********************************************** " );
       
    33     
       
    34     HelloTraceTypes::SignedIntegers();
       
    35     HelloTraceTypes::UnsignedIntegers();
       
    36     HelloTraceTypes::Descriptors();    
       
    37     }
       
    38 
       
    39 EXPORT_C void HelloTraceExample::Interface()
       
    40     {
       
    41     OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_INTERFACE, "*********************************************** " );
       
    42     
       
    43     TVersion version = CHelloTraceInterface::Version();   
       
    44     if (version.iMajor >= 1) 
       
    45         {
       
    46         CHelloTraceInterface* example = CHelloTraceInterface::NewLC();
       
    47         example->AddCharL('H');
       
    48         example->AddCharL('e');
       
    49         example->AddCharL('l');
       
    50         example->AddCharL('l');
       
    51         example->AddCharL('o');
       
    52         example->AddCharL('T');        
       
    53         example->RemoveLast();        
       
    54         example->AddCharL(' ');
       
    55         example->AddCharL('T');
       
    56         example->AddCharL('r');
       
    57         example->AddCharL('a');
       
    58         example->AddCharL('c');
       
    59         example->AddCharL('e');
       
    60         example->AddCharL('!');
       
    61         CleanupStack::PopAndDestroy(example);
       
    62         }
       
    63     else
       
    64         {
       
    65         OstTrace0( TRACE_ERROR, HELLOTRACEEXAMPLE_UNSUPPORTED_VERSION, "Unsupported version!");
       
    66         }
       
    67     }
       
    68 
       
    69 EXPORT_C void HelloTraceExample::FnEntryExit()
       
    70     {
       
    71     OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_FNENTRYEXIT, "*********************************************** " );
       
    72        
       
    73     CHelloTraceFn* example = CHelloTraceFn::NewLC();
       
    74     CIdle* idle = CIdle::NewL(CActive::EPriorityIdle);
       
    75     CleanupStack::PushL(idle);
       
    76 
       
    77     CHelloTraceFn::StaticOutputsParamsL(1);
       
    78    
       
    79     example->Simple();
       
    80     example->OutputsParams(2, CHelloTraceFn::EExample1);
       
    81     example->OutputsParams2(2, CHelloTraceFn::EExample1);
       
    82     example->OutputsParams3(2, CHelloTraceFn::EExample1);
       
    83     example->OutputsParams(3, CHelloTraceFn::EExample2);
       
    84     example->OutputsSignedIntegers(-4, -5, -6, -7);
       
    85     example->OutputsUnsignedIntegers(8, 9, 10, 11);
       
    86     example->OutputsTIntReturnValue();    
       
    87     example->OutputsTInt64ReturnValue(); 
       
    88     example->OutputsTFnEnumReturnValue();
       
    89     example->OutputsUnknownPtrType(idle);    
       
    90     example->OutputsUnknownRefType(*idle);
       
    91 #ifdef _DEBUG
       
    92     example->PreProcessedFn(12);
       
    93 #else
       
    94     example->PreProcessedFn();
       
    95 #endif
       
    96     example->OutputMissingParams(13, 14, 15);
       
    97 
       
    98     CleanupStack::PopAndDestroy(idle);
       
    99     CleanupStack::PopAndDestroy(example);
       
   100     }
       
   101 
       
   102 EXPORT_C void HelloTraceExample::PanicTrace()
       
   103     {
       
   104     OstTrace0( TRACE_EXAMPLE, HELLOTRACEEXAMPLE_PANIC, "*********************************************** " );
       
   105 
       
   106     Panic(EHelloTraceDllExamplePanic);
       
   107     }