Monero
Loading...
Searching...
No Matches
net::dandelionpp::connection_map Class Reference

Assists with mapping source -> stem and tracking connections for stem. More...

#include <dandelionpp.h>

Public Types

using value_type = boost::uuids::uuid
using size_type = std::vector<boost::uuids::uuid>::size_type
using difference_type = std::vector<boost::uuids::uuid>::difference_type
using reference = const boost::uuids::uuid&
using const_reference = reference
using iterator = std::vector<boost::uuids::uuid>::const_iterator
using const_iterator = iterator

Public Member Functions

 connection_map ()
 Initialized with zero stem connections.
 connection_map (std::vector< boost::uuids::uuid > out_connections, std::size_t stems)
 Initialized with out_connections and stem_count.
 connection_map (connection_map &&)=default
 ~connection_map () noexcept
connection_mapoperator= (connection_map &&)=default
connection_mapoperator= (const connection_map &)=delete
connection_map clone () const
const_iterator begin () const noexcept
const_iterator end () const noexcept
bool update (std::vector< boost::uuids::uuid > current)
std::size_t size () const noexcept
boost::uuids::uuid get_stem (const boost::uuids::uuid &source)

Private Member Functions

 connection_map (const connection_map &)=default

Private Attributes

std::vector< boost::uuids::uuid > out_mapping_
std::vector< std::pair< boost::uuids::uuid, std::size_t > > in_mapping_
std::vector< std::size_t > usage_count_

Detailed Description

Assists with mapping source -> stem and tracking connections for stem.

Member Typedef Documentation

◆ const_iterator

◆ const_reference

◆ difference_type

using net::dandelionpp::connection_map::difference_type = std::vector<boost::uuids::uuid>::difference_type

◆ iterator

using net::dandelionpp::connection_map::iterator = std::vector<boost::uuids::uuid>::const_iterator

◆ reference

◆ size_type

using net::dandelionpp::connection_map::size_type = std::vector<boost::uuids::uuid>::size_type

◆ value_type

Constructor & Destructor Documentation

◆ connection_map() [1/4]

net::dandelionpp::connection_map::connection_map ( const connection_map & )
privatedefault

◆ connection_map() [2/4]

net::dandelionpp::connection_map::connection_map ( )
inlineexplicit

Initialized with zero stem connections.

◆ connection_map() [3/4]

net::dandelionpp::connection_map::connection_map ( std::vector< boost::uuids::uuid > out_connections,
std::size_t stems )
explicit

Initialized with out_connections and stem_count.

◆ connection_map() [4/4]

net::dandelionpp::connection_map::connection_map ( connection_map && )
default

◆ ~connection_map()

net::dandelionpp::connection_map::~connection_map ( )
noexcept

Member Function Documentation

◆ begin()

const_iterator net::dandelionpp::connection_map::begin ( ) const
inlinenoexcept
Returns
First stem connection.

◆ clone()

connection_map net::dandelionpp::connection_map::clone ( ) const
Returns
An exact duplicate of this map.

◆ end()

const_iterator net::dandelionpp::connection_map::end ( ) const
inlinenoexcept
Returns
One-past the last stem connection.

◆ get_stem()

boost::uuids::uuid net::dandelionpp::connection_map::get_stem ( const boost::uuids::uuid & source)
Returns
Current stem mapping for source or nil_uuid() if none is possible.

◆ operator=() [1/2]

connection_map & net::dandelionpp::connection_map::operator= ( connection_map && )
default

◆ operator=() [2/2]

connection_map & net::dandelionpp::connection_map::operator= ( const connection_map & )
delete

◆ size()

std::size_t net::dandelionpp::connection_map::size ( ) const
noexcept
Returns
Number of outgoing connections in use.

◆ update()

bool net::dandelionpp::connection_map::update ( std::vector< boost::uuids::uuid > current)

Merges in current connections with the previous set of connections. If a connection died, a new one will take its place in the stem or the stem is marked as dead.

Parameters
connectionsCurrent outbound connection ids.
Returns
True if any updates to get_connections() was made.

Member Data Documentation

◆ in_mapping_

std::vector<std::pair<boost::uuids::uuid, std::size_t> > net::dandelionpp::connection_map::in_mapping_
private

◆ out_mapping_

std::vector<boost::uuids::uuid> net::dandelionpp::connection_map::out_mapping_
private

◆ usage_count_

std::vector<std::size_t> net::dandelionpp::connection_map::usage_count_
private

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