CARB_PLUGIN_IMPL_EX
Defined in carb/PluginUtils.h
-
CARB_PLUGIN_IMPL_EX(impl, ...)
Main macro to declare a plugin implementation where multiple interface versions are required.
Authors of Carbonite plugins must use this macro in exactly one compilation unit for their plugin to generate code expected by the Carbonite framework.
In particular, this macro:
Defines global variables, such as g_carbFramework.
Registers a default logging channel with omni::log::ILog.
Adds boiler-plate code for Omniverse Native Interfaces interop.
Adds boiler-plate code for plugin startup, shutdown, and registration. (See Framework Overview for more information).
This macro must be used in the global namespace. A carb::PluginImplDesc must be provided as well as all interfaces exported by this plugin. Each interface must be declared with CARB_PLUGIN_INTERFACE. There must also exist a fillInterface(carb::Version*, void*) function for each interface type that is exported by this plugin. A trailing semicolon is optional.
Example:
// Plugin Implementation Descriptor const carb::PluginImplDesc kPluginImpl{ "carb.windowing-glfw.plugin", "Windowing (glfw).", "NVIDIA", carb::PluginHotReload::eDisabled, "dev" }; // Generate boilerplate code CARB_PLUGIN_IMPL_EX(kPluginImpl, carb::windowing::IWindowing, carb::windowing::IGLContext) // Construct the carb::windowing::IWindowing interface template <> void fillInterface<carb::windowing::IWindowing>(carb::Version* v, void* iface) { /* ... */ } // Construct the carb::windowing::IGLContext interface template <> void fillInterface<carb::windowing::IGLContext>(carb::Version* v, void* iface) { /* ... */ }
See Framework Overview and Carbonite Interfaces for more information on creating Carbonite plugins.
Note
This implementation macro allows Carbonite plugins to provide multiple versions of an interface in order to remain backwards compatible with apps and modules that are built against earlier versions of plugins. Every interface exported by the plugin must have a fillInterface(carb::Version*, void*) function.
- Parameters
impl – The carb::PluginImplDesc constant to be used as plugin description.
... – One or more interface types to be implemented by the plugin. An interface is a
struct
orclass
with a use of CARB_PLUGIN_INTERFACE() inside it. These interface types are constructed by a global explicitly- specialized template function fillInterface(carb::Version*, void*) that must exist in the plugin. See fillInterface(carb::Version*, void*) for more information about interface construction and destruction.