wlan_bearer/wlanldd/wlan_common/osa_common/inc/osalist_iterator.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 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 the License "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:   list declaration
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 3 %
       
    20 */
       
    21 
       
    22 #ifndef WLANLIST_ITERATOR_H
       
    23 #define WLANLIST_ITERATOR_H
       
    24 
       
    25 #include "algorithm.h"  // for operator !=
       
    26 
       
    27 /**
       
    28  *  list iterator with limited interface
       
    29  *
       
    30  *
       
    31  *  @lib wlanosa.lib
       
    32  *  @since S60 v3.2
       
    33  */
       
    34 template<class T, class J> 
       
    35 class list_iterator : public DBase
       
    36     {
       
    37 
       
    38 	typedef list_iterator<T, J> Self;
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * ctor
       
    44      *
       
    45      * @since S60 v3.2
       
    46      * @param aElem data to be iterated
       
    47      */
       
    48     explicit list_iterator( T* aElem = NULL ) : iNode( aElem ) {};
       
    49 
       
    50     /**
       
    51      * dtor
       
    52      *
       
    53      * @since S60 v3.2
       
    54      */
       
    55 	virtual ~list_iterator() {};
       
    56 
       
    57     /**
       
    58      * copy ctor 
       
    59      *
       
    60      * @since S60 v3.2
       
    61      * @param aElem me, myself and I
       
    62      */
       
    63     inline list_iterator( const Self& aElem );
       
    64 
       
    65     /**
       
    66      * assignment 
       
    67      *
       
    68      * @since S60 v3.2
       
    69      * @param aElem me, myself and I
       
    70      * @return me, myself and I
       
    71      */
       
    72 	inline Self& operator=( const Self& aElem );
       
    73 
       
    74     /**
       
    75      * operator ->
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @return node of the actual element
       
    79      */
       
    80 	inline T* operator->();
       
    81 
       
    82     /**
       
    83      * operator*
       
    84      *
       
    85      * @since S60 v3.2
       
    86      * @return actual element
       
    87      */
       
    88 	inline J& operator*();
       
    89 
       
    90     /**
       
    91      * operator++ (prefix++) step forward
       
    92      *
       
    93      * @since S60 v3.2
       
    94      * @return iterator with the new position
       
    95      */
       
    96     inline Self& operator++();
       
    97 
       
    98     /**
       
    99      * operator-- (prefix--) step backward
       
   100      *
       
   101      * @since S60 v3.2
       
   102      * @return iterator with the new position
       
   103      */
       
   104     inline Self& operator--();
       
   105 
       
   106     /**
       
   107      * operator()
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @return the one and only node
       
   111      */
       
   112     inline T* operator()();
       
   113 
       
   114     /**
       
   115      * operator==
       
   116      *
       
   117      * @since S60 v3.2
       
   118      * @param aObj object to compare against
       
   119      * @return ETrue upon equal, any other for non equal
       
   120      */
       
   121     inline TBool operator== ( const Self& aObj ) const 
       
   122         { 
       
   123         return ( iNode == (aObj.iNode) );
       
   124         }
       
   125 
       
   126 private:
       
   127 
       
   128     /**
       
   129      * list node
       
   130      * Not own.  
       
   131      */
       
   132     T*   iNode;
       
   133 
       
   134     };
       
   135 
       
   136 #include "osalist_iterator.inl"
       
   137 
       
   138 #endif // WLANLIST_ITERATOR_H
       
   139 
       
   140