Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::SubscriptionContext Class Reference

A context of a WsBase connection for subscriptions. More...

#include <SubscriptionContext.hpp>

Inheritance diagram for web::SubscriptionContext:
Collaboration diagram for web::SubscriptionContext:

Public Member Functions

 SubscriptionContext (util::TagDecoratorFactory const &factory, std::shared_ptr< ConnectionBase > connection)
 Construct a new Subscription Context object.
 
 ~SubscriptionContext () override
 Destroy the Subscription Context object.
 
void send (std::shared_ptr< std::string > message) override
 Send message to the client.
 
void onDisconnect (OnDisconnectSlot const &slot) override
 Connect a slot to onDisconnect connection signal.
 
void setApiSubversion (uint32_t value) override
 Set the API subversion.
 
uint32_t apiSubversion () const override
 Get the API subversion.
 
- Public Member Functions inherited from web::SubscriptionContextInterface
- Public Member Functions inherited from util::Taggable
 Taggable (Taggable &&)=default
 
Taggableoperator= (Taggable &&)=default
 
BaseTagDecorator const & tag () const
 Getter for tag decorator.
 

Additional Inherited Members

- Public Types inherited from web::SubscriptionContextInterface
using OnDisconnectSlot = std::function<void(SubscriptionContextInterface*)>
 Alias for on disconnect slot.
 
- Protected Member Functions inherited from util::Taggable
 Taggable (util::TagDecoratorFactory const &tagFactory)
 New Taggable from a specified factory.
 

Detailed Description

A context of a WsBase connection for subscriptions.

Constructor & Destructor Documentation

◆ SubscriptionContext()

web::SubscriptionContext::SubscriptionContext ( util::TagDecoratorFactory const & factory,
std::shared_ptr< ConnectionBase > connection )

Construct a new Subscription Context object.

Parameters
factoryThe tag decorator factory to use to init taggable.
connectionThe connection for which the context is created.

Member Function Documentation

◆ apiSubversion()

uint32_t web::SubscriptionContext::apiSubversion ( ) const
overridevirtual

Get the API subversion.

Returns
The API subversion.

Implements web::SubscriptionContextInterface.

◆ onDisconnect()

void web::SubscriptionContext::onDisconnect ( OnDisconnectSlot const & slot)
overridevirtual

Connect a slot to onDisconnect connection signal.

Parameters
slotThe slot to connect.

Implements web::SubscriptionContextInterface.

◆ send()

void web::SubscriptionContext::send ( std::shared_ptr< std::string > message)
overridevirtual

Send message to the client.

Note
This method will not do anything if the related connection got disconnected.
Parameters
messageThe message to send.

Implements web::SubscriptionContextInterface.

◆ setApiSubversion()

void web::SubscriptionContext::setApiSubversion ( uint32_t value)
overridevirtual

Set the API subversion.

Parameters
valueThe value to set.

Implements web::SubscriptionContextInterface.


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