PECengine/PresenceServer2/ServerSrc/CPEngOutGoingTransContainer.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Container of the one outgoing transaction handler
       
    15 *				  It process one handler until it is completed
       
    16 * 				  canceled or some error ocures.
       
    17 * 				  Its completion is signaled to the observer
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CPENGOUTGOINGTRANSCONTAINER_H__
       
    24 #define __CPENGOUTGOINGTRANSCONTAINER_H__
       
    25 
       
    26 //  INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MPEngHandlerSendData;
       
    31 class MPEngPureDataHandler;
       
    32 class MPEngOutgoingTransactionHandler;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  *  Container of the one outgoing transaction handler
       
    38  *  It process one handler until it is completed
       
    39  *  canceled or some error ocures.
       
    40  *  Its completion is signaled to the observer
       
    41  *
       
    42  *  @lib PEngServer2
       
    43  *  @since 3.0
       
    44  */
       
    45 NONSHARABLE_CLASS( CPEngOutGoingTransContainer ) :
       
    46         public CActive
       
    47     {
       
    48 public:  // Constructors and destructor
       
    49 
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      * @since 3.0
       
    53      * @param aRequestHandler request handler,to signal completion
       
    54      * @param aPureDataHandler pure data handler
       
    55      * @param aTransactionHandlersArray transaction array
       
    56      *			to store new transaction
       
    57      * @return transaction container instance
       
    58      */
       
    59     static CPEngOutGoingTransContainer* NewL(
       
    60         MPEngHandlerSendData& aRequestHandler,
       
    61         MPEngPureDataHandler& aPureDataHandler,
       
    62         RPointerArray<MPEngOutgoingTransactionHandler>&
       
    63         aTransactionHandlersArray );
       
    64 
       
    65     static CPEngOutGoingTransContainer* NewLC(
       
    66         MPEngHandlerSendData& aRequestHandler,
       
    67         MPEngPureDataHandler& aPureDataHandler,
       
    68         RPointerArray<MPEngOutgoingTransactionHandler>&
       
    69         aTransactionHandlersArray );
       
    70 
       
    71     /**
       
    72      * Destructor.
       
    73      */
       
    74     virtual ~CPEngOutGoingTransContainer();
       
    75 
       
    76 public: // New functions
       
    77 
       
    78     /**
       
    79      *  Start Handeling of the transaction
       
    80      *
       
    81      *  @since 3.0
       
    82      *  @param	transaction handler, ownership is taked by the function
       
    83      *		it is safe to call it when transaction handler is not in
       
    84      *		the clean up stack
       
    85      */
       
    86     void StartTransactionL(
       
    87         MPEngOutgoingTransactionHandler* aOutgoingTransaction );
       
    88 
       
    89 public:		// Function from the CActive
       
    90 
       
    91     /**
       
    92      * CActive RunL()
       
    93      * @since 3.0
       
    94      */
       
    95     void RunL();
       
    96 
       
    97     /**
       
    98      * CActive RunError()
       
    99      * @since 3.0
       
   100      * @param aError The leave code
       
   101      * @return KErrNone
       
   102      */
       
   103     TInt RunError( TInt aError );
       
   104 
       
   105     /**
       
   106      * Implements cancellation of an outstanding request.
       
   107      * This function is called as part of the active object’s Cancel()
       
   108      * @since 3.0
       
   109      */
       
   110     void DoCancel();
       
   111 
       
   112 private:
       
   113 
       
   114     /**
       
   115      *  C++ default constructor.
       
   116      */
       
   117     CPEngOutGoingTransContainer(
       
   118         MPEngHandlerSendData& aRequestHandler,
       
   119         MPEngPureDataHandler& aPureDataHandler,
       
   120         RPointerArray<MPEngOutgoingTransactionHandler>&
       
   121         aTransactionHandlersArray );
       
   122 
       
   123     /**
       
   124      *  By default Symbian 2nd phase constructor is private.
       
   125      */
       
   126     void ConstructL();
       
   127 
       
   128 private:    // Data
       
   129 
       
   130 
       
   131     /// OWN: Pure data handler
       
   132     MPEngPureDataHandler&								iPureDataHandler;
       
   133 
       
   134     /// OWN: Outgoing transaction ID
       
   135     TInt												iTransactionId;
       
   136 
       
   137     /// REF: Request Handler
       
   138     MPEngHandlerSendData&								iRequestHandler;
       
   139 
       
   140     /// OWN: Outgoing transaction handler
       
   141     MPEngOutgoingTransactionHandler*					iTransactionHandler;
       
   142 
       
   143     ///  OWN: This array is used when Transaction needs to multiply
       
   144     ///       Elements REFerenced
       
   145     RPointerArray<MPEngOutgoingTransactionHandler>&	iNewTransactionHandlers;
       
   146 
       
   147     };
       
   148 
       
   149 #endif      // __CPENGOUTGOINGTRANSCONTAINER_H__
       
   150 
       
   151 // End of File