mmserv/voipaudioservices/VoIPIntfc/src/VoIPDataBufferImpl.cpp
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2008 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:  VOIP Audio Services
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "VoIPSharedData.h"
       
    20 #include "VoIPDataBufferImpl.h"
       
    21 
       
    22 
       
    23 // -----------------------------------------------------------------------------
       
    24 // CVoIPDataBufferImpl::NewL
       
    25 // -----------------------------------------------------------------------------
       
    26 //
       
    27 CVoIPDataBufferImpl* CVoIPDataBufferImpl::NewL(TInt aBufferLen)
       
    28     {
       
    29     CVoIPDataBufferImpl* self = new (ELeave) CVoIPDataBufferImpl();
       
    30     CleanupStack::PushL(self);
       
    31     self->ConstructL(aBufferLen);
       
    32     CleanupStack::Pop(self);
       
    33     return self;
       
    34     }
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CVoIPDataBufferImpl::CVoIPDataBufferImpl
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CVoIPDataBufferImpl::CVoIPDataBufferImpl() :
       
    41     iPayloadPtr(0,0,0)
       
    42     {
       
    43     iType = CVoIPDataBuffer::EStandard;
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CVoIPDataBufferImpl::~CVoIPDataBufferImpl
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CVoIPDataBufferImpl::~CVoIPDataBufferImpl()
       
    51     {
       
    52     delete iBuf;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CVoIPDataBufferImpl::ConstructL
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 void CVoIPDataBufferImpl::ConstructL(TInt aBufferLen)
       
    60     {
       
    61     CVoIPDataBuffer::ConstructL(this);
       
    62     iBuf = HBufC8::New(aBufferLen); //non-leaving?
       
    63     iPayloadPtr.Set(iBuf->Des());
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CVoIPDataBufferImpl::GetPayloadPtr
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 void CVoIPDataBufferImpl::GetPayloadPtr(TPtr8& aPayloadPtr)
       
    71     {
       
    72     aPayloadPtr.Set(iPayloadPtr);
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CVoIPDataBufferImpl::SetBufferType
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 void CVoIPDataBufferImpl::SetPayloadPtr(TPtr8 aPayloadPtr)
       
    80     {
       
    81     iPayloadPtr.Set(aPayloadPtr);
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CVoIPDataBufferImpl::GetBufferType
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CVoIPDataBufferImpl::GetBufferType(CVoIPDataBuffer::TVoIPBufferType& aType)
       
    89     {
       
    90     aType = iType;
       
    91     }
       
    92 
       
    93 
       
    94 // End of file