Monero
Loading...
Searching...
No Matches
cryptonote::bootstrap_node::selector_auto Class Reference

#include <bootstrap_node_selector.h>

Inheritance diagram for cryptonote::bootstrap_node::selector_auto:
Collaboration diagram for cryptonote::bootstrap_node::selector_auto:

Classes

struct  node
struct  by_address
struct  by_fails

Public Member Functions

 selector_auto (std::function< std::map< std::string, bool >()> get_nodes, size_t max_nodes=1000)
void handle_result (const std::string &address, bool success) final
boost::optional< node_infonext_node () final
Public Member Functions inherited from cryptonote::bootstrap_node::selector
virtual ~selector ()=default

Private Types

typedef boost::multi_index_container< node, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< by_address >, boost::multi_index::member< node, std::string, &node::address > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< by_fails >, boost::multi_index::member< node, size_t, &node::fails > > > > nodes_list

Private Member Functions

bool has_at_least_one_good_node () const
void append_new_nodes ()
void truncate ()

Private Attributes

const std::function< std::map< std::string, bool >()> m_get_nodes
const size_t m_max_nodes
nodes_list m_nodes

Member Typedef Documentation

◆ nodes_list

typedef boost::multi_index_container< node, boost::multi_index::indexed_by< boost::multi_index::ordered_unique<boost::multi_index::tag<by_address>, boost::multi_index::member<node, std::string, &node::address> >, boost::multi_index::ordered_non_unique<boost::multi_index::tag<by_fails>, boost::multi_index::member<node, size_t, &node::fails> > > > cryptonote::bootstrap_node::selector_auto::nodes_list
private

Constructor & Destructor Documentation

◆ selector_auto()

cryptonote::bootstrap_node::selector_auto::selector_auto ( std::function< std::map< std::string, bool >()> get_nodes,
size_t max_nodes = 1000 )
inline

Member Function Documentation

◆ append_new_nodes()

void cryptonote::bootstrap_node::selector_auto::append_new_nodes ( )
private

◆ handle_result()

void cryptonote::bootstrap_node::selector_auto::handle_result ( const std::string & address,
bool success )
finalvirtual

◆ has_at_least_one_good_node()

bool cryptonote::bootstrap_node::selector_auto::has_at_least_one_good_node ( ) const
private

◆ next_node()

boost::optional< node_info > cryptonote::bootstrap_node::selector_auto::next_node ( )
finalvirtual

◆ truncate()

void cryptonote::bootstrap_node::selector_auto::truncate ( )
private

Member Data Documentation

◆ m_get_nodes

const std::function<std::map<std::string, bool>()> cryptonote::bootstrap_node::selector_auto::m_get_nodes
private

◆ m_max_nodes

const size_t cryptonote::bootstrap_node::selector_auto::m_max_nodes
private

◆ m_nodes

nodes_list cryptonote::bootstrap_node::selector_auto::m_nodes
private

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