stub_analytics_plugin  1.6
Network Optix Video Analytics SDK
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nx::sdk::analytics::CommonEngine Class Referenceabstract

#include <common_engine.h>

Inheritance diagram for nx::sdk::analytics::CommonEngine:
nxpt::CommonRefCounter< Engine > nx::mediaserver_plugins::analytics::stub::Engine

Public Member Functions

virtual Pluginplugin () const override
 
virtual void * queryInterface (const nxpl::NX_GUID &interfaceId) override
 
virtual void setSettings (const nx::sdk::Settings *settings) override
 
virtual nx::sdk::SettingspluginSideSettings () const override
 
virtual const IStringmanifest (Error *error) const override
 
virtual void executeAction (Action *action, Error *outError) override
 
virtual nx::sdk::Error setHandler (nx::sdk::analytics::Engine::IHandler *handler) override
 
- Public Member Functions inherited from nxpt::CommonRefCounter< Engine >
 CommonRefCounter (const CommonRefCounter &)=delete
 
 CommonRefCounter (CommonRefCounter &&)=delete
 
CommonRefCounteroperator= (const CommonRefCounter &)=delete
 
CommonRefCounteroperator= (CommonRefCounter &&)=delete
 
virtual unsigned int addRef () override
 
virtual unsigned int releaseRef () override
 
unsigned int refCount () const
 

Protected Member Functions

 CommonEngine (Plugin *plugin, bool enableOutput, const std::string &printPrefix="")
 
virtual std::string manifest () const =0
 
virtual void settingsReceived ()
 
std::string getParamValue (const char *paramName)
 
virtual void executeAction (const std::string &, nxpl::NX_GUID, nxpl::NX_GUID, int64_t, const std::map< std::string, std::string > &, std::string *, std::string *, Error *)
 
void pushPluginEvent (nx::sdk::IPluginEvent::Level level, std::string caption, std::string description)
 
template<typename DerivedPlugin >
DerivedPlugin * pluginCasted ()
 
nx::sdk::analytics::Engine::IHandlerhandler ()
 
- Protected Member Functions inherited from nxpt::CommonRefCounter< Engine >
 CommonRefCounter (CommonRefManager *refManager)
 

Protected Attributes

nx::sdk::Utils utils
 
- Protected Attributes inherited from nxpt::CommonRefCounter< Engine >
CommonRefManager m_refManager
 

Detailed Description

Base class for a typical implementation of an Analytics Engine. Hides many technical details of the Analytics Plugin SDK, but may limit plugin capabilities - use only when suitable.

To use NX_PRINT/NX_OUTPUT in a derived class with the same printPrefix as used in this class, add the following to the derived class cpp:


    #define NX_PRINT_PREFIX (this->utils.printPrefix)
    #include <nx/kit/debug.h>

Constructor & Destructor Documentation

◆ CommonEngine()

nx::sdk::analytics::CommonEngine::CommonEngine ( Plugin plugin,
bool  enableOutput,
const std::string &  printPrefix = "" 
)
protected
Parameters
enableOutputEnables NX_OUTPUT. Typically, use NX_DEBUG_ENABLE_OUTPUT as a value.
printPrefixPrefix for NX_PRINT and NX_OUTPUT. If empty, will be made from libName.

Member Function Documentation

◆ executeAction()

virtual void nx::sdk::analytics::CommonEngine::executeAction ( const std::string &  ,
nxpl::NX_GUID  ,
nxpl::NX_GUID  ,
int64_t  ,
const std::map< std::string, std::string > &  ,
std::string *  ,
std::string *  ,
Error *   
)
inlineprotectedvirtual

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

Parameters
actionIdId of the action being triggered.
objectIdId of a metadata object for which the action has been triggered.
paramsIf the engine manifest defines params for the action being triggered, contains their values after they are filled by the user via Client form. Otherwise, empty.
outActionUrlIf set by this call, Client will open this URL in an embedded browser.
outMessageToUserIf set by this call, Client will show this text to the user.

Reimplemented in nx::mediaserver_plugins::analytics::stub::Engine.

◆ getParamValue()

std::string nx::sdk::analytics::CommonEngine::getParamValue ( const char *  paramName)
protected

Provides access to the Plugin global settings stored by the server.

Returns
Param value, or an empty string if such param does not exist, having logged the error.

◆ pluginCasted()

template<typename DerivedPlugin >
DerivedPlugin* nx::sdk::analytics::CommonEngine::pluginCasted ( )
inlineprotected

Intended to be called from a method of a derived class overriding plugin().

Returns
Parent Plugin, casted to the specified type.

◆ pushPluginEvent()

void nx::sdk::analytics::CommonEngine::pushPluginEvent ( nx::sdk::IPluginEvent::Level  level,
std::string  caption,
std::string  description 
)
protected

Sends a PluginEvent to the Server. Can be called from any thread, but if called before settingsReceived() was called, will be ignored in case setHandler() was not called yet.

◆ settingsReceived()

virtual void nx::sdk::analytics::CommonEngine::settingsReceived ( )
inlineprotectedvirtual

Called when the settings are received from the server (even if the values are not changed). Should perform any required (re)initialization. Called even if the settings model is empty.

Reimplemented in nx::mediaserver_plugins::analytics::stub::Engine.


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