wim/WimServer/src/WimResponse.cpp
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003-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:  WIM Response functions. Complete messages from client.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "WimResponse.h"
       
    21 #include    "WimUtilityFuncs.h"
       
    22 #include    "WimTrace.h"
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // C++ default constructor can NOT contain any code, that
       
    29 // might leave.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CWimResponse::CWimResponse( RMessage2 aMessage )
       
    33     : iMessage( aMessage ),
       
    34       iStatus( WIMI_ERR_Internal ),
       
    35       iError( 0 )
       
    36     {
       
    37     _WIMTRACE(_L("WIM | WIMServer | CWimResponse::CWimResponse | Begin"));
       
    38     }
       
    39 
       
    40 // Destructor
       
    41 CWimResponse::~CWimResponse()
       
    42     {
       
    43     _WIMTRACE(_L("WIM | WIMServer | CWimResponse::~CWimResponse | Begin"));
       
    44     if( !iMessage.IsNull() )
       
    45         {
       
    46         if( iError ) // Check if any intenal error
       
    47             {
       
    48             iMessage.Complete( iError );
       
    49             }
       
    50         else
       
    51             {
       
    52             // Set the status of the WIM Call
       
    53             iMessage.Complete( CWimUtilityFuncs::MapWIMError( iStatus ) );
       
    54             }
       
    55         }
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CWimResponse::CompleteMsgAndDelete
       
    60 // Delete message. Message is completed in destructor so just delete response.
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 void CWimResponse::CompleteMsgAndDelete()
       
    64     {
       
    65     _WIMTRACE(_L("WIM | WIMServer | CWimResponse::CompleteMsgAndDelete | Begin"));
       
    66     delete this;
       
    67     }
       
    68 
       
    69 // End of File