locationtriggering/ltcontainer/src/lbttriggerstorerepository.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:54:42 +0300
changeset 20 82ee1f804b63
parent 0 667063e416a2
child 39 3efc7a0e8755
permissions -rw-r--r--
Revision: 201015 Kit: 201018

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  This file defines the abstract factory class for
*                trigger store implementations
*
*/


#include "lbttriggerstorerepository.h"
#include "lbtdbtriggersmanager.h"
#include "lbtramtriggersmanager.h"


// ---------------------------------------------------------------------------
// This method returns the number of trigger stores supported in the container
// ---------------------------------------------------------------------------
//
TInt LbtTriggerStoreFactory::NumStores()
    {
    return 2;
    }
    

// ---------------------------------------------------------------------------
// Creates and returns all the available trigger stores.
// ---------------------------------------------------------------------------
//
void LbtTriggerStoreFactory::CreateTriggerStoresL(RPointerArray<MLbtTriggerStore>& aStoreArray)
    {
    CleanupClosePushL(aStoreArray);
    CLbtDbTriggersManager* dbTriggerStore = CLbtDbTriggersManager::NewL();
    CleanupStack::PushL( dbTriggerStore );
    
    aStoreArray.Append( dbTriggerStore );
    
    CLbtRamTriggersManager* ramTriggerStore = CLbtRamTriggersManager::NewL();
    CleanupStack::PushL( ramTriggerStore );
    
    aStoreArray.Append( ramTriggerStore );
    
    CleanupStack::Pop( 3, &aStoreArray );
    }