11.18. 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.18.1. Generation of bindings
11.18.1.1. log_cpp_class_adapter
- log_cpp_class_adapter(cpp_file: file; name: string; cinfo: TypeDeclPtr; implemented_methods: array<string> = array<string>() )
Generates a C++ adapter for abstract methods and explicitly selected default methods.
implemented_methods preserves callbacks with a daslang fallback implementation.
- Arguments:
cpp_file : file
name : string
cinfo : TypeDeclPtr
implemented_methods : array<string>
- log_cpp_class_adapter(cpp_file: StringBuilderWriter; name: string; cinfo: TypeDeclPtr; implemented_methods: array<string> = array<string>() )