NAP
Public Member Functions | List of all members
PortalComponentInstance Class Reference

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

Public Member Functions

 PortalComponentInstance (EntityInstance &entity, Component &resource)
 
virtual bool init (utility::ErrorState &error) override
 
virtual void onDestroy () override
 
bool processRequest (PortalEvent &event, utility::ErrorState &error)
 
bool processUpdate (PortalEvent &event, utility::ErrorState &error)
 
const PortalWebSocketServergetServer () const
 
PortalWebSocketServergetServer ()
 
- Public Member Functions inherited from ComponentInstance
 ComponentInstance (EntityInstance &entity, Component &resource)
 
virtual void update (double deltaTime)
 
nap::EntityInstancegetEntityInstance () const
 
nap::ComponentgetComponent () const
 
template<typename T >
T * getComponent () const
 
virtual bool init (utility::ErrorState &errorState)
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 
Inheritance diagram for PortalComponentInstance:
[legend]
Collaboration diagram for PortalComponentInstance:
[legend]

Constructor & Destructor Documentation

◆ PortalComponentInstance()

PortalComponentInstance ( EntityInstance entity,
Component resource 
)

Constructor

Member Function Documentation

◆ getServer() [1/2]

PortalWebSocketServer& getServer ( )
Returns
the client or server this component receives events from.

◆ getServer() [2/2]

const PortalWebSocketServer& getServer ( ) const
Returns
the client or server this component receives events from.

◆ init()

virtual bool init ( utility::ErrorState error)
overridevirtual

Initializes the portal component instance. Connect to portal item updates.

Parameters
errorshould hold the error message when initialization fails
Returns
if the component initialized successfully

Reimplemented from ComponentInstance.

◆ onDestroy()

virtual void onDestroy ( )
overridevirtual

Called when the portal is destroyed. Disconnect from portal item updates.

Reimplemented from Object.

◆ processRequest()

bool processRequest ( PortalEvent event,
utility::ErrorState error 
)

Processes a request type portal event

Parameters
eventthe portal event that is to be processed
errorcontains information when processing fails
Returns
if the event was processed successfully

◆ processUpdate()

bool processUpdate ( PortalEvent event,
utility::ErrorState error 
)

Processes an update type portal event

Parameters
eventthe portal event that is to be processed
errorcontains information when processing fails
Returns
if the event was processed successfully