datasourceadaptation/gpsdatasourceadaptation/inc/EPos_CPositionerRegistry.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CPOSITIONERREGISTRY_H
       
    21 #define CPOSITIONERREGISTRY_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MPosStatusObserver;
       
    27 class MPosParameterObserver;
       
    28 class MPositionerStatus;
       
    29 class CPosPsyExtension;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 * Class used to keep track of all CPositioner instances. All such instances 
       
    35 * should register/de-register themselves once to this class.
       
    36 * 
       
    37 */
       
    38 class CPositionerRegistry : public CBase
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Singleton constructor.
       
    44         *
       
    45         * @param aImplementationUid PSY implementation UID
       
    46         * @return the one and only CPositionerRegistry instance.
       
    47         */
       
    48         static CPositionerRegistry* InstanceL(
       
    49         /* IN  */       MPosStatusObserver* aStatusObserver
       
    50         );
       
    51 
       
    52         /**
       
    53         * Singleton destructor.
       
    54         *
       
    55         * @param aImplementationUid PSY implementation UID
       
    56         */
       
    57         void Release();
       
    58 
       
    59     public:  // New functions
       
    60 
       
    61         /**
       
    62         * Registers a positioner as user of this PSY.
       
    63         *
       
    64         * @param aImplementationUid the implementation UID for the PSY.
       
    65         * @return the CPosPsyExtension instance, common for all CPositioner
       
    66         *         instances with the same implementation UID.
       
    67         */
       
    68         CPosPsyExtension* RegisterPositionerL(
       
    69         /* IN  */       TUid aImplementationUid
       
    70         );
       
    71 
       
    72         /**
       
    73         * De-registers a positioner as user of this PSY.
       
    74         *
       
    75         * @param aImplementationUid the implementationUid for the PSY.
       
    76         */
       
    77         void DeregisterPositioner(
       
    78         /* IN  */       TUid aImplementationUid
       
    79         );
       
    80 
       
    81     private:  // New functions
       
    82 
       
    83         TInt Find(TUid aImplementationUid);
       
    84 
       
    85     private:  // Constructors and destructor
       
    86 
       
    87         /**
       
    88         * C++ default constructor.
       
    89         */
       
    90         CPositionerRegistry(MPosStatusObserver* aStatusObserver);
       
    91 
       
    92         /**
       
    93         * Destructor.
       
    94         */
       
    95         ~CPositionerRegistry();
       
    96 
       
    97         // By default, prohibit copy constructor
       
    98         CPositionerRegistry( const CPositionerRegistry& );
       
    99         // Prohibit assigment operator
       
   100         CPositionerRegistry& operator= ( const CPositionerRegistry& );
       
   101 
       
   102     private: // Data
       
   103 
       
   104         RPointerArray<CPosPsyExtension> iPsyExtensions;
       
   105         TInt                            iRefCount;
       
   106         MPosStatusObserver*             iStatusObserver;
       
   107         
       
   108     };  
       
   109 
       
   110 #endif  // CPOSITIONERREGISTRY_H
       
   111 
       
   112 // End of File