commsfwutils/commsbufs/inc/commsbufpondintf.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 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 //
       
    15 
       
    16 #ifndef __COMMSBUFPONDINTF_H__
       
    17 #define __COMMSBUFPONDINTF_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 class RCommsBuf;
       
    22 class CCommsBufAsyncRequest;
       
    23 class MCommsBufPondDbg;
       
    24 
       
    25 /**
       
    26 This class defines a interface to communicate with the legacy mbufmanager or
       
    27 with the system wide shared buffer mechanism
       
    28 @internalTechnology
       
    29 */
       
    30 class MCommsBufPondIntf 
       
    31 	{
       
    32 	public:
       
    33 	/**
       
    34 	Allocate a new RCommsBuf
       
    35 	
       
    36 	@param aSize - Requested total size
       
    37 	@param aMinBufSize - The size that the allocated buffer must atleast have
       
    38 	@param aMaxBufSize - The size that the allocated buffer "can" have.
       
    39 
       
    40 	@return RCommsBuf if allocation is successful otherwise NULL.
       
    41 	*/
       
    42 
       
    43 	virtual RCommsBuf* Alloc(TInt aSize, TInt aMinBufSize, TInt aMaxBufSize) =0;
       
    44 	
       
    45 	virtual RCommsBuf* FromHandle(TInt aHandle) =0;
       
    46 
       
    47 	virtual TInt Store(TDes8& aStore) const = 0;
       
    48 
       
    49 	/**
       
    50 	Frees the RCommsBuf
       
    51 
       
    52 	@param aBuf - RCommsBuf for freeing
       
    53 	*/
       
    54 	virtual void Free(RCommsBuf* aBuf) =0;
       
    55 	/**
       
    56 	Total bytes available in the mbufmgr or shared buffer system
       
    57 	*/
       
    58 	virtual TInt BytesAvailable() const =0;
       
    59 	/**
       
    60 	Total bytes available in a pool with a given size.
       
    61 	*/
       
    62 	virtual TInt BytesAvailable(TInt aSize) const =0;
       
    63 	/**
       
    64 	Returns the buffer size that is greater than the given size.
       
    65 	*/
       
    66 	virtual TInt NextBufSize(TInt aSize) const =0;
       
    67 
       
    68 	/**
       
    69 	Larget buffer size available in the mbufmgr or shared buffer system
       
    70 	*/
       
    71 	virtual TInt LargestBufSize() const =0;
       
    72 	/**
       
    73 	Request to allocate a RCommsBuf asynchronously
       
    74 	*/
       
    75 	virtual void StartRequest(CCommsBufAsyncRequest& aRequest) =0;
       
    76 
       
    77 	/**
       
    78 	Cance the request to allocate a RCommsBuf asynchronously
       
    79 	*/
       
    80 	virtual void CancelRequest(CCommsBufAsyncRequest& aRequest) =0;
       
    81 
       
    82 	/**
       
    83 	Set the conext. In the case of system shared buffer manager this function is not having any implmentation
       
    84 	as the context will be set by the RCommsBufPond. For mbufmgr which is another DLL needs
       
    85 	to set the context for the usage of global timers etc...
       
    86 	*/
       
    87 	virtual void SetContext() =0;
       
    88 	
       
    89 	virtual void Release(RLibrary& aLib) =0;
       
    90 
       
    91 	virtual MCommsBufPondDbg& CommsBufPondDbg() =0;
       
    92 	
       
    93 	};
       
    94 
       
    95 #endif // __COMMSBUFPONDINTF_H__