rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::HashRouter::Entry Class Reference

An entry in the routing table. More...

Inheritance diagram for ripple::HashRouter::Entry:
Inheritance graph
[legend]
Collaboration diagram for ripple::HashRouter::Entry:
Collaboration graph
[legend]

Public Member Functions

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

Static Private Member Functions

static auto & getCounter () noexcept
 

Private Attributes

int flags_ = 0
 
std::set< PeerShortIDpeers_
 
std::optional< Stopwatch::time_pointrelayed_
 
std::optional< Stopwatch::time_pointprocessed_
 

Detailed Description

An entry in the routing table.

Definition at line 89 of file HashRouter.h.

Constructor & Destructor Documentation

◆ Entry()

ripple::HashRouter::Entry::Entry ( )

Definition at line 92 of file HashRouter.h.

Member Function Documentation

◆ addPeer()

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

Definition at line 97 of file HashRouter.h.

◆ getFlags()

int ripple::HashRouter::Entry::getFlags ( void  ) const

Definition at line 104 of file HashRouter.h.

◆ setFlags()

void ripple::HashRouter::Entry::setFlags ( int  flagsToSet)

Definition at line 110 of file HashRouter.h.

◆ releasePeerSet()

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

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

Definition at line 117 of file HashRouter.h.

◆ relayed()

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

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

Definition at line 124 of file HashRouter.h.

◆ shouldRelay()

bool ripple::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 136 of file HashRouter.h.

◆ shouldProcess()

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

Definition at line 147 of file HashRouter.h.

◆ getCounter()

static auto & ripple::CountedObject< Entry >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 129 of file CountedObject.h.

Member Data Documentation

◆ flags_

int ripple::HashRouter::Entry::flags_ = 0
private

Definition at line 156 of file HashRouter.h.

◆ peers_

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

Definition at line 157 of file HashRouter.h.

◆ relayed_

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

Definition at line 160 of file HashRouter.h.

◆ processed_

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

Definition at line 161 of file HashRouter.h.