|
Ring Daemon
|
#include <swarm_manager.h>


Public Member Functions | |
| void | addChannel (const std::shared_ptr< dhtnet::ChannelSocketInterface > &channel) |
| Add channel to routing table. | |
| void | changeMobility (const NodeId &nodeId, bool isMobile) |
| Change mobility of specific node. | |
| void | deleteNode (const std::vector< NodeId > &nodes) |
| Delete nodes from the different tables in bucket. | |
| void | display () |
| Display swarm manager info. | |
| unsigned | getActiveNodesCount () const |
| std::vector< NodeId > | getAllNodes () const |
| get all nodes from the different tables in bucket | |
| std::list< Bucket > & | getBuckets () |
| Get buckets of routing table. | |
| std::vector< NodeId > | getConnectedNodes () const |
| const NodeId & | getId () const |
| Get swarm manager id. | |
| RoutingTable & | getRoutingTable () |
| Get routing table. | |
| std::vector< std::map< std::string, std::string > > | getRoutingTableInfo () const |
| bool | isConnected () const |
| Check if swarm manager is connected. | |
| bool | isConnectedWith (const NodeId &deviceId) |
| Check if we're connected with a specific device. | |
| bool | isMobile () const |
| Get mobility of swarm manager. | |
| bool | isShutdown () |
| Check if swarm manager is shutdown. | |
| void | maintainBuckets (const std::set< NodeId > &toConnect={}) |
| Maintain/Update buckets. | |
| void | onConnectionChanged (OnConnectionChanged cb) |
| void | removeNode (const NodeId &nodeId) |
| Remove channel from routing table. | |
| void | restart () |
| Restart the swarm manager. | |
| bool | setKnownNodes (const std::vector< NodeId > &known_nodes) |
| Set list of nodes to the routing table known_nodes. | |
| void | setMobileNodes (const std::vector< NodeId > &mobile_nodes) |
| Set list of nodes to the routing table mobile_nodes. | |
| void | setMobility (bool isMobile) |
| Set mobility of swarm manager. | |
| void | shutdown () |
| Shutdown swarm manager. | |
| SwarmManager (const NodeId &, const std::mt19937_64 &rand, ToConnectCb &&toConnectCb) | |
| std::weak_ptr< SwarmManager > | weak () |
| ~SwarmManager () | |
Public Attributes | |
| NeedSocketCb | needSocketCb_ |
Definition at line 28 of file swarm_manager.h.
|
explicit |
Definition at line 27 of file swarm_manager.cpp.
References jami::RoutingTable::setId().

| jami::SwarmManager::~SwarmManager | ( | ) |
Definition at line 35 of file swarm_manager.cpp.
References shutdown().

| void jami::SwarmManager::addChannel | ( | const std::shared_ptr< dhtnet::ChannelSocketInterface > & | channel | ) |
Add channel to routing table.
| channel |
Definition at line 86 of file swarm_manager.cpp.
References jami::RoutingTable::addNode(), jami::emitSignal(), jami::RoutingTable::findBucket(), getId(), and JAMI_DEBUG.

Change mobility of specific node.
| nodeId | |
| isMobile |
Definition at line 121 of file swarm_manager.cpp.
References jami::emitSignal(), jami::RoutingTable::findBucket(), and isMobile().

Delete nodes from the different tables in bucket.
Definition at line 383 of file swarm_manager.cpp.
References jami::RoutingTable::deleteNode(), and maintainBuckets().

|
inline |
Display swarm manager info.
Definition at line 133 of file swarm_manager.h.
References jami::emitSignal(), jami::RoutingTable::getBuckets(), getId(), jami::RoutingTable::getNodeCount(), and JAMI_DEBUG.

|
inline |
Definition at line 96 of file swarm_manager.h.
References jami::RoutingTable::getActiveNodesCount().

| std::vector< NodeId > jami::SwarmManager::getAllNodes | ( | ) | const |
get all nodes from the different tables in bucket
Definition at line 339 of file swarm_manager.cpp.
References jami::RoutingTable::getAllNodes().

|
inline |
Get buckets of routing table.
Definition at line 115 of file swarm_manager.h.
References jami::RoutingTable::getBuckets().

| std::vector< NodeId > jami::SwarmManager::getConnectedNodes | ( | ) | const |
Definition at line 346 of file swarm_manager.cpp.
References jami::RoutingTable::getConnectedNodes().

Get swarm manager id.
Definition at line 47 of file swarm_manager.h.
Referenced by addChannel(), and display().
|
inline |
| std::vector< std::map< std::string, std::string > > jami::SwarmManager::getRoutingTableInfo | ( | ) | const |
Definition at line 353 of file swarm_manager.cpp.
References jami::emitSignal(), and jami::RoutingTable::getRoutingTableStats().

| bool jami::SwarmManager::isConnected | ( | ) | const |
Check if swarm manager is connected.
Definition at line 376 of file swarm_manager.cpp.
References jami::RoutingTable::isEmpty().

Check if we're connected with a specific device.
| deviceId |
Definition at line 129 of file swarm_manager.cpp.
References jami::RoutingTable::hasNode().
Referenced by removeNode().

|
inline |
Get mobility of swarm manager.
Definition at line 163 of file swarm_manager.h.
Referenced by changeMobility(), and setMobility().
|
inline |
Check if swarm manager is shutdown.
Definition at line 182 of file swarm_manager.h.
Maintain/Update buckets.
| toConnect | Nodes to connect |
Definition at line 166 of file swarm_manager.cpp.
References jami::RoutingTable::addConnectingNode(), jami::Bucket::BUCKET_MAX_SIZE, jami::RoutingTable::contains(), jami::emitSignal(), and jami::RoutingTable::getBuckets().
Referenced by deleteNode(), and removeNode().

|
inline |
Definition at line 151 of file swarm_manager.h.
References jami::emitSignal().

Remove channel from routing table.
| channel |
Definition at line 110 of file swarm_manager.cpp.
References jami::emitSignal(), isConnectedWith(), and maintainBuckets().

| void jami::SwarmManager::restart | ( | ) |
Restart the swarm manager.
This function must be called in situations where we want to use a swarm manager that was previously shut down.
Definition at line 146 of file swarm_manager.cpp.
Set list of nodes to the routing table known_nodes.
| known_nodes |
Definition at line 42 of file swarm_manager.cpp.
References jami::emitSignal(), and weak().

Set list of nodes to the routing table mobile_nodes.
| mobile_nodes |
Definition at line 76 of file swarm_manager.cpp.
Set mobility of swarm manager.
| isMobile |
Definition at line 157 of file swarm_manager.h.
References isMobile().

| void jami::SwarmManager::shutdown | ( | ) |
Shutdown swarm manager.
Definition at line 135 of file swarm_manager.cpp.
References jami::RoutingTable::shutdownAllNodes().
Referenced by ~SwarmManager().

|
inline |
Definition at line 41 of file swarm_manager.h.
References jami::emitSignal().
Referenced by setKnownNodes().

| NeedSocketCb jami::SwarmManager::needSocketCb_ |
Definition at line 39 of file swarm_manager.h.