multimediacommsengine/tsrc/testdriver/testclient/net/src/CTcBearer.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #include "CTcBearer.h"
       
    19 #include "MTcBearerFactory.h"
       
    20 #include "MTcBearerManager.h"
       
    21 
       
    22 EXPORT_C CTcBearer* CTcBearer::NewL( const MTcBearerFactory& aFactory )
       
    23 	{
       
    24 	CTcBearer* self = new( ELeave ) CTcBearer;
       
    25 
       
    26 	CleanupStack::PushL( self );
       
    27 	self->ConstructL( aFactory );
       
    28 	CleanupStack::Pop( self );
       
    29 
       
    30 	return self;
       
    31 	}
       
    32 
       
    33 EXPORT_C CTcBearer::~CTcBearer()
       
    34 	{
       
    35 	delete iManager;
       
    36 	}
       
    37 
       
    38 CTcBearer::CTcBearer()
       
    39 	{
       
    40 	}
       
    41 
       
    42 void CTcBearer::ConstructL( const MTcBearerFactory& aFactory )
       
    43 	{
       
    44 	iManager = aFactory.CreateManagerL();
       
    45 	}
       
    46 
       
    47 EXPORT_C void CTcBearer::ConnectL( TInetAddr* aRemoteAddr )
       
    48 	{
       
    49 	iManager->ConnectL( aRemoteAddr );
       
    50 	}
       
    51 
       
    52 EXPORT_C void CTcBearer::Close()
       
    53 	{
       
    54 	iManager->Close();
       
    55 	}
       
    56 
       
    57 EXPORT_C void CTcBearer::Send( const TDesC8& aDes )
       
    58 	{
       
    59 	iManager->Send( aDes );
       
    60 	}
       
    61 
       
    62 EXPORT_C void CTcBearer::Receive( TDes8& aDes )
       
    63 	{
       
    64 	iManager->Receive( aDes );
       
    65 	}
       
    66 
       
    67 EXPORT_C void CTcBearer::ReceiveOneOrMore( TDes8& aDes )
       
    68 	{
       
    69 	iManager->ReceiveOneOrMore( aDes );
       
    70 	}
       
    71 
       
    72 EXPORT_C void CTcBearer::SetObserver( MTcBearerObserver* aObserver )
       
    73 	{
       
    74 	iManager->SetObserver( aObserver );
       
    75 	}
       
    76 
       
    77 EXPORT_C void CTcBearer::GetLocalAddressL( TDes& aDes )
       
    78 	{
       
    79 	iManager->GetLocalAddressL( aDes );
       
    80 	}