crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginView.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 System.Text;
       
    20 using System.IO;
       
    21 using SymbianUtils;
       
    22 using SymbianUtils.Tracer;
       
    23 using SymbianUtils.FileTypes;
       
    24 using SymbianUtils.FileSystem.FilePair;
       
    25 using SymbianStructuresLib.CodeSegments;
       
    26 
       
    27 namespace SymbianDebugLib.PluginAPI
       
    28 {
       
    29     public abstract class DbgPluginView : DisposableObject
       
    30     {
       
    31         #region Constructors
       
    32         protected DbgPluginView( string aName, DbgPluginEngine aEngine )
       
    33 		{
       
    34             iName = aName;
       
    35             iEngine = aEngine;
       
    36 		}
       
    37 		#endregion
       
    38 
       
    39         #region API - frameowork
       
    40         public abstract bool Contains( uint aAddress );
       
    41 
       
    42         public virtual void Activate( IEnumerable<CodeSegDefinition> aCodeSegments )
       
    43         {
       
    44             foreach ( CodeSegDefinition codeSeg in aCodeSegments )
       
    45             {
       
    46                 Activate( codeSeg );
       
    47             }
       
    48         }
       
    49 
       
    50         public abstract bool Activate( CodeSegDefinition aCodeSegment );
       
    51 
       
    52         public virtual void Deactivate( IEnumerable<CodeSegDefinition> aCodeSegments )
       
    53         {
       
    54             foreach ( CodeSegDefinition cs in aCodeSegments )
       
    55             {
       
    56                 Deactivate( cs );
       
    57             }
       
    58         }
       
    59 
       
    60         public abstract bool Deactivate( CodeSegDefinition aCodeSegment );
       
    61 
       
    62         public virtual object CustomOperation( string aName, object aParam1, object aParam2 )
       
    63         {
       
    64             throw new NotSupportedException();
       
    65         }
       
    66 
       
    67         public virtual bool SerializeTaggedCollections( FileNamePairCollection aFilesToSave )
       
    68         {
       
    69             return false;
       
    70         }
       
    71 
       
    72         public abstract bool IsReady
       
    73         {
       
    74             get;
       
    75         }
       
    76         #endregion
       
    77 
       
    78 		#region Properties
       
    79         public string Name
       
    80         {
       
    81             get { return iName; }
       
    82         }
       
    83 
       
    84         protected DbgPluginEngine Engine
       
    85         {
       
    86             get { return iEngine; }
       
    87         }
       
    88         #endregion
       
    89 
       
    90         #region Internal methods
       
    91         internal static int GetHashCode( string aName )
       
    92         {
       
    93             int ret = aName.GetHashCode();
       
    94             return ret;
       
    95         }
       
    96         #endregion
       
    97 
       
    98         #region From System.Object
       
    99         public override int GetHashCode()
       
   100         {
       
   101             return iName.GetHashCode();
       
   102         }
       
   103 
       
   104         public override string ToString()
       
   105         {
       
   106             string ret = string.Format( "DbgPluginView: [{0}]", iName );
       
   107             return ret;
       
   108         }
       
   109         #endregion
       
   110 
       
   111         #region From DisposableObject
       
   112         protected override void CleanupManagedResources()
       
   113         {
       
   114             try
       
   115             {
       
   116                 base.CleanupManagedResources();
       
   117             }
       
   118             finally
       
   119             {
       
   120                 iEngine.CloseView( this );
       
   121             }
       
   122         }
       
   123         #endregion
       
   124 
       
   125         #region Data members
       
   126         private readonly string iName;
       
   127         private readonly DbgPluginEngine iEngine;
       
   128         #endregion
       
   129     }
       
   130 }