xrpld
Loading...
Searching...
No Matches
xrpl::test::PeerSim Class Reference
Inheritance diagram for xrpl::test::PeerSim:
Collaboration diagram for xrpl::test::PeerSim:

Public Types

using ID = Peer::ID

Public Member Functions

 PeerSim (Overlay &overlay, beast::Journal journal)
 ~PeerSim () override=default
void onMessage (MessageSPtr const &m, SquelchCB f) override
 Local Peer (PeerImp).
void onMessage (protocol::TMSquelch const &squelch) override
 Remote Peer (Directly connected Peer).
void send (protocol::TMSquelch const &squelch)
void send (std::shared_ptr< Message > const &) override
 PeerStub (ID id=0)
beast::ip::Endpoint getRemoteAddress () const override
void sendTxQueue () override
void addTxQueue (UInt256 const &) override
void removeTxQueue (UInt256 const &) override
void charge (resource::Charge const &, std::string const &) override
ID id () const override
bool cluster () const override
bool isHighLatency () const override
int getScore (bool) const override
PublicKey const & getNodePublic () const override
json::Value json () override
bool supportsFeature (ProtocolFeature) const override
std::optional< std::size_t > publisherListSequence (PublicKey const &) const override
void setPublisherListSequence (PublicKey const &, std::size_t const) override
std::string const & fingerprint () const override
UInt256 getClosedLedgerHash () const override
bool hasLedger (UInt256 const &, std::uint32_t) const override
void ledgerRange (std::uint32_t &, std::uint32_t &) const override
bool hasTxSet (UInt256 const &) const override
void cycleStatus () override
bool hasRange (std::uint32_t, std::uint32_t) override
bool compressionEnabled () const override
bool txReduceRelayEnabled () const override
T shared_from_this (T... args)
T weak_from_this (T... args)

Static Public Member Functions

static void resetId ()

Public Attributes

int id
std::set< int > set

Private Attributes

Overlay & overlay_
reduce_relay::Squelch< ManualClock > squelch_
ID const id_
PublicKey const nodePublicKey_
std::string const fingerprint_

Static Private Attributes

static ID sid = 0

Detailed Description

Definition at line 358 of file reduce_relay_test.cpp.

Member Typedef Documentation

◆ ID

Definition at line 361 of file reduce_relay_test.cpp.

Constructor & Destructor Documentation

◆ PeerSim()

xrpl::test::PeerSim::PeerSim ( Overlay & overlay,
beast::Journal journal )

Definition at line 362 of file reduce_relay_test.cpp.

◆ ~PeerSim()

xrpl::test::PeerSim::~PeerSim ( )
overridedefault

Member Function Documentation

◆ resetId()

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

Definition at line 370 of file reduce_relay_test.cpp.

◆ onMessage() [1/2]

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

Local Peer (PeerImp).

Implements xrpl::test::PeerPartial.

Definition at line 379 of file reduce_relay_test.cpp.

◆ onMessage() [2/2]

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

Remote Peer (Directly connected Peer).

Implements xrpl::test::PeerPartial.

Definition at line 394 of file reduce_relay_test.cpp.

◆ send() [1/2]

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

Definition at line 83 of file reduce_relay_test.cpp.

◆ send() [2/2]

void xrpl::test::PeerStub::send ( std::shared_ptr< Message > const & )
overrideinherited

Definition at line 44 of file PeerStub.h.

◆ PeerStub()

xrpl::test::PeerStub::PeerStub ( ID id = 0)
explicitinherited
Parameters
idThe connection id reported by id().

Definition at line 36 of file PeerStub.h.

◆ getRemoteAddress()

beast::ip::Endpoint xrpl::test::PeerStub::getRemoteAddress ( ) const
nodiscardoverrideinherited

Definition at line 49 of file PeerStub.h.

◆ sendTxQueue()

void xrpl::test::PeerStub::sendTxQueue ( )
overrideinherited

Definition at line 55 of file PeerStub.h.

◆ addTxQueue()

void xrpl::test::PeerStub::addTxQueue ( UInt256 const & )
overrideinherited

Definition at line 60 of file PeerStub.h.

◆ removeTxQueue()

void xrpl::test::PeerStub::removeTxQueue ( UInt256 const & )
overrideinherited

Definition at line 65 of file PeerStub.h.

◆ charge()

void xrpl::test::PeerStub::charge ( resource::Charge const & ,
std::string const &  )
overrideinherited

Definition at line 70 of file PeerStub.h.

◆ id()

ID xrpl::test::PeerStub::id ( ) const
nodiscardoverrideinherited

Definition at line 75 of file PeerStub.h.

◆ cluster()

bool xrpl::test::PeerStub::cluster ( ) const
nodiscardoverrideinherited

Definition at line 81 of file PeerStub.h.

◆ isHighLatency()

bool xrpl::test::PeerStub::isHighLatency ( ) const
nodiscardoverrideinherited

Definition at line 87 of file PeerStub.h.

◆ getScore()

int xrpl::test::PeerStub::getScore ( bool ) const
nodiscardoverrideinherited

Definition at line 93 of file PeerStub.h.

◆ getNodePublic()

PublicKey const & xrpl::test::PeerStub::getNodePublic ( ) const
nodiscardoverrideinherited

Definition at line 99 of file PeerStub.h.

◆ json()

json::Value xrpl::test::PeerStub::json ( )
overrideinherited

Definition at line 105 of file PeerStub.h.

◆ supportsFeature()

bool xrpl::test::PeerStub::supportsFeature ( ProtocolFeature ) const
nodiscardoverrideinherited

Definition at line 111 of file PeerStub.h.

◆ publisherListSequence()

std::optional< std::size_t > xrpl::test::PeerStub::publisherListSequence ( PublicKey const & ) const
nodiscardoverrideinherited

Definition at line 117 of file PeerStub.h.

◆ setPublisherListSequence()

void xrpl::test::PeerStub::setPublisherListSequence ( PublicKey const & ,
std::size_t const  )
overrideinherited

Definition at line 123 of file PeerStub.h.

◆ fingerprint()

std::string const & xrpl::test::PeerStub::fingerprint ( ) const
nodiscardoverrideinherited

Definition at line 128 of file PeerStub.h.

◆ getClosedLedgerHash()

UInt256 xrpl::test::PeerStub::getClosedLedgerHash ( ) const
nodiscardoverrideinherited

Definition at line 134 of file PeerStub.h.

◆ hasLedger()

bool xrpl::test::PeerStub::hasLedger ( UInt256 const & ,
std::uint32_t  ) const
nodiscardoverrideinherited

Definition at line 140 of file PeerStub.h.

◆ ledgerRange()

void xrpl::test::PeerStub::ledgerRange ( std::uint32_t & ,
std::uint32_t &  ) const
overrideinherited

Definition at line 146 of file PeerStub.h.

◆ hasTxSet()

bool xrpl::test::PeerStub::hasTxSet ( UInt256 const & ) const
nodiscardoverrideinherited

Definition at line 151 of file PeerStub.h.

◆ cycleStatus()

void xrpl::test::PeerStub::cycleStatus ( )
overrideinherited

Definition at line 157 of file PeerStub.h.

◆ hasRange()

bool xrpl::test::PeerStub::hasRange ( std::uint32_t ,
std::uint32_t  )
overrideinherited

Definition at line 162 of file PeerStub.h.

◆ compressionEnabled()

bool xrpl::test::PeerStub::compressionEnabled ( ) const
nodiscardoverrideinherited

Definition at line 168 of file PeerStub.h.

◆ txReduceRelayEnabled()

bool xrpl::test::PeerStub::txReduceRelayEnabled ( ) const
nodiscardoverrideinherited

Definition at line 174 of file PeerStub.h.

Member Data Documentation

◆ sid

ID xrpl::test::PeerSim::sid = 0
staticprivate

Definition at line 409 of file reduce_relay_test.cpp.

◆ overlay_

Overlay& xrpl::test::PeerSim::overlay_
private

Definition at line 410 of file reduce_relay_test.cpp.

◆ squelch_

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

Definition at line 411 of file reduce_relay_test.cpp.

◆ id_

ID const xrpl::test::PeerStub::id_
privateinherited

Definition at line 180 of file PeerStub.h.

◆ nodePublicKey_

PublicKey const xrpl::test::PeerStub::nodePublicKey_
privateinherited

Definition at line 181 of file PeerStub.h.

◆ fingerprint_

std::string const xrpl::test::PeerStub::fingerprint_
privateinherited

Definition at line 182 of file PeerStub.h.

◆ id

int xrpl::test::Peer::id
inherited

Definition at line 15 of file BasicNetwork.cpp.

◆ set

std::set<int> xrpl::test::Peer::set
inherited

Definition at line 16 of file BasicNetwork.cpp.