ncdengine/provider/server/src/ncdnodesupplier.cpp
changeset 4 32704c33136d
equal deleted inserted replaced
-1:000000000000 4:32704c33136d
       
     1 /*
       
     2 * Copyright (c) 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:   Implementation of CNcdNodeSupplier class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "ncdnodesupplier.h"
       
    20 #include "ncdnodesupplierlink.h"
       
    21 
       
    22 CNcdNodeSupplier* CNcdNodeSupplier::NewL(
       
    23     CNcdNodeManager& aNodeManager,
       
    24     const CNcdNodeIdentifier& aIdentifier ) 
       
    25     {
       
    26     CNcdNodeSupplier* self = 
       
    27         CNcdNodeSupplier::NewLC( aNodeManager,
       
    28                                  aIdentifier );
       
    29     CleanupStack::Pop( self );
       
    30     return self;    
       
    31     }
       
    32 
       
    33 CNcdNodeSupplier* CNcdNodeSupplier::NewLC(
       
    34     CNcdNodeManager& aNodeManager,
       
    35     const CNcdNodeIdentifier& aIdentifier ) 
       
    36     {
       
    37     CNcdNodeSupplier* self = 
       
    38         new ( ELeave ) CNcdNodeSupplier( aNodeManager );
       
    39     CleanupClosePushL( *self );
       
    40     self->ConstructL( aIdentifier );
       
    41     return self;    
       
    42     }
       
    43     
       
    44 CNcdNodeSupplier::CNcdNodeSupplier( CNcdNodeManager& aNodeManager ) :
       
    45     CNcdNode(
       
    46         aNodeManager,
       
    47         NcdNodeClassIds::ENcdSupplierNodeClassId,
       
    48         NcdNodeClassIds::ENcdSupplierNodeLinkClassId,
       
    49         NcdNodeClassIds::ENcdSupplierNodeMetaDataClassId ) 
       
    50     {
       
    51     }
       
    52     
       
    53 CNcdNodeLink* CNcdNodeSupplier::CreateLinkL() 
       
    54     {
       
    55     DLTRACEIN((""));
       
    56     CNcdNodeLink* link = NodeLink();
       
    57     
       
    58     if ( link )
       
    59         {
       
    60         DLTRACEOUT(("Link already exists"));
       
    61         // The link was already created
       
    62         return link;
       
    63         }
       
    64     else
       
    65         {
       
    66         DLTRACEOUT(("Creating a new link"));
       
    67         // Link was not already created.
       
    68         // So, create new.
       
    69         return CNcdNodeSupplierLink::NewL( *this );        
       
    70         }
       
    71     }