#include <websocketcomponent.h>
Public Member Functions | |
WebSocketComponentInstance (EntityInstance &entity, Component &resource) | |
virtual | ~WebSocketComponentInstance () |
virtual bool | init (utility::ErrorState &errorState) override |
const WebSocketInterface & | getInterface () const |
WebSocketInterface & | getInterface () |
![]() | |
ComponentInstance (EntityInstance &entity, Component &resource) | |
virtual void | update (double deltaTime) |
nap::EntityInstance * | getEntityInstance () const |
nap::Component * | getComponent () const |
template<typename T > | |
T * | getComponent () const |
virtual bool | init (utility::ErrorState &errorState) |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
nap::Signal< const WebSocketConnectionOpenedEvent & > | connectionOpened |
nap::Signal< const WebSocketConnectionClosedEvent & > | connectionClosed |
nap::Signal< const WebSocketConnectionFailedEvent & > | connectionFailed |
nap::Signal< const WebSocketMessageReceivedEvent & > | messageReceived |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Instance part of the WebSocketComponent, receives web-socket client and server events. Listen to the various signals to receive web-socket events in your application. The events are received on the main application thread. This object ensures thread-safety. Only web-socket events that originated from the given interface (client or server) are accepted.
WebSocketComponentInstance | ( | EntityInstance & | entity, |
Component & | resource | ||
) |
Constructor.
entity | the entity this component belongs to. |
resource | the original nap::WebSocketComponent |
|
virtual |
WebSocketInterface& getInterface | ( | ) |
const WebSocketInterface& getInterface | ( | ) | const |
|
overridevirtual |
Initialize this instance of the nap::WebSocketComponent.
errorState | holds the error message when initialization fails. |
Reimplemented from ComponentInstance.
nap::Signal<const WebSocketConnectionClosedEvent&> connectionClosed |
Occurs when a connection to a client or server is closed.
nap::Signal<const WebSocketConnectionFailedEvent&> connectionFailed |
Occurs when a connection to a client or server failed to establish.
nap::Signal<const WebSocketConnectionOpenedEvent&> connectionOpened |
Occurs when a new connection to a client or server is established.
nap::Signal<const WebSocketMessageReceivedEvent&> messageReceived |
Occurs when a new message from a client or server is received.