|
xrpld
|
Manages a client's subscription to data feeds. More...
#include <InfoSub.h>


Classes | |
| class | Source |
| Abstracts the source of subscription data. More... | |
Public Types | |
| using | pointer = std::shared_ptr<InfoSub> |
| using | wptr = std::weak_ptr<InfoSub> |
| using | ref = std::shared_ptr<InfoSub> const& |
| using | Consumer = Resource::Consumer |
Public Member Functions | |
| InfoSub (Source &source) | |
| InfoSub (Source &source, Consumer consumer) | |
| virtual | ~InfoSub () |
| Consumer & | getConsumer () |
| virtual void | send (json::Value const &jvObj, bool broadcast)=0 |
| std::uint64_t | getSeq () const |
| void | onSendEmpty () |
| void | insertSubAccountInfo (AccountID const &account, bool rt) |
| void | deleteSubAccountInfo (AccountID const &account, bool rt) |
| void | insertBookSubscription (Book const &book) |
Record that this subscriber is following book. | |
| void | deleteBookSubscription (Book const &book) |
Stop tracking book for this subscriber. | |
| bool | insertSubAccountHistory (AccountID const &account) |
| void | deleteSubAccountHistory (AccountID const &account) |
| void | clearRequest () |
| void | setRequest (std::shared_ptr< InfoSubRequest > const &req) |
| std::shared_ptr< InfoSubRequest > const & | getRequest () |
| void | setApiVersion (unsigned int apiVersion) |
| unsigned int | getApiVersion () const noexcept |
Public Attributes | |
| friend | Object |
Protected Attributes | |
| std::mutex | lock_ |
Static Private Member Functions | |
| static int | assignId () |
| static auto & | getCounter () noexcept |
Private Attributes | |
| Consumer | consumer_ |
| Source & | source_ |
| hash_set< AccountID > | realTimeSubscriptions_ |
| hash_set< AccountID > | normalSubscriptions_ |
| std::shared_ptr< InfoSubRequest > | request_ |
| std::uint64_t | seq_ |
| hash_set< AccountID > | accountHistorySubscriptions_ |
| hash_set< Book > | bookSubscriptions_ |
| unsigned int | apiVersion_ = 0 |
Manages a client's subscription to data feeds.
An InfoSub holds a non-owning reference to its Source (typically the process-wide NetworkOPsImp). The destructor reaches back into the Source to remove this subscriber from every server-side subscription map.
| using xrpl::InfoSub::pointer = std::shared_ptr<InfoSub> |
| using xrpl::InfoSub::wptr = std::weak_ptr<InfoSub> |
| using xrpl::InfoSub::ref = std::shared_ptr<InfoSub> const& |
| xrpl::InfoSub::InfoSub | ( | Source & | source | ) |
Definition at line 56 of file InfoSub.cpp.
Definition at line 60 of file InfoSub.cpp.
|
virtual |
Definition at line 65 of file InfoSub.cpp.
| Resource::Consumer & xrpl::InfoSub::getConsumer | ( | ) |
Definition at line 108 of file InfoSub.cpp.
|
pure virtual |
Implemented in xrpl::RPCSubImp, and xrpl::WSInfoSub.
|
nodiscard |
Definition at line 114 of file InfoSub.cpp.
| void xrpl::InfoSub::onSendEmpty | ( | ) |
Definition at line 120 of file InfoSub.cpp.
| void xrpl::InfoSub::insertSubAccountInfo | ( | AccountID const & | account, |
| bool | rt ) |
Definition at line 125 of file InfoSub.cpp.
| void xrpl::InfoSub::deleteSubAccountInfo | ( | AccountID const & | account, |
| bool | rt ) |
Definition at line 140 of file InfoSub.cpp.
| void xrpl::InfoSub::insertBookSubscription | ( | Book const & | book | ) |
Record that this subscriber is following book.
Called by NetworkOPsImp::subBook so that ~InfoSub() can issue a matching unsubBook for every book this subscriber is tracking, keeping per-subscriber state symmetric with the server-side map.
| book | The order book this subscriber has just subscribed to. |
Definition at line 169 of file InfoSub.cpp.
| void xrpl::InfoSub::deleteBookSubscription | ( | Book const & | book | ) |
Stop tracking book for this subscriber.
Called by the unsubscribe RPC handler so that the book is not re-unsubscribed by ~InfoSub(). Pairs with insertBookSubscription.
| book | The order book to forget. |
book was not previously inserted. Definition at line 176 of file InfoSub.cpp.
| bool xrpl::InfoSub::insertSubAccountHistory | ( | AccountID const & | account | ) |
Definition at line 155 of file InfoSub.cpp.
| void xrpl::InfoSub::deleteSubAccountHistory | ( | AccountID const & | account | ) |
Definition at line 162 of file InfoSub.cpp.
| void xrpl::InfoSub::clearRequest | ( | ) |
Definition at line 183 of file InfoSub.cpp.
| void xrpl::InfoSub::setRequest | ( | std::shared_ptr< InfoSubRequest > const & | req | ) |
Definition at line 189 of file InfoSub.cpp.
| std::shared_ptr< InfoSubRequest > const & xrpl::InfoSub::getRequest | ( | ) |
Definition at line 195 of file InfoSub.cpp.
| void xrpl::InfoSub::setApiVersion | ( | unsigned int | apiVersion | ) |
Definition at line 201 of file InfoSub.cpp.
|
nodiscardnoexcept |
Definition at line 207 of file InfoSub.cpp.
|
staticprivatenoexceptinherited |
Definition at line 109 of file CountedObject.h.
|
protected |
|
private |
|
private |
|
inherited |
Definition at line 134 of file CountedObject.h.