PECengine/AttributeLibrary2/Inc/PEngAttrLibFactory.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  PEngAttrLibFactory - object factory
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __PENGATTRLIBFACTORY_H
       
    19 #define __PENGATTRLIBFACTORY_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Std.h>
       
    23 
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CPEngSessionSlotId;
       
    27 class MPEngPresenceAttrManager;
       
    28 class MPEngPresenceAttrTransactionEnv;
       
    29 class MPEngTransactionFactory;
       
    30 
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * Attribute Library Factory
       
    37  *
       
    38  * @lib PEngAttrLib
       
    39  * @since 3.0
       
    40  */
       
    41 class PEngAttrLibFactory
       
    42     {
       
    43     public: // Reference counted singletons
       
    44 
       
    45         /**
       
    46          * Gets a reference to Attribute Manager.
       
    47          *
       
    48          * Client must release instance by calling
       
    49          * MPEngPresenceAttrManager::Close() when it is no
       
    50          * more needed. If instance is needed just temporarily
       
    51          * (not as member), use AttributeManagerInstanceLC()
       
    52          * and the instance is freed by CleanupStack.
       
    53          *
       
    54          * @since 3.0
       
    55          * @param aSlotId
       
    56          * @return Attribute manager instance.
       
    57          */
       
    58         IMPORT_C static MPEngPresenceAttrManager* AttributeManagerInstanceL(
       
    59             const CPEngSessionSlotId& aSlotId );
       
    60         IMPORT_C static MPEngPresenceAttrManager* AttributeManagerInstanceLC(
       
    61             const CPEngSessionSlotId& aSlotId );
       
    62 
       
    63 
       
    64         /**
       
    65          * Gets a reference to Attribute Transaction environment.
       
    66          *
       
    67          * Attribute transaction environment provides services
       
    68          * to server side attribute transactions.
       
    69          *
       
    70          * Client must release instance by calling
       
    71          * MPEngPresenceAttrTransactionEnv::Close() when it is no
       
    72          * more needed. If instance is needed just temporarily
       
    73          * (not as member), use AttributeTransEnvInstanceLC()
       
    74          * and the instance is freed by CleanupStack.
       
    75          *
       
    76          * @since 3.0
       
    77          * @param aSlotId
       
    78          * @return Attribute transaction environment instance.
       
    79          */
       
    80         IMPORT_C static MPEngPresenceAttrTransactionEnv* AttributeTransEnvInstanceL(
       
    81             const CPEngSessionSlotId& aSlotId );
       
    82         IMPORT_C static MPEngPresenceAttrTransactionEnv* AttributeTransEnvInstanceLC(
       
    83             const CPEngSessionSlotId& aSlotId );
       
    84 
       
    85 
       
    86         /**
       
    87          * Gets a reference to Attribute Transaction environment.
       
    88          *
       
    89          * Attribute transaction environment provides services
       
    90          * to server side attribute transactions.
       
    91          *
       
    92          * Client must release instance by calling
       
    93          * MPEngTransactionFactory::Close() when it is no
       
    94          * more needed. If instance is needed just temporarily
       
    95          * (not as member), use AttributeTransFactoryInstanceLC()
       
    96          * and the instance is freed by CleanupStack.
       
    97          *
       
    98          * @since 3.0
       
    99          * @param aSlotId
       
   100          * @return Attribute transaction factory instance.
       
   101          */
       
   102         IMPORT_C static MPEngTransactionFactory* AttributeTransFactoryInstanceL(
       
   103             const CPEngSessionSlotId& aSlotId );
       
   104         IMPORT_C static MPEngTransactionFactory* AttributeTransFactoryInstanceLC(
       
   105             const CPEngSessionSlotId& aSlotId );
       
   106 
       
   107 
       
   108 
       
   109     public: // Debug support
       
   110 
       
   111         /**
       
   112          * Debug and test support for reference counted singletons.
       
   113          * @since 3.0
       
   114          */
       
   115         IMPORT_C static void __DbgObjectCounts( TInt& aHolder,
       
   116                                                 TInt& aAttrMan,
       
   117                                                 TInt& aTransEnv,
       
   118                                                 TInt& aTransFact );
       
   119 
       
   120         IMPORT_C static void __DbgAttrManRefCount( const CPEngSessionSlotId& aSlotId,
       
   121                                                    TInt& aRefCount );
       
   122 
       
   123         IMPORT_C static void __DbgTransEnvRefCount( const CPEngSessionSlotId& aSlotId,
       
   124                                                     TInt& aRefCount );
       
   125 
       
   126         IMPORT_C static void __DbgTransFactRefCount( const CPEngSessionSlotId& aSlotId,
       
   127                                                      TInt& aRefCount );
       
   128 
       
   129 
       
   130 
       
   131     private: // Prohibited constructors and destructor
       
   132 
       
   133         PEngAttrLibFactory();
       
   134         ~PEngAttrLibFactory();
       
   135 
       
   136     };
       
   137 
       
   138 #endif      // __PENGATTRLIBFACTORY_H
       
   139 
       
   140 // End of File