supl/locationsuplfw/gateway/inc/epos_csuplsessionretryq.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 19:06:58 +0300
branchRCL_3
changeset 18 d746aee05493
permissions -rw-r--r--
Revision: 201025 Kit: 2010127

/*
* ==============================================================================
*  Name        : epos_csuplsessionretryq.h
*  Part of     : SUPL Framework / SUPL Server
*  Interface   : --
*  Description : Class to handle retries of failed requests. It waits for all the current sessions to end and then
*  				 notifies the failed sessions that they can retry.
*  Version     :
*
*  Copyright (c) 2010 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation. All rights are reserved. Copying,
*  including reproducing, storing, adapting or translating, any
*  or all of this material requires the prior written consent of
*  Nokia Corporation. This material also contains confidential
*  information which may not be disclosed to others without the
*  prior written consent of Nokia Corporation.
* ==============================================================================
*/

#ifndef EPOS_CSUPLSESSIONRETRYQ_H
#define EPOS_CSUPLSESSIONRETRYQ_H

// INCLUDES
#include <e32base.h>

// CLASS DECLARATION
class CSuplSessionRequest;

/**
 * Class to handle retries of failed requests. It waits for all the current sessions to end and then
 *		 notifies the failed sessions that they can retry.
 */
class CSuplSessionRetryQ : public CTimer
    {
    public:
        static CSuplSessionRetryQ* NewL();
		~CSuplSessionRetryQ();

        void AddToQueueL(CSuplSessionRequest& aSessionRequest);
        void RemoveFromQueueL(CSuplSessionRequest& aSessionRequest);
		void SessionStarted();
		void SessionEnded();

    private:
		CSuplSessionRetryQ();
        void ConstructL();

        // By default, prohibit copy constructor
        CSuplSessionRetryQ( const CSuplSessionRetryQ& );
        // Prohibit assigment operator
        CSuplSessionRetryQ& operator= ( const CSuplSessionRetryQ& );

    protected:  // Functions from base classes

        /**
        * From CActive.
        * Called when timer completes
        */
        void RunL();

    private:    // Data
		RPointerArray<CSuplSessionRequest> iSessionRequests;
		TInt iSessionCount;
		TBool iSomeSessionEnded;
		TTime iTimeOfLastEndedSession;
    };

#endif // EPOS_CSUPLSESSIONRETRYQ_H

// End of File