nx_metadata_sdk  1.0
Metadata SDK
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
nx::sdk::analytics::IDeviceAgent Class Referenceabstract

#include <i_device_agent.h>

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

Classes

class  IHandler
 

Public Member Functions

Result< const ISettingsResponse * > setSettings (const IStringMap *settings)
 
Result< const ISettingsResponse * > pluginSideSettings () const
 
Result< const IString * > manifest () const
 
virtual void setHandler (IHandler *handler)=0
 
Result< void > setNeededMetadataTypes (const IMetadataTypes *neededMetadataTypes)
 
- Public Member Functions inherited from nx::sdk::Interface< IDeviceAgent >
virtual IRefCountablequeryInterface (const InterfaceId *id)
 
Ptr< InterfacequeryInterface ()
 
Ptr< const InterfacequeryInterface () const
 
- Public Member Functions inherited from nx::sdk::IRefCountable
virtual ~IRefCountable ()=default
 
template<class Interface >
Ptr< InterfacequeryInterface ()
 
template<class Interface >
Ptr< const InterfacequeryInterface () const
 
virtual int addRef () const =0
 
virtual int releaseRef () const =0
 
int refCountThreadUnsafe () const
 

Static Public Member Functions

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

Protected Member Functions

virtual void doSetSettings (Result< const ISettingsResponse *> *outResult, const IStringMap *settings)=0
 
virtual void getPluginSideSettings (Result< const ISettingsResponse *> *outResult) const =0
 
virtual void getManifest (Result< const IString *> *outResult) const =0
 
virtual void doSetNeededMetadataTypes (Result< void > *outResult, const IMetadataTypes *neededMetadataTypes)=0
 
- Protected Member Functions inherited from nx::sdk::Interface< IDeviceAgent >
virtual IRefCountablequeryInterface (const IRefCountable::InterfaceId *id) override
 
IRefCountablequeryInterfaceSupportingDeprecatedId (const IRefCountable::InterfaceId *id, const Uuid &deprecatedInterfaceId)
 

Additional Inherited Members

- Static Protected Member Functions inherited from nx::sdk::IRefCountable
template<int len>
static constexpr const InterfaceIdmakeId (const char(&charArray)[len])
 
template<class TemplateInstance , class TemplateArg , int len>
static const InterfaceIdmakeIdForTemplate (const char(&baseIdCharArray)[len])
 

Detailed Description

Metadata producer for a particular Device (e.g. a camera). This is a base interface which allows to identify the Device which the Engine has been assigned to work with, and is suitable only for Plugins which generate metadata without additional input from the Device. If the Plugin requires input data from the Device (e.g. video frames from the camera), it may implement one of the derived interfaces that offer such data.

All methods are guaranteed to be called without overlapping even if from different threads (i.e. with a guaranteed barrier between the calls), thus, no synchronization is required for the implementation.

Member Function Documentation

◆ doSetNeededMetadataTypes()

virtual void nx::sdk::analytics::IDeviceAgent::doSetNeededMetadataTypes ( Result< void > *  outResult,
const IMetadataTypes neededMetadataTypes 
)
protectedpure virtual

Sets a list of metadata types that are needed by the Server. Empty list means that the Server does not need any metadata from this DeviceAgent.

Parameters
neededMetadataTypesLists of type ids of events and objects.

◆ doSetSettings()

virtual void nx::sdk::analytics::IDeviceAgent::doSetSettings ( Result< const ISettingsResponse *> *  outResult,
const IStringMap settings 
)
protectedpure 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 the combination of a device instance and an Engine instance.

Parameters
settingsValues of settings declared in the manifest. Never null.
Returns
Result containing a map of errors that occurred while applying each setting - the keys are the setting ids, and the values are human readable error strings in English. Even if some settings can't be applied or an error happens while applying them, this method must return a successful result with a corresponding map of errors. A faulty result containing error information instead of the map should be returned only in case of some general failure that affected the procedure of applying the settings. The result should contain null if no errors occurred.

◆ getManifest()

virtual void nx::sdk::analytics::IDeviceAgent::getManifest ( Result< const IString *> *  outResult) const
protectedpure virtual

Provides DeviceAgent manifest in JSON format.

Returns
JSON string in UTF-8.

◆ getPluginSideSettings()

virtual void nx::sdk::analytics::IDeviceAgent::getPluginSideSettings ( Result< const ISettingsResponse *> *  outResult) const
protectedpure virtual

In addition to the settings stored in a Server database, a DeviceAgent can have some settings which are stored somewhere "under the hood" of the DeviceAgent, e.g. on a device acting as a DeviceAgent'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
Result containing (in case of success) information about settings that are stored on the plugin side. Errors corresponding to the particular settings should be placed in the ISettingsResponse object. A faulty result must be returned only in case of a general failure that affects the settings retrieval procedure. The result should contain null if the Engine has no plugin-side settings.

◆ setHandler()

virtual void nx::sdk::analytics::IDeviceAgent::setHandler ( IHandler handler)
pure virtual
Parameters
handlerProcesses event metadata and object metadata fetched by DeviceAgent. DeviceAgent should fetch events metadata after setNeededMetadataTypes() call. Generic device related events (errors, warning, info messages) might also be reported via this handler.

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