stub_analytics_plugin  1.6
Network Optix Video Analytics SDK
Classes | Public Member Functions | Static Public Member Functions | List of all members
nx::sdk::analytics::IEngine Class Referenceabstract

#include <i_engine.h>

Inheritance diagram for nx::sdk::analytics::IEngine:
nx::sdk::Interface< IEngine > nx::sdk::IRefCountable

Classes

class  IHandler
 

Public Member Functions

virtual IPluginplugin () const =0
 
virtual void setSettings (const IStringMap *settings)=0
 
virtual IStringMappluginSideSettings () const =0
 
virtual const IStringmanifest (Error *outError) const =0
 
virtual bool isCompatible (const IDeviceInfo *deviceInfo) const =0
 
virtual IDeviceAgentobtainDeviceAgent (const IDeviceInfo *deviceInfo, Error *outError)=0
 
virtual void executeAction (IAction *action, Error *outError)=0
 
virtual Error setHandler (IHandler *handler)=0
 
- Public Member Functions inherited from nx::sdk::Interface< IEngine >
virtual IRefCountablequeryInterface (IRefCountable::InterfaceId id) override
 
virtual IRefCountablequeryInterface (InterfaceId id)
 
const IRefCountablequeryInterface (InterfaceId id) const
 
InterfacequeryInterface ()
 
const InterfacequeryInterface () const
 
- Public Member Functions inherited from nx::sdk::IRefCountable
virtual ~IRefCountable ()=default
 
const IRefCountablequeryInterface (InterfaceId id) const
 
template<class Interface >
InterfacequeryInterface ()
 
template<class Interface >
const InterfacequeryInterface () const
 
virtual int addRef () const =0
 
virtual int releaseRef () const =0
 

Static Public Member Functions

static auto interfaceId ()
 
- Static Public Member Functions inherited from nx::sdk::IRefCountable
static auto interfaceId ()
 

Additional Inherited Members

- Protected Member Functions inherited from nx::sdk::Interface< IEngine >
IRefCountablequeryInterfaceSupportingDeprecatedId (IRefCountable::InterfaceId id, const Uuid &deprecatedInterfaceId)
 

Detailed Description

Main interface for an Analytics Engine instance. The instances are created by a Mediaserver via calling analytics::IPlugin::createEngine() typically on Mediaserver start (or when a new Engine is created by the system administrator), and destroyed (via releaseRef()) on Mediaserver shutdown (or when an existing Engine is deleted by the system administrator).

For the VMS end user, each Engine instance is perceived as an independent Analytics Engine which has its own set of values of settings stored in the Mediaserver database.

All methods are guaranteed to be called without overlappings, even if from different threads, thus, no synchronization is required for the implementation.

Member Function Documentation

◆ executeAction()

virtual void nx::sdk::analytics::IEngine::executeAction ( IAction action,
Error *  outError 
)
pure virtual

Action handler. Called when some action defined by this Engine is triggered by Server.

Parameters
actionProvides data for the action such as metadata object for which the action has been triggered, and a means for reporting back action results to Server. This object should not be used after returning from this function.
outErrorStatus of the operation; is set to noError before this call.

◆ isCompatible()

virtual bool nx::sdk::analytics::IEngine::isCompatible ( const IDeviceInfo deviceInfo) const
pure virtual
Returns
True if the Engine is able to create DeviceAgents for the provided device, false otherwise.

◆ manifest()

virtual const IString* nx::sdk::analytics::IEngine::manifest ( Error *  outError) const
pure virtual

Provides a JSON manifest for this Engine instance. See the example of such manifest in stub_analytics_plugin. Can either be static (constant), or can be dynamically generated by this Engine based on its current state, including setting values received via setSettings(). After creation of this Engine instance, this method is called after setSettings(), but can be called again at any other moment to obtain the most actual manifest.

Parameters
outErrorStatus of the operation; is set to noError before this call.
Returns
JSON string in UTF-8.

◆ obtainDeviceAgent()

virtual IDeviceAgent* nx::sdk::analytics::IEngine::obtainDeviceAgent ( const IDeviceInfo deviceInfo,
Error *  outError 
)
pure virtual

Creates, or returns an already existing, a DeviceAgent instance intended to work with the given device.

Parameters
deviceInfoInformation about the device for which a DeviceAgent should be created.
outErrorStatus of the operation; is set to noError before this call.
Returns
Pointer to an object that implements DeviceAgent interface, or null in case of failure.

◆ plugin()

virtual IPlugin* nx::sdk::analytics::IEngine::plugin ( ) const
pure virtual
Returns
Parent Plugin.

◆ pluginSideSettings()

virtual IStringMap* nx::sdk::analytics::IEngine::pluginSideSettings ( ) const
pure virtual

In addition to the settings stored in a Server database, an Engine can have some settings which are stored somewhere "under the hood" of the Engine, e.g. on a device acting as an Engine's backend. Such settings do not need to be explicitly marked in the Settings Model, but every time the Server offers the user to edit the values, it calls this method and merges the received values with the ones in its database.

Returns
Engine settings that are stored on the plugin side, or null if there are no such settings.

◆ setHandler()

virtual Error nx::sdk::analytics::IEngine::setHandler ( IHandler handler)
pure virtual
Parameters
handlerGeneric Engine-related events (errors, warning, info messages) might be reported via this handler.

◆ setSettings()

virtual void nx::sdk::analytics::IEngine::setSettings ( const IStringMap settings)
pure virtual

Called before other methods. Server provides the set of settings stored in its database, combined with the values received from the plugin via pluginSideSettings() (if any), for this Engine instance.

Parameters
settingsValues of settings declared in the manifest. Never null. Valid only during the call.

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