add isl_map_plain_gist
[isl.git] / interface / cpp.h
blobfcff26e3ddb3686a980d5e64e225537e6a137b5d
1 #include "generator.h"
3 using namespace std;
4 using namespace clang;
6 class cpp_generator : public generator {
7 public:
8 cpp_generator(set<RecordDecl *> &exported_types,
9 set<FunctionDecl *> exported_functions,
10 set<FunctionDecl *> functions) :
11 generator(exported_types, exported_functions, functions) {}
13 enum function_kind {
14 function_kind_static_method,
15 function_kind_member_method,
16 function_kind_constructor,
19 virtual void generate();
20 private:
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 void print_private_constructors_decl(ostream &os,
28 const isl_class &clazz);
29 void print_copy_assignment_decl(ostream &os, const isl_class &clazz);
30 void print_public_constructors_decl(ostream &os,
31 const isl_class &clazz);
32 void print_constructors_decl(ostream &os, const isl_class &clazz);
33 void print_destructor_decl(ostream &os, const isl_class &clazz);
34 void print_ptr_decl(ostream &os, const isl_class &clazz);
35 void print_methods_decl(ostream &os, const isl_class &clazz);
36 void print_method_group_decl(ostream &os, const isl_class &clazz,
37 const string &fullname, const set<FunctionDecl *> &methods);
38 void print_method_decl(ostream &os, const isl_class &clazz,
39 const string &fullname, FunctionDecl *method,
40 function_kind kind);
41 void print_implementations(ostream &os);
42 void print_class_impl(ostream &os, const isl_class &clazz);
43 void print_class_factory_impl(ostream &os, const isl_class &clazz);
44 void print_private_constructors_impl(ostream &os,
45 const isl_class &clazz);
46 void print_public_constructors_impl(ostream &os,
47 const isl_class &clazz);
48 void print_constructors_impl(ostream &os, const isl_class &clazz);
49 void print_copy_assignment_impl(ostream &os, const isl_class &clazz);
50 void print_destructor_impl(ostream &os, const isl_class &clazz);
51 void print_ptr_impl(ostream &os, const isl_class &clazz);
52 void print_methods_impl(ostream &os, const isl_class &clazz);
53 void print_method_group_impl(ostream &os, const isl_class &clazz,
54 const string &fullname, const set<FunctionDecl *> &methods);
55 void print_method_impl(ostream &os, const isl_class &clazz,
56 const string &fullname, FunctionDecl *method,
57 function_kind kind);
58 void print_method_param_use(ostream &os, ParmVarDecl *param,
59 bool load_from_this_ptr);
60 void print_method_header(ostream &os, const isl_class &clazz,
61 FunctionDecl *method, const string &fullname,
62 bool is_declaration, function_kind kind);
63 string generate_callback_args(QualType type, bool cpp);
64 string generate_callback_type(QualType type);
65 void print_callback_local(ostream &os, ParmVarDecl *param);
66 std::string rename_method(std::string name);
67 string type2cpp(const isl_class &clazz);
68 string type2cpp(string type_string);
69 string type2cpp(QualType type);
70 bool is_implicit_conversion(const isl_class &clazz, FunctionDecl *cons);
71 bool is_subclass(QualType subclass_type, const isl_class &class_type);
72 function_kind get_method_kind(const isl_class &clazz,
73 FunctionDecl *method);