mmfenh/advancedaudiocontroller/tsrc/advancedaudiocontrollertestmodule/ActiveScheduledTestModule/inc/TemplateParameters.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Active Scheduler Test Module
       
    15 *
       
    16 */
       
    17 
       
    18 // TemplateParameters.h: interface for the CTemplateParameters class.
       
    19 //
       
    20 //////////////////////////////////////////////////////////////////////
       
    21 
       
    22 //#if !defined(AFX_TEMPLATEPARAMETERS_H__77EC4487_6A81_4A9B_9CAE_C4D9913B5017__INCLUDED_)
       
    23 //#define AFX_TEMPLATEPARAMETERS_H__77EC4487_6A81_4A9B_9CAE_C4D9913B5017__INCLUDED_
       
    24 
       
    25 //#if _MSC_VER > 1000
       
    26 //#pragma once
       
    27 //#endif // _MSC_VER > 1000
       
    28 
       
    29 #ifndef __TEMPLATE_PARAMETERS
       
    30 #define __TEMPLATE_PARAMETERS
       
    31 
       
    32 #include "Parameters.h"
       
    33 
       
    34 template <class DataKind>
       
    35 class CTemplateParameters : public CParameters
       
    36 {
       
    37 protected:
       
    38 	inline CTemplateParameters(TInt aAction);
       
    39 public:
       
    40 	inline static CTemplateParameters<DataKind>* NewL(TInt aAction, const DataKind &aData);
       
    41 	inline static CTemplateParameters<DataKind>* NewLC(TInt aAction, const DataKind &aData);
       
    42 	virtual ~CTemplateParameters();
       
    43 	inline DataKind GetData();
       
    44 
       
    45 private:
       
    46 	inline void ConstructL(const DataKind &aData);
       
    47 	DataKind iData;
       
    48 };
       
    49 
       
    50 template<class DataKind> void CTemplateParameters<DataKind>::ConstructL(const DataKind &aData)
       
    51 	{
       
    52 	iData = aData;
       
    53 	}
       
    54 
       
    55 template<class DataKind> CTemplateParameters<DataKind>* CTemplateParameters<DataKind>::NewLC(TInt aAction, const DataKind &aFileName)
       
    56 	{
       
    57 	CTemplateParameters *__self = new (ELeave) CTemplateParameters(aAction);
       
    58 	CleanupStack::PushL(__self);
       
    59 	__self->ConstructL(aFileName);
       
    60 	return __self;
       
    61 	}
       
    62 
       
    63 template<class DataKind> CTemplateParameters<DataKind>* CTemplateParameters<DataKind>::NewL(TInt aAction, const DataKind &aData)
       
    64 	{
       
    65 	CTemplateParameters *__self = CTemplateParameters::NewLC(aAction, aData);
       
    66 	CleanupStack::Pop(__self);
       
    67 	return __self;
       
    68 	}
       
    69 
       
    70 template<class DataKind> CTemplateParameters<DataKind>::CTemplateParameters(TInt aAction) : CParameters(aAction) {}
       
    71 
       
    72 template<class DataKind> CTemplateParameters<DataKind>::~CTemplateParameters()
       
    73 	{
       
    74 	//delete iFileName;
       
    75 	}
       
    76 
       
    77 template<class DataKind> DataKind CTemplateParameters<DataKind>::GetData()
       
    78 	{
       
    79 	return iData;
       
    80 	}
       
    81 
       
    82 
       
    83 //#endif // !defined(AFX_TEMPLATEPARAMETERS_H__77EC4487_6A81_4A9B_9CAE_C4D9913B5017__INCLUDED_)
       
    84 #endif	//__TEMPLATE_PARAMETERS