nx_server_plugin_sdk 1.0 Server Plugin 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:

## Classes
class | IHandler
class | IHandler0

## Public Member Functions
Result< const ISettingsResponse * > | setSettings (const IStringMap *settings)
Result< const ISettingsResponse * > | integrationSideSettings () 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 IRefCountable * | queryInterface (const InterfaceId *id)
Ptr< Interface > | queryInterface ()
Ptr< const Interface > | queryInterface () const
Public Member Functions inherited from nx::sdk::IRefCountable
virtual | ~IRefCountable ()=default
template<class Interface >
Ptr< Interface > | queryInterface ()
template<class Interface >
Ptr< const Interface > | queryInterface () 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 | getIntegrationSideSettings (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 IRefCountable * | queryInterface (const IRefCountable::InterfaceId *id) override
IRefCountable * | queryInterfaceSupportingDeprecatedId (const IRefCountable::InterfaceId *id, const Uuid &deprecatedInterfaceId)

## Additional Inherited Members
Static Protected Member Functions inherited from nx::sdk::IRefCountable
template<int len>
static const InterfaceId * | makeId (const char(&charArray)[len])
template<int len, int alternativeLen>
static std::vector< const InterfaceId * > | makeIdWithAlternative (const char(&charArray)[len], const char(&alternativeCharArray)[alternativeLen])
template<class TemplateInstance , class TemplateArg , int len>
static const InterfaceId * | makeIdForTemplate (const char(&baseIdCharArray)[len])
static std::vector< const InterfaceId * > | alternativeInterfaceIds (const InterfaceId *id)
static std::vector< const InterfaceId * > | alternativeInterfaceIds (std::vector< const InterfaceId *> ids)

## 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
| ) |  |
| protected pure virtual

Called by setNeededMetadataTypes()

## ◆ doSetSettings()

virtual void nx::sdk::analytics::IDeviceAgent::doSetSettings | ( | Result< const ISettingsResponse *> * | outResult,
|  | const IStringMap * | settings
| ) |  |
| protected pure virtual

Called by setSettings()

## ◆ getIntegrationSideSettings()

virtual void nx::sdk::analytics::IDeviceAgent::getIntegrationSideSettings | ( | Result< const ISettingsResponse *> * | outResult | ) | const
| protected pure virtual

Called by integrationSideSettings()

## ◆ getManifest()

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

Called by manifest()

## ◆ integrationSideSettings()

Result<const ISettingsResponse*> nx::sdk::analytics::IDeviceAgent::integrationSideSettings | ( |  | ) | const
| inline

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
  An error code with a message in case of some general failure, or a combination of optional individual setting errors, optional setting values, and an optional new Settings Model. Can be null if none of the above items are present.

## ◆ manifest()

Result<const IString*> nx::sdk::analytics::IDeviceAgent::manifest | ( |  | ) | const
| inline

Provides DeviceAgent Manifest in JSON format.

See the manifest specification in Analytics Integration Manifests.

Returns
  JSON string in UTF-8.

## ◆ setHandler()

virtual void nx::sdk::analytics::IDeviceAgent::setHandler | ( | IHandler * | handler | ) |
| pure virtual

Parameters

  handler | Processes 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.

## ◆ setNeededMetadataTypes()

Result<void> nx::sdk::analytics::IDeviceAgent::setNeededMetadataTypes | ( | const IMetadataTypes * | neededMetadataTypes | ) |
| inline

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

  neededMetadataTypes | Lists of type ids of events and objects.

## ◆ setSettings()

Result<const ISettingsResponse*> nx::sdk::analytics::IDeviceAgent::setSettings | ( | const IStringMap * | settings | ) |
| inline

Receives the values of settings stored in the Server database for the combination of a device instance and an Engine instance.

After creating the new IDeviceAgent instance, this method is called after manifest().

ATTENTION: If the DeviceAgent has some Integration-side settings (see integrationSideSettings()) which are hosted in the backend (e.g. on the Device) and potentially can be changed by the user directly on that backend, their values must be ignored in this function when it is called for the first time after the creation of the DeviceAgent. Otherwise, these values, which technically are the values last known to the Server, may override the values stored in the backend and potentially changed by the user directly during the period when the DeviceAgent did not exist (i.e., Analytics has been turned off for this Device).

Parameters

  settings | Values of settings conforming to the Settings Model. Never null.

Returns
  An error code with a message in case of some general failure that affected the procedure of applying the settings, or a combination of optional individual setting errors, optional new setting values in case they were changed during the applying, and an optional new Settings Model. Can be null if none of the above items are present.

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

- src/nx/sdk/analytics/i_device_agent.h