dbgsrv/coredumpserver/interface/formatter/formatterapi.inl
changeset 0 c6b0df440bee
equal deleted inserted replaced
-1:000000000000 0:c6b0df440bee
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implement some of the ECOM Core Dump Formatter interface.
       
    15 //
       
    16 
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedPartner
       
    22  @released
       
    23 */
       
    24 
       
    25 // Set default to be first implementation found by resolver
       
    26 _LIT8(KDefaultImplementation,"*");
       
    27 
       
    28 #include <debuglogging.h>
       
    29 
       
    30 inline CCoreDumpFormatter::CCoreDumpFormatter()
       
    31     {
       
    32 	LOG_MSG( "CCoreDumpFormatter::CCoreDumpFormatter()\n" );
       
    33     }
       
    34 
       
    35 inline CCoreDumpFormatter::~CCoreDumpFormatter()
       
    36     {
       
    37 	LOG_MSG2( "CCoreDumpFormatter::~CCoreDumpFormatter() with iDtor_ID_Key=0x%X\n", iDtor_ID_Key );
       
    38     // Destroy any instance variables and then
       
    39     // inform the framework that this specific
       
    40     // instance of the interface has been destroyed.
       
    41     REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    42     }
       
    43 
       
    44 inline CCoreDumpFormatter* CCoreDumpFormatter::NewL()
       
    45     {
       
    46 	LOG_MSG( "CCoreDumpFormatter::NewL()\n" );
       
    47     // Set up the interface find for the default resolver.
       
    48     TEComResolverParams resolverParams;
       
    49     resolverParams.SetDataType(KDefaultImplementation());
       
    50     //resolverParams.SetGenericMatch(ETrue);     // Allow wildcard matching
       
    51 	resolverParams.SetWildcardMatch(ETrue);     // Allow wildcard matching
       
    52 
       
    53     // Set up some empty initialisation parameters
       
    54     TExampleInterfaceInitParams initParams;
       
    55     initParams.integer      = 0;
       
    56     initParams.descriptor   = NULL;
       
    57 
       
    58     return reinterpret_cast<CCoreDumpFormatter*>(
       
    59                             REComSession::CreateImplementationL(KCCoreDumpFormatterUid,
       
    60                                                              _FOFF(CCoreDumpFormatter,iDtor_ID_Key),
       
    61                                                              &initParams,
       
    62                                                              resolverParams));
       
    63     }
       
    64 
       
    65 inline CCoreDumpFormatter* CCoreDumpFormatter::NewL(const TDesC8& aCue)
       
    66 	{
       
    67 	LOG_MSG( "CCoreDumpFormatter::NewL(const TDesC8& aCue)\n" );
       
    68 
       
    69 	TEComResolverParams resolverParams;
       
    70 	resolverParams.SetDataType(aCue);
       
    71 	resolverParams.SetGenericMatch(ETrue);
       
    72 	TAny* symbianElf = REComSession::CreateImplementationL(KCCoreDumpFormatterUid, _FOFF(CCoreDumpFormatter, iDtor_ID_Key),
       
    73 		resolverParams);
       
    74 	return reinterpret_cast<CCoreDumpFormatter*>(symbianElf);
       
    75 	}
       
    76 
       
    77 
       
    78 inline CCoreDumpFormatter* CCoreDumpFormatter::NewL(const TUid& aUid)
       
    79 	{
       
    80 	LOG_MSG( "CCoreDumpFormatter::NewL(const TUid& aUid)\n" );
       
    81 
       
    82 	LOG_MSG2( "->REComSession::CreateImplementationL(aUid=0x%X)\n", (aUid) );
       
    83 	
       
    84 	TAny* symbianElf = REComSession::CreateImplementationL( aUid, _FOFF(CCoreDumpFormatter, iDtor_ID_Key) );
       
    85 	LOG_MSG2( "<-REComSession::CreateImplementationL() iDtor_ID_Key=0x%X\n", _FOFF(CCoreDumpFormatter, iDtor_ID_Key) );
       
    86 		
       
    87 	return reinterpret_cast<CCoreDumpFormatter*>(symbianElf);
       
    88 	}
       
    89 
       
    90 
       
    91 inline void CCoreDumpFormatter::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray)
       
    92 	{
       
    93 	REComSession::ListImplementationsL(KCCoreDumpFormatterUid, aImplInfoArray);
       
    94 	}