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

Loads CBO modules and resolves their native function bindings. More...

#include <bond/vm/cboloader.h>

Public Member Functions

 CboLoader (Allocator &allocator)
 Constructs a CboLoader using the same allocator for temporary and persistent data.
 CboLoader (Allocator &tempAllocator, Allocator &permAllocator)
 Constructs a CboLoader with separate allocators for temporary and persistent data.
 CboLoader (const CboLoader &other)=delete
CboLoaderoperator= (const CboLoader &other)=delete
void AddNativeBinding (const NativeBindingCollection &nativeBinding)
 Adds a collection of native function bindings used to resolve native declarations.
void AddCboFile (const void *byteCode, size_t length)
 Adds an in-memory CBO file.
void AddCboFile (InputStream &cboStream)
 Adds a CBO file stream.
CodeSegmentHandle Load ()
 Loads all added CBO files and returns the merged code segment.

Detailed Description

Loads CBO modules and resolves their native function bindings.

A CboLoader aggregates one or more CBO inputs, combines their contents into a single CodeSegment, and binds native functions from supplied NativeBindingCollections.

Constructor & Destructor Documentation

◆ CboLoader() [1/3]

Bond::CboLoader::CboLoader ( Allocator & allocator)
inlineexplicit

Constructs a CboLoader using the same allocator for temporary and persistent data.

Parameters
allocatorThe allocator used while loading and for the resulting CodeSegment.

◆ CboLoader() [2/3]

Bond::CboLoader::CboLoader ( Allocator & tempAllocator,
Allocator & permAllocator )
inline

Constructs a CboLoader with separate allocators for temporary and persistent data.

Parameters
tempAllocatorAllocator used for temporary state during loading.
permAllocatorAllocator used for data that survives in the resulting CodeSegment.

◆ CboLoader() [3/3]

Bond::CboLoader::CboLoader ( const CboLoader & other)
delete

Member Function Documentation

◆ AddCboFile() [1/2]

void Bond::CboLoader::AddCboFile ( const void * byteCode,
size_t length )
inline

Adds an in-memory CBO file.

Parameters
byteCodePointer to the CBO byte stream.
lengthNumber of bytes in the CBO stream.

◆ AddCboFile() [2/2]

void Bond::CboLoader::AddCboFile ( InputStream & cboStream)
inline

Adds a CBO file stream.

Parameters
cboStreamInput stream containing CBO data. The stream is not copied and must remain valid until Load() returns.

◆ AddNativeBinding()

void Bond::CboLoader::AddNativeBinding ( const NativeBindingCollection & nativeBinding)
inline

Adds a collection of native function bindings used to resolve native declarations.

Parameters
nativeBindingNative binding collection to search when binding native functions. The collection is not copied and must remain valid until Load() returns.

◆ Load()

CodeSegmentHandle Bond::CboLoader::Load ( )

Loads all added CBO files and returns the merged code segment.

Returns
A CodeSegmentHandle owning the loaded CodeSegment.

◆ operator=()

CboLoader & Bond::CboLoader::operator= ( const CboLoader & other)
delete

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