sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef MDFPUCONFIG_H sl@0: #define MDFPUCONFIG_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: const TInt KUidTTaskConfig = 0x102737DF; sl@0: const TInt KUidTTaskConfig2 = 0x10273822 ; sl@0: const TInt KUidPCMConfig = 0x102737E0; sl@0: sl@0: /** sl@0: Configuration structure base class. sl@0: Represents a configuration structure identified by a base class. sl@0: */ sl@0: class TPuConfig sl@0: { sl@0: public: sl@0: inline TUid Uid() const; sl@0: protected: sl@0: inline TPuConfig(); sl@0: TUid iUid; sl@0: }; sl@0: sl@0: /** sl@0: Template class to create a TPuConfig configuration given a structure and an unique UID to identify it. sl@0: */ sl@0: template sl@0: class TPuConfigParam : public TPuConfig sl@0: { sl@0: public: sl@0: TPuConfigParam(const T& aParameterStructure); sl@0: TPuConfigParam(); sl@0: operator T&(); sl@0: static const T* GetStructure(const TPuConfig& aConfig); sl@0: static T* GetStructure(TPuConfig& aConfig); sl@0: private: sl@0: TPckgBuf iBuf; sl@0: }; sl@0: sl@0: /** sl@0: Constructor sl@0: @param aParameterStructure The structure to store sl@0: */ sl@0: template sl@0: TPuConfigParam::TPuConfigParam(const T& aParameterStructure) sl@0: { sl@0: iUid = TUid::Uid(U); sl@0: iBuf = TPckgBuf(aParameterStructure); sl@0: } sl@0: sl@0: template sl@0: TPuConfigParam::TPuConfigParam() sl@0: { sl@0: iUid = TUid::Uid(U); sl@0: } sl@0: sl@0: /** sl@0: Operator to return the structure represented by the class. sl@0: @return The structure represented by the class. sl@0: */ sl@0: template sl@0: TPuConfigParam::operator T&() sl@0: { sl@0: return iBuf(); sl@0: } sl@0: sl@0: /** sl@0: Static method to return the structure represented by TPuConfig. sl@0: @param A const reference to the base structure. sl@0: @return A const pointer to the structure represented by the class. sl@0: */ sl@0: template sl@0: const T* TPuConfigParam::GetStructure(const TPuConfig& aConfig) sl@0: { sl@0: const T* ptr = &((static_cast& >(aConfig)).iBuf()); sl@0: return ptr; sl@0: } sl@0: sl@0: /** sl@0: Static method to return the structure represented by TPuConfig. sl@0: @param A reference to the base structure. sl@0: @return A pointer to the structure represented by the class. sl@0: */ sl@0: template sl@0: T* TPuConfigParam::GetStructure(TPuConfig& aConfig) sl@0: { sl@0: T* ptr = &((static_cast& >(aConfig)).iBuf()); sl@0: return ptr; sl@0: } sl@0: sl@0: /** sl@0: Numeric data type. sl@0: */ sl@0: enum TDataType sl@0: { sl@0: /** sl@0: Signed data sl@0: */ sl@0: ESigned, sl@0: /** sl@0: Unsigned data sl@0: */ sl@0: EUnsigned sl@0: }; sl@0: sl@0: /** sl@0: Numeric endian type. sl@0: */ sl@0: enum TEndian sl@0: { sl@0: /** sl@0: Little endian data, (LSB to MSB) sl@0: */ sl@0: ELittleEndian, sl@0: /** sl@0: Big endian data. (MSB to LSB) sl@0: */ sl@0: EBigEndian sl@0: }; sl@0: sl@0: typedef TPuConfigParam TPuTaskConfig; sl@0: typedef TPuConfigParam TPuTaskConfig2; sl@0: sl@0: #include sl@0: sl@0: #endif // MDFPUCONFIG_H