6 class cpp_generator
: public generator
{
8 cpp_generator(set
<RecordDecl
*> &exported_types
,
9 set
<FunctionDecl
*> exported_functions
,
10 set
<FunctionDecl
*> functions
) :
11 generator(exported_types
, exported_functions
, functions
) {}
14 function_kind_static_method
,
15 function_kind_member_method
,
16 function_kind_constructor
,
19 virtual void generate();
21 void print_file(ostream
&os
, std::string filename
);
22 void print_forward_declarations(ostream
&os
);
23 void print_declarations(ostream
&os
);
24 void print_class(ostream
&os
, const isl_class
&clazz
);
25 void print_class_forward_decl(ostream
&os
, const isl_class
&clazz
);
26 void print_class_factory_decl(ostream
&os
, const isl_class
&clazz
,
27 const std::string
&prefix
= std::string());
28 void print_private_constructors_decl(ostream
&os
,
29 const isl_class
&clazz
);
30 void print_copy_assignment_decl(ostream
&os
, const isl_class
&clazz
);
31 void print_public_constructors_decl(ostream
&os
,
32 const isl_class
&clazz
);
33 void print_constructors_decl(ostream
&os
, const isl_class
&clazz
);
34 void print_destructor_decl(ostream
&os
, const isl_class
&clazz
);
35 void print_ptr_decl(ostream
&os
, const isl_class
&clazz
);
36 void print_methods_decl(ostream
&os
, const isl_class
&clazz
);
37 void print_method_group_decl(ostream
&os
, const isl_class
&clazz
,
38 const string
&fullname
, const set
<FunctionDecl
*> &methods
);
39 void print_method_decl(ostream
&os
, const isl_class
&clazz
,
40 const string
&fullname
, FunctionDecl
*method
,
42 void print_implementations(ostream
&os
);
43 void print_class_impl(ostream
&os
, const isl_class
&clazz
);
44 void print_class_factory_impl(ostream
&os
, const isl_class
&clazz
);
45 void print_private_constructors_impl(ostream
&os
,
46 const isl_class
&clazz
);
47 void print_public_constructors_impl(ostream
&os
,
48 const isl_class
&clazz
);
49 void print_constructors_impl(ostream
&os
, const isl_class
&clazz
);
50 void print_copy_assignment_impl(ostream
&os
, const isl_class
&clazz
);
51 void print_destructor_impl(ostream
&os
, const isl_class
&clazz
);
52 void print_ptr_impl(ostream
&os
, const isl_class
&clazz
);
53 void print_methods_impl(ostream
&os
, const isl_class
&clazz
);
54 void print_method_group_impl(ostream
&os
, const isl_class
&clazz
,
55 const string
&fullname
, const set
<FunctionDecl
*> &methods
);
56 void print_method_impl(ostream
&os
, const isl_class
&clazz
,
57 const string
&fullname
, FunctionDecl
*method
,
59 void print_method_param_use(ostream
&os
, ParmVarDecl
*param
,
60 bool load_from_this_ptr
);
61 void print_method_header(ostream
&os
, const isl_class
&clazz
,
62 FunctionDecl
*method
, const string
&fullname
,
63 bool is_declaration
, function_kind kind
);
64 string
generate_callback_args(QualType type
, bool cpp
);
65 string
generate_callback_type(QualType type
);
66 void print_callback_local(ostream
&os
, ParmVarDecl
*param
);
67 std::string
rename_method(std::string name
);
68 string
type2cpp(const isl_class
&clazz
);
69 string
type2cpp(string type_string
);
70 string
type2cpp(QualType type
);
71 bool is_implicit_conversion(const isl_class
&clazz
, FunctionDecl
*cons
);
72 bool is_subclass(QualType subclass_type
, const isl_class
&class_type
);
73 function_kind
get_method_kind(const isl_class
&clazz
,
74 FunctionDecl
*method
);