phonebookengines/VirtualPhonebook/VPbkSimStoreImpl/inc/CParallelCompositeCmd.h
branchRCL_3
changeset 63 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2007-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:  A composite command that runs subcommands parallel.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VPBKSIMSTOREIMPL_CPARALLELCOMPOSITECMD_H
       
    21 #define VPBKSIMSTOREIMPL_CPARALLELCOMPOSITECMD_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CCompositeCmdBase.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 namespace VPbkSimStoreImpl {
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  A composite command that runs subcommands parallel.
       
    34 */
       
    35 NONSHARABLE_CLASS(CParallelCompositeCmd) : public CCompositeCmdBase
       
    36     {
       
    37     public: // Data types
       
    38         enum TTerminationPolicy
       
    39             {
       
    40             /// Composite terminates when the first subcommand is done.
       
    41             EFirstSubCommandDone,
       
    42             /// Composite terminates when all subcommands are done.
       
    43             EAllSubCommandsDone
       
    44             };
       
    45         
       
    46     public: // Construction and Destruction
       
    47 
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         *
       
    51         * @param aTerminationPolicy Defines how the composite terminates
       
    52         * @return A new instance of this class
       
    53         */
       
    54         static CParallelCompositeCmd* NewL( 
       
    55                 TTerminationPolicy aTerminationPolicy );
       
    56         
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         *
       
    60         * @param aTerminationPolicy Defines how the composite terminates
       
    61         * @return A new instance of this class in CleanupStack
       
    62         */
       
    63         static CParallelCompositeCmd* NewLC( 
       
    64                 TTerminationPolicy aTerminationPolicy );
       
    65         
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         ~CParallelCompositeCmd();
       
    70     
       
    71     public: // Functions from base classes
       
    72      
       
    73         /**
       
    74         * From MVPbkSimCommand
       
    75         */
       
    76         void Execute();
       
    77         
       
    78     private: // Functions from base classes
       
    79         
       
    80         /**
       
    81         * From MVPbkSimCommandObserver
       
    82         */
       
    83         void CommandDone( MVPbkSimCommand& aCommand );
       
    84 
       
    85     private: // Implementation
       
    86 
       
    87         /**
       
    88         * C++ constructor.
       
    89         */
       
    90         CParallelCompositeCmd( TTerminationPolicy aTerminationPolicy );
       
    91         
       
    92     private:    // Data
       
    93         /// Own: Defines when the composite terminates
       
    94         TTerminationPolicy iTerminationPolicy;
       
    95         /// Own: A counter for terminated subcommands.
       
    96         TInt iTerminatedCommands;
       
    97     };
       
    98 } // namespace VPbkSimStoreImpl
       
    99 #endif      // VPBKSIMSTOREIMPL_CPARALLELCOMPOSITECMD_H
       
   100             
       
   101 // End of File