lowlevellibsandfws/pluginfw/Framework/Example/examplefourteen.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 2007-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 // The implementation of CImplementationClassFourteen
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include "examplefourteen.h"
       
    24 
       
    25 /**
       
    26 	Intended Usage	: Standardised safe construction which leaves nothing the cleanup stack.
       
    27 	Error Condition	: Leaves with error code.
       
    28 	@leave          	KErrNoMemory.
       
    29 	@param			aInitParams The parameter struct used for initialising this object
       
    30 	@return			CImplementationClassFourteen* The class instance.
       
    31 	@pre 			None
       
    32 	@post			CImplementationClassFourteen has been constructed,
       
    33 					and initialised.
       
    34  */
       
    35 CImplementationClassFourteen* CImplementationClassFourteen::NewL(TAny* aInitParams)
       
    36 	{
       
    37 	CImplementationClassFourteen* self=new(ELeave) CImplementationClassFourteen(); 
       
    38 	CleanupStack::PushL(self);	
       
    39 	self->ConstructL(aInitParams); 
       
    40 	CleanupStack::Pop(self);
       
    41 	return self;
       
    42 	}
       
    43 
       
    44 /**
       
    45 	Intended Usage	: Destructor of CImplementationClassFourteen
       
    46 	Error Condition	: None	
       
    47 	@pre 			CImplementationClassFourteen has been constructed
       
    48 	@post			CImplementationClassFourteen has been completely destroyed.
       
    49  */
       
    50 CImplementationClassFourteen::~CImplementationClassFourteen()
       
    51 	{
       
    52 	delete iInternalDescriptor;
       
    53 	Dll::FreeTls();
       
    54 	}
       
    55 /**
       
    56 	Intended Usage	: Default Constructor : usable only by derived classes	
       
    57 	Error Condition	: None	
       
    58 	@pre 			None
       
    59 	@post			CImplementationClassFourteen has been constructed
       
    60  */
       
    61 CImplementationClassFourteen::CImplementationClassFourteen()
       
    62 : CExampleInterface()
       
    63 	{
       
    64 	}
       
    65 
       
    66 /**
       
    67 	Intended Usage	: Completes the safe construction of the CImplementationClassFourteen object
       
    68 	Error Condition	: Leaves with the error code.	
       
    69 	@leave          	KErrNoMemory.	
       
    70 	@param			aInitParams The parameter struct used for initialising this object
       
    71 	@pre 			CImplementationClassFourteen has been constructed
       
    72 	@post			CImplementationClassFourteen has been fully initialised.
       
    73  */
       
    74 void CImplementationClassFourteen::ConstructL(TAny* aInitParams)
       
    75 	{
       
    76 	TExampleInterfaceInitParams* params = REINTERPRET_CAST(TExampleInterfaceInitParams*, aInitParams);
       
    77 	if(params)
       
    78 		{
       
    79 		if(params->descriptor)
       
    80 			{
       
    81 			iInternalDescriptor = params->descriptor->AllocL();
       
    82 			}
       
    83 		}
       
    84 	User::LeaveIfError(Dll::SetTls(&iTLSInt));
       
    85 	}
       
    86 
       
    87 /**
       
    88 	Intended Usage	: Overload of the pure interface method
       
    89 					Representative of a method provided on 
       
    90 					the interface by the interface definer.
       
    91 	@return			None
       
    92  */	
       
    93 void CImplementationClassFourteen::DoMethodL()
       
    94 	{
       
    95 	// Access TLS to ensure it has been set properly
       
    96 	ASSERT(Dll::Tls()!=NULL);
       
    97 	}
       
    98 
       
    99 /**
       
   100 	Intended Usage	: Overload of the pure interface method
       
   101 					asynchronous function which 
       
   102 					an interface definer could specify.  
       
   103 	@return			TInt KErrNone for success.
       
   104  */
       
   105 TInt CImplementationClassFourteen::FireAndForget()
       
   106 	{
       
   107 	return KErrNone;			
       
   108 	}
       
   109 
       
   110 // Provide the CActive overloads
       
   111 void CImplementationClassFourteen::RunL()
       
   112 	{
       
   113 	// Do nothing : should never be called
       
   114 	__ASSERT_DEBUG(EFalse,User::Invariant());
       
   115 	}
       
   116 
       
   117 void CImplementationClassFourteen::DoCancel()
       
   118 	{
       
   119 	// Do nothing
       
   120 	}
       
   121 
       
   122 TInt CImplementationClassFourteen::RunError(TInt aError)
       
   123 	{
       
   124 	return aError;
       
   125 	}
       
   126 /**
       
   127 	Intended Usage	: To verify the object returned by ECOM.
       
   128 	@return			TUid (ECOM's Implementation Uid for this class.)
       
   129  */
       
   130 TUid CImplementationClassFourteen::ImplId()
       
   131 	{
       
   132 	return KImplUid;
       
   133 	}
       
   134 
       
   135