backupandrestore/backupengine/inc/sbeserver.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 /**
       
     2 * Copyright (c) 2004-2009 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:
       
    15 * Declaration of CSBEServer class.
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24 */
       
    25 
       
    26 #ifndef __SBESERVER_H__
       
    27 #define __SBESERVER_H__
       
    28 
       
    29 #include "sbshutdown.h"
       
    30 #include "sbheapwrapper.h"
       
    31 
       
    32 namespace conn
       
    33 	{
       
    34 
       
    35 	/** @defgroup SBEServer SBE Server Documentation
       
    36 	*/
       
    37 
       
    38 	class CSBShutdown;
       
    39 	class CDataOwnerManager;
       
    40 	
       
    41 
       
    42 	class CSBEServer :	public CPolicyServer
       
    43 	/** The SBE Server.
       
    44     @internalComponent
       
    45 	@ingroup SBEServer
       
    46 	*/
       
    47 		{
       
    48 		public:
       
    49 			~CSBEServer();
       
    50 			static CSBEServer* NewLC(CDataOwnerManager* aDOM);
       
    51 			void AddSession();
       
    52 			void DropSession();
       
    53 			inline RChunk& GlobalSharedHeap();
       
    54 			inline CHeapWrapper& GSHInterface();
       
    55 			inline CDataOwnerManager& DataOwnerManager();
       
    56 
       
    57 		private:
       
    58 			CSBEServer(CDataOwnerManager* aDOM);
       
    59 			void ConstructL();
       
    60 			
       
    61 			//
       
    62 			// From CServer2
       
    63 			virtual CSession2* NewSessionL(const TVersion& aVersion,
       
    64 				const RMessage2& aMessage) const;
       
    65 			
       
    66 			TInt RunError(TInt aError);
       
    67 			void PanicClient(TInt aPanic) const;
       
    68 			void AllocateGlobalSharedHeapL();
       
    69 
       
    70 		private:
       
    71 			/** Active client sessions. */
       
    72 			TInt iSessionCount;
       
    73 			
       
    74 			/** Shutdown timer. */
       
    75 			CSBShutdown iShutdown;
       
    76 			
       
    77 			/** Global shared heap for passing large amounts of data between client and server
       
    78 			without having to use IPC */
       
    79 			RChunk iGlobalSharedHeap;
       
    80 			
       
    81 			/** Interface to the global shared heap */
       
    82 			CHeapWrapper* iGSHInterface;
       
    83 			
       
    84 			/** Pointer to the Data owner manager */
       
    85 			CDataOwnerManager* iDOM;
       
    86 		};
       
    87 
       
    88 		inline RChunk& CSBEServer::GlobalSharedHeap()
       
    89 		/* Get the global shared heap
       
    90 		
       
    91 		@return the global shared heap
       
    92 		*/
       
    93 			{
       
    94 			return iGlobalSharedHeap;
       
    95 			}
       
    96 			
       
    97 		inline CHeapWrapper& CSBEServer::GSHInterface()
       
    98 			/** Get the global shared heap interface
       
    99 			
       
   100 			@return the global shared heap interface
       
   101 			*/
       
   102 			{
       
   103 			return *iGSHInterface;
       
   104 			}
       
   105 			
       
   106 		inline CDataOwnerManager& CSBEServer::DataOwnerManager()
       
   107 			/* Get the data owner manager
       
   108 			
       
   109 			@return the data owner manager.
       
   110 			*/
       
   111 			{
       
   112 			
       
   113 			
       
   114 			return *iDOM;
       
   115 			}
       
   116 	}
       
   117 
       
   118 #endif //__SBESERVER_H__