crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/File/MapFileEnumerator.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using SymbolLib.Generics;
       
    20 
       
    21 namespace SymbolLib.Sources.Map.File
       
    22 {
       
    23     internal class MapFileEnumerator : IEnumerator<GenericSymbol>
       
    24 	{
       
    25 		#region Constructors & destructor
       
    26         public MapFileEnumerator( MapFile aMapFile )
       
    27 		{
       
    28             iMapFile = aMapFile;
       
    29 		}
       
    30 		#endregion
       
    31 
       
    32 		#region IEnumerator Members
       
    33 		public void Reset()
       
    34 		{
       
    35 			iCurrentIndex = -1;
       
    36 		}
       
    37 
       
    38 		public object Current
       
    39 		{
       
    40 			get
       
    41 			{
       
    42                 return iMapFile[ iCurrentIndex ];
       
    43 			}
       
    44 		}
       
    45 
       
    46 		public bool MoveNext()
       
    47 		{
       
    48             return ( ++iCurrentIndex < iMapFile.Count );
       
    49 		}
       
    50 		#endregion
       
    51  
       
    52         #region From IEnumerator<GenericSymbol>
       
    53         GenericSymbol IEnumerator<GenericSymbol>.Current
       
    54         {
       
    55             get { return iMapFile[ iCurrentIndex ]; }
       
    56         }
       
    57         #endregion
       
    58 
       
    59         #region From IDisposable
       
    60         public void Dispose()
       
    61         {
       
    62         }
       
    63         #endregion
       
    64         
       
    65         #region Data members
       
    66         private readonly MapFile iMapFile;
       
    67 		private int iCurrentIndex = -1;
       
    68 		#endregion
       
    69 	}
       
    70 }