landmarks/locationlandmarks/server/inc/EPos_CPosLmActiveCompacter.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2005 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: Declaration of Active object that compacts database.
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPOSLMACTIVECOMPACTER_H
       
    21 #define CPOSLMACTIVECOMPACTER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <epos_cposlmlocaldbaccess.h>
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CPosLmLocalAccessSubsession;
       
    31 class CPosLmCompactDatabase;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Active object that compacts database.
       
    37 */
       
    38 class CPosLmActiveCompacter : public CActive
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         *
       
    45         * @param aOwner The owner of the database lock.
       
    46         * @param aDb The database to compact.
       
    47         */
       
    48         static CPosLmActiveCompacter* NewL(
       
    49         /* IN */        CPosLmLocalAccessSubsession& aOwner,
       
    50         /* IN */        CPosLmLocalDbAccess& aDb
       
    51         );
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CPosLmActiveCompacter();
       
    57 
       
    58     public: // From base classes
       
    59 
       
    60         /**
       
    61         * From CActive.
       
    62         *
       
    63         */
       
    64         void DoCancel();
       
    65 
       
    66         /**
       
    67         * From CActive.
       
    68         *
       
    69         */
       
    70         void RunL();
       
    71 
       
    72         /**
       
    73         * From CActive.
       
    74         *
       
    75         * @param aError The leave code.
       
    76         * @return Returns KErrNone.
       
    77         */
       
    78         TInt RunError(
       
    79         /* IN */    TInt aError
       
    80         );
       
    81 
       
    82     private:
       
    83 
       
    84         /**
       
    85         * C++ default constructor.
       
    86         *
       
    87         * @param aDb The database to compact.
       
    88         */
       
    89         CPosLmActiveCompacter(
       
    90         /* IN */        CPosLmLocalAccessSubsession& aOwner
       
    91         );
       
    92 
       
    93         /**
       
    94         * By default Symbian 2nd phase constructor is private.
       
    95         *
       
    96         * @param aDb The database to compact.
       
    97         */
       
    98         void ConstructL(
       
    99         /* IN */        CPosLmLocalDbAccess& aDb
       
   100         );
       
   101 
       
   102         /**
       
   103         * Completes this active object after each incremental step.
       
   104         */
       
   105         void CompleteSelf();
       
   106 
       
   107     private:    // Data
       
   108 
       
   109         CPosLmLocalAccessSubsession& iOwner;
       
   110 
       
   111         CPosLmCompactDatabase* iCompactDb;
       
   112 
       
   113     };
       
   114 
       
   115 #endif      // CPOSLMACTIVECOMPACTER_H
       
   116 
       
   117 // End of File
       
   118