Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Native API

These types and functions bind native C++ functions to Bond and give access to the Bond Standard Library. More...

Classes

struct  Bond::NativeFunctionBinding
 Binds a native Bond function to its C++ implementation. More...
struct  Bond::NativeBindingCollection
 A collection of NativeFunctionBindings, typically one per library, passed to CboLoader::AddNativeBinding. More...

Typedefs

typedef void(*) Bond::NativeFunction(StackFrame &frame)
 A C++ function that implements a function declared native in Bond.

Functions

BOND_API void Bond::LoadAllLibs (CboLoader &cboLoader)
 Adds all libraries of the Bond Standard Library to the given CboLoader.
BOND_API void Bond::LoadLibIo (CboLoader &cboLoader)
 Adds the compiled code and native bindings of the io library to the given CboLoader.
BOND_API void Bond::LoadLibMath (CboLoader &cboLoader)
 Adds the compiled code and native bindings of the math library to the given CboLoader.
BOND_API void Bond::LoadLibMemory (CboLoader &cboLoader)
 Adds the compiled code and native bindings of the memory library to the given CboLoader.
BOND_API void Bond::LoadLibString (CboLoader &cboLoader)
 Adds the compiled code and native bindings of the string library to the given CboLoader.
BOND_API void Bond::LoadLibType (CboLoader &cboLoader)
 Adds the compiled code and native bindings of the type library to the given CboLoader.

Variables

const DataViewIndex Bond::INCLUDE_FILE_INDEX
 An index of the source of the include files of the Bond Standard Library, which are embedded in the Bond library.

Detailed Description

These types and functions bind native C++ functions to Bond and give access to the Bond Standard Library.

Typedef Documentation

◆ NativeFunction

typedef void(*) Bond::NativeFunction(StackFrame &frame)

A C++ function that implements a function declared native in Bond.

The function reads its arguments from, and sets its return value through, the StackFrame of its invocation.

See also
StackFrame::GetArg, StackFrame::SetReturnValue

Function Documentation

◆ LoadAllLibs()

BOND_API void Bond::LoadAllLibs ( CboLoader & cboLoader)

Adds all libraries of the Bond Standard Library to the given CboLoader.

Equivalent to calling LoadLibIo(), LoadLibMath(), LoadLibMemory(), LoadLibString() and LoadLibType().

Parameters
cboLoaderThe CboLoader to which the libraries are added.

◆ LoadLibIo()

BOND_API void Bond::LoadLibIo ( CboLoader & cboLoader)

Adds the compiled code and native bindings of the io library to the given CboLoader.

Parameters
cboLoaderThe CboLoader to which the library is added.

◆ LoadLibMath()

BOND_API void Bond::LoadLibMath ( CboLoader & cboLoader)

Adds the compiled code and native bindings of the math library to the given CboLoader.

Parameters
cboLoaderThe CboLoader to which the library is added.

◆ LoadLibMemory()

BOND_API void Bond::LoadLibMemory ( CboLoader & cboLoader)

Adds the compiled code and native bindings of the memory library to the given CboLoader.

Parameters
cboLoaderThe CboLoader to which the library is added.

◆ LoadLibString()

BOND_API void Bond::LoadLibString ( CboLoader & cboLoader)

Adds the compiled code and native bindings of the string library to the given CboLoader.

Parameters
cboLoaderThe CboLoader to which the library is added.

◆ LoadLibType()

BOND_API void Bond::LoadLibType ( CboLoader & cboLoader)

Adds the compiled code and native bindings of the type library to the given CboLoader.

Parameters
cboLoaderThe CboLoader to which the library is added.

Variable Documentation

◆ INCLUDE_FILE_INDEX

const DataViewIndex Bond::INCLUDE_FILE_INDEX
extern

An index of the source of the include files of the Bond Standard Library, which are embedded in the Bond library.

The files are named "io.bond", "math.bond", "memory.bond", "string.bond" and "type.bond". The index can be used to resolve include directives in Bond scripts without accessing the file system, e.g. with a MemoryStreamFactory.