#include <ResolvedPeers.h>

Collaboration diagram for PeerConnectionPointer:

Public Types

using size_type = ResolvedPeers::size_type
 

Public Member Functions

 PeerConnectionPointer ()=default
 
 PeerConnectionPointer (std::nullptr_t)
 implicit nullptr conversion More...
 
 PeerConnectionPointer (const Comm::ConnectionPointer &conn, const size_type pos)
 
 operator bool () const
 
Comm::Connectionoperator-> () const
 
Comm::Connectionoperator* () const
 
 operator const Comm::ConnectionPointer & () const
 convenience conversion to Comm::ConnectionPointer More...
 
void finalize (const Comm::ConnectionPointer &conn)
 upgrade stored peer selection details with a matching actual connection More...
 
void print (std::ostream &) const
 debugging dump More...
 

Private Attributes

Comm::ConnectionPointer connection_
 half-baked, open, failed, or closed Comm::Connection (or nil) More...
 
size_type position_ = npos
 ResolvedPeers-maintained membership index (or npos) More...
 

Static Private Attributes

static constexpr auto npos = std::numeric_limits<size_type>::max()
 non-existent position for nil connection More...
 

Friends

class ResolvedPeers
 

Detailed Description

An invasive reference-counting Comm::Connection pointer that also keeps an (optional) ResolvedPeers position for the ResolvedPeers::reinstatePath() usage. Reference counting mechanism is compatible with Comm::ConnectionPointer.

Definition at line 121 of file ResolvedPeers.h.

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ PeerConnectionPointer() [1/3]

PeerConnectionPointer::PeerConnectionPointer ( )
default

◆ PeerConnectionPointer() [2/3]

PeerConnectionPointer::PeerConnectionPointer ( std::nullptr_t  )
inline

Definition at line 127 of file ResolvedPeers.h.

◆ PeerConnectionPointer() [3/3]

PeerConnectionPointer::PeerConnectionPointer ( const Comm::ConnectionPointer conn,
const size_type  pos 
)
inline

Definition at line 128 of file ResolvedPeers.h.

Member Function Documentation

◆ finalize()

void PeerConnectionPointer::finalize ( const Comm::ConnectionPointer conn)
inline

◆ operator bool()

PeerConnectionPointer::operator bool ( ) const
inlineexplicit

Definition at line 131 of file ResolvedPeers.h.

References connection_.

◆ operator const Comm::ConnectionPointer &()

PeerConnectionPointer::operator const Comm::ConnectionPointer & ( ) const
inline

Definition at line 136 of file ResolvedPeers.h.

References connection_.

◆ operator*()

Comm::Connection & PeerConnectionPointer::operator* ( ) const
inline

Definition at line 133 of file ResolvedPeers.h.

References assert, and connection_.

◆ operator->()

Comm::Connection * PeerConnectionPointer::operator-> ( ) const
inline

Definition at line 132 of file ResolvedPeers.h.

References assert, connection_, and RefCount< C >::getRaw().

◆ print()

void PeerConnectionPointer::print ( std::ostream &  os) const

Definition at line 229 of file ResolvedPeers.cc.

References connection_, npos, and position_.

Referenced by operator<<().

Friends And Related Function Documentation

◆ ResolvedPeers

friend class ResolvedPeers
friend

Definition at line 153 of file ResolvedPeers.h.

Member Data Documentation

◆ connection_

Comm::ConnectionPointer PeerConnectionPointer::connection_
private

◆ npos

constexpr auto PeerConnectionPointer::npos = std::numeric_limits<size_type>::max()
staticconstexprprivate

Definition at line 146 of file ResolvedPeers.h.

Referenced by print().

◆ position_

size_type PeerConnectionPointer::position_ = npos
private

Definition at line 152 of file ResolvedPeers.h.

Referenced by print(), and ResolvedPeers::reinstatePath().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors