nx_server_plugin_sdk  1.0
Server Plugin SDK
Classes | Typedefs
entry_points.h File Reference
#include <nx/sdk/i_integration.h>

Go to the source code of this file.

Classes

struct  nx::sdk::IntegrationEntryPoint
 
struct  nx::sdk::MultiIntegrationEntryPoint
 

Typedefs

typedef IIntegration * nx::sdk::createNxPlugin()
 
typedef IIntegration * nx::sdk::createNxPluginByIndex(int instanceIndex)
 

Detailed Description

The plugin dynamic library should export only a number of extern-C functions with the name and prototype defined in the SDK - we call such plugin functions "entry points". Those of them which act like factories for main Integration objects are defined here.

Note that there are additional entry point functions declared and implemented in nx/sdk/helpers/lib_context.h. They give the Integration some useful capabilities, and require no special efforts from the Integration creator besides incorporating that header and its .cpp.

Note that there is an old-SDK entry point function defined in plugins/plugin_api.h - it can be used for creating Integrations of old-SDK types (namely, Video Source and Storage).

ATTENTION: If the plugin dynamic library is linked to any dynamic libraries, including the ones from the OS, consult Using dynamic libraries in Plugins to avoid potential issues.

Typedef Documentation

◆ createNxPlugin

typedef IIntegration* nx::sdk::createNxPlugin()

Prototype of the entry point function for single-Integration plugins. Cannot be used for old-SDK Integrations.

The Server calls this function only when the plugin library does not export the multi-Integration entry point function, or if the latter returns null for the index 0.

◆ createNxPluginByIndex

typedef IIntegration* nx::sdk::createNxPluginByIndex(int instanceIndex)

Prototype of the entry point function for multi-Integration plugins.

The Server calls this function multiple times, passing sequential values starting from 0, until the function returns null. Each non-null result is processed similarly to the single-Integration entry point functions (either the old-SDK or the new-SDK one), thus it is possible to pack different IIntegration types into the same plugin dynamic library. If an old-SDK Integration is returned, its pointer must be reinterpret-casted from nxpl::PluginInterface - it is safe because nxpl::PluginInterface is ABI-compatible with IIntegration.

If this function is exported from the plugin library and returns at least one Integration instance, the single-Integration entry point function will not be called.