rippled
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
ripple::test::PeerSim Class Reference
Inheritance diagram for ripple::test::PeerSim:
Inheritance graph
[legend]
Collaboration diagram for ripple::test::PeerSim:
Collaboration graph
[legend]

Public Types

using id_t = Peer::id_t
 
using ptr = std::shared_ptr< Peer >
 

Public Member Functions

 PeerSim (Overlay &overlay, beast::Journal journal)
 
 ~PeerSim ()=default
 
id_t id () const override
 
void onMessage (MessageSPtr const &m, SquelchCB f) override
 Local Peer (PeerImp) More...
 
virtual void onMessage (protocol::TMSquelch const &squelch) override
 Remote Peer (Directly connected Peer) More...
 
void send (protocol::TMSquelch const &squelch)
 
void send (std::shared_ptr< Message > const &m) override
 
beast::IP::Endpoint getRemoteAddress () const override
 
void charge (Resource::Charge const &fee) override
 Adjust this peer's load balance based on the type of load imposed. More...
 
bool cluster () const override
 Returns true if this connection is a member of the cluster. More...
 
bool isHighLatency () const override
 
int getScore (bool) const override
 
PublicKey const & getNodePublic () const override
 
Json::Value json () override
 
bool supportsFeature (ProtocolFeature f) const override
 
std::optional< std::size_tpublisherListSequence (PublicKey const &) const override
 
void setPublisherListSequence (PublicKey const &, std::size_t const) override
 
uint256 const & getClosedLedgerHash () const override
 
bool hasLedger (uint256 const &hash, std::uint32_t seq) const override
 
void ledgerRange (std::uint32_t &minSeq, std::uint32_t &maxSeq) const override
 
bool hasTxSet (uint256 const &hash) const override
 
void cycleStatus () override
 
bool hasRange (std::uint32_t uMin, std::uint32_t uMax) override
 
bool compressionEnabled () const override
 
bool txReduceRelayEnabled () const override
 
void sendTxQueue () override
 Send aggregated transactions' hashes. More...
 
void addTxQueue (const uint256 &) override
 Aggregate transaction's hash. More...
 
void removeTxQueue (const uint256 &) override
 Remove hash from the transactions' hashes queue. More...
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 

Static Public Member Functions

static void resetId ()
 

Private Attributes

id_t id_
 
Overlayoverlay_
 
reduce_relay::Squelch< ManualClocksquelch_
 

Static Private Attributes

static id_t sid_ = 0
 

Detailed Description

Definition at line 448 of file reduce_relay_test.cpp.

Member Typedef Documentation

◆ id_t

Definition at line 451 of file reduce_relay_test.cpp.

◆ ptr

Definition at line 48 of file ripple/overlay/Peer.h.

Constructor & Destructor Documentation

◆ PeerSim()

ripple::test::PeerSim::PeerSim ( Overlay overlay,
beast::Journal  journal 
)

Definition at line 452 of file reduce_relay_test.cpp.

◆ ~PeerSim()

ripple::test::PeerSim::~PeerSim ( )
default

Member Function Documentation

◆ id()

id_t ripple::test::PeerSim::id ( ) const
overridevirtual

Implements ripple::Peer.

Definition at line 461 of file reduce_relay_test.cpp.

◆ resetId()

static void ripple::test::PeerSim::resetId ( )
static

Definition at line 467 of file reduce_relay_test.cpp.

◆ onMessage() [1/2]

void ripple::test::PeerSim::onMessage ( MessageSPtr const &  m,
SquelchCB  f 
)
overridevirtual

Local Peer (PeerImp)

Implements ripple::test::PeerPartial.

Definition at line 474 of file reduce_relay_test.cpp.

◆ onMessage() [2/2]

virtual void ripple::test::PeerSim::onMessage ( protocol::TMSquelch const &  squelch)
overridevirtual

Remote Peer (Directly connected Peer)

Implements ripple::test::PeerPartial.

Definition at line 486 of file reduce_relay_test.cpp.

◆ send() [1/2]

void ripple::test::PeerPartial::send ( protocol::TMSquelch const &  squelch)
inherited

Definition at line 69 of file reduce_relay_test.cpp.

◆ send() [2/2]

void ripple::test::PeerPartial::send ( std::shared_ptr< Message > const &  m)
overridevirtualinherited

Implements ripple::Peer.

Definition at line 76 of file reduce_relay_test.cpp.

◆ getRemoteAddress()

beast::IP::Endpoint ripple::test::PeerPartial::getRemoteAddress ( ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 80 of file reduce_relay_test.cpp.

◆ charge()

void ripple::test::PeerPartial::charge ( Resource::Charge const &  fee)
overridevirtualinherited

Adjust this peer's load balance based on the type of load imposed.

Implements ripple::Peer.

Definition at line 85 of file reduce_relay_test.cpp.

◆ cluster()

bool ripple::test::PeerPartial::cluster ( ) const
overridevirtualinherited

Returns true if this connection is a member of the cluster.

Implements ripple::Peer.

Definition at line 89 of file reduce_relay_test.cpp.

◆ isHighLatency()

bool ripple::test::PeerPartial::isHighLatency ( ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 94 of file reduce_relay_test.cpp.

◆ getScore()

int ripple::test::PeerPartial::getScore ( bool  ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 99 of file reduce_relay_test.cpp.

◆ getNodePublic()

PublicKey const& ripple::test::PeerPartial::getNodePublic ( ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 104 of file reduce_relay_test.cpp.

◆ json()

Json::Value ripple::test::PeerPartial::json ( )
overridevirtualinherited

Implements ripple::Peer.

Definition at line 110 of file reduce_relay_test.cpp.

◆ supportsFeature()

bool ripple::test::PeerPartial::supportsFeature ( ProtocolFeature  f) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 115 of file reduce_relay_test.cpp.

◆ publisherListSequence()

std::optional<std::size_t> ripple::test::PeerPartial::publisherListSequence ( PublicKey const &  ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 120 of file reduce_relay_test.cpp.

◆ setPublisherListSequence()

void ripple::test::PeerPartial::setPublisherListSequence ( PublicKey const &  ,
std::size_t const   
)
overridevirtualinherited

Implements ripple::Peer.

Definition at line 125 of file reduce_relay_test.cpp.

◆ getClosedLedgerHash()

uint256 const& ripple::test::PeerPartial::getClosedLedgerHash ( ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 129 of file reduce_relay_test.cpp.

◆ hasLedger()

bool ripple::test::PeerPartial::hasLedger ( uint256 const &  hash,
std::uint32_t  seq 
) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 135 of file reduce_relay_test.cpp.

◆ ledgerRange()

void ripple::test::PeerPartial::ledgerRange ( std::uint32_t minSeq,
std::uint32_t maxSeq 
) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 140 of file reduce_relay_test.cpp.

◆ hasTxSet()

bool ripple::test::PeerPartial::hasTxSet ( uint256 const &  hash) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 144 of file reduce_relay_test.cpp.

◆ cycleStatus()

void ripple::test::PeerPartial::cycleStatus ( )
overridevirtualinherited

Implements ripple::Peer.

Definition at line 149 of file reduce_relay_test.cpp.

◆ hasRange()

bool ripple::test::PeerPartial::hasRange ( std::uint32_t  uMin,
std::uint32_t  uMax 
)
overridevirtualinherited

Implements ripple::Peer.

Definition at line 153 of file reduce_relay_test.cpp.

◆ compressionEnabled()

bool ripple::test::PeerPartial::compressionEnabled ( ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 158 of file reduce_relay_test.cpp.

◆ txReduceRelayEnabled()

bool ripple::test::PeerPartial::txReduceRelayEnabled ( ) const
overridevirtualinherited

Implements ripple::Peer.

Definition at line 163 of file reduce_relay_test.cpp.

◆ sendTxQueue()

void ripple::test::PeerPartial::sendTxQueue ( )
overridevirtualinherited

Send aggregated transactions' hashes.

Implements ripple::Peer.

Definition at line 168 of file reduce_relay_test.cpp.

◆ addTxQueue()

void ripple::test::PeerPartial::addTxQueue ( const uint256 )
overridevirtualinherited

Aggregate transaction's hash.

Implements ripple::Peer.

Definition at line 172 of file reduce_relay_test.cpp.

◆ removeTxQueue()

void ripple::test::PeerPartial::removeTxQueue ( const uint256 )
overridevirtualinherited

Remove hash from the transactions' hashes queue.

Implements ripple::Peer.

Definition at line 176 of file reduce_relay_test.cpp.

Member Data Documentation

◆ sid_

id_t ripple::test::PeerSim::sid_ = 0
staticprivate

Definition at line 498 of file reduce_relay_test.cpp.

◆ id_

id_t ripple::test::PeerSim::id_
private

Definition at line 499 of file reduce_relay_test.cpp.

◆ overlay_

Overlay& ripple::test::PeerSim::overlay_
private

Definition at line 500 of file reduce_relay_test.cpp.

◆ squelch_

reduce_relay::Squelch<ManualClock> ripple::test::PeerSim::squelch_
private

Definition at line 501 of file reduce_relay_test.cpp.