Public Types | Public Member Functions | Protected Attributes | List of all members
foxglove::Client< ClientConfiguration > Class Template Reference

#include <websocket_client.hpp>

Inheritance diagram for foxglove::Client< ClientConfiguration >:
Inheritance graph
[legend]

Public Types

using ClientType = websocketpp::client< ClientConfiguration >
 
using ConnectionPtr = typename ClientType::connection_ptr
 
using MessagePtr = typename ClientType::message_ptr
 

Public Member Functions

void advertise (const std::vector< ClientAdvertisement > &channels) override
 
 Client ()
 
void close () override
 
void connect (const std::string &uri, std::function< void(websocketpp::connection_hdl)> onOpenHandler, std::function< void(websocketpp::connection_hdl)> onCloseHandler=nullptr) override
 
std::future< void > connect (const std::string &uri) override
 
void getParameters (const std::vector< std::string > &parameterNames, const std::optional< std::string > &requestId=std::nullopt) override
 
void messageHandler (websocketpp::connection_hdl hdl, MessagePtr msg)
 
void publish (ClientChannelId channelId, const uint8_t *buffer, size_t size) override
 
void sendBinary (const uint8_t *data, size_t dataLength)
 
void sendServiceRequest (const ServiceRequest &request) override
 
void sendText (const std::string &payload)
 
void setBinaryMessageHandler (BinaryMessageHandler handler) override
 
void setParameters (const std::vector< Parameter > &parameters, const std::optional< std::string > &requestId=std::nullopt) override
 
void setTextMessageHandler (TextMessageHandler handler) override
 
void subscribe (const std::vector< std::pair< SubscriptionId, ChannelId >> &subscriptions) override
 
void subscribeParameterUpdates (const std::vector< std::string > &parameterNames) override
 
void unadvertise (const std::vector< ClientChannelId > &channelIds) override
 
void unsubscribe (const std::vector< SubscriptionId > &subscriptionIds) override
 
void unsubscribeParameterUpdates (const std::vector< std::string > &parameterNames) override
 
virtual ~Client ()
 

Protected Attributes

BinaryMessageHandler _binaryMessageHandler
 
ConnectionPtr _con
 
ClientType _endpoint
 
std::shared_mutex _mutex
 
TextMessageHandler _textMessageHandler
 
websocketpp::lib::shared_ptr< websocketpp::lib::thread > _thread
 

Detailed Description

template<typename ClientConfiguration>
class foxglove::Client< ClientConfiguration >

Definition at line 59 of file websocket_client.hpp.

Member Typedef Documentation

◆ ClientType

template<typename ClientConfiguration>
using foxglove::Client< ClientConfiguration >::ClientType = websocketpp::client<ClientConfiguration>

Definition at line 61 of file websocket_client.hpp.

◆ ConnectionPtr

template<typename ClientConfiguration>
using foxglove::Client< ClientConfiguration >::ConnectionPtr = typename ClientType::connection_ptr

Definition at line 63 of file websocket_client.hpp.

◆ MessagePtr

template<typename ClientConfiguration>
using foxglove::Client< ClientConfiguration >::MessagePtr = typename ClientType::message_ptr

Definition at line 62 of file websocket_client.hpp.

Constructor & Destructor Documentation

◆ Client()

template<typename ClientConfiguration>
foxglove::Client< ClientConfiguration >::Client ( )
inline

Definition at line 65 of file websocket_client.hpp.

◆ ~Client()

template<typename ClientConfiguration>
virtual foxglove::Client< ClientConfiguration >::~Client ( )
inlinevirtual

Definition at line 78 of file websocket_client.hpp.

Member Function Documentation

◆ advertise()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::advertise ( const std::vector< ClientAdvertisement > &  channels)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 168 of file websocket_client.hpp.

◆ close()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::close ( )
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 118 of file websocket_client.hpp.

◆ connect() [1/2]

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::connect ( const std::string &  uri,
std::function< void(websocketpp::connection_hdl)>  onOpenHandler,
std::function< void(websocketpp::connection_hdl)>  onCloseHandler = nullptr 
)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 84 of file websocket_client.hpp.

◆ connect() [2/2]

template<typename ClientConfiguration>
std::future<void> foxglove::Client< ClientConfiguration >::connect ( const std::string &  uri)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 107 of file websocket_client.hpp.

◆ getParameters()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::getParameters ( const std::vector< std::string > &  parameterNames,
const std::optional< std::string > &  requestId = std::nullopt 
)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 194 of file websocket_client.hpp.

◆ messageHandler()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::messageHandler ( websocketpp::connection_hdl  hdl,
MessagePtr  msg 
)
inline

Definition at line 128 of file websocket_client.hpp.

◆ publish()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::publish ( ClientChannelId  channelId,
const uint8_t *  buffer,
size_t  size 
)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 179 of file websocket_client.hpp.

◆ sendBinary()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::sendBinary ( const uint8_t *  data,
size_t  dataLength 
)
inline

Definition at line 239 of file websocket_client.hpp.

◆ sendServiceRequest()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::sendServiceRequest ( const ServiceRequest request)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 187 of file websocket_client.hpp.

◆ sendText()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::sendText ( const std::string &  payload)
inline

Definition at line 234 of file websocket_client.hpp.

◆ setBinaryMessageHandler()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::setBinaryMessageHandler ( BinaryMessageHandler  handler)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 229 of file websocket_client.hpp.

◆ setParameters()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::setParameters ( const std::vector< Parameter > &  parameters,
const std::optional< std::string > &  requestId = std::nullopt 
)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 203 of file websocket_client.hpp.

◆ setTextMessageHandler()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::setTextMessageHandler ( TextMessageHandler  handler)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 224 of file websocket_client.hpp.

◆ subscribe()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::subscribe ( const std::vector< std::pair< SubscriptionId, ChannelId >> &  subscriptions)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 151 of file websocket_client.hpp.

◆ subscribeParameterUpdates()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::subscribeParameterUpdates ( const std::vector< std::string > &  parameterNames)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 212 of file websocket_client.hpp.

◆ unadvertise()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::unadvertise ( const std::vector< ClientChannelId > &  channelIds)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 173 of file websocket_client.hpp.

◆ unsubscribe()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::unsubscribe ( const std::vector< SubscriptionId > &  subscriptionIds)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 162 of file websocket_client.hpp.

◆ unsubscribeParameterUpdates()

template<typename ClientConfiguration>
void foxglove::Client< ClientConfiguration >::unsubscribeParameterUpdates ( const std::vector< std::string > &  parameterNames)
inlineoverridevirtual

Implements foxglove::ClientInterface.

Definition at line 218 of file websocket_client.hpp.

Member Data Documentation

◆ _binaryMessageHandler

template<typename ClientConfiguration>
BinaryMessageHandler foxglove::Client< ClientConfiguration >::_binaryMessageHandler
protected

Definition at line 250 of file websocket_client.hpp.

◆ _con

template<typename ClientConfiguration>
ConnectionPtr foxglove::Client< ClientConfiguration >::_con
protected

Definition at line 247 of file websocket_client.hpp.

◆ _endpoint

template<typename ClientConfiguration>
ClientType foxglove::Client< ClientConfiguration >::_endpoint
protected

Definition at line 245 of file websocket_client.hpp.

◆ _mutex

template<typename ClientConfiguration>
std::shared_mutex foxglove::Client< ClientConfiguration >::_mutex
protected

Definition at line 248 of file websocket_client.hpp.

◆ _textMessageHandler

template<typename ClientConfiguration>
TextMessageHandler foxglove::Client< ClientConfiguration >::_textMessageHandler
protected

Definition at line 249 of file websocket_client.hpp.

◆ _thread

template<typename ClientConfiguration>
websocketpp::lib::shared_ptr<websocketpp::lib::thread> foxglove::Client< ClientConfiguration >::_thread
protected

Definition at line 246 of file websocket_client.hpp.


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


foxglove_bridge
Author(s): Foxglove
autogenerated on Mon Jul 3 2023 02:12:22