|
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.Collections.Generic; |
|
20 using CrashItemLib.Crash; |
|
21 using SymbianDebugLib.Engine; |
|
22 using CrashItemLib.Crash.Messages; |
|
23 |
|
24 namespace CrashItemLib.Crash.Base |
|
25 { |
|
26 public class CIElementId : IComparable<CIElementId> |
|
27 { |
|
28 #region Constructors |
|
29 public CIElementId() |
|
30 : this( KDefaultValue ) |
|
31 { |
|
32 } |
|
33 |
|
34 public CIElementId( long aId ) |
|
35 { |
|
36 iId = aId; |
|
37 } |
|
38 |
|
39 public CIElementId( CIElementId aId ) |
|
40 { |
|
41 iId = aId.Id; |
|
42 } |
|
43 #endregion |
|
44 |
|
45 #region API |
|
46 #endregion |
|
47 |
|
48 #region Properties |
|
49 public long Id |
|
50 { |
|
51 get { return iId; } |
|
52 set { iId = value; } |
|
53 } |
|
54 #endregion |
|
55 |
|
56 #region Operators |
|
57 public static implicit operator long( CIElementId aElement ) |
|
58 { |
|
59 return aElement.Id; |
|
60 } |
|
61 |
|
62 public static implicit operator CIElementId( long aValue ) |
|
63 { |
|
64 return new CIElementId( aValue ); |
|
65 } |
|
66 |
|
67 public static implicit operator string( CIElementId aElement ) |
|
68 { |
|
69 return aElement.ToString(); |
|
70 } |
|
71 #endregion |
|
72 |
|
73 #region From System.Object |
|
74 public override string ToString() |
|
75 { |
|
76 return iId.ToString(); |
|
77 } |
|
78 #endregion |
|
79 |
|
80 #region From IComparable<CIElementId> |
|
81 public int CompareTo( CIElementId aOther ) |
|
82 { |
|
83 int ret = 1; |
|
84 // |
|
85 if ( aOther != null ) |
|
86 { |
|
87 ret = iId.CompareTo( aOther.Id ); |
|
88 } |
|
89 // |
|
90 return ret; |
|
91 } |
|
92 #endregion |
|
93 |
|
94 #region Internal constants |
|
95 private const long KDefaultValue = -1; |
|
96 #endregion |
|
97 |
|
98 #region Data members |
|
99 private long iId = KDefaultValue; |
|
100 #endregion |
|
101 } |
|
102 } |