wlan_bearer/wlanldd/wlan_common/osa_common/inc/osalist.inl
branchCompilerCompatibility
changeset 11 0dc7a084f6bd
parent 0 c40eb8fe8501
equal deleted inserted replaced
9:08907e19c36b 11:0dc7a084f6bd
    35 // -----------------------------------------------------------------------------
    35 // -----------------------------------------------------------------------------
    36 // 
    36 // 
    37 // -----------------------------------------------------------------------------
    37 // -----------------------------------------------------------------------------
    38 //
    38 //
    39 template<class T>
    39 template<class T>
    40 inline list<T>::iterator list<T>::begin()
    40 inline typename list<T>::iterator list<T>::begin()
    41     {
    41     {
    42     // for empty ranges begin() == end()
    42     // for empty ranges begin() == end()
    43     return ( !(empty()) ? list_iterator<Node, T>( iFirst ) : end() );
    43     return ( !(empty()) ? list_iterator<Node, T>( iFirst ) : end() );
    44     }
    44     }
    45 
    45 
    46 // -----------------------------------------------------------------------------
    46 // -----------------------------------------------------------------------------
    47 // 
    47 // 
    48 // -----------------------------------------------------------------------------
    48 // -----------------------------------------------------------------------------
    49 //
    49 //
    50 template<class T>
    50 template<class T>
    51 inline list<T>::const_iterator list<T>::begin() const
    51 inline typename list<T>::const_iterator list<T>::begin() const
    52     {
    52     {
    53     // for empty ranges begin() == end()
    53     // for empty ranges begin() == end()
    54     return ( !(empty()) ? list_iterator<Node, T>( iFirst ) : end() );
    54     return ( !(empty()) ? list_iterator<Node, T>( iFirst ) : end() );
    55     }
    55     }
    56 
    56 
    57 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    58 // 
    58 // 
    59 // -----------------------------------------------------------------------------
    59 // -----------------------------------------------------------------------------
    60 //
    60 //
    61 template<class T>
    61 template<class T>
    62 inline list<T>::iterator list<T>::end()
    62 inline typename list<T>::iterator list<T>::end()
    63     {
    63     {
    64     return list_iterator<Node, T>();
    64     return list_iterator<Node, T>();
    65     }
    65     }
    66 
    66 
    67 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
    68 // 
    68 // 
    69 // -----------------------------------------------------------------------------
    69 // -----------------------------------------------------------------------------
    70 //
    70 //
    71 template<class T>
    71 template<class T>
    72 inline list<T>::const_iterator list<T>::end() const
    72 inline typename list<T>::const_iterator list<T>::end() const
    73     {
    73     {
    74     return list_iterator<Node, T>();
    74     return list_iterator<Node, T>();
    75     }
    75     }
    76 
    76 
    77 // -----------------------------------------------------------------------------
    77 // -----------------------------------------------------------------------------
    78 // 
    78 // 
    79 // -----------------------------------------------------------------------------
    79 // -----------------------------------------------------------------------------
    80 //
    80 //
    81 template<class T>
    81 template<class T>
    82 inline list<T>::size_type list<T>::size() const
    82 inline typename list<T>::size_type list<T>::size() const
    83     {
    83     {
    84     return iNumOfElems;
    84     return iNumOfElems;
    85     }
    85     }
    86 
    86 
    87 // -----------------------------------------------------------------------------
    87 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    98 // 
    98 // 
    99 // -----------------------------------------------------------------------------
    99 // -----------------------------------------------------------------------------
   100 //
   100 //
   101 template<class T>
   101 template<class T>
   102 inline list<T>::reference list<T>::front()
   102 inline typename list<T>::reference list<T>::front()
   103     {
   103     {
   104     // front() for empty sequence is undefined so assert
   104     // front() for empty sequence is undefined so assert
   105     MWlanOsa::Assert( 
   105     MWlanOsa::Assert( 
   106         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   106         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   107     return iFirst->iElem;
   107     return iFirst->iElem;
   110 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   111 // 
   111 // 
   112 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   113 //
   113 //
   114 template<class T>
   114 template<class T>
   115 inline list<T>::const_reference list<T>::front()  const
   115 inline typename list<T>::const_reference list<T>::front()  const
   116     {
   116     {
   117     // front() for empty sequence is undefined so assert
   117     // front() for empty sequence is undefined so assert
   118     MWlanOsa::Assert( 
   118     MWlanOsa::Assert( 
   119         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   119         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   120     return iFirst->iElem;
   120     return iFirst->iElem;
   123 // -----------------------------------------------------------------------------
   123 // -----------------------------------------------------------------------------
   124 // 
   124 // 
   125 // -----------------------------------------------------------------------------
   125 // -----------------------------------------------------------------------------
   126 //
   126 //
   127 template<class T>
   127 template<class T>
   128 inline list<T>::reference list<T>::back()
   128 inline typename list<T>::reference list<T>::back()
   129     {
   129     {
   130     // back() for empty sequence is undefined so assert
   130     // back() for empty sequence is undefined so assert
   131     MWlanOsa::Assert( 
   131     MWlanOsa::Assert( 
   132         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   132         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   133     return iLast->iElem;
   133     return iLast->iElem;
   136 // -----------------------------------------------------------------------------
   136 // -----------------------------------------------------------------------------
   137 // 
   137 // 
   138 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   139 //
   139 //
   140 template<class T>
   140 template<class T>
   141 inline list<T>::const_reference list<T>::back() const
   141 inline typename list<T>::const_reference list<T>::back() const
   142     {
   142     {
   143     // back() for empty sequence is undefined so assert
   143     // back() for empty sequence is undefined so assert
   144     MWlanOsa::Assert( 
   144     MWlanOsa::Assert( 
   145         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   145         reinterpret_cast<const TInt8*>(WLAN_FILE), __LINE__, size() );
   146     return iLast->iElem;
   146     return iLast->iElem;
   302 // -----------------------------------------------------------------------------
   302 // -----------------------------------------------------------------------------
   303 // 
   303 // 
   304 // -----------------------------------------------------------------------------
   304 // -----------------------------------------------------------------------------
   305 //
   305 //
   306 template<class T>
   306 template<class T>
   307 inline list<T>::iterator list<T>::insert( iterator aPos, const T& aElem )
   307 inline typename list<T>::iterator list<T>::insert( iterator aPos, const T& aElem )
   308     {
   308     {
   309     // allocate a new node for the element
   309     // allocate a new node for the element
   310     Node* node = new Node( aElem );
   310     Node* node = new Node( aElem );
   311 
   311 
   312     if ( node )
   312     if ( node )
   353 // -----------------------------------------------------------------------------
   353 // -----------------------------------------------------------------------------
   354 // 
   354 // 
   355 // -----------------------------------------------------------------------------
   355 // -----------------------------------------------------------------------------
   356 //
   356 //
   357 template<class T>
   357 template<class T>
   358 inline list<T>::iterator list<T>::erase( iterator aPos )
   358 inline typename list<T>::iterator list<T>::erase( iterator aPos )
   359     {
   359     {
   360     // extract node to be erased
   360     // extract node to be erased
   361     Node* node = aPos();
   361     Node* node = aPos();
   362 
   362 
   363     if ( node->iNext )
   363     if ( node->iNext )