Changeset 195 for Include/Classes/System/TypeInfo.ab
- Timestamp:
- Mar 30, 2007, 4:22:30 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/TypeInfo.ab
r186 r195 1 1 ' 実装中... 2 2 '(※ まだ組み込んでいません) 3 4 5 'Namespace System 6 3 7 4 8 Class TypeInfo … … 35 39 36 40 ' 中間的な実装(継承専用) 37 Class Type Impl41 Class TypeBaseImpl 38 42 Inherits TypeInfo 39 43 … … 46 50 Protected 47 51 48 Sub Type Impl()52 Sub TypeBaseImpl() 49 53 name = "" 50 54 strNamespace = "" … … 52 56 End Sub 53 57 54 Sub Type Impl( name As String, strNamespace As String )58 Sub TypeBaseImpl( name As String, strNamespace As String ) 55 59 This.name = name 56 60 This.strNamespace = strNamespace 57 baseType = Nothing 58 End Sub 59 60 Sub TypeImpl( name As String, strNamespace As String, baseType As Type ) 61 TypeImpl( name, strNamespace ) 61 This.baseType = Nothing 62 End Sub 63 64 Sub TypeBaseImpl( name As String, strNamespace As String, baseType As TypeInfo ) 65 This.name = name 66 This.strNamespace = strNamespace 62 67 This.baseType = baseType 63 68 End Sub 64 69 65 70 /* 66 Sub Type Impl( name As String, strNamespace As String, baseType As Type, interfaces As ... )67 Type Impl( name, strNamespace, baseType )71 Sub TypeBaseImpl( name As String, strNamespace As String, baseType As Type, interfaces As ... ) 72 TypeBaseImpl( name, strNamespace, baseType ) 68 73 End Sub 69 74 */ … … 131 136 ' 値型を管理するためのクラス 132 137 Class _System_TypeForValueType 133 Inherits Type Impl134 Public 135 Sub _System_TypeForValueType( name )138 Inherits TypeBaseImpl 139 Public 140 Sub _System_TypeForValueType( name As String ) 136 141 TypeInfo( name, "" ) 137 142 End Sub … … 144 149 ' クラスを管理するためのクラス 145 150 Class _System_TypeForClass 146 Inherits TypeImpl 147 Public 151 Inherits TypeBaseImpl 152 Public 153 Sub _System_TypeForClass( name As String, strNamespace As String, baseType As TypeInfo ) 154 TypeBaseImpl( name, strNamespace, baseType ) 155 End Sub 156 Sub ~_System_TypeForClass() 157 End Sub 158 Override Function IsClass() As Boolean 159 Return True 160 End Function 148 161 End Class 149 162 150 163 ' インターフェイスを管理するためのクラス 151 164 Class _System_TypeForInterface 152 Inherits Type Impl165 Inherits TypeBaseImpl 153 166 Public 154 167 End Class … … 156 169 ' 列挙体を管理するためのクラス 157 170 Class _System_TypeForEnum 158 Inherits Type Impl171 Inherits TypeBaseImpl 159 172 Public 160 173 End Class … … 162 175 ' デリゲートを管理するためのクラス 163 176 Class _System_TypeForDelegate 164 Inherits Type Impl177 Inherits TypeBaseImpl 165 178 Public 166 179 End Class … … 171 184 '-------------------------------------------------------------------- 172 185 Class _System_TypeBase 173 p pTypes As *Type186 pTypes As *TypeInfo 174 187 count As Long 175 188 176 189 Sub _System_TypeBase() 177 p pTypes = GC_malloc( 1 )190 pTypes = GC_malloc( 1 ) 178 191 count = 0 179 192 End Sub 180 193 Sub ~_System_TypeBase() 181 Dim i As Long 182 For i=0 To ELM( count ) 183 Delete ppTypes[i] 184 Next 194 End Sub 195 196 Sub _add( typeInfo As TypeInfo ) 197 pTypes = realloc( pTypes, ( count + 1 ) * SizeOf(*TypeInfo) ) 198 pTypes[count] = typeInfo 199 count++ 185 200 End Sub 186 201 … … 190 205 Public 191 206 192 Sub Add( pType As *Type ) 193 ppTypes = realloc( ppTypes, ( count + 1 ) * SizeOf(*Type) ) 194 ppTypes[count] = pType 195 count++ 207 Static Sub Add( typeInfo As TypeInfo ) 208 obj._add( typeInfo ) 196 209 End Sub 197 210 … … 214 227 obj.Add( New _System_TypeForValueType( "Double" ) ) 215 228 End Sub 216 End Class 229 230 Static Sub InitializeUserTypes() 231 ' このメソッドの実装はコンパイラが自動生成する 232 End Sub 233 234 Static Sub Initialize() 235 ' 値型を初期化 236 InitializeValueType() 237 238 ' Class / Interface / Enum / Delegate を初期化 239 InitializeUserTypes() 240 End Sub 241 End Class 242 243 ' End Namespace ' System
Note:
See TracChangeset
for help on using the changeset viewer.