|
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.Text; |
|
19 using System.IO; |
|
20 using System.Collections.Generic; |
|
21 using CrashItemLib.Crash; |
|
22 using CrashItemLib.Crash.Base; |
|
23 using CrashItemLib.Crash.Container; |
|
24 using SymbianStructuresLib.Uids; |
|
25 |
|
26 namespace CrashItemLib.Crash.Memory |
|
27 { |
|
28 public class CIMemoryInfoCollection : CIElement, IEnumerable<CIMemoryInfo> |
|
29 { |
|
30 #region Constructors |
|
31 public CIMemoryInfoCollection( CIContainer aContainer ) |
|
32 : base( aContainer, TAutoPopulateType.EAutoPopulateEnabled ) |
|
33 { |
|
34 } |
|
35 #endregion |
|
36 |
|
37 #region API |
|
38 public override void AddChild( CIElement aChild ) |
|
39 { |
|
40 if ( aChild.GetType() != typeof( CIMemoryInfo ) ) |
|
41 { |
|
42 throw new ArgumentException( "Child must be a CIMemoryInfo" ); |
|
43 } |
|
44 |
|
45 base.AddChild( aChild ); |
|
46 } |
|
47 #endregion |
|
48 |
|
49 #region Properties |
|
50 #endregion |
|
51 |
|
52 #region Internal methods |
|
53 #endregion |
|
54 |
|
55 #region From IEnumerable<CIMemoryInfo> |
|
56 public new IEnumerator<CIMemoryInfo> GetEnumerator() |
|
57 { |
|
58 foreach ( CIElement element in base.Children ) |
|
59 { |
|
60 if ( element is CIMemoryInfo ) |
|
61 { |
|
62 CIMemoryInfo ret = (CIMemoryInfo) element; |
|
63 yield return ret; |
|
64 } |
|
65 } |
|
66 } |
|
67 |
|
68 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() |
|
69 { |
|
70 foreach ( CIElement element in base.Children ) |
|
71 { |
|
72 if ( element is CIMemoryInfo ) |
|
73 { |
|
74 CIMemoryInfo ret = (CIMemoryInfo) element; |
|
75 yield return ret; |
|
76 } |
|
77 } |
|
78 } |
|
79 #endregion |
|
80 |
|
81 #region Data members |
|
82 private List<CIMemoryInfo> iEntries = new List<CIMemoryInfo>(); |
|
83 #endregion |
|
84 } |
|
85 } |