cumbia-websocket 1.x
Qt widgets on top of the cumbia C++ library
Public Types | Public Member Functions | List of all members
CumbiaWebSocket Class Reference

#include <cumbiawebsocket.h>

Inheritance diagram for CumbiaWebSocket:
Inheritance graph
[legend]

Public Types

enum  Type { CumbiaWSType = Cumbia::CumbiaUserType + 12 }
 

Public Member Functions

 CumbiaWebSocket (const QString &websocket_url, const QString &http_url, CuThreadFactoryImplI *tfi, CuThreadsEventBridgeFactory_I *teb)
 CumbiaWebSocket. More...
 
 ~CumbiaWebSocket ()
 
CuThreadFactoryImplI * getThreadFactoryImpl () const
 
CuThreadsEventBridgeFactory_I * getThreadEventsBridgeFactory () const
 
QString httpUrl () const
 
QString websocketUrl () const
 
virtual int getType () const
 
CuWSClientwebsocketClient () const
 
void addAction (const std::string &source, CuDataListener *l, const CuWSActionFactoryI &f)
 
void unlinkListener (const string &source, CuWSActionI::Type t, CuDataListener *l)
 
CuWSActionIfindAction (const std::string &source, CuWSActionI::Type t) const
 
void openSocket ()
 
void closeSocket ()
 
void addReplaceWildcardI (QuReplaceWildcards_I *rwi)
 
QList< QuReplaceWildcards_I * > getReplaceWildcard_Ifaces () const
 
virtual void onUpdate (const QString &message)
 Callback invoked by CuWSClient when a new message is received from the websocket. More...
 
virtual void onUpdate (const QString &message)=0
 

Member Enumeration Documentation

◆ Type

Enumerator
CumbiaWSType 

Constructor & Destructor Documentation

◆ CumbiaWebSocket()

CumbiaWebSocket::CumbiaWebSocket ( const QString &  websocket_url,
const QString &  http_url,
CuThreadFactoryImplI *  tfi,
CuThreadsEventBridgeFactory_I *  teb 
)

CumbiaWebSocket.

Parameters
websocket_urlthe url to be used for websocket incoming data
http_urlthe http (https) url to be used to send requests to the server (output)
tfithread factory implementation
tebthread events bridge factory

◆ ~CumbiaWebSocket()

CumbiaWebSocket::~CumbiaWebSocket ( )

Member Function Documentation

◆ addAction()

void CumbiaWebSocket::addAction ( const std::string &  source,
CuDataListener *  l,
const CuWSActionFactoryI f 
)

◆ addReplaceWildcardI()

void CumbiaWebSocket::addReplaceWildcardI ( QuReplaceWildcards_I *  rwi)

◆ closeSocket()

void CumbiaWebSocket::closeSocket ( )

◆ findAction()

CuWSActionI * CumbiaWebSocket::findAction ( const std::string &  source,
CuWSActionI::Type  t 
) const

◆ getReplaceWildcard_Ifaces()

QList< QuReplaceWildcards_I * > CumbiaWebSocket::getReplaceWildcard_Ifaces ( ) const

◆ getThreadEventsBridgeFactory()

CuThreadsEventBridgeFactory_I * CumbiaWebSocket::getThreadEventsBridgeFactory ( ) const

◆ getThreadFactoryImpl()

CuThreadFactoryImplI * CumbiaWebSocket::getThreadFactoryImpl ( ) const

◆ getType()

int CumbiaWebSocket::getType ( ) const
virtual

References CumbiaWSType.

◆ httpUrl()

QString CumbiaWebSocket::httpUrl ( ) const

◆ onUpdate()

void CumbiaWebSocket::onUpdate ( const QString &  message)
virtual

Callback invoked by CuWSClient when a new message is received from the websocket.

The received message is used to build a JSon document in order to extract the source. The decoding of the message is taken over by the CuWSActionI with the given source

See also
CuWSClient::onMessageReceived

Implements CuWSClientListener.

References CuWSActionFactoryService::CuWSActionFactoryServiceType, CuWSActionI::decodeMessage(), CuWSActionI::exiting(), findAction(), CuWSActionI::Reader, CuWSActionI::ReaderConfig, CuWSActionFactoryService::unregisterAction(), CuWSActionI::Writer, and CuWSActionI::WriterConfig.

◆ openSocket()

void CumbiaWebSocket::openSocket ( )

◆ unlinkListener()

void CumbiaWebSocket::unlinkListener ( const string &  source,
CuWSActionI::Type  t,
CuDataListener *  l 
)

◆ websocketClient()

CuWSClient * CumbiaWebSocket::websocketClient ( ) const

◆ websocketUrl()

QString CumbiaWebSocket::websocketUrl ( ) const

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