upnp/upnpstack/serviceframework/src/upnpdispatcherrequest.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 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:  Defines CUpnpdispacherrequest class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <badesca.h>
       
    21 #include "upnpdispatcherrequest.h"
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CUpnpDispatcherRequest::CUpnpDispatcherRequest
       
    27 // C++ default constructor can NOT contain any code, that
       
    28 // might leave.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CUpnpDispatcherRequest::CUpnpDispatcherRequest( TMessageHandlerRqst aRequest )
       
    32 : iRequest(aRequest)
       
    33     {
       
    34     }
       
    35 // -----------------------------------------------------------------------------
       
    36 // CUpnpDispatcherRequest::NewL
       
    37 // Two-phased constructor.
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CUpnpDispatcherRequest* CUpnpDispatcherRequest::NewLC( TMessageHandlerRqst aRequest )
       
    41     {
       
    42     CUpnpDispatcherRequest* self = new (ELeave) CUpnpDispatcherRequest( aRequest );
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL();
       
    45     return self;
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CUpnpDispatcherRequest::ConstructL
       
    50 // Second phase constructor.
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void CUpnpDispatcherRequest::ConstructL()
       
    54     {
       
    55     const TInt KDefaultGranurality(8);
       
    56     iArguments = new (ELeave) CDesC8ArrayFlat( KDefaultGranurality );
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CUpnpDispatcherRequest::~CUpnpDispatcherRequest
       
    61 // Destructor.
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 CUpnpDispatcherRequest::~CUpnpDispatcherRequest()
       
    65     {
       
    66     delete iArguments;
       
    67     delete iServices;
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CUpnpDispatcherRequest::AddArgumentL
       
    72 //
       
    73 // (other items were commented in a header).
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 void CUpnpDispatcherRequest::AddArgumentL(const TDesC8& aArgument)
       
    77     {
       
    78     iArguments->AppendL( aArgument );
       
    79     }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CUpnpDispatcherRequest::AddServices
       
    83 //
       
    84 // (other items were commented in a header).
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 void CUpnpDispatcherRequest::AddServices(CDesC8ArrayFlat* aArgument)
       
    88     {
       
    89     delete iServices;
       
    90     iServices = aArgument;
       
    91     }
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // CUpnpDispatcherRequest::Arguments
       
    95 //
       
    96 // (other items were commented in a header).
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 CDesC8ArrayFlat& CUpnpDispatcherRequest::Arguments()
       
   100     {
       
   101     return *iArguments;
       
   102     }
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CUpnpDispatcherRequest::Services
       
   106 //
       
   107 // (other items were commented in a header).
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 CDesC8ArrayFlat& CUpnpDispatcherRequest::Services()
       
   111     {
       
   112     return *iServices;
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // CUpnpDispatcherRequest::Request
       
   117 //
       
   118 // (other items were commented in a header).
       
   119 // -----------------------------------------------------------------------------
       
   120 //
       
   121 TMessageHandlerRqst CUpnpDispatcherRequest::Request()
       
   122     {
       
   123     return iRequest;
       
   124     }
       
   125 
       
   126 //  End of File