CARB_PLUGIN_INTERFACE

Defined in carb/Interface.h

CARB_PLUGIN_INTERFACE(name, major, minor)

Macro to declare a struct as a Carbonite interface.

This macro must be used in a public section of the interface struct. It is recommended to have it be the first public “member” of the struct.

For plugins that support multiple interface versions through CARB_PLUGIN_IMPL_EX, the major and minor version represent the highest version available. This version will also be requested immediately after plugin registration and must succeed.

When using, a trailing semicolon is optional.

See Framework Overview and Carbonite Interfaces for more information on creating Carbonite plugins.

See also

CARB_PLUGIN_INTERFACE_EX

// Effective implementation
static constexpr carb::InterfaceDesc getInterfaceDesc() noexcept
{
    return carb::InterfaceDesc{ name, { major, minor } };
}
static constexpr carb::InterfaceDesc getLatestInterfaceDesc() noexcept
{
    return carb::InterfaceDesc{ name, { major, minor } };
}

Note

A major of 0 has special significance to Semantic Versioning: every iteration of minor is also considered a breaking change. However, carb::isVersionSemanticallyCompatible will warn on different minor versions if the major version is 0, but still report true.

Note

This macro has been superseded by CARB_PLUGIN_INTERFACE_EX which allows for the current version number to be different than the latest version number.

Parameters
  • name – The name of the interface.

  • major – The major Semantic Version of the interface. It is recommended to start at 1.

  • minor – The minor Semantic Version of the interface. It is recommended to start at 0.