imservices/imfeatureplugin/srcimdatamodel/imapidataobjfactoryaccessor.cpp
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 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:  Base class for API implementations.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "imapidataobjfactoryaccessor.h"
       
    19 #include "imeventcodec.h"
       
    20 #include "imapidataobjfactory.h"
       
    21 
       
    22 //DATA TYPES
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS =============================
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // CImApiDataObjFactoryAccessor::NewL()
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C CImApiDataObjFactoryAccessor* CImApiDataObjFactoryAccessor::NewL()
       
    32     {
       
    33     CImApiDataObjFactoryAccessor* self = new( ELeave ) CImApiDataObjFactoryAccessor() ;
       
    34     CleanupStack::PushL( self );
       
    35     self->ConstructL();
       
    36     CleanupStack::Pop( self );
       
    37     return self;
       
    38     }
       
    39 
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // CImApiDataObjFactoryAccessor::ConstructL()
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 void CImApiDataObjFactoryAccessor::ConstructL()
       
    46     {
       
    47     // FIXME: would be probably better to have the Event Codec and other factories as singleton
       
    48     iImEventCodec = CImEventCodec::NewL();    
       
    49     iImApiDataObjFactory = CImApiDataObjFactory::NewL();
       
    50     }
       
    51 
       
    52 
       
    53 // ---------------------------------------------------------------------------
       
    54 // CImApiDataObjFactoryAccessor::CImApiDataObjFactoryAccessor()
       
    55 // ---------------------------------------------------------------------------
       
    56 //
       
    57 CImApiDataObjFactoryAccessor::CImApiDataObjFactoryAccessor()
       
    58     {
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CImApiDataObjFactoryAccessor::~CImApiDataObjFactoryAccessor()
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 CImApiDataObjFactoryAccessor::~CImApiDataObjFactoryAccessor()
       
    66     {
       
    67     delete iImEventCodec;
       
    68     delete iImApiDataObjFactory;
       
    69     }
       
    70 
       
    71     
       
    72 // ---------------------------------------------------------------------------
       
    73 // CImApiDataObjFactoryAccessor::EventCodec()
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 MEventCodec& CImApiDataObjFactoryAccessor::EventCodec()
       
    77     {
       
    78     return *iImEventCodec;
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // CImApiDataObjFactoryAccessor::ApiDataObjFactory()
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 MApiDataObjFactory& CImApiDataObjFactoryAccessor::ApiDataObjFactory()
       
    86     {
       
    87     return *iImApiDataObjFactory;
       
    88     }
       
    89 
       
    90 
       
    91 
       
    92 // End of file
       
    93 
       
    94 
       
    95 
       
    96 
       
    97 
       
    98 
       
    99