FreeBASIC  0.91.0
rtl-oop.bas
Go to the documentation of this file.
1 '' intrinsic runtime lib OOP functions (is operator, dynamic cast, ...)
2 ''
3 '' chng: apr/2011 written [v1ctor]
4 
5 #include once "fb.bi"
6 #include once "fbint.bi"
7 #include once "ast.bi"
8 #include once "rtl.bi"
9 
10  dim shared as FB_RTL_PROCDEF funcdata( 0 to 3 ) = _
11  { _
12 /' function fb_IsTypeOf( byref obj as any, byref rtti as $fb_RTTI ) as long '/ _
13  ( _
14  @FB_RTL_ISTYPEOF, NULL, _
15  FB_DATATYPE_LONG, FB_FUNCMODE_FBCALL, _
16  NULL, FB_RTL_OPT_NONE, _
17  2, _
18  { _
19  ( FB_DATATYPE_VOID,FB_PARAMMODE_BYREF, FALSE ), _
20  ( FB_DATATYPE_VOID,FB_PARAMMODE_BYREF, FALSE ) _
21  } _
22  ), _
23 /' EOL '/ _
24  ( _
25  NULL _
26  ) _
27  }
28 
29 '':::::
31 
33 
34 end sub
35 
36 '':::::
38 
39  '' procs will be deleted when symbEnd is called
40 
41 end sub
42 
43 '':::::
44 function rtlOOPIsTypeOf _
45  ( _
46  byval inst as ASTNODE ptr, _
47  byval rtti as ASTNODE ptr _
48  ) as ASTNODE ptr
49 
50 
51  var proc = astNewCALL( PROCLOOKUP( ISTYPEOF ) )
52 
53  '' byref obj as any ptr
54  if( astNewARG( proc, inst ) = NULL ) then
55  exit function
56  end if
57 
58  '' byref rtti as any ptr
59  if( astNewARG( proc, rtti ) = NULL ) then
60  exit function
61  end if
62 
63  function = proc
64 
65 end function
66