wlan_bearer/wlanldd/wlan_common/osa_common/inc/osachunkbase.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2007 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 the License "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:   osachunkbase interface declaration
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 4 %
       
    20 */
       
    21 
       
    22 #ifndef M_WLANOSACHUNKBASE_H
       
    23 #define M_WLANOSACHUNKBASE_H
       
    24 
       
    25 /**
       
    26  *  osachunk interface declaration
       
    27  *
       
    28  *
       
    29  *  @lib wlanosa.lib
       
    30  *  @since S60 v3.2
       
    31  */
       
    32 class MWlanOsaChunkBase 
       
    33     {
       
    34 
       
    35 public:
       
    36 
       
    37 	/**
       
    38 	 * Destructor.
       
    39 	 *
       
    40 	 * @since S60 v3.2
       
    41 	 */
       
    42     virtual ~MWlanOsaChunkBase() {};
       
    43 
       
    44     /**
       
    45      * Memory allocation. 
       
    46      * Correct alignment guaranteed
       
    47      *
       
    48      * @since S60 v3.2
       
    49      * @param aSize size of the buffer to be allocated in bytes. 
       
    50      *              Must be positive otherwise the allocation fails
       
    51      * @param aZeroStamp zero stamp memory or not
       
    52      * @return begin of the allocated memory, NULL upon failure
       
    53      */
       
    54     virtual void* Alloc( TInt aSize, TBool aZeroStamp ) = 0;
       
    55 
       
    56     /**
       
    57      * Releases memory allocated by the Alloc method
       
    58      *
       
    59      * @since S60 v3.2
       
    60      * @param aPtr begin of the buffer to be freed
       
    61      */
       
    62     virtual void Free( void* aPtr ) = 0;
       
    63 
       
    64     /**
       
    65      * Returns the maximum free link size
       
    66      *
       
    67      * @since S60 v3.2
       
    68      * @return maximum free link size
       
    69      */
       
    70     virtual TInt MaxFreeLinkSize() const = 0;
       
    71 
       
    72     /**
       
    73      * Evaluates is chunk in use or not, 
       
    74      * meaning is memory allocated from there or not
       
    75      *
       
    76      * @since S60 v3.2
       
    77      * @return ETrue for unused chunk any other for used chunk
       
    78      */
       
    79     virtual TBool IsInUse() const = 0;
       
    80 
       
    81     /**
       
    82      * Returns the size of the memory chunk meta header in bytes
       
    83      *
       
    84      * @since S60 v3.2
       
    85      * @return size of the memory chunk meta header
       
    86      */
       
    87     virtual TInt HeaderSize() const = 0;
       
    88     };
       
    89 
       
    90 #endif // M_WLANOSACHUNKBASE_H