crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollectionEnumerator.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;
       
    19 using System.Collections.Generic;
       
    20 
       
    21 namespace SymbolLib.CodeSegDef
       
    22 {
       
    23 	internal class CodeSegDefinitionCollectionEnumerator : IEnumerator<CodeSegDefinition>
       
    24 	{
       
    25 		#region Constructors & destructor
       
    26 		public CodeSegDefinitionCollectionEnumerator( CodeSegDefinitionCollection aCollection )
       
    27 		{
       
    28 			iCollection = aCollection;
       
    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 iCollection[ iCurrentIndex ];
       
    43 			}
       
    44 		}
       
    45 
       
    46 		public bool MoveNext()
       
    47 		{
       
    48 			return ( ++iCurrentIndex < iCollection.Count );
       
    49 		}
       
    50 		#endregion
       
    51 
       
    52         #region IDisposable Members
       
    53         void IDisposable.Dispose()
       
    54         {
       
    55         }
       
    56         #endregion
       
    57 
       
    58         #region IEnumerator<CodeSegDefinition> Members
       
    59         CodeSegDefinition IEnumerator<CodeSegDefinition>.Current
       
    60         {
       
    61             get { return iCollection[ iCurrentIndex ]; }
       
    62         }
       
    63         #endregion
       
    64 
       
    65 		#region Data members
       
    66 		private readonly CodeSegDefinitionCollection iCollection;
       
    67 		private int iCurrentIndex = -1;
       
    68 		#endregion
       
    69     }
       
    70 }