upnpavcontroller/upnpavcontrollerserver/src/upnpdevicediscoverymessage.cpp
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2008 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:      Device message class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 // include files
       
    24 #include <e32base.h>
       
    25 
       
    26 // avcontroller internal
       
    27 #include "upnpdevicediscoverymessage.h"
       
    28 #include "upnpavdevice.h"
       
    29 
       
    30 // --------------------------------------------------------------------------
       
    31 // CUpnpDeviceDiscoveryMessage::CUpnpDeviceDiscoveryMessage
       
    32 // constructor
       
    33 // --------------------------------------------------------------------------
       
    34 CUpnpDeviceDiscoveryMessage::CUpnpDeviceDiscoveryMessage()
       
    35     {
       
    36     // none implement
       
    37     }
       
    38 
       
    39 // --------------------------------------------------------------------------
       
    40 // CUpnpDeviceDiscoveryMessage::NewL
       
    41 // Two-phased constructor.
       
    42 // --------------------------------------------------------------------------
       
    43 CUpnpDeviceDiscoveryMessage* CUpnpDeviceDiscoveryMessage::NewL(
       
    44         const CUpnpAVDevice* aDevice, TAVControllerDeviceDiscovery aType )
       
    45     {
       
    46     CUpnpDeviceDiscoveryMessage* self = NewLC( aDevice, aType );
       
    47     CleanupStack::Pop( self );
       
    48     return self;
       
    49     }
       
    50 
       
    51 // --------------------------------------------------------------------------
       
    52 // CUpnpDeviceDiscoveryMessage::NewLC
       
    53 // Two-phased constructor.
       
    54 // --------------------------------------------------------------------------
       
    55 CUpnpDeviceDiscoveryMessage* CUpnpDeviceDiscoveryMessage::NewLC( 
       
    56         const CUpnpAVDevice* aDevice, TAVControllerDeviceDiscovery aType )
       
    57     {
       
    58     CUpnpDeviceDiscoveryMessage* self = new( ELeave )
       
    59             CUpnpDeviceDiscoveryMessage;    
       
    60     CleanupStack::PushL( self );
       
    61     self->iUpnpAVDevice = ( CUpnpAVDevice* )aDevice;
       
    62     self->iMsgType = aType;
       
    63     return self;
       
    64     }
       
    65     
       
    66 // --------------------------------------------------------------------------
       
    67 // CUpnpDeviceDiscoveryMessage::~CUpnpDeviceDiscoveryMessage
       
    68 // Destructor
       
    69 // --------------------------------------------------------------------------
       
    70 CUpnpDeviceDiscoveryMessage::~CUpnpDeviceDiscoveryMessage()
       
    71     {
       
    72     delete iUpnpAVDevice;
       
    73     }
       
    74 
       
    75 // --------------------------------------------------------------------------
       
    76 // CUpnpDeviceDiscoveryMessage::LinkOffset
       
    77 // See upnpdevicediscoverymessage.h
       
    78 // --------------------------------------------------------------------------
       
    79 TInt CUpnpDeviceDiscoveryMessage::LinkOffset()
       
    80     {
       
    81     return _FOFF( CUpnpDeviceDiscoveryMessage, iSlink );
       
    82     }
       
    83 
       
    84 // --------------------------------------------------------------------------
       
    85 // CUpnpDeviceDiscoveryMessage::Device
       
    86 // See upnpdevicediscoverymessage.h
       
    87 // --------------------------------------------------------------------------
       
    88 CUpnpAVDevice* CUpnpDeviceDiscoveryMessage::Device()
       
    89     {
       
    90     return iUpnpAVDevice;
       
    91     }
       
    92 
       
    93 // --------------------------------------------------------------------------
       
    94 // CUpnpDeviceDiscoveryMessage::MsgType
       
    95 // See upnpdevicediscoverymessage.h
       
    96 // --------------------------------------------------------------------------
       
    97 TAVControllerDeviceDiscovery& CUpnpDeviceDiscoveryMessage::MsgType()
       
    98     {
       
    99     return iMsgType;
       
   100     }