os/persistentdata/persistentstorage/dbms/security/SC_PolicySpace.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2004-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 // CPolicySpace class
    15 // 
    16 //
    17 
    18 #ifndef __SC_POLICYSPACE_H__
    19 #define __SC_POLICYSPACE_H__
    20 
    21 #include "D32Map.h"
    22 #include "SC_Policy.h"
    23 
    24 namespace DBSC
    25 {
    26 
    27 //Forward declarations
    28 class CPassAllPolicy;
    29 
    30 /**
    31 CPolicySpace class implements MPolicySpace interface and manages a set of 
    32 CPolicyDomain objects (one per binary policy file).
    33 All requests for particular MPOlicy implementations go through CPolicySpace object.
    34 The DBMS server has to create only one CPolicySpace instance during the DBMS startup.
    35 @internalComponent
    36 */
    37 NONSHARABLE_CLASS(CPolicySpace) : public CBase, public MPolicySpace
    38 	{
    39 public:
    40 	static CPolicySpace* NewL(RFs& aFs, const TDesC& aPrivatePath);
    41 	virtual ~CPolicySpace();
    42 	virtual void Release();
    43 	virtual const MPolicy* DbPolicyL(const TDbPolicyRequest& aDbPolicyRequest) const;
    44 	virtual const MPolicy* TblPolicyL(const TDbPolicyRequest& aDbPolicyRequest, const TDesC& aTblName) const;
    45 	virtual TSecureId BackupSIDL(TUid aDbUid) const;
    46 
    47 private:
    48 	inline CPolicySpace();
    49 	void ConstructL(RFs& aFs, const TDesC& aPrivatePath);
    50 	void LoadPolicyDomainsL(RFs& aFs, const TDesC& aPolicyDir);
    51 	CPolicyDomain* PolicyDomain(TUid aDomainUid) const;
    52 
    53 private:
    54 	CPassAllPolicy*				iPassAllDbPolicy;
    55 	CPassAllPolicy*				iPassAllTblPolicy;
    56 	RMap<TInt, CPolicyDomain*>	iPDCollection;
    57 
    58 	};
    59 
    60 } //end of - namespace DBSC
    61 
    62 #endif//__SC_POLICYSPACE_H__