crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitList.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.Text;
       
    19 using System.Collections.Generic;
       
    20 using CrashItemLib.Crash;
       
    21 using CrashItemLib.Crash.Base;
       
    22 using CrashItemLib.Crash.Container;
       
    23 using CrashItemLib.Crash.Registers;
       
    24 using SymbianUtils.Range;
       
    25 
       
    26 namespace CrashItemLib.Crash.Registers.Visualization.Bits
       
    27 {
       
    28     public abstract class CIRegisterVisBitList : CIElementList<CIRegisterVisBit>
       
    29     {
       
    30         #region Constructors
       
    31         protected CIRegisterVisBitList( CIContainer aContainer )
       
    32             : base( aContainer )
       
    33         {
       
    34         }
       
    35 		#endregion
       
    36 
       
    37         #region API
       
    38         public void AddBit( int aIndex, TBit aValue, string aCategory )
       
    39         {
       
    40             AddBit( aIndex, aValue, aCategory, string.Empty );
       
    41         }
       
    42 
       
    43         public void AddBit( int aIndex, TBit aValue, string aCategory, string aInterpretation )
       
    44         {
       
    45             CIRegisterVisBit bit = new CIRegisterVisBit( Container );
       
    46             bit.Index = aIndex;
       
    47             bit.Value = aValue;
       
    48             bit.Category = aCategory;
       
    49             bit.Interpretation = aInterpretation;
       
    50             //
       
    51             Add( bit );
       
    52         }
       
    53         
       
    54         public new void Add( CIRegisterVisBit aBit )
       
    55         {
       
    56             base.Add( aBit );
       
    57         }
       
    58         #endregion
       
    59 
       
    60         #region Properties
       
    61         public override string Name
       
    62         {
       
    63             get { return Category; }
       
    64             set
       
    65             {
       
    66                 Category = value;
       
    67             }
       
    68         }
       
    69 
       
    70         public string Category
       
    71         {
       
    72             get { return iCategory; }
       
    73             set
       
    74             {
       
    75                 iCategory = value;
       
    76             }
       
    77         }
       
    78 
       
    79         public AddressRange Range
       
    80         {
       
    81             get { return iRange; }
       
    82         }
       
    83 
       
    84         public bool IsReserved
       
    85         {
       
    86             get { return iIsReserved; }
       
    87             set { iIsReserved = value; }
       
    88         }
       
    89 
       
    90         public string Interpretation
       
    91         {
       
    92             get
       
    93             {
       
    94                 if ( IsReserved )
       
    95                 {
       
    96                     return string.Empty;
       
    97                 }
       
    98 
       
    99                 return iInterpretation; 
       
   100             }
       
   101             set { iInterpretation = value; }
       
   102         }
       
   103         #endregion
       
   104 
       
   105         #region Internal methods
       
   106         #endregion
       
   107 
       
   108         #region Internal constants
       
   109         #endregion
       
   110 
       
   111         #region From System.Object
       
   112         public override string ToString()
       
   113         {
       
   114             StringBuilder ret = new StringBuilder();
       
   115             //
       
   116             foreach ( CIRegisterVisBit bit in this )
       
   117             {
       
   118                 ret.Append( bit.ToString() );
       
   119             }
       
   120             //
       
   121             return ret.ToString();
       
   122         }
       
   123         #endregion
       
   124 
       
   125         #region Data members
       
   126         private string iCategory = string.Empty;
       
   127         private string iInterpretation = string.Empty;
       
   128         private AddressRange iRange = new AddressRange();
       
   129         private bool iIsReserved = false;
       
   130         #endregion
       
   131     }
       
   132 }