hti/HtiServicePlugins/HtiIpProxyServicePlugin/IPProxyEngine/Src/CWriteEvent.h
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 #ifndef CWRITEEVENT_H
       
    21 #define CWRITEEVENT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <es_sock.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 *  Write event for queuing data to be sent. The class only stores
       
    31 *  data and ports.
       
    32 */
       
    33 NONSHARABLE_CLASS( CWriteEvent ) : public CBase
       
    34     {
       
    35     public:  // Constructors and destructor
       
    36 
       
    37         /**
       
    38         * Factory function.
       
    39         * @param aProtocolDesc Protocol description to store.
       
    40         * @param aData Data to store.
       
    41         * @param aPeerPort Peer port to store.
       
    42         * @param aOriginalPort Original port to store.
       
    43         */
       
    44         static CWriteEvent* NewL( TProtocolDesc aProtocolDesc,
       
    45             const TDesC8& aData, TInt aPeerPort, TInt aOriginalPort );
       
    46 
       
    47         /**
       
    48         * Factory function.
       
    49         * @param aProtocolDesc Protocol description to store.
       
    50         * @param aData Data to store.
       
    51         * @param aPeerPort Peer port to store.
       
    52         * @param aOriginalPort Original port to store.
       
    53         */
       
    54         static CWriteEvent* NewLC( TProtocolDesc aProtocolDesc,
       
    55             const TDesC8& aData, TInt aPeerPort, TInt aOriginalPort );
       
    56 
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         ~CWriteEvent();
       
    61 
       
    62     public: // New functions
       
    63 
       
    64         /**
       
    65         * @return Protocol description
       
    66         */
       
    67         TProtocolDesc ProtocolDesc() const;
       
    68 
       
    69         /**
       
    70         * @return Data
       
    71         */
       
    72         const TDesC8& Data() const;
       
    73 
       
    74         /**
       
    75         * @return Peer port
       
    76         */
       
    77         TInt PeerPort() const;
       
    78 
       
    79         /**
       
    80         * @return Original port
       
    81         */
       
    82         TInt OriginalPort() const;
       
    83 
       
    84     private:
       
    85 
       
    86         /**
       
    87         * Default constructor.
       
    88         * @param aProtocolDesc Protocol description to store.
       
    89         * @param aPeerPort Peer port to store.
       
    90         * @param aOriginalPort Original port to store.
       
    91         */
       
    92         CWriteEvent( TProtocolDesc aProtocolDesc, TInt aPeerPort, TInt aOriginalPort );
       
    93 
       
    94         /**
       
    95         * 2nd phase constructor.
       
    96         * @param aData Data to store
       
    97         */
       
    98         void ConstructL( const TDesC8& aData );
       
    99 
       
   100 
       
   101     private:    // Data
       
   102         HBufC8* iData;
       
   103         TInt iPeerPort;
       
   104         TInt iOriginalPort;
       
   105         TProtocolDesc iProtocolDesc;
       
   106     };
       
   107 
       
   108 #endif      // CWRITEEVENT_H
       
   109 
       
   110 // End of File