Changeset 560


Ignore:
Timestamp:
Jul 21, 2008, 2:34:12 PM (16 years ago)
Author:
dai
Message:

#183への対応。コンストラクタ、デストラクタが直接呼び出された場合はエラーとして扱うようにした。
(64bit版は後ほどコミットします)

Location:
trunk/ab5.0
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab

    r558 r560  
    1717    End Sub
    1818
    19 Public
    20     Sub List()
     19    Sub _Initialize( capacity = 0 As Long )
    2120        items = GC_malloc( 1 )
    2221
    2322        ' 列挙子の位置を初期化
    2423        Reset()
    25     End Sub
    26 
    27     /*!
    28     @brief  予め要素数を指定してList<T>を初期化
    29     @author NoWest
    30     @date   2008/07/13
    31     @param  リストの要素数
    32     */
    33     Sub List( capacity As Long )
    34         This.List()
     24
    3525        If capacity > 0 Then
    3626            This.size = capacity
     
    3929    End Sub
    4030
     31Public
     32    Sub List()
     33        _Initialize()
     34    End Sub
     35
     36    /*!
     37    @brief  予め要素数を指定してList<T>を初期化
     38    @author NoWest
     39    @date   2008/07/13
     40    @param  リストの要素数
     41    */
     42    Sub List( capacity As Long )
     43        _Initialize( capacity )
     44    End Sub
     45
    4146    /*!
    4247    @brief  既存の配列List<T>を初期化
     
    4651    */
    4752    Sub List( array As *T, length As Long )
    48         This.List( length )
     53        _Initialize( length )
     54
    4955        memmove( This.items, array, length * SizeOf(T) )
    5056        This.count = length
  • trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Queue.ab

    r558 r560  
    2222
    2323    Sub Queue ( capacity As Long )
    24         This.Queue()
     24        This.items = GC_malloc( 1 )
     25        Reset()
    2526        If capacity > 0 Then
    2627            This.size = capacity
  • trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab

    r558 r560  
    2222
    2323    Sub Stack ( capacity As Long )
    24         Stack()
     24        This.items = GC_malloc( 1 )
     25        Reset()
    2526        If capacity > 0 Then
    2627            This.size = capacity
  • trunk/ab5.0/ablib/src/Classes/System/IO/Exception.ab

    r435 r560  
    2525    */
    2626    Sub IOException()
    27         Exception(GetType().FullName, Nothing)
     27        SystemException(GetType().FullName)
    2828        HResult = ActiveBasic.AB_E_IO
    2929    End Sub
     
    3333    */
    3434    Sub IOException(message As String)
    35         Exception(message, Nothing)
     35        SystemException(message)
    3636        HResult = ActiveBasic.AB_E_IO
    3737    End Sub
     
    4242    */
    4343    Sub IOException(message As String, innerException As Exception)
    44         Exception(message, innerException)
     44        SystemException(message, innerException)
    4545        HResult = ActiveBasic.AB_E_IO
    4646    End Sub
     
    5151    */
    5252    Sub IOException(message As String, hr As HRESULT)
    53         Exception(message, Nothing)
     53        SystemException(message)
    5454        HResult = hr
    5555    End Sub
  • trunk/ab5.0/ablib/src/Classes/System/IO/FileStream.ab

    r552 r560  
    3131    offset As QWord 'オーバーラップドIO用
    3232
    33 Public
    34     /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */
    35     Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
     33    Sub _Initialize(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
    3634        If ActiveBasic.IsNothing(path) Then
    3735            Throw New ArgumentNullException("path")
     
    7270        End If
    7371    End Sub
     72
     73Public
     74    /* コンストラクタ.NETと同じように実装は難しい、一先ず動くものを実装したが変更が必要だと思う */
     75    Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare, options As FileOptions)
     76        _Initialize( path, mode, access, share, options )
     77    End Sub
    7478    Sub FileStream(path As String, mode As FileMode, access As FileAccess, share As FileShare)
    75         This.FileStream(path,mode,access,share,FileOptions.None)
     79        _Initialize(path,mode,access,share,FileOptions.None)
    7680    End Sub
    7781    Sub FileStream(path As String, mode As FileMode, access As FileAccess)
    78         This.FileStream(path,mode,access,FileShare.None,FileOptions.None)
     82        _Initialize(path,mode,access,FileShare.None,FileOptions.None)
    7983    End Sub
    8084    Sub FileStream(path As String, mode As FileMode)
     
    9498                access=FileAccess.Write
    9599        End Select
    96         This.FileStream(path,mode,access,FileShare.None,FileOptions.None)
     100        _Initialize(path,mode,access,FileShare.None,FileOptions.None)
    97101    End Sub
    98102    /*
  • trunk/ab5.0/ablib/src/Classes/System/Threading/AutoResetEvent.ab

    r494 r560  
    99Public
    1010    Sub AutoResetEvent(initialState As Boolean)
    11         This.EventWaitHandle(initialState,EventResetMode.AutoReset)
     11        EventWaitHandle(initialState,EventResetMode.AutoReset)
    1212    End Sub
    1313
  • trunk/ab5.0/ablib/src/Classes/System/Threading/ManualResetEvent.ab

    r494 r560  
    99Public
    1010    Sub ManualResetEvent(initialState As Boolean)
    11         This.EventWaitHandle(initialState,EventResetMode.ManualReset)
     11        EventWaitHandle(initialState,EventResetMode.ManualReset)
    1212    End Sub
    1313
Note: See TracChangeset for help on using the changeset viewer.