| 1 | [[PageOutline]] |
| 2 | |
| 3 | = Language Binding: C++ = |
| 4 | |
| 5 | The language binding layer takes the interface description given as a binding DSEL and creates the corresponding meta-object binding in C++. This is both generating the C++ code, through template instantiations. And creating an instance of the meta-object binding for other languages to use. |
| 6 | |
| 7 | == Interface DSEL == |
| 8 | |
| 9 | A domain specific embeded language (DSEL) describes and defines the exposed C++ interfaces. |
| 10 | |
| 11 | namespace_, module:: |
| 12 | Define a namespace scope for definitions. |
| 13 | def:: |
| 14 | Declare a binding of a static or global. |
| 15 | class_:: |
| 16 | Declare a binding class. |
| 17 | class_::def:: |
| 18 | Declare either a value or function member of the class. |
| 19 | class_::def_readwrite:: |
| 20 | A readable and writable property. |
| 21 | class_::def_readonly:: |
| 22 | A readable, only, property. |
| 23 | class_::property:: |
| 24 | A custom read and/or write property. |
| 25 | class_::enum_:: |
| 26 | An enumeration within the class. |
| 27 | class_::scope:: |
| 28 | Begin declarations within the class scope. |
| 29 | constructor:: |
| 30 | Define a constructor for the class. |
| 31 | self, const_self, other:: |
| 32 | Reference to arguments of our own class. |
| 33 | tostring:: |
| 34 | Printable representation of the instance. |
| 35 | enum_:: |
| 36 | Scope level enumeration. |
| 37 | value:: |
| 38 | Value in an enumeration. |
| 39 | operators:: |
| 40 | “+”, “-”, “*”, “/”, “==”, “<”, “<=” |
| 41 | Return value policies:: |
| 42 | * adopt – Binding language takes ownership of the result object instance. |
| 43 | * dependency – Extends the lifetime of arguments to the result lifetime. |
| 44 | * return_reference_to – Indicates that the result is one of the arguments. |
| 45 | * copy – Indicates that a result should be copied when returned. |
| 46 | * discard_result – Ignores the result, making the exposed function return void. |
| 47 | Parameter policies:: |
| 48 | * out_value – Defines arguments that will also be returned, either as part of the result or through a reference argument. |
| 49 | * pure_out_value – An out_value which is not exposed in the function binding. |
| 50 | Storage policies |
| 51 | |
| 52 | Building of a Meta-Object Binding from the interface description |