btobexprofiles/obexserviceman/obexservicemanserver/src/SrcsMessage.cpp
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  obexserviceman message handling.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "SrcsMessage.h"
       
    21 
       
    22 
       
    23 // ================= MEMBER FUNCTIONS =======================
       
    24 
       
    25 // ---------------------------------------------------------
       
    26 // C++ default constructor can NOT contain any code, that
       
    27 // might leave.
       
    28 // ---------------------------------------------------------
       
    29 //
       
    30 CSrcsMessage::CSrcsMessage(const RMessage2& aMessage)
       
    31     {
       
    32     iMessagePtr = aMessage;
       
    33     iCancelPtr = aMessage.Ptr2();
       
    34     }
       
    35 // ---------------------------------------------------------
       
    36 // Two-phased constructor.
       
    37 // ---------------------------------------------------------
       
    38 //
       
    39 CSrcsMessage* CSrcsMessage::NewL(const RMessage2& aMessage)
       
    40     {
       
    41     return (new(ELeave) CSrcsMessage(aMessage));
       
    42     }
       
    43 
       
    44 // ---------------------------------------------------------
       
    45 // Destructor
       
    46 // ---------------------------------------------------------
       
    47 //
       
    48 CSrcsMessage::~CSrcsMessage()
       
    49     {
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------
       
    53 // Complete
       
    54 // Completes the RMessage2 and deletes any associated helper.
       
    55 // ---------------------------------------------------------
       
    56 //
       
    57 void CSrcsMessage::Complete(TInt aReason)
       
    58     {
       
    59     //complete the message
       
    60     iMessagePtr.Complete(aReason);
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // MessagePtr
       
    65 // Returns reference to RMessage2.
       
    66 // ---------------------------------------------------------
       
    67 //
       
    68 const RMessage2& CSrcsMessage::MessagePtr()
       
    69     {
       
    70     return iMessagePtr;
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------
       
    74 // CancelPtr
       
    75 // The CancelPtr is the address of the TRequestStatus of the
       
    76 // client-side active object dealing with the request.
       
    77 // When a request is cancelled, it is located server-side using
       
    78 // this address.
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 const TAny* CSrcsMessage::CancelPtr()
       
    82     {
       
    83     return iCancelPtr;
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------
       
    87 // operator==
       
    88 // Compares Message pointers, if they are same, return value
       
    89 // is ETrue, else EFalse.
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 TBool CSrcsMessage::operator==(CSrcsMessage& aMessage) const
       
    93     {
       
    94     if (iMessagePtr == aMessage.MessagePtr())
       
    95         {
       
    96         return ETrue;
       
    97         }
       
    98     return EFalse;
       
    99     }
       
   100 
       
   101 //  End of File