locationtriggering/ltcontainer/inc/lbtramtriggeridtree.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2006 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:  This header file describes the class that handles the storage
       
    15 *                of triggers in RAM Structures.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_LBTCONTAINER_RAMTRIGGERID_TREE_H
       
    21 #define C_LBTCONTAINER_RAMTRIGGERID_TREE_H
       
    22 
       
    23 // system includes
       
    24 #include <e32base.h>
       
    25 #include <e32cmn.h>
       
    26 #include "lbtcontainertriggerentry.h"
       
    27 #include "lbttriggerkey.h"
       
    28 
       
    29 
       
    30 
       
    31 
       
    32 
       
    33 
       
    34 /**
       
    35  *  This class consists of the RAM structures that store the triggers.
       
    36  *
       
    37  *  It internally utilizes RAM memory and stores the trigger information
       
    38  *  in a efficient data structure.
       
    39  */
       
    40 NONSHARABLE_CLASS( CLbtRamTriggerIdTree ) : public CBase
       
    41                                         
       
    42     {
       
    43 public:
       
    44     /**
       
    45      * The Symbian 2 phase constructor.
       
    46      * This method creates a new instance of CLbtRamTriggersManager
       
    47      *
       
    48      * @return An instance of this class
       
    49      */
       
    50     static CLbtRamTriggerIdTree* NewL();
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      */
       
    55     virtual ~CLbtRamTriggerIdTree();
       
    56 
       
    57 
       
    58 	/**
       
    59      *
       
    60      */    
       
    61     void AddToTreeL(CLbtContainerTriggerEntry* aEntry );
       
    62     
       
    63     /**
       
    64      *
       
    65      */    
       
    66     void DeleteFromTreeL( TLbtTriggerId aKey );
       
    67     
       
    68     
       
    69     /**
       
    70      * Delete all the current entries in the tree and eset the tree.
       
    71      */    
       
    72     void ResetL();
       
    73     
       
    74     void SetIteratorL();
       
    75     
       
    76     /**
       
    77      * Checks if the tree is entry
       
    78      */
       
    79     TBool IsEmpty();
       
    80     
       
    81     CLbtContainerTriggerEntry* GetNextEntryL();
       
    82     
       
    83     CLbtContainerTriggerEntry* FindEntryInTreeL(TLbtTriggerId aKey );
       
    84     
       
    85 protected: 
       
    86    
       
    87 
       
    88 private:
       
    89     /**
       
    90      * C++ constructor
       
    91      */
       
    92     CLbtRamTriggerIdTree();
       
    93 
       
    94     /**
       
    95      * Symbian 2nd phase of construction
       
    96      */
       
    97     void ConstructL();
       
    98 
       
    99     /**
       
   100      * C++ Copy Constructor
       
   101      * The private copy constructor prevents the usage of copy constructors
       
   102      * with this class.
       
   103      */
       
   104     CLbtRamTriggerIdTree(const CLbtRamTriggerIdTree& aRamTriggersStore);
       
   105     
       
   106     /**
       
   107      * Overload equality operator
       
   108      * The private overload of the equality operator prevents the usage of
       
   109      * equality operator with this class.
       
   110      */
       
   111     CLbtRamTriggerIdTree& operator =(const CLbtRamTriggerIdTree& aRamTriggersStore);
       
   112     
       
   113     /**
       
   114      * Instance of TLbtTriggerKey to manage key values to access trigger 
       
   115      * information stored in the Btree
       
   116      */
       
   117     TLbtTriggerKey                                  iKey;
       
   118     
       
   119     /**
       
   120      * Allocates memory to be used by the BTree to store trigger information
       
   121      */
       
   122     CMemPagePool*                                   iPool;
       
   123     
       
   124     /**
       
   125      * An instance of TBtreeFix to contain the list of enabled and valid 
       
   126      * triggers in the system
       
   127      */
       
   128     TBtreeFix< CLbtContainerTriggerEntry*, TLbtTriggerId >*           iTriggerList;
       
   129     
       
   130     TBtreeMark iMark;
       
   131     TBool iNext;
       
   132     /**
       
   133      * To gain access to trigger information structure
       
   134      */
       
   135     friend class TLbtTriggerKey; 
       
   136     };
       
   137 
       
   138 
       
   139 #endif // C_LBTCONTAINER_RAMTRIGGERID_TREE_H