summaryrefslogtreecommitdiffstats
path: root/doc/overview.rst
blob: 2ceb42fb84b4c90a9b8f9bfadc7db0e0bf5d41a6 (plain)
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
.. _gen-overview:

******************
Generator Overview
******************

In a few words, the Generator is a system that
parses a collecion of header and typesystem files, generating other
files (code, documentation, etc.) as result.

Creating new bindings
=====================

.. figure:: images/bindinggen-development.png
   :scale: 80
   :align: center

   Creating new bindings

Each module of the generator system has a specific role.

1. Provide enough data about the classes and functions.
2. Generate valid code, with modifications from typesystems and
   injected codes.
3. Modify the API to expose the objects in a Python-friendly way.
4. Insert customizations where handwritten code is needed.

.. figure:: images/boostqtarch.png
   :scale: 80
   :align: center

   Runtime architecture

Handwritten inputs
==================

Creating new bindings involves creating two pieces of "code":
The typesystem and the inject code.

:typesystem: XML files that provides the developer with a tool to
             customize the way that the generators will see the classes
             and functions. For example, functions can be renamed, have
             its signature changed and many other actions.
:inject code: allows the developer to insert handwritten code where
              the generated code is not suitable or needs some customization.