crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Buffer/ETBBuffer.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 
       
    18 using System;
       
    19 using System.Collections.Generic;
       
    20 using System.IO;
       
    21 using System.Text;
       
    22 using SymbianETMLib.Common.Types;
       
    23 using SymbianETMLib.Common.Exception;
       
    24 using SymbianETMLib.Common.Buffer;
       
    25 
       
    26 namespace SymbianETMLib.ETB.Buffer
       
    27 {
       
    28     public class ETBBuffer : ETBufferBase
       
    29     {
       
    30         #region Constructors
       
    31         public ETBBuffer()
       
    32         {
       
    33         }
       
    34 
       
    35         public ETBBuffer( string aFileName )
       
    36             : base( aFileName )
       
    37         {
       
    38         }
       
    39         #endregion
       
    40 
       
    41         #region API
       
    42         public void Reorder( uint aAddressOfFirstByte )
       
    43         {
       
    44             List<byte> data = base.Data;
       
    45             //
       
    46             if ( aAddressOfFirstByte > data.Count )
       
    47             {
       
    48                 throw new ETMException( "ERROR - initial write pointer is out-of-bounds" );
       
    49             }
       
    50             else if ( aAddressOfFirstByte != 0 )
       
    51             {
       
    52                 List<byte> newData = new List<byte>();
       
    53                 //
       
    54                 int count = data.Count;
       
    55                 for ( int i = (int) aAddressOfFirstByte; i < count; i++ )
       
    56                 {
       
    57                     byte b = data[ i ];
       
    58                     newData.Add( b );
       
    59                 }
       
    60                 for ( int i = 0; i < (int) aAddressOfFirstByte; i++ )
       
    61                 {
       
    62                     byte b = data[ i ];
       
    63                     newData.Add( b );
       
    64                 }
       
    65                 // 
       
    66                 base.Data = newData;
       
    67             }
       
    68         }
       
    69         #endregion
       
    70 
       
    71         #region Properties
       
    72         #endregion
       
    73 
       
    74         #region Internal methods
       
    75         #endregion
       
    76 
       
    77         #region Data members
       
    78         #endregion
       
    79     }
       
    80 }