menucontentsrv/srvsrc/menusrvbuf.cpp
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 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 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 
       
    20 #include "menusrvbuf.h"
       
    21 
       
    22 // CONSTANTS
       
    23 
       
    24 /// Buffer granularity.
       
    25 LOCAL_D const TInt KMenuSrvBufGranularity = 512;
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // HMenuSrvBuf::NewL()
       
    31 // ---------------------------------------------------------
       
    32 //
       
    33 HMenuSrvBuf* HMenuSrvBuf::NewL()
       
    34     {
       
    35     HMenuSrvBuf* buf = NewLC();
       
    36     CleanupStack::Pop( buf );
       
    37     return buf;
       
    38     }
       
    39 
       
    40 // ---------------------------------------------------------
       
    41 // HMenuSrvBuf::NewLC()
       
    42 // ---------------------------------------------------------
       
    43 //
       
    44 HMenuSrvBuf* HMenuSrvBuf::NewLC()
       
    45     {
       
    46     HMenuSrvBuf* buf = new (ELeave) HMenuSrvBuf;
       
    47     buf->PushL();
       
    48     buf->ConstructL();
       
    49     return buf;
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------
       
    53 // HMenuSrvBuf::ConstructL()
       
    54 // ---------------------------------------------------------
       
    55 //
       
    56 void HMenuSrvBuf::ConstructL()
       
    57     {
       
    58     iBuf = CBufSeg::NewL( KMenuSrvBufGranularity );
       
    59     Set( *iBuf, 0, ERead | EWrite );
       
    60     }
       
    61 
       
    62 // ---------------------------------------------------------
       
    63 // HMenuSrvBuf::DoRelease()
       
    64 // ---------------------------------------------------------
       
    65 //
       
    66 void HMenuSrvBuf::DoRelease()
       
    67     {
       
    68     delete this;
       
    69     }
       
    70 
       
    71 //  End of File