hti/HtiServicePlugins/HtiIpProxyServicePlugin/IPProxyEngine/Src/CWriteEvent.cpp
branchRCL_3
changeset 59 8ad140f3dd41
parent 0 a03f92240627
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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:  Write event for queuing data to be sent
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "CWriteEvent.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CWriteEvent::CWriteEvent
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 CWriteEvent::CWriteEvent( TProtocolDesc aProtocolDesc, TInt aPeerPort,
       
    31     TInt aOriginalPort ) :
       
    32     iPeerPort( aPeerPort ),
       
    33     iOriginalPort( aOriginalPort ),
       
    34     iProtocolDesc( aProtocolDesc )
       
    35     {
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CWriteEvent::ConstructL
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 void CWriteEvent::ConstructL( const TDesC8& aData )
       
    43     {
       
    44     iData = aData.AllocL();
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CWriteEvent::NewL
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 CWriteEvent* CWriteEvent::NewL( TProtocolDesc aProtocolDesc,
       
    52     const TDesC8& aData, TInt aPeerPort, TInt aOriginalPort )
       
    53     {
       
    54     CWriteEvent* self = CWriteEvent::NewLC( aProtocolDesc, aData, aPeerPort, aOriginalPort );
       
    55     CleanupStack::Pop();
       
    56 
       
    57     return self;
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CWriteEvent::NewLC
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 CWriteEvent* CWriteEvent::NewLC( TProtocolDesc aProtocolDesc,
       
    65     const TDesC8& aData, TInt aPeerPort, TInt aOriginalPort )
       
    66     {
       
    67     CWriteEvent* self = new( ELeave ) CWriteEvent( aProtocolDesc, aPeerPort,
       
    68         aOriginalPort );
       
    69     CleanupStack::PushL( self );
       
    70 
       
    71     self->ConstructL( aData );
       
    72     return self;
       
    73     }
       
    74 
       
    75 
       
    76 // Destructor
       
    77 CWriteEvent::~CWriteEvent()
       
    78     {
       
    79     delete iData;
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CWriteEvent::ProtocolDesc
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 TProtocolDesc CWriteEvent::ProtocolDesc() const
       
    87     {
       
    88     return iProtocolDesc;
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CWriteEvent::Data
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 const TDesC8& CWriteEvent::Data() const
       
    96     {
       
    97     return *iData;
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CWriteEvent::PeerPort
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 TInt CWriteEvent::PeerPort() const
       
   105     {
       
   106     return iPeerPort;
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CWriteEvent::OriginalPort
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 TInt CWriteEvent::OriginalPort() const
       
   114     {
       
   115     return iOriginalPort;
       
   116     }
       
   117 
       
   118 
       
   119 //  End of File