File: create_wrapper.hpp

package info (click to toggle)
supertux 0.6.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 264,124 kB
  • sloc: cpp: 113,426; ansic: 9,654; sh: 4,483; cs: 1,296; makefile: 407; yacc: 398; python: 382; lisp: 285; objc: 248; csh: 219; lex: 140; perl: 118; xml: 53; ruby: 36
file content (51 lines) | stat: -rw-r--r-- 1,588 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __CREATE_WRAPPER_H__
#define __CREATE_WRAPPER_H__

#include "tree.hpp"

class WrapperCreator
{
public:
    /// this is used for indentation
    const char* ind;
    // output stream
    std::ostream& out;
    std::ostream& hppout;

    WrapperCreator(std::ostream& _out = std::cout, std::ostream& _hppout = std::cout) :
        ind("  "),
        out(_out),
        hppout(_hppout),
        ns_prefix()
    { }

    void create_wrapper(Namespace* ns);

private:
    std::string ns_prefix;

    void create_register_functions_code(Namespace* ns);
    void create_register_function_code(Function* function, Class* _class);
    void create_register_classes_code(Namespace* ns);
    void create_register_class_code(Class* _class);
    void create_register_constant_code(Field* field);
    void create_register_constants_code(Namespace* ns);
    void create_register_slot_code(const std::string& what,
                                   const std::string& name);

    void create_function_list(Namespace* ns);
    void create_const_lists(Namespace* ns);
    void create_class_const_lists(Class* _class);
    void create_class_wrapper(Class* _class);
    void create_class_release_hook(Class* _class);
    void create_squirrel_instance(Class* _class);
    void create_function_wrapper(Class* _class, Function* function);
    void prepare_argument(const Type& type, size_t idx, const std::string& var);
    void push_to_stack(const Type& type, const std::string& var);

private:
    WrapperCreator(const WrapperCreator&);
    WrapperCreator& operator=(const WrapperCreator&);
};

#endif