OpenFin C++ Adapter 1.1.0

Loading...
Searching...
No Matches
OpenFinAdapterApi::ChannelClient Class Reference

Represents a Channel Client that can connect to a Channel Provider. More...

#include <OpenFinAdapter.h>

Inheritance diagram for OpenFinAdapterApi::ChannelClient:
OpenFinAdapterApi::MessageChannelClient

Public Member Functions

shared_future< void > connectAsync (bool wait=true)
 Connects the client to a channel.
 
shared_future< void > disconnectAsync () const
 Disconnects the client from the channel.
 
shared_future< shared_ptr< string > > dispatchAsync (const string &topic) const
 Dispatches a signal on a topic to a channel provider, with no payload.
 
shared_future< shared_ptr< string > > dispatchAsync (const string &topic, const string &payloadJson) const
 Dispatches a payload on a topic to the channel provider.
 
void subscribeDisconnected (const function< void()> &listener)
 Creates a subscription to the channel disconnected event.
 
void unsubscribeDisconnected (const function< void()> &listener)
 Un-registers a listener from the channel disconnected event.
 
- Public Member Functions inherited from OpenFinAdapterApi::MessageChannelClient
void registerTopic (const string &topic, const function< shared_ptr< string >(shared_ptr< string >, EndpointId)> &listener)
 Registers a listener of a topic.
 
void unregisterTopic (const string &topic)
 Unregisters a listener of a topic.
 

Detailed Description

Represents a Channel Client that can connect to a Channel Provider.

Member Function Documentation

◆ connectAsync()

shared_future< void > OpenFinAdapterApi::ChannelClient::connectAsync ( bool wait = true)

Connects the client to a channel.

Parameters
waitwhether to wait for the provider to open if not already open
Returns
A shared pointer to an async future which completes when the connection has been established

◆ disconnectAsync()

shared_future< void > OpenFinAdapterApi::ChannelClient::disconnectAsync ( ) const

Disconnects the client from the channel.

Returns
A shared pointer to an async future which completes when the channel has been disconnected

◆ dispatchAsync() [1/2]

shared_future< shared_ptr< string > > OpenFinAdapterApi::ChannelClient::dispatchAsync ( const string & topic) const

Dispatches a signal on a topic to a channel provider, with no payload.

Parameters
topicThe topic on which to dispatch the signal
Returns
The response from the provider

◆ dispatchAsync() [2/2]

shared_future< shared_ptr< string > > OpenFinAdapterApi::ChannelClient::dispatchAsync ( const string & topic,
const string & payloadJson ) const

Dispatches a payload on a topic to the channel provider.

Parameters
topicThe topic on which to dispatch the payload
payloadJsonThe payload of the message in JSON format
Returns
The response from the provider

◆ subscribeDisconnected()

void OpenFinAdapterApi::ChannelClient::subscribeDisconnected ( const function< void()> & listener)

Creates a subscription to the channel disconnected event.

Parameters
listenerThe listener function

◆ unsubscribeDisconnected()

void OpenFinAdapterApi::ChannelClient::unsubscribeDisconnected ( const function< void()> & listener)

Un-registers a listener from the channel disconnected event.

Parameters
listenerThe registered listener function

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