xrpld
Loading...
Searching...
No Matches
xrpl::PeerFinder::Livecache< Allocator >::HopsT Class Reference

#include <Livecache.h>

Collaboration diagram for xrpl::PeerFinder::Livecache< Allocator >::HopsT:

Classes

struct  Transform

Public Types

using iterator = boost::transform_iterator<Transform<false>, lists_type::iterator>
using const_iterator
using reverse_iterator
using const_reverse_iterator

Public Member Functions

iterator begin ()
const_iterator begin () const
const_iterator cbegin () const
iterator end ()
const_iterator end () const
const_iterator cend () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
const_reverse_iterator crbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
const_reverse_iterator crend () const
void shuffle ()
 Shuffle each hop list.
std::string histogram () const

Private Types

using Histogram = std::array<int, 1 + Tuning::kMaxHops + 1>
using lists_type = std::array<list_type, 1 + Tuning::kMaxHops + 1>

Private Member Functions

 HopsT (Allocator const &alloc)
void insert (Element &e)
void reinsert (Element &e, std::uint32_t hops)
void remove (Element &e)

Private Attributes

lists_type lists_
Histogram hist_ {}

Friends

class Livecache

Detailed Description

template<class Allocator = std::allocator<char>>
class xrpl::PeerFinder::Livecache< Allocator >::HopsT

Definition at line 197 of file Livecache.h.

Member Typedef Documentation

◆ Histogram

template<class Allocator = std::allocator<char>>
using xrpl::PeerFinder::Livecache< Allocator >::HopsT::Histogram = std::array<int, 1 + Tuning::kMaxHops + 1>
private

Definition at line 205 of file Livecache.h.

◆ lists_type

template<class Allocator = std::allocator<char>>
using xrpl::PeerFinder::Livecache< Allocator >::HopsT::lists_type = std::array<list_type, 1 + Tuning::kMaxHops + 1>
private

Definition at line 206 of file Livecache.h.

◆ iterator

template<class Allocator = std::allocator<char>>
using xrpl::PeerFinder::Livecache< Allocator >::HopsT::iterator = boost::transform_iterator<Transform<false>, lists_type::iterator>

Definition at line 224 of file Livecache.h.

◆ const_iterator

template<class Allocator = std::allocator<char>>
using xrpl::PeerFinder::Livecache< Allocator >::HopsT::const_iterator
Initial value:
boost::transform_iterator<Transform<true>, lists_type::const_iterator>

Definition at line 226 of file Livecache.h.

◆ reverse_iterator

template<class Allocator = std::allocator<char>>
using xrpl::PeerFinder::Livecache< Allocator >::HopsT::reverse_iterator
Initial value:
boost::transform_iterator<Transform<false>, lists_type::reverse_iterator>

Definition at line 229 of file Livecache.h.

◆ const_reverse_iterator

template<class Allocator = std::allocator<char>>
using xrpl::PeerFinder::Livecache< Allocator >::HopsT::const_reverse_iterator
Initial value:
boost::transform_iterator<Transform<true>, lists_type::const_reverse_iterator>

Definition at line 232 of file Livecache.h.

Constructor & Destructor Documentation

◆ HopsT()

template<class Allocator>
xrpl::PeerFinder::Livecache< Allocator >::HopsT::HopsT ( Allocator const & alloc)
explicitprivate

Definition at line 490 of file Livecache.h.

Member Function Documentation

◆ begin() [1/2]

template<class Allocator = std::allocator<char>>
iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::begin ( )

Definition at line 236 of file Livecache.h.

◆ begin() [2/2]

template<class Allocator = std::allocator<char>>
const_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::begin ( ) const
nodiscard

Definition at line 242 of file Livecache.h.

◆ cbegin()

template<class Allocator = std::allocator<char>>
const_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::cbegin ( ) const
nodiscard

Definition at line 248 of file Livecache.h.

◆ end() [1/2]

template<class Allocator = std::allocator<char>>
iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::end ( )

Definition at line 254 of file Livecache.h.

◆ end() [2/2]

template<class Allocator = std::allocator<char>>
const_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::end ( ) const
nodiscard

Definition at line 260 of file Livecache.h.

◆ cend()

template<class Allocator = std::allocator<char>>
const_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::cend ( ) const
nodiscard

Definition at line 266 of file Livecache.h.

◆ rbegin() [1/2]

template<class Allocator = std::allocator<char>>
reverse_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::rbegin ( )

Definition at line 272 of file Livecache.h.

◆ rbegin() [2/2]

template<class Allocator = std::allocator<char>>
const_reverse_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::rbegin ( ) const
nodiscard

Definition at line 278 of file Livecache.h.

◆ crbegin()

template<class Allocator = std::allocator<char>>
const_reverse_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::crbegin ( ) const
nodiscard

Definition at line 284 of file Livecache.h.

◆ rend() [1/2]

template<class Allocator = std::allocator<char>>
reverse_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::rend ( )

Definition at line 290 of file Livecache.h.

◆ rend() [2/2]

template<class Allocator = std::allocator<char>>
const_reverse_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::rend ( ) const
nodiscard

Definition at line 296 of file Livecache.h.

◆ crend()

template<class Allocator = std::allocator<char>>
const_reverse_iterator xrpl::PeerFinder::Livecache< Allocator >::HopsT::crend ( ) const
nodiscard

Definition at line 302 of file Livecache.h.

◆ shuffle()

template<class Allocator>
void xrpl::PeerFinder::Livecache< Allocator >::HopsT::shuffle ( )

Shuffle each hop list.

Definition at line 461 of file Livecache.h.

◆ histogram()

template<class Allocator>
std::string xrpl::PeerFinder::Livecache< Allocator >::HopsT::histogram ( ) const
nodiscard

Definition at line 477 of file Livecache.h.

◆ insert()

template<class Allocator>
void xrpl::PeerFinder::Livecache< Allocator >::HopsT::insert ( Element & e)
private

Definition at line 497 of file Livecache.h.

◆ reinsert()

template<class Allocator>
void xrpl::PeerFinder::Livecache< Allocator >::HopsT::reinsert ( Element & e,
std::uint32_t hops )
private

Definition at line 509 of file Livecache.h.

◆ remove()

template<class Allocator>
void xrpl::PeerFinder::Livecache< Allocator >::HopsT::remove ( Element & e)
private

Definition at line 526 of file Livecache.h.

◆ Livecache

template<class Allocator = std::allocator<char>>
friend class Livecache
friend

Definition at line 327 of file Livecache.h.

Member Data Documentation

◆ lists_

template<class Allocator = std::allocator<char>>
lists_type xrpl::PeerFinder::Livecache< Allocator >::HopsT::lists_
private

Definition at line 328 of file Livecache.h.

◆ hist_

template<class Allocator = std::allocator<char>>
Histogram xrpl::PeerFinder::Livecache< Allocator >::HopsT::hist_ {}
private

Definition at line 329 of file Livecache.h.