-Weffc++ cleanup for miniswig
[supertux.git] / tools / miniswig / create_wrapper.hpp
1 #ifndef __CREATE_WRAPPER_H__
2 #define __CREATE_WRAPPER_H__
3
4 #include "tree.hpp"
5
6 class WrapperCreator
7 {
8 public:
9     /// this is used for indentation
10     const char* ind;
11     // output stream
12     std::ostream& out;
13     std::ostream& hppout;
14
15     WrapperCreator(std::ostream& _out = std::cout, std::ostream& _hppout = std::cout) :
16         ind("  "),
17         out(_out),
18         hppout(_hppout),
19         ns_prefix()
20     { }
21
22     void create_wrapper(Namespace* ns);
23
24 private:
25     std::string ns_prefix;
26
27     void create_register_functions_code(Namespace* ns);
28     void create_register_function_code(Function* function, Class* _class);
29     void create_register_classes_code(Namespace* ns);
30     void create_register_class_code(Class* _class);
31     void create_register_constant_code(Field* field);
32     void create_register_constants_code(Namespace* ns);
33     void create_register_slot_code(const std::string& what,
34                                    const std::string& name);
35
36     void create_function_list(Namespace* ns);
37     void create_const_lists(Namespace* ns);
38     void create_class_const_lists(Class* _class);
39     void create_class_wrapper(Class* _class);
40     void create_class_release_hook(Class* _class);
41     void create_squirrel_instance(Class* _class);
42     void create_function_wrapper(Class* _class, Function* function);
43     void prepare_argument(const Type& type, size_t idx, const std::string& var);
44     void push_to_stack(const Type& type, const std::string& var);
45
46 private:
47     WrapperCreator(const WrapperCreator&);
48     WrapperCreator& operator=(const WrapperCreator&);
49 };
50
51 #endif