1
2
3
4
5
6 import os
7 import algorithm
8 import code_creator
9 import declaration_based
10 import registration_based
11 from pygccxml import declarations
12 from pyplusplus import decl_wrappers
13 from pyplusplus import code_repository
14
15 -class expose_this_t( registration_based.registration_based_t
16 , declaration_based.declaration_based_t ):
17 """
18 creates code that expose address of the object to Python
19 """
20
24
26 answer = [ 'add_property' ]
27 answer.append( '( ' )
28 answer.append('"this"')
29 answer.append( self.PARAM_SEPARATOR )
30 answer.append( 'pyplus_conv::make_addressof_inst_getter< %s >()' % self.decl_identifier )
31 if self.documentation:
32 answer.append( self.PARAM_SEPARATOR )
33 answer.append( self.documentation )
34 answer.append( ' ) ' )
35
36 return ''.join( answer )
37
40
41 -class expose_sizeof_t( registration_based.registration_based_t
42 , declaration_based.declaration_based_t ):
43 """
44 creates code that expose address of the object to Python
45 """
46
50
52 return 'def( pyplus_conv::register_sizeof( boost::type< %s >() ) )' % self.decl_identifier
53
56