Changeset 147


Ignore:
Timestamp:
Mar 11, 2007, 4:40:51 AM (18 years ago)
Author:
dai
Message:

リスナオブジェクトをオブジェクトポインタではなくオブジェクトとして管理するようにした。

Location:
Include/Classes/System/Diagnostics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Diagnostics/TraceListener.ab

    r69 r147  
    3030    ' コピーコンストラクタ
    3131    Sub TraceListener( ByRef listener As TraceListener )
    32         memcpy( VarPtr( This ), VarPtr( listener ), SizeOf( TraceListener ) )
     32        indentLevel = listener.indentLevel
     33        indentSize = listener.indentSize
    3334    End Sub
    3435
  • Include/Classes/System/Diagnostics/TraceListenerCollection.ab

    r79 r147  
    11' リスナコレクション
    22Class TraceListenerCollection
    3     ppListeners As **TraceListener
     3    pListeners As *TraceListener
    44    count As Long
    55Public
    66
    77    Sub TraceListenerCollection()
    8         ppListeners = _System_malloc( 1 )
     8        pListeners = _System_malloc( 1 )
    99    End Sub
    1010    Sub ~TraceListenerCollection()
    11         Dim i As Long
    12         For i = 0 To ELM( count )
    13             Delete ppListeners[i]
    14         Next
    15         _System_free( ppListeners )
     11        _System_free( pListeners )
    1612    End Sub
    1713
     
    2218    ' リスナを追加
    2319    Sub Add( listener As TraceListener ) As Long
    24         ppListeners = _System_realloc( ppListeners, ( count + 1 ) * SizeOf( *TraceListener ) )
    25         ppListeners[count] = New TraceListener( listener )
     20        pListeners = _System_realloc( pListeners, ( count + 1 ) * SizeOf( LONG_PTR ) )
     21        pListeners[count] = listener
    2622        count++
    2723    End Sub
     
    6157
    6258    ' インデクサ ( Getter )
    63     Function Operator[] ( index As Long ) ByRef As TraceListener
     59    Function Operator[] ( index As Long ) As TraceListener
    6460        If index < 0 or count <= index Then
    6561            ' TODO: エラー処理
     
    6763        End If
    6864
    69         Return ByVal ppListeners[index]
     65        Return pListeners[index]
    7066    End Function
    7167
  • Include/Classes/System/Diagnostics/base.ab

    r108 r147  
    1212    ' コンストラクタ
    1313    Sub _System_TraceBase()
    14         Dim _System_defaultTraceListener As DefaultTraceListener
    15         listeners.Add( _System_defaultTraceListener )
     14        Dim defaultTraceListener As DefaultTraceListener
     15        listeners.Add( defaultTraceListener )
    1616
    1717        indentLevel = 0
     
    6565        Dim i As Long
    6666        For i = 0 To ELM( listeners.Count )
    67             Dim ByRef listener = listeners[i]
     67            Dim listener = listeners[i]
    6868            listener.Write( value )
    6969        Next
     
    7272        Dim i As Long
    7373        For i = 0 To ELM( listeners.Count )
    74             Dim ByRef listener = listeners[i]
     74            Dim listener = listeners[i]
    7575            listener.Write( message )
    7676        Next
     
    7979        Dim i As Long
    8080        For i = 0 To ELM( listeners.Count )
    81             Dim ByRef listener = listeners[i]
     81            Dim listener = listeners[i]
    8282            listener.Write( value, category )
    8383        Next
     
    8686        Dim i As Long
    8787        For i = 0 To ELM( listeners.Count )
    88             Dim ByRef listener = listeners[i]
     88            Dim listener = listeners[i]
    8989            listener.Write( message, category )
    9090        Next
     
    9595        Dim i As Long
    9696        For i = 0 To ELM( listeners.Count )
    97             Dim ByRef listener = listeners[i]
     97            Dim listener = listeners[i]
    9898            listener.WriteLine( value )
    9999        Next
     
    102102        Dim i As Long
    103103        For i = 0 To ELM( listeners.Count )
    104             Dim ByRef listener = listeners[i]
     104            Dim listener = listeners[i]
    105105            listener.WriteLine( message )
    106106        Next
     
    109109        Dim i As Long
    110110        For i = 0 To ELM( listeners.Count )
    111             Dim ByRef listener = listeners[i]
     111            Dim listener = listeners[i]
    112112            listener.WriteLine( value, category )
    113113        Next
     
    116116        Dim i As Long
    117117        For i = 0 To ELM( listeners.Count )
    118             Dim ByRef listener = listeners[i]
     118            Dim listener = listeners[i]
    119119            listener.WriteLine( message, category )
    120120        Next
     
    125125        Dim i As Long
    126126        For i = 0 To ELM( listeners.Count )
    127             Dim ByRef listener = listeners[i]
     127            Dim listener = listeners[i]
    128128            listener.WriteIf( condition, value )
    129129        Next
     
    132132        Dim i As Long
    133133        For i = 0 To ELM( listeners.Count )
    134             Dim ByRef listener = listeners[i]
     134            Dim listener = listeners[i]
    135135            listener.WriteIf( condition, message )
    136136        Next
     
    139139        Dim i As Long
    140140        For i = 0 To ELM( listeners.Count )
    141             Dim ByRef listener = listeners[i]
     141            Dim listener = listeners[i]
    142142            listener.WriteIf( condition, value, category )
    143143        Next
     
    146146        Dim i As Long
    147147        For i = 0 To ELM( listeners.Count )
    148             Dim ByRef listener = listeners[i]
     148            Dim listener = listeners[i]
    149149            listener.WriteIf( condition, message, category )
    150150        Next
     
    155155        Dim i As Long
    156156        For i = 0 To ELM( listeners.Count )
    157             Dim ByRef listener = listeners[i]
     157            Dim listener = listeners[i]
    158158            listener.WriteLineIf( condition, value )
    159159        Next
     
    162162        Dim i As Long
    163163        For i = 0 To ELM( listeners.Count )
    164             Dim ByRef listener = listeners[i]
     164            Dim listener = listeners[i]
    165165            listener.WriteLineIf( condition, message )
    166166        Next
     
    169169        Dim i As Long
    170170        For i = 0 To ELM( listeners.Count )
    171             Dim ByRef listener = listeners[i]
     171            Dim listener = listeners[i]
    172172            listener.WriteLineIf( condition, value, category )
    173173        Next
     
    176176        Dim i As Long
    177177        For i = 0 To ELM( listeners.Count )
    178             Dim ByRef listener = listeners[i]
     178            Dim listener = listeners[i]
    179179            listener.WriteLineIf( condition, message, category )
    180180        Next
     
    195195        Dim i As Long
    196196        For i = 0 To ELM( listeners.Count )
    197             Dim ByRef listener = listeners[i]
     197            Dim listener = listeners[i]
    198198            listener.IndentLevel = indentLevel
    199199        Next
     
    209209        Dim i As Long
    210210        For i = 0 To ELM( listeners.Count )
    211             Dim ByRef listener = listeners[i]
     211            Dim listener = listeners[i]
    212212            listener.IndentSize = indentSize
    213213        Next
Note: See TracChangeset for help on using the changeset viewer.