siplasplas
A library for C++ reflection and introspection
cpp::dynamic_reflection::RuntimeLoader Class Reference

Loads dynamic reflection information from an external library. More...

#include <siplasplas/reflection/dynamic/runtimeloader.hpp>

Public Member Functions

 RuntimeLoader ()=default
 Default constructs a runtime loader. More...
 
 RuntimeLoader (const cpp::DynamicLibrary &library)
 Initializes and loads a dynamic reflection runtime from a given external library. More...
 
void load (const cpp::DynamicLibrary &library)
 Loads reflection information from the given external library. More...
 
Runtimeruntime ()
 Returns a reference to the loaded runtime.
 

Detailed Description

Loads dynamic reflection information from an external library.

Examples:
cmake/cmake-project.cpp, and examples/reflection/dynamic/plugin.cpp.

Constructor & Destructor Documentation

cpp::dynamic_reflection::RuntimeLoader::RuntimeLoader ( )
default

Default constructs a runtime loader.

No loaded library is assigned and the runtime is empty

cpp::dynamic_reflection::RuntimeLoader::RuntimeLoader ( const cpp::DynamicLibrary library)

Initializes and loads a dynamic reflection runtime from a given external library.

See load()

Parameters
libraryExternal dynamic library to load the reflection data from

Member Function Documentation

void cpp::dynamic_reflection::RuntimeLoader::load ( const cpp::DynamicLibrary library)

Loads reflection information from the given external library.

This function invokes the type exportation function of the external library to load the library exported types and functions. The runtime is reset to reference this library, and all the library types and functions are registered into this runtime.

The behavior is undefined if the library has no type export function See SIPLASPLAS_REFLECTION_DYNAMIC_EXPORT_TYPES() macro.

Parameters
libraryExternal library to load reflection information from

The documentation for this class was generated from the following file: