11.15. C++ bindings generator
The CPP_BIND module provides utilities for generating daslang bindings to C++ code. It helps generate module registration code, type annotations, and function wrappers for exposing C++ APIs to daslang programs.
All functions and symbols are in “cpp_bind” module, use require to get access to it.
require daslib/cpp_bind
11.15.1. Generation of bindings
- cpp_bind::log_cpp_class_adapter(cpp_file: file; name: string; cinfo: TypeDeclPtr)
Generates C++ class adapter for the Daslang class. Intended use:
log_cpp_class_adapter(cppFileNameDotInc, "daslangClassName", typeinfo(ast_typedecl type<daslangClassName>))
- Arguments
cpp_file : file
name : string
cinfo : TypeDeclPtr