wiki:Langbinding/CPPBinding

Version 1 (modified by René Rivera, 15 years ago) ( diff )

--

Language Binding: C++

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.

Interface DSEL

A domain specific embeded language (DSEL) describes and defines the exposed C++ interfaces.

namespace_, module
Define a namespace scope for definitions.
def
Declare a binding of a static or global.
class_
Declare a binding class. class_::def:: Declare either a value or function member of the class. class_::def_readwrite:: A readable and writable property. class_::def_readonly:: A readable, only, property. class_::property:: A custom read and/or write property. class_::enum_:: An enumeration within the class. class_::scope:: Begin declarations within the class scope.
constructor
Define a constructor for the class.
self, const_self, other
Reference to arguments of our own class.
tostring
Printable representation of the instance.
enum_
Scope level enumeration.
value
Value in an enumeration.
operators
“+”, “-”, “*”, “/”, “==”, “<”, “<=”
Return value policies
  • adopt – Binding language takes ownership of the result object instance.
  • dependency – Extends the lifetime of arguments to the result lifetime.
  • return_reference_to – Indicates that the result is one of the arguments.
  • copy – Indicates that a result should be copied when returned.
  • discard_result – Ignores the result, making the exposed function return void.
Parameter policies
  • out_value – Defines arguments that will also be returned, either as part of the result or through a reference argument.
  • pure_out_value – An out_value which is not exposed in the function binding.
Storage policies

Building of a Meta-Object Binding from the interface description

Note: See TracWiki for help on using the wiki.