Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::NativeBindingGenerator Class Reference

A generator for C++ native binding declarations and definitions. More...

#include <bond/tools/nativebindinggenerator.h>

Public Member Functions

void Generate (const TranslationUnit *translationUnitList, OutputStream &cppStream, OutputStream &hStream, const char *collectionName, const char *includeName, const char *exportMacro=nullptr, const char *exportHeader=nullptr)
 Generates C++ native binding source and header output.

Detailed Description

A generator for C++ native binding declarations and definitions.

The NativeBindingGenerator scans parsed Bond translation units and emits C++ binding glue that allows Bond code to call native functions. The generated source file defines a NativeBindingCollection that binds the native functions declared in the translation units, including the getters and setters of native struct members, to C++ functions declared in the generated header file, which the embedder must implement. The header also declares C++ equivalents of the enums. Only the TranslationUnits that are flagged as requiring code generation are scanned.

See also
TranslationUnit, OutputStream

Member Function Documentation

◆ Generate()

void Bond::NativeBindingGenerator::Generate ( const TranslationUnit * translationUnitList,
OutputStream & cppStream,
OutputStream & hStream,
const char * collectionName,
const char * includeName,
const char * exportMacro = nullptr,
const char * exportHeader = nullptr )

Generates C++ native binding source and header output.

Parameters
translationUnitListLinked list of translation units to scan for native declarations.
cppStreamOutput stream receiving generated C++ source definitions.
hStreamOutput stream receiving generated C++ header declarations.
collectionNameIdentifier of the generated native binding collection.
includeNameInclude path written into the generated C++ source file for the header.
exportMacroMacro applied to generated declarations, or nullptr or empty for none.
exportHeaderHeader included by the generated header to define the export macro, or nullptr or empty for none.

The documentation for this class was generated from the following file:
  • include/bond/tools/nativebindinggenerator.h