diff -r 000000000000 -r bde4ae8d615e os/persistentdata/featuremgmt/featuremgr/src/clientdll/featmgr.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/persistentdata/featuremgmt/featuremgr/src/clientdll/featmgr.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,89 @@ +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +// INCLUDE FILES +#include +#include "featmgrtlsdata.h" +#include +#include "featmgrdebug.h" +#include + +// LOCAL CONSTANTS AND MACROS +_LIT( KPanicCategory, "FeatMgr" ); + + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// FeatureManager::InitializeLibL() +// ----------------------------------------------------------------------------- +// +EXPORT_C void FeatureManager::InitializeLibL() + { + FUNC_LOG + + if ( !Dll::Tls() ) + { + Dll::SetTls( CFeatMgrTlsData::NewL() ); + } + + // Increase the client count (self) + TlsData()->IncreaseClientCount(); + } + +// ----------------------------------------------------------------------------- +// FeatureManager::UnInitializeLibL() +// ----------------------------------------------------------------------------- +// +EXPORT_C void FeatureManager::UnInitializeLib() + { + FUNC_LOG + + if ( Dll::Tls() ) + { + CFeatMgrTlsData::DeleteClient(); + } + } + +// ----------------------------------------------------------------------------- +// FeatureManager::FeatureSupported() +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool FeatureManager::FeatureSupported( TInt aFeature ) + { + TFeatureEntry feature( TUid::Uid(aFeature) ); + TInt err( TlsData()->FeatureSupported( feature ) ); + + return (( err > 0 ) ? ETrue : EFalse ); + } + +// ----------------------------------------------------------------------------- +// FeatureManager::TlsData() +// ----------------------------------------------------------------------------- +// +CFeatMgrTlsData* FeatureManager::TlsData() + { + CFeatMgrTlsData* tlsData = STATIC_CAST( CFeatMgrTlsData*, Dll::Tls() ); + + __ASSERT_ALWAYS( tlsData, User::Panic( KPanicCategory, ELibNotInitialized ) ); + + return tlsData; + } + +// End of File