rippled
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | Static Private Member Functions | Private Attributes | List of all members
xrpl::InfoSub Class Referenceabstract

Manages a client's subscription to data feeds. More...

#include <InfoSub.h>

Inheritance diagram for xrpl::InfoSub:
Inheritance graph
[legend]
Collaboration diagram for xrpl::InfoSub:
Collaboration graph
[legend]

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 ()
 
ConsumergetConsumer ()
 
virtual void send (Json::Value const &jvObj, bool broadcast)=0
 
std::uint64_t getSeq ()
 
void onSendEmpty ()
 
void insertSubAccountInfo (AccountID const &account, bool rt)
 
void deleteSubAccountInfo (AccountID const &account, bool rt)
 
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
 

Protected Attributes

std::mutex mLock
 

Static Private Member Functions

static int assign_id ()
 
static auto & getCounter () noexcept
 

Private Attributes

Consumer m_consumer
 
Sourcem_source
 
hash_set< AccountIDrealTimeSubscriptions_
 
hash_set< AccountIDnormalSubscriptions_
 
std::shared_ptr< InfoSubRequestrequest_
 
std::uint64_t mSeq
 
hash_set< AccountIDaccountHistorySubscriptions_
 
unsigned int apiVersion_ = 0
 

Detailed Description

Manages a client's subscription to data feeds.

Definition at line 30 of file InfoSub.h.

Member Typedef Documentation

◆ pointer

Definition at line 33 of file InfoSub.h.

◆ wptr

Definition at line 37 of file InfoSub.h.

◆ ref

Definition at line 39 of file InfoSub.h.

◆ Consumer

Definition at line 41 of file InfoSub.h.

Constructor & Destructor Documentation

◆ InfoSub() [1/2]

xrpl::InfoSub::InfoSub ( Source source)

Definition at line 16 of file InfoSub.cpp.

◆ InfoSub() [2/2]

xrpl::InfoSub::InfoSub ( Source source,
Consumer  consumer 
)

Definition at line 20 of file InfoSub.cpp.

◆ ~InfoSub()

xrpl::InfoSub::~InfoSub ( )
virtual

Definition at line 24 of file InfoSub.cpp.

Member Function Documentation

◆ getConsumer()

Resource::Consumer & xrpl::InfoSub::getConsumer ( )

Definition at line 48 of file InfoSub.cpp.

◆ send()

virtual void xrpl::InfoSub::send ( Json::Value const &  jvObj,
bool  broadcast 
)
pure virtual

Implemented in xrpl::WSInfoSub, and xrpl::RPCSubImp.

◆ getSeq()

std::uint64_t xrpl::InfoSub::getSeq ( )

Definition at line 54 of file InfoSub.cpp.

◆ onSendEmpty()

void xrpl::InfoSub::onSendEmpty ( )

Definition at line 60 of file InfoSub.cpp.

◆ insertSubAccountInfo()

void xrpl::InfoSub::insertSubAccountInfo ( AccountID const &  account,
bool  rt 
)

Definition at line 65 of file InfoSub.cpp.

◆ deleteSubAccountInfo()

void xrpl::InfoSub::deleteSubAccountInfo ( AccountID const &  account,
bool  rt 
)

Definition at line 76 of file InfoSub.cpp.

◆ insertSubAccountHistory()

bool xrpl::InfoSub::insertSubAccountHistory ( AccountID const &  account)

Definition at line 87 of file InfoSub.cpp.

◆ deleteSubAccountHistory()

void xrpl::InfoSub::deleteSubAccountHistory ( AccountID const &  account)

Definition at line 94 of file InfoSub.cpp.

◆ clearRequest()

void xrpl::InfoSub::clearRequest ( )

Definition at line 101 of file InfoSub.cpp.

◆ setRequest()

void xrpl::InfoSub::setRequest ( std::shared_ptr< InfoSubRequest > const &  req)

Definition at line 107 of file InfoSub.cpp.

◆ getRequest()

std::shared_ptr< InfoSubRequest > const & xrpl::InfoSub::getRequest ( )

Definition at line 113 of file InfoSub.cpp.

◆ setApiVersion()

void xrpl::InfoSub::setApiVersion ( unsigned int  apiVersion)

Definition at line 119 of file InfoSub.cpp.

◆ getApiVersion()

unsigned int xrpl::InfoSub::getApiVersion ( ) const
noexcept

Definition at line 125 of file InfoSub.cpp.

◆ assign_id()

static int xrpl::InfoSub::assign_id ( )
staticprivate

Definition at line 217 of file InfoSub.h.

◆ getCounter()

static auto & xrpl::CountedObject< InfoSub >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 109 of file CountedObject.h.

Member Data Documentation

◆ mLock

std::mutex xrpl::InfoSub::mLock
protected

Definition at line 204 of file InfoSub.h.

◆ m_consumer

Consumer xrpl::InfoSub::m_consumer
private

Definition at line 207 of file InfoSub.h.

◆ m_source

Source& xrpl::InfoSub::m_source
private

Definition at line 208 of file InfoSub.h.

◆ realTimeSubscriptions_

hash_set<AccountID> xrpl::InfoSub::realTimeSubscriptions_
private

Definition at line 209 of file InfoSub.h.

◆ normalSubscriptions_

hash_set<AccountID> xrpl::InfoSub::normalSubscriptions_
private

Definition at line 210 of file InfoSub.h.

◆ request_

std::shared_ptr<InfoSubRequest> xrpl::InfoSub::request_
private

Definition at line 211 of file InfoSub.h.

◆ mSeq

std::uint64_t xrpl::InfoSub::mSeq
private

Definition at line 212 of file InfoSub.h.

◆ accountHistorySubscriptions_

hash_set<AccountID> xrpl::InfoSub::accountHistorySubscriptions_
private

Definition at line 213 of file InfoSub.h.

◆ apiVersion_

unsigned int xrpl::InfoSub::apiVersion_ = 0
private

Definition at line 214 of file InfoSub.h.