cache_peer configuration storage More...

#include <CachePeers.h>

Collaboration diagram for CachePeers:

Public Types

using Storage = std::vector< std::unique_ptr< CachePeer >, PoolingAllocator< std::unique_ptr< CachePeer > > >
 owns stored CachePeer objects More...
 
using const_iterator = Storage::const_iterator
 

Public Member Functions

void add (CachePeer *p)
 stores a being-configured cache_peer More...
 
void remove (CachePeer *)
 deletes a previously add()ed CachePeer object More...
 
auto size () const
 the number of currently stored (i.e. added and not removed) cache_peers More...
 
auto begin () const
 
auto end () const
 
CachePeernextPeerToPing (size_t iteration)
 

Private Attributes

Storage storage
 cache_peers in configuration/parsing order More...
 
uint64_t peerPolls_ = 0
 total number of completed peer scans by nextPeerToPing()-calling code More...
 

Detailed Description

Definition at line 20 of file CachePeers.h.

Member Typedef Documentation

◆ const_iterator

using CachePeers::const_iterator = Storage::const_iterator

Definition at line 36 of file CachePeers.h.

◆ Storage

using CachePeers::Storage = std::vector< std::unique_ptr<CachePeer>, PoolingAllocator< std::unique_ptr<CachePeer> > >

Definition at line 24 of file CachePeers.h.

Member Function Documentation

◆ add()

void CachePeers::add ( CachePeer p)
inline

Definition at line 27 of file CachePeers.h.

References storage.

Referenced by parse_peer().

◆ begin()

auto CachePeers::begin ( ) const
inline

Definition at line 37 of file CachePeers.h.

References storage.

◆ end()

auto CachePeers::end ( ) const
inline

Definition at line 38 of file CachePeers.h.

References storage.

◆ nextPeerToPing()

CachePeer & CachePeers::nextPeerToPing ( size_t  iteration)

A CachePeer to query next when scanning all peer caches in hope to fetch a remote cache hit.

See also
neighborsUdpPing()
Parameters
iterationa 0-based index of a loop scanning all peers

Definition at line 14 of file CachePeers.cc.

References Assure, peerPolls_, size(), and storage.

Referenced by neighborsDigestSelect(), and neighborsUdpPing().

◆ remove()

void CachePeers::remove ( CachePeer peer)

Definition at line 31 of file CachePeers.cc.

References Assure, and storage.

Referenced by DeleteConfigured().

◆ size()

auto CachePeers::size ( ) const
inline

Definition at line 33 of file CachePeers.h.

References storage.

Referenced by neighborsDigestSelect(), neighborsUdpPing(), nextPeerToPing(), and peer_Inst().

Member Data Documentation

◆ peerPolls_

uint64_t CachePeers::peerPolls_ = 0
private

Definition at line 50 of file CachePeers.h.

Referenced by nextPeerToPing().

◆ storage

Storage CachePeers::storage
private

Definition at line 47 of file CachePeers.h.

Referenced by add(), begin(), end(), nextPeerToPing(), remove(), and size().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors