Last change
on this file was 237, checked in by イグトランス (egtra), 18 years ago |
#_fullcompileで検出されたエラーの修正(明らかに判るもののみ)
|
File size:
1.6 KB
|
Line | |
---|
1 | Class Object
|
---|
2 |
|
---|
3 | Public
|
---|
4 |
|
---|
5 | Sub Object()
|
---|
6 | End Sub
|
---|
7 | Sub ~Object()
|
---|
8 | End Sub
|
---|
9 |
|
---|
10 | ' 2つのオブジェクトが等しいかどうかを判断する
|
---|
11 | Virtual Function Equals( object As Object ) As Boolean
|
---|
12 | If ObjPtr(This) = ObjPtr(object) Then
|
---|
13 | ' If This.GetHashCode() = object.GetHashCode() Then
|
---|
14 | Return True
|
---|
15 | Else
|
---|
16 | Return False
|
---|
17 | End If
|
---|
18 | End Function
|
---|
19 |
|
---|
20 | Static Function Equals( objectA As Object, objectB As Object ) As Boolean
|
---|
21 | If ObjPtr(objectA) = NULL /*objectA = Nothing*/ Then
|
---|
22 | Return ObjPtr(objectB) = NULL 'objectB = Nothing
|
---|
23 | Else
|
---|
24 | Return objectA.Equals(objectB)
|
---|
25 | End If
|
---|
26 | End Function
|
---|
27 |
|
---|
28 | ' 参照先が等しいか判断する
|
---|
29 | Static Function ReferenceEquals(objectA As Object, objectB As Object) As Boolean
|
---|
30 | If ObjPtr( objectA ) = ObjPtr( objectB) Then
|
---|
31 | Return True
|
---|
32 | Else
|
---|
33 | Return False
|
---|
34 | End If
|
---|
35 | End Function
|
---|
36 |
|
---|
37 | ' ハッシュコードを取得する
|
---|
38 | Virtual Function GetHashCode() As Long
|
---|
39 | Return ObjPtr( This ) As Long
|
---|
40 | End Function
|
---|
41 |
|
---|
42 | ' オブジェクトに関係する文字列を返す
|
---|
43 | Virtual Function ToString() As String
|
---|
44 | Return GetType().Name
|
---|
45 | End Function
|
---|
46 |
|
---|
47 | /*
|
---|
48 | Function Operator Downcast() As VoidPtr
|
---|
49 | End Function
|
---|
50 | */
|
---|
51 |
|
---|
52 |
|
---|
53 | '----------------------------------------------------------------
|
---|
54 | ' 実行時型情報
|
---|
55 | '----------------------------------------------------------------
|
---|
56 |
|
---|
57 | Private
|
---|
58 | typeInfo As TypeInfo
|
---|
59 |
|
---|
60 | Public
|
---|
61 | Sub _System_SetType( typeInfo As TypeInfo )
|
---|
62 | If _System_TypeBase.IsReady() = False Then
|
---|
63 | Return
|
---|
64 | End If
|
---|
65 |
|
---|
66 | This.typeInfo = typeInfo
|
---|
67 | End Sub
|
---|
68 |
|
---|
69 | Virtual Function GetType() As TypeInfo
|
---|
70 | Return typeInfo
|
---|
71 | End Function
|
---|
72 |
|
---|
73 | End Class
|
---|
74 | Dim aaa As Long
|
---|
Note:
See
TracBrowser
for help on using the repository browser.