os/kernelhwsrv/userlibandfileserver/fileserver/sfile/sf_plugin.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/sfile/sf_plugin.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,102 @@
     1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// f32\sfile\sf_plugin.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#if !defined(__SF_PLUGIN_H__)
    1.22 +
    1.23 +#define __SF_PLUGIN_H__
    1.24 +
    1.25 +#include "message.h"
    1.26 +#include <f32fsys.h>
    1.27 +#include <F32plugin.h>
    1.28 +
    1.29 +class CFsSyncMessageScheduler;
    1.30 +class CFsInternalRequest;
    1.31 +
    1.32 +class TFsPluginThread
    1.33 +	{
    1.34 +public:
    1.35 +	TFsPluginThread();
    1.36 +public:
    1.37 +	TInt iDriveNumber;
    1.38 +	TBool iIsAvailable;
    1.39 +	RMutex iPluginLock;
    1.40 +	CPluginThread* iThread;
    1.41 +	TUint iId;
    1.42 +	};
    1.43 +
    1.44 +/**
    1.45 + * Plugin Manager
    1.46 + *
    1.47 + *	- Initialised in main thread
    1.48 + *
    1.49 + *	- Contains array of request chains which represent the
    1.50 + *	  plugins registered for each request type.
    1.51 + *	
    1.52 + *	- Plugins register their interest with each request type,
    1.53 + *	  specifying the associated thread and pre/post processing options.
    1.54 + */
    1.55 +class FsPluginManager
    1.56 +	{
    1.57 +public:
    1.58 +	static void InitialiseL();
    1.59 +
    1.60 +	static TInt MountPlugin(CFsPluginFactory& aPluginFactory, TInt aDrive, TInt aPos);
    1.61 +	static void DismountPlugin(CFsPluginFactory& aPluginFactory, TInt aPos);
    1.62 +
    1.63 +	static TInt InstallPluginFactory(CFsPluginFactory* aFactory,RLibrary aLib);
    1.64 +	static CFsPluginFactory* GetPluginFactory(const TDesC& aName);
    1.65 +
    1.66 +	static TInt NextPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock, TBool aCheckCurrentOperation=ETrue);
    1.67 +	static TInt PrevPlugin(CFsPlugin*& aPlugin, CFsMessageRequest* aMsgRequest, TBool aLock);
    1.68 +	static TInt InsertInPluginStack(CFsPlugin*& aPlugin,TInt aPos);
    1.69 +	static TInt IsInChain(TInt aUPos, TInt aPos,TInt aDrive, CFsPluginFactory* aPluginFactory);
    1.70 +	static CFsPlugin* FindByUniquePosition(TInt aPos);
    1.71 +
    1.72 +	static TInt InitPlugin(CFsPlugin& aPlugin);
    1.73 +	static void TransferRequests(CPluginThread* aPluginThread);
    1.74 +	static void CancelPlugin(CFsPlugin* aPlugin,CSessionFs* aSession);
    1.75 +	static TInt ChainCount();
    1.76 +	static TInt Plugin(CFsPlugin*& aPlugin, TInt aPos);
    1.77 +
    1.78 +	static void LockChain();
    1.79 +	static void UnlockChain();
    1.80 +
    1.81 +	static CFsPluginConn* CreatePluginConnL(TInt aUniquePosition, TUint aClientId);
    1.82 +	static CFsPluginConn* GetPluginConnFromHandle(CSessionFs* aSession, TInt aHandle);
    1.83 +
    1.84 +	static TBool IsPluginConnThread(TThreadId tid, CFsPlugin* aPlugin);
    1.85 +
    1.86 +	static void DispatchSync(CFsRequest* aRequest);
    1.87 +	static void CompleteSessionRequests(CSessionFs* aSession, TInt aValue, CFsInternalRequest* aRequest);
    1.88 +
    1.89 +private:
    1.90 +	static TInt UpdateMountedDrive(CFsPlugin* aPlugin, CFsPluginFactory* aFactory,TInt aDrive);
    1.91 +	static void GetNextCancelPluginOpRequest(CPluginThread* aPluginThread, CFsRequest*& aCancelPluginRequest);
    1.92 +private:
    1.93 +	static CFsObjectCon* iPluginFactories;
    1.94 +	static CFsObjectCon* iPluginConns;
    1.95 +
    1.96 +	static RPointerArray<CFsPlugin> iPluginChain;
    1.97 +	static RFastLock iChainLock;
    1.98 +
    1.99 +	static CFsSyncMessageScheduler* iScheduler;
   1.100 +
   1.101 +	friend class RequestAllocator;
   1.102 +	};
   1.103 +
   1.104 +#endif // __SF_PLUGIN_H
   1.105 +