NAP
Public Member Functions | Public Attributes | List of all members
PortalItem Class Referenceabstract

#include </opt/build/repo/nap/system_modules/napportal/src/portalitem.h>

Public Member Functions

virtual bool processUpdate (const APIEvent &event, utility::ErrorState &error)=0
 
virtual APIEventPtr getDescriptor () const =0
 
virtual APIEventPtr getValue () const =0
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

Signal< const PortalItem & > updateSignal
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Represents a single item (e.g. slider, toggle, button) in a NAP portal. Implementations are in derived classes, PortalItem only serves as a base class.

Inheritance diagram for PortalItem:
[legend]
Collaboration diagram for PortalItem:
[legend]

Member Function Documentation

◆ getDescriptor()

virtual APIEventPtr getDescriptor ( ) const
pure virtual

Gets the descriptor as an API event. Implementation differs per derived class.

Returns
the descriptor of the portal item as an API event

Implemented in PortalItemVec< T >, PortalItemColor< T >, PortalItemNumeric< T >, PortalItemSimple< T >, PortalItemDropDown, PortalItemButton, and PortalItemOperationalCalendar.

◆ getValue()

virtual APIEventPtr getValue ( ) const
pure virtual

Gets the current value as an API event. Implementation differs per derived class.

Returns
the current value of the portal item as an API event

Implemented in PortalItemVec< T >, PortalItemColor< T >, PortalItemNumeric< T >, PortalItemSimple< T >, PortalItemDropDown, PortalItemButton, and PortalItemOperationalCalendar.

◆ processUpdate()

virtual bool processUpdate ( const APIEvent event,
utility::ErrorState error 
)
pure virtual

Processes an update type API event. Implementation differs per derived class.

Parameters
eventThe event to be processed
errorcontains information when processing fails
Returns
if the event was processed successfully

Implemented in PortalItemVec< T >, PortalItemColor< T >, PortalItemNumeric< T >, PortalItemSimple< T >, PortalItemSimple< std::string >, PortalItemDropDown, PortalItemButton, and PortalItemOperationalCalendar.

Member Data Documentation

◆ updateSignal

Signal<const PortalItem&> updateSignal

Occurs when the portal item signals connected clients of an update