NUGU SDK Linux  1.7.6
NuguClientKit::ICapabilityInterface Class Referenceabstract

capability interface More...

#include <capability_interface.hh>

+ Inheritance diagram for NuguClientKit::ICapabilityInterface:

Public Types

using EventResultCallback = std::function< void(const std::string &, const std::string &, const std::string &, int, int)>
 Event result callback for error handling. More...
 
enum class  SuspendPolicy { STOP , PAUSE }
 Capability suspend policy. More...
 

Public Member Functions

virtual void addEventResultCallback (const std::string &ename, EventResultCallback callback)=0
 Add event result callback for error handling. More...
 
virtual void cancelDirective (NuguDirective *ndir)=0
 Receive a directive cancellation from the Directive sequencer. More...
 
virtual void deInitialize ()=0
 Deinitialize the current object.
 
virtual std::string getName ()=0
 Get the capability name of the current object. More...
 
virtual bool getProperties (const std::string &property, std::list< std::string > &values)=0
 It is possible to share own property values among objects. More...
 
virtual bool getProperty (const std::string &property, std::string &value)=0
 It is possible to share own property value among objects. More...
 
virtual std::string getVersion ()=0
 Get the capability version of the current object. More...
 
virtual void initialize ()=0
 Initialize the current object.
 
virtual void notifyEventResponse (const std::string &msg_id, const std::string &data, bool success)=0
 Notify event response info. More...
 
virtual void notifyEventResult (const std::string &event_desc)=0
 Notify event result. More...
 
virtual void preprocessDirective (NuguDirective *ndir)=0
 Receive a directive preprocessing request from Directive sequencer. More...
 
virtual void processDirective (NuguDirective *ndir)=0
 Receive a directive processing request from Directive sequencer. More...
 
virtual bool receiveCommand (const std::string &from, const std::string &command, const std::string &param)=0
 Process command from other objects. More...
 
virtual void receiveCommandAll (const std::string &command, const std::string &param)=0
 Process command received from capability manager. More...
 
virtual void removeEventResultCallback (const std::string &ename)=0
 Remove event result callback. More...
 
virtual void restore ()=0
 Restore previous suspended action.
 
virtual void setCancelPolicy (bool cancel_previous_dialog, DirectiveCancelPolicy &&cancel_policy={ true })=0
 Set directive cancel policy. More...
 
virtual void setCapabilityListener (ICapabilityListener *clistener)=0
 Set the listener object. More...
 
virtual void setNuguCoreContainer (INuguCoreContainer *core_container)=0
 Set INuguCoreContainer for using functions in NuguCore. More...
 
virtual void setSuspendPolicy (SuspendPolicy policy=SuspendPolicy::STOP)=0
 Set capability suspend policy. More...
 
virtual void suspend ()=0
 Suspend current action.
 
virtual void updateCompactContext (NJson::Value &ctx)=0
 Update the compact context information of the capability agent. More...
 
virtual void updateInfoForContext (NJson::Value &ctx)=0
 Update the current context information of the capability agent. More...
 

Detailed Description

capability interface

See also
NuguDirective
ICapabilityListener

Member Typedef Documentation

◆ EventResultCallback

using NuguClientKit::ICapabilityInterface::EventResultCallback = std::function<void(const std::string&, const std::string&, const std::string&, int, int)>

Event result callback for error handling.

Parameters
[in]enameevent name
[in]msg_idevent message id
[in]dialog_idevent request dialog id
[in]successevent result
[in]codeevent result code (similar to http status code)

Member Enumeration Documentation

◆ SuspendPolicy

Capability suspend policy.

Enumerator
STOP 

Stop current action unconditionally

PAUSE 

Pause current action. It could resume later

Member Function Documentation

◆ setNuguCoreContainer()

virtual void NuguClientKit::ICapabilityInterface::setNuguCoreContainer ( INuguCoreContainer core_container)
pure virtual

Set INuguCoreContainer for using functions in NuguCore.

Parameters
[in]core_containerNuguCoreContainer instance

Implemented in NuguClientKit::Capability.

◆ setSuspendPolicy()

virtual void NuguClientKit::ICapabilityInterface::setSuspendPolicy ( SuspendPolicy  policy = SuspendPolicy::STOP)
pure virtual

Set capability suspend policy.

Parameters
[in]policysuspend policy

Implemented in NuguClientKit::Capability.

◆ addEventResultCallback()

virtual void NuguClientKit::ICapabilityInterface::addEventResultCallback ( const std::string &  ename,
EventResultCallback  callback 
)
pure virtual

Add event result callback for error handling.

Parameters
[in]enameevent name
[in]callbackevent result callback

Implemented in NuguClientKit::Capability.

◆ removeEventResultCallback()

virtual void NuguClientKit::ICapabilityInterface::removeEventResultCallback ( const std::string &  ename)
pure virtual

Remove event result callback.

Parameters
[in]enameevent name

Implemented in NuguClientKit::Capability.

◆ notifyEventResult()

virtual void NuguClientKit::ICapabilityInterface::notifyEventResult ( const std::string &  event_desc)
pure virtual

Notify event result.

Parameters
[in]event_descevent result description (format: 'cname.ename.msgid.dialogid.success.code')

Implemented in NuguClientKit::Capability.

◆ notifyEventResponse()

virtual void NuguClientKit::ICapabilityInterface::notifyEventResponse ( const std::string &  msg_id,
const std::string &  data,
bool  success 
)
pure virtual

Notify event response info.

Parameters
[in]msg_idmessage id which is sent with event
[in]dataraw data which is received from server about event (json format)
[in]successwhether receive event response

Implemented in NuguClientKit::Capability.

◆ getName()

virtual std::string NuguClientKit::ICapabilityInterface::getName ( )
pure virtual

Get the capability name of the current object.

Returns
capability name of the object

Implemented in NuguClientKit::Capability.

◆ getVersion()

virtual std::string NuguClientKit::ICapabilityInterface::getVersion ( )
pure virtual

Get the capability version of the current object.

Returns
capability version of the object

Implemented in NuguClientKit::Capability.

◆ preprocessDirective()

virtual void NuguClientKit::ICapabilityInterface::preprocessDirective ( NuguDirective ndir)
pure virtual

Receive a directive preprocessing request from Directive sequencer.

Parameters
[in]ndirdirective

Implemented in NuguClientKit::Capability.

◆ cancelDirective()

virtual void NuguClientKit::ICapabilityInterface::cancelDirective ( NuguDirective ndir)
pure virtual

Receive a directive cancellation from the Directive sequencer.

Parameters
[in]ndirdirective

Implemented in NuguClientKit::Capability.

◆ processDirective()

virtual void NuguClientKit::ICapabilityInterface::processDirective ( NuguDirective ndir)
pure virtual

Receive a directive processing request from Directive sequencer.

Parameters
[in]ndirdirective

Implemented in NuguClientKit::Capability.

◆ updateInfoForContext()

virtual void NuguClientKit::ICapabilityInterface::updateInfoForContext ( NJson::Value &  ctx)
pure virtual

Update the current context information of the capability agent.

Parameters
[in]ctxcapability agent's context

◆ updateCompactContext()

virtual void NuguClientKit::ICapabilityInterface::updateCompactContext ( NJson::Value &  ctx)
pure virtual

Update the compact context information of the capability agent.

Parameters
[in]ctxcapability agent's context

Implemented in NuguClientKit::Capability.

◆ receiveCommand()

virtual bool NuguClientKit::ICapabilityInterface::receiveCommand ( const std::string &  from,
const std::string &  command,
const std::string &  param 
)
pure virtual

Process command from other objects.

Parameters
[in]fromcapability who send the command
[in]commandcommand
[in]paramcommand parameter
Returns
command result
Return values
trueThe command is valid
falseThe command is invalid

Implemented in NuguClientKit::Capability.

◆ receiveCommandAll()

virtual void NuguClientKit::ICapabilityInterface::receiveCommandAll ( const std::string &  command,
const std::string &  param 
)
pure virtual

Process command received from capability manager.

Parameters
[in]commandcommand
[in]paramcommand parameter

Implemented in NuguClientKit::Capability.

◆ getProperty()

virtual bool NuguClientKit::ICapabilityInterface::getProperty ( const std::string &  property,
std::string &  value 
)
pure virtual

It is possible to share own property value among objects.

Parameters
[in]propertycapability property
[in]valuecapability property value
Returns
property get result
Return values
trueThe property is valid
falseThe property is invalid

Implemented in NuguClientKit::Capability.

◆ getProperties()

virtual bool NuguClientKit::ICapabilityInterface::getProperties ( const std::string &  property,
std::list< std::string > &  values 
)
pure virtual

It is possible to share own property values among objects.

Parameters
[in]propertycapability property
[in]valuescapability property values
Returns
property get result
Return values
trueThe property is valid
falseThe property is invalid

Implemented in NuguClientKit::Capability.

◆ setCapabilityListener()

virtual void NuguClientKit::ICapabilityInterface::setCapabilityListener ( ICapabilityListener clistener)
pure virtual

Set the listener object.

Parameters
[in]clistenerlistener

Implemented in NuguClientKit::Capability.

◆ setCancelPolicy()

virtual void NuguClientKit::ICapabilityInterface::setCancelPolicy ( bool  cancel_previous_dialog,
DirectiveCancelPolicy &&  cancel_policy = { true } 
)
pure virtual

Set directive cancel policy.

Parameters
[in]cancel_previous_dialogwhether canceling previous dialog or not
[in]cancel_policypolicy object

Implemented in NuguClientKit::Capability.


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