graphicscomposition/openwfsupport/inc/streammap.h
branchRCL_3
changeset 163 bbf46f59e123
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
equal deleted inserted replaced
150:57c618273d5c 163:bbf46f59e123
    19 #define STREAMMAP_H
    19 #define STREAMMAP_H
    20 
    20 
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include <e32std.h>			//for RFastLock
    22 #include <e32std.h>			//for RFastLock
    23 #include <e32hashtab.h>		//for RHashMap
    23 #include <e32hashtab.h>		//for RHashMap
    24 #include <graphics/surfacemanager.h>
       
    25 
       
    26 #include <graphics/updateserverprovider.h>
       
    27 
    24 
    28 class CSurfaceStream;
    25 class CSurfaceStream;
    29 class TSurfaceId;
    26 class TSurfaceId;
    30 class MSurfaceUpdateServerProvider;
    27 class MSurfaceUpdateServerProvider;
    31 class CExtensionContainer;
    28 class CExtensionContainer;
       
    29 class RSurfaceManager;
    32 
    30 
    33 NONSHARABLE_CLASS(COpenWfcStreamMap): public CBase
    31 NONSHARABLE_CLASS(COpenWfcStreamMap): public CBase
    34 	{
    32 	{
    35 	public:
    33 	public:
    36 		/**
    34 		/**
    37 		 * Returns a reference to the singleton instance.
    35 		 * Returns a reference to the singleton instance.
    38 		 * 
    36 		 * 
    39 		 * @return	The pointer to the singleton instance
    37 		 * @return	The pointer to the singleton instance
    40 		 */
    38 		 */
    41 		IMPORT_C static COpenWfcStreamMap& InstanceL();
    39 		IMPORT_C static COpenWfcStreamMap& InstanceL();
    42 		/**
       
    43 		 * Expands the array to accommodate a specified number of key-value pairs.
       
    44 		 * If the hash map already has enough space for the specified number of elements, no
       
    45 		 * action is taken. Any elements already in the map are retained.
       
    46 		 * 
       
    47 		 * @param	aExpand	The number of key-value pairs for which space should be allocated.
       
    48 		 * @return	KErrNone if the operation completed aInternalVersion.
       
    49 		 * @return	KErrNoMemory if sufficient memory could not be allocated.
       
    50 		 */
       
    51 		IMPORT_C TInt Reserve(TInt aExpand);
       
    52 		/**
    40 		/**
    53 		 * Look up a specified TSurfaceId key in the associative array and return a pointer to the
    41 		 * Look up a specified TSurfaceId key in the associative array and return a pointer to the
    54 		 * corresponding to a native stream. The reference counter of the native stream is incremented by one.
    42 		 * corresponding to a native stream. The reference counter of the native stream is incremented by one.
    55 		 * 
    43 		 * 
    56 		 * @param	aSurfaceId	The TSurfaceId key to look up
    44 		 * @param	aSurfaceId	The TSurfaceId key to look up
   106 		/**
    94 		/**
   107 		 * Returns a reference to the surface manager.
    95 		 * Returns a reference to the surface manager.
   108 		 * 
    96 		 * 
   109 		 * @return	A reference to the local SurfaceManager
    97 		 * @return	A reference to the local SurfaceManager
   110 		 */
    98 		 */
   111 		RSurfaceManager& SurfaceManager();
    99         IMPORT_C RSurfaceManager& SurfaceManager();
   112 		
   100 		
   113         /**
   101         /**
   114          * Returns a pointer to the main heap
   102          * Returns a pointer to the main heap
   115          * 
   103          * 
   116          * @return  A pointer to the main heap
   104          * @return  A pointer to the main heap
   156 			private:
   144 			private:
   157 				RFastLock& iLock;
   145 				RFastLock& iLock;
   158 			};
   146 			};
   159 	private:
   147 	private:
   160 		/**
   148 		/**
   161 		 * Copy constructor
       
   162 		 */
       
   163 		COpenWfcStreamMap(const COpenWfcStreamMap&);
       
   164 		/**
       
   165 		 * Assignment operator
       
   166 		 */
       
   167 		COpenWfcStreamMap& operator= (const COpenWfcStreamMap&);
       
   168 		/**
       
   169 		 * Symbian constructor used with two stage construction pattern
   149 		 * Symbian constructor used with two stage construction pattern
   170 		 */
   150 		 */
   171 		void ConstructL();
   151 		void ConstructL();
   172 		/**
   152 		/**
   173 		Forms a 32-bit hash value from a TSurfaceId.
   153 		Forms a 32-bit hash value from a TSurfaceId.
   196 		 */
   176 		 */
   197 		static COpenWfcStreamMap* pInstance;
   177 		static COpenWfcStreamMap* pInstance;
   198 		/**
   178 		/**
   199 		 * Surface manager
   179 		 * Surface manager
   200 		 */
   180 		 */
   201 		RSurfaceManager iSurfaceManager;
   181 		RSurfaceManager* iSurfaceManager;
   202 
   182 
   203 		RHeap *iMainHeap; //< --This points to main thread's heap--
   183 		RHeap *iMainHeap; //< --This points to main thread's heap--
   204 		
   184 		
   205 		RHashMap<TInt32, CExtensionContainer*>	iRegisteredUpdaters; //< Proxy objects for handing surface update notifications.
   185 		RHashMap<TInt32, CExtensionContainer*>	iRegisteredUpdaters; //< Proxy objects for handing surface update notifications.
   206 		
   186