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::IEngine0 Class Referenceabstract
Inheritance diagram for nx::sdk::analytics::IEngine0:
nx::sdk::Interface< IEngine0 > nx::sdk::IRefCountable

Classes

class  IHandler
 

Public Member Functions

virtual void setEngineInfo (const IEngineInfo *engineInfo)=0
 
Result< const ISettingsResponse * > setSettings (const IStringMap *settings)
 
Result< const ISettingsResponse * > pluginSideSettings () const
 
Result< const IString * > manifest () const
 
virtual bool isCompatible (const IDeviceInfo *deviceInfo) const =0
 
Result< IDeviceAgent * > obtainDeviceAgent (const IDeviceInfo *deviceInfo)
 
Result< IAction::ResultexecuteAction (const IAction *action)
 
virtual void setHandler (IHandler *handler)=0
 
- Public Member Functions inherited from nx::sdk::Interface< IEngine0 >
virtual IRefCountablequeryInterface (const InterfaceId *id)
 
Ptr< RefCountablequeryInterface ()
 
Ptr< const RefCountablequeryInterface () const
 
- Public Member Functions inherited from nx::sdk::IRefCountable
virtual ~IRefCountable ()=default
 
template<class RefCountable >
Ptr< RefCountablequeryInterface ()
 
template<class RefCountable >
Ptr< const RefCountablequeryInterface () 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 doObtainDeviceAgent (Result< IDeviceAgent *> *outResult, const IDeviceInfo *deviceInfo)=0
 
virtual void doExecuteAction (Result< IAction::Result > *outResult, const IAction *action)=0
 
- Protected Member Functions inherited from nx::sdk::Interface< IEngine0 >
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])
 
- Static Protected Attributes inherited from nx::sdk::IRefCountable
template<typename RefCountable >
static constexpr bool hasAlternativeInterfaceId = HasAlternativeInterfaceId<RefCountable>::value
 

Member Function Documentation

◆ doExecuteAction()

virtual void nx::sdk::analytics::IEngine0::doExecuteAction ( Result< IAction::Result > *  outResult,
const IAction action 
)
protectedpure virtual

Called by executeAction()

◆ doObtainDeviceAgent()

virtual void nx::sdk::analytics::IEngine0::doObtainDeviceAgent ( Result< IDeviceAgent *> *  outResult,
const IDeviceInfo deviceInfo 
)
protectedpure virtual

◆ doSetSettings()

virtual void nx::sdk::analytics::IEngine0::doSetSettings ( Result< const ISettingsResponse *> *  outResult,
const IStringMap settings 
)
protectedpure virtual

Called by setSettings()

◆ executeAction()

Result<IAction::Result> nx::sdk::analytics::IEngine0::executeAction ( const IAction action)
inline

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.

◆ getManifest()

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

Called by manifest()

◆ getPluginSideSettings()

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

◆ isCompatible()

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

◆ manifest()

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

Provides a JSON Manifest for this Engine instance. See the example of such Manifest in stub_analytics_plugin.

When creating the new IEngine instance, this method is called after setSettings(), but the Manifest must not depend on the setting values, because it will not be re-requested on settings change afterwards.

See the manifest specification in Analytics Plugin Manifests.

Returns
JSON string in UTF-8.

◆ obtainDeviceAgent()

Result<IDeviceAgent*> nx::sdk::analytics::IEngine0::obtainDeviceAgent ( const IDeviceInfo deviceInfo)
inline

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.
Returns
Pointer to an object that implements IDeviceAgent interface, or null if a DeviceAgent for this particular Device makes no sense (e.g. if the Device supports no Analytics Events and Objects) - this is not treated as an error (the user is not notified).

◆ pluginSideSettings()

Result<const ISettingsResponse*> nx::sdk::analytics::IEngine0::pluginSideSettings ( ) const
inline

In addition to the settings stored in the 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
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.

◆ setEngineInfo()

virtual void nx::sdk::analytics::IEngine0::setEngineInfo ( const IEngineInfo engineInfo)
pure virtual

Called right after the Engine creation (before all other methods) or when some Engine-related change occurs on the Server side (e.g. Engine name is changed).

◆ setHandler()

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

◆ setSettings()

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

Receives the values of settings stored in the Server database for this Engine instance. The values must conform to the Settings Model, which is initially defined in the Plugin Manifest, but may be overridden via returning an updated Model from this method.

After creating the new IEngine instance, this method is called after setEngineInfo() but before manifest().

Parameters
settingsValues 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: