rippled
Classes | Public Types | Public Member Functions | Protected Attributes | Static Private Member Functions | Private Attributes | List of all members
ripple::InfoSub Class Referenceabstract

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

Inheritance diagram for ripple::InfoSub:
Inheritance graph
[legend]
Collaboration diagram for ripple::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 = const std::shared_ptr< InfoSub > &
 
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 (const std::shared_ptr< InfoSubRequest > &req)
 
std::shared_ptr< InfoSubRequest > const & getRequest ()
 

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_
 

Detailed Description

Manages a client's subscription to data feeds.

Definition at line 51 of file InfoSub.h.

Member Typedef Documentation

◆ pointer

Definition at line 54 of file InfoSub.h.

◆ wptr

Definition at line 58 of file InfoSub.h.

◆ ref

Definition at line 60 of file InfoSub.h.

◆ Consumer

Definition at line 62 of file InfoSub.h.

Constructor & Destructor Documentation

◆ InfoSub() [1/2]

ripple::InfoSub::InfoSub ( Source source)

Definition at line 36 of file InfoSub.cpp.

◆ InfoSub() [2/2]

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

Definition at line 40 of file InfoSub.cpp.

◆ ~InfoSub()

ripple::InfoSub::~InfoSub ( )
virtual

Definition at line 45 of file InfoSub.cpp.

Member Function Documentation

◆ getConsumer()

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

Definition at line 69 of file InfoSub.cpp.

◆ send()

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

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

◆ getSeq()

std::uint64_t ripple::InfoSub::getSeq ( )

Definition at line 75 of file InfoSub.cpp.

◆ onSendEmpty()

void ripple::InfoSub::onSendEmpty ( )

Definition at line 81 of file InfoSub.cpp.

◆ insertSubAccountInfo()

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

Definition at line 86 of file InfoSub.cpp.

◆ deleteSubAccountInfo()

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

Definition at line 97 of file InfoSub.cpp.

◆ insertSubAccountHistory()

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

Definition at line 108 of file InfoSub.cpp.

◆ deleteSubAccountHistory()

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

Definition at line 115 of file InfoSub.cpp.

◆ clearRequest()

void ripple::InfoSub::clearRequest ( )

Definition at line 122 of file InfoSub.cpp.

◆ setRequest()

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

Definition at line 128 of file InfoSub.cpp.

◆ getRequest()

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

Definition at line 134 of file InfoSub.cpp.

◆ assign_id()

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

Definition at line 245 of file InfoSub.h.

◆ getCounter()

static auto& ripple::CountedObject< InfoSub >::getCounter
staticprivatenoexceptinherited

Definition at line 128 of file CountedObject.h.

Member Data Documentation

◆ mLock

std::mutex ripple::InfoSub::mLock
protected

Definition at line 233 of file InfoSub.h.

◆ m_consumer

Consumer ripple::InfoSub::m_consumer
private

Definition at line 236 of file InfoSub.h.

◆ m_source

Source& ripple::InfoSub::m_source
private

Definition at line 237 of file InfoSub.h.

◆ realTimeSubscriptions_

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

Definition at line 238 of file InfoSub.h.

◆ normalSubscriptions_

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

Definition at line 239 of file InfoSub.h.

◆ request_

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

Definition at line 240 of file InfoSub.h.

◆ mSeq

std::uint64_t ripple::InfoSub::mSeq
private

Definition at line 241 of file InfoSub.h.

◆ accountHistorySubscriptions_

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

Definition at line 242 of file InfoSub.h.