Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::SubscriptionContextInterface Class Referenceabstract

An interface to provide connection functionality for subscriptions. More...

#include <SubscriptionContextInterface.hpp>

Inheritance diagram for web::SubscriptionContextInterface:
Collaboration diagram for web::SubscriptionContextInterface:

Public Types

using OnDisconnectSlot = std::function<void(SubscriptionContextInterface*)>
 Alias for on disconnect slot.
 

Public Member Functions

virtual void send (std::shared_ptr< std::string > message)=0
 Send message to the client.
 
virtual void onDisconnect (OnDisconnectSlot const &slot)=0
 Connect a slot to onDisconnect connection signal.
 
virtual void setApiSubversion (uint32_t value)=0
 Set the API subversion.
 
virtual uint32_t apiSubversion () const =0
 Get the API subversion.
 
- Public Member Functions inherited from util::Taggable
 Taggable (Taggable &&)=default
 
Taggableoperator= (Taggable &&)=default
 
BaseTagDecorator const & tag () const
 Getter for tag decorator.
 

Additional Inherited Members

- Protected Member Functions inherited from util::Taggable
 Taggable (util::TagDecoratorFactory const &tagFactory)
 New Taggable from a specified factory.
 

Detailed Description

An interface to provide connection functionality for subscriptions.

Note
Since subscription is only allowed for websocket connection, this interface is used only for websocket connections.

Member Function Documentation

◆ apiSubversion()

virtual uint32_t web::SubscriptionContextInterface::apiSubversion ( ) const
pure virtual

Get the API subversion.

Returns
The API subversion.

Implemented in web::ng::SubscriptionContext, and web::SubscriptionContext.

◆ onDisconnect()

virtual void web::SubscriptionContextInterface::onDisconnect ( OnDisconnectSlot const & slot)
pure virtual

Connect a slot to onDisconnect connection signal.

Parameters
slotThe slot to connect.

Implemented in web::ng::SubscriptionContext, and web::SubscriptionContext.

◆ send()

virtual void web::SubscriptionContextInterface::send ( std::shared_ptr< std::string > message)
pure virtual

Send message to the client.

Parameters
messageThe message to send.

Implemented in web::ng::SubscriptionContext, and web::SubscriptionContext.

◆ setApiSubversion()

virtual void web::SubscriptionContextInterface::setApiSubversion ( uint32_t value)
pure virtual

Set the API subversion.

Parameters
valueThe value to set.

Implemented in web::ng::SubscriptionContext, and web::SubscriptionContext.


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