PECengine/AttributeLibrary2/SrcTransactions/CPEngOrphanNotificationQue.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     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:  Que for orphan presence notifications.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CPENGORPHANNOTIFICATIONQUE_H
       
    19 #define __CPENGORPHANNOTIFICATIONQUE_H
       
    20 
       
    21 
       
    22 //  INCLUDES
       
    23 #include <E32Base.h>
       
    24 
       
    25 
       
    26 // CLASS DECLARATION
       
    27 /**
       
    28  * Size limited que for orphan presence notifications.
       
    29  *
       
    30  * @since 3.0
       
    31  */
       
    32 NONSHARABLE_CLASS( CPEngOrphanNotificationQue ) : public CBase
       
    33     {
       
    34 public:  // Constructors and destructor
       
    35 
       
    36     /**
       
    37      * Two-phased constructor.
       
    38      *
       
    39      * @since 3.0
       
    40      * @param aQueSize Size for the que.
       
    41      */
       
    42     static CPEngOrphanNotificationQue* NewL( TInt aQueSize );
       
    43 
       
    44 
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     ~CPEngOrphanNotificationQue();
       
    49 
       
    50 private:
       
    51 
       
    52     /**
       
    53      * C++ default constructor.
       
    54      */
       
    55     CPEngOrphanNotificationQue( TInt aQueSize );
       
    56 
       
    57 
       
    58 public: // New functions
       
    59 
       
    60 
       
    61     /**
       
    62      * Adds a element to que.
       
    63      * If the que is full, drops the oldes element out from que.
       
    64      *
       
    65      * @since 3.0
       
    66      * @param aPresenceBlock The presence block to add to que.
       
    67      */
       
    68     void AddToQueL( const TDesC8& aPresenceBlock );
       
    69 
       
    70 
       
    71     /**
       
    72      * Sets the current element cursor to the first
       
    73      * (oldest) element in the que and returns it.
       
    74      * If que is empty, returns NULL.
       
    75      *
       
    76      * @since 3.0
       
    77      * @param First element from que, or NULL if the que is empty.
       
    78      */
       
    79     const TDesC8* GetFirst();
       
    80 
       
    81 
       
    82     /**
       
    83      * Deletes the element pointed by the current element cursor.
       
    84      * Sets the current element cursor to point to next
       
    85      * element following the deleted one and also returns it.
       
    86      * If there isn't following elements, returns NULL.
       
    87      *
       
    88      * @since 3.0
       
    89      * @param Next element from que, or NULL if the que is empty.
       
    90      */
       
    91     const TDesC8* DeleteCurrentAndGetNext();
       
    92 
       
    93 
       
    94     /**
       
    95      * Sets the current element cursor to point to next element
       
    96      * and also returns it. If there isn't anymore elements,
       
    97      * returns NULL.
       
    98      *
       
    99      * @since 3.0
       
   100      * @param Next element from que, or NULL if the que is empty.
       
   101      */
       
   102     const TDesC8* GetNext();
       
   103 
       
   104 
       
   105 
       
   106 
       
   107 private: // New helpers
       
   108 
       
   109     /**
       
   110      * Checks is there element in the que at given index.
       
   111      *
       
   112      * @since 3.0
       
   113      * @param aIndex The index to verify.
       
   114      * @return ETrue if index is valid. Else EFalse.
       
   115      */
       
   116     TBool DoIndexValid( TInt aIndex ) const;
       
   117 
       
   118 
       
   119     /**
       
   120      * Returns the current element or NULL if
       
   121      * current index is out of bounds.
       
   122      *
       
   123      * @since 3.0
       
   124      * @return Current element or NULL.
       
   125      */
       
   126     const TDesC8* DoGetCurrent() const;
       
   127 
       
   128 
       
   129 private: // Data
       
   130 
       
   131     //OWN: Max que size
       
   132     const TInt iMaxQueSize;
       
   133 
       
   134     //OWN: Current index
       
   135     TInt iIndex;
       
   136 
       
   137     //OWN: The que
       
   138     RPointerArray< HBufC8 > iQue;
       
   139     };
       
   140 
       
   141 
       
   142 #endif      // __CPENGORPHANNOTIFICATIONQUE_H
       
   143 
       
   144 // End of File