NAP
Public Member Functions | Protected Member Functions | List of all members
PortalService Class Reference

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

Public Member Functions

 PortalService (ServiceConfiguration *configuration)
 
WebSocketServicegetWebSocketService ()
 
const WebSocketServicegetWebSocketService () const
 
- Public Member Functions inherited from Service
UNPREFIXED_MODULE_NAME_INPUTCASE Service (ServiceConfiguration *configuration)
 
virtual bool init (nap::utility::ErrorState &errorState) override
 
virtual void shutdown () override
 
 Service (ServiceConfiguration *configuration)
 
virtual ~Service ()
 
CoregetCore ()
 
const CoregetCore () const
 
std::string getTypeName () const
 
const ModulegetModule () const
 
 Service (Service &)=delete
 
Serviceoperator= (const Service &)=delete
 
 Service (Service &&)=delete
 
Serviceoperator= (Service &&)=delete
 

Protected Member Functions

virtual void registerObjectCreators (rtti::Factory &factory) override
 
virtual void getDependentServices (std::vector< rtti::TypeInfo > &dependencies) override
 
virtual void created () override
 
virtual void update (double deltaTime) override
 
- Protected Member Functions inherited from Service
virtual bool init (utility::ErrorState &error)
 
virtual void preUpdate (double deltaTime)
 
virtual void postUpdate (double deltaTime)
 
virtual void preShutdown ()
 
virtual void shutdown ()
 
virtual void preResourcesLoaded ()
 
virtual void postResourcesLoaded ()
 
template<typename SERVICE_CONFIG >
SERVICE_CONFIG * getConfiguration ()
 
template<typename SERVICE_CONFIG >
const SERVICE_CONFIG * getConfiguration () const
 
std::string getIniFilePath () const
 
std::string getIniFilePath (const std::string &appendix) const
 

Description

The portal service consumes all events received by the portal web socket servers on a background thread and forwards these events to the right portal on update of the application thread.

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

Constructor & Destructor Documentation

◆ PortalService()

PortalService ( ServiceConfiguration configuration)

Default constructor

Member Function Documentation

◆ created()

virtual void created ( )
overrideprotectedvirtual

Called after creation

Reimplemented from Service.

◆ getDependentServices()

virtual void getDependentServices ( std::vector< rtti::TypeInfo > &  dependencies)
overrideprotectedvirtual

This service depends on the WebSocket service

Reimplemented from Service.

◆ getWebSocketService() [1/2]

WebSocketService& getWebSocketService ( )
Returns
the WebSocket service

◆ getWebSocketService() [2/2]

const WebSocketService& getWebSocketService ( ) const
Returns
const ref to the WebSocket service

◆ registerObjectCreators()

virtual void registerObjectCreators ( rtti::Factory factory)
overrideprotectedvirtual

Registers all objects that need a specific way of construction.

Parameters
factorythe factory to register the object creators with.

Reimplemented from Service.

◆ update()

virtual void update ( double  deltaTime)
overrideprotectedvirtual

Processes all received portal events from all registered portal WebSocket servers. The events are forwarded to all the registered portal components. This function is called automatically by the application loop.

Parameters
deltaTimetime in between calls in seconds.

Reimplemented from Service.