xrpld
Loading...
Searching...
No Matches
xrpl::HashRouter::Entry Class Reference

An entry in the routing table. More...

Inheritance diagram for xrpl::HashRouter::Entry:
Collaboration diagram for xrpl::HashRouter::Entry:

Public Member Functions

 Entry ()=default
void addPeer (PeerShortID peer)
HashRouterFlags getFlags (void) const
void setFlags (HashRouterFlags flagsToSet)
std::set< PeerShortIDreleasePeerSet ()
 Return set of peers we've relayed to and reset tracking.
std::optional< Stopwatch::time_pointrelayed () const
 Return seated relay time point if the message has been relayed.
bool shouldRelay (Stopwatch::time_point const &now, std::chrono::seconds relayTime)
 Determines if this item should be relayed.
bool shouldProcess (Stopwatch::time_point now, std::chrono::seconds interval)

Public Attributes

friend Object

Static Private Member Functions

static auto & getCounter () noexcept

Private Attributes

HashRouterFlags flags_ = HashRouterFlags::UNDEFINED
std::set< PeerShortIDpeers_
std::optional< Stopwatch::time_pointrelayed_
std::optional< Stopwatch::time_pointprocessed_

Detailed Description

An entry in the routing table.

Definition at line 109 of file HashRouter.h.

Constructor & Destructor Documentation

◆ Entry()

xrpl::HashRouter::Entry::Entry ( )
default

Member Function Documentation

◆ addPeer()

void xrpl::HashRouter::Entry::addPeer ( PeerShortID peer)

Definition at line 115 of file HashRouter.h.

◆ getFlags()

HashRouterFlags xrpl::HashRouter::Entry::getFlags ( void ) const
nodiscard

Definition at line 122 of file HashRouter.h.

◆ setFlags()

void xrpl::HashRouter::Entry::setFlags ( HashRouterFlags flagsToSet)

Definition at line 128 of file HashRouter.h.

◆ releasePeerSet()

std::set< PeerShortID > xrpl::HashRouter::Entry::releasePeerSet ( )

Return set of peers we've relayed to and reset tracking.

Definition at line 135 of file HashRouter.h.

◆ relayed()

std::optional< Stopwatch::time_point > xrpl::HashRouter::Entry::relayed ( ) const
nodiscard

Return seated relay time point if the message has been relayed.

Definition at line 142 of file HashRouter.h.

◆ shouldRelay()

bool xrpl::HashRouter::Entry::shouldRelay ( Stopwatch::time_point const & now,
std::chrono::seconds relayTime )

Determines if this item should be relayed.

Checks whether the item has been recently relayed. If it has, return false. If it has not, update the last relay timestamp and return true.

Definition at line 154 of file HashRouter.h.

◆ shouldProcess()

bool xrpl::HashRouter::Entry::shouldProcess ( Stopwatch::time_point now,
std::chrono::seconds interval )

Definition at line 163 of file HashRouter.h.

◆ getCounter()

auto & xrpl::CountedObject< Entry >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 109 of file CountedObject.h.

Member Data Documentation

◆ flags_

HashRouterFlags xrpl::HashRouter::Entry::flags_ = HashRouterFlags::UNDEFINED
private

Definition at line 172 of file HashRouter.h.

◆ peers_

std::set<PeerShortID> xrpl::HashRouter::Entry::peers_
private

Definition at line 173 of file HashRouter.h.

◆ relayed_

std::optional<Stopwatch::time_point> xrpl::HashRouter::Entry::relayed_
private

Definition at line 176 of file HashRouter.h.

◆ processed_

std::optional<Stopwatch::time_point> xrpl::HashRouter::Entry::processed_
private

Definition at line 177 of file HashRouter.h.

◆ Object

friend xrpl::CountedObject< Entry >::Entry
inherited

Definition at line 134 of file CountedObject.h.