#include <catcher.h>
Inheritance diagram for Catcher::
Public Methods | |
Catcher () | |
Create the catcher. More... | |
virtual | ~Catcher () |
Delete the node list. More... | |
int | getNumberOfNodes () |
Return the number of nodes we know about. More... | |
bool | getNode (int, Node *) |
Get a copy of the node at the index specified. More... | |
Node * | lookup (IpAddress ipAddr) |
Search the node list for the specified IP address. More... | |
Node * | getUnconnectedNode () |
Gets a node that may be worth connecting to. More... | |
int | addNode (Node *node) |
Adds a node to the list. More... | |
bool | deleteNode (Node *) |
Delete the node specified. More... | |
bool | save () |
Save node list to default host file. More... | |
bool | save (string path) |
Write the Catcher configuration to a file. More... | |
int | load () |
Read host list from default host list file. More... | |
int | load (string path) |
Read Catcher configuration from file. More... | |
virtual void | toStream (std::ostream &out) |
Protected Methods | |
Node * | isDup (IpAddress ipAddr) |
Return the node found in the table if it is a duplicate, NULL otherwise. More... | |
bool | deleteNode () |
Find a good node to delete and delete it. More... | |
void | deleteAll () |
Delete all the nodes in the list. More... | |
Protected Attributes | |
std::vector< Node *> | m_nodeList |
Pointer to an array of pointers to Nodes. This is a list of all known nodes. We must do it this way because MaxHosts is configurable. More... | |
Mutex | m_nodeListLock |
Mutex for the node list. More... | |
TRanrotBGenerator | m_randomNumberGenerator |
Friends | |
std::istream & | operator>> (std::istream &in, Catcher &catcher) |
This is where the memory for the nodes is stored. Lots of other classes make pointers to these nodes.
Definition at line 11 of file catcher.h.
|
Create the catcher. Create an empty node list. Definition at line 12 of file catcher.cpp. |
|
Delete the node list.
Definition at line 20 of file catcher.cpp. |
|
Adds a node to the list.
Definition at line 53 of file catcher.cpp. Referenced by NodeManagerCommand::addNode(), and NetworkLayer::handleImHerePacket().
|
|
Delete all the nodes in the list.
Definition at line 270 of file catcher.cpp. Referenced by load(), and ~Catcher().
|
|
Find a good node to delete and delete it.
Definition at line 212 of file catcher.cpp. Referenced by addNode().
|
|
Delete the node specified.
Definition at line 240 of file catcher.cpp. Referenced by NodeManagerCommand::run().
|
|
Get a copy of the node at the index specified. The copy will be placed in the "node" argument passed in. Return false if the index is invalid, true otherwise. Definition at line 104 of file catcher.cpp. Referenced by NodeManagerCommand::getHtmlInterface().
|
|
Return the number of nodes we know about.
Definition at line 93 of file catcher.cpp. Referenced by SummaryScreenCommand::getHtmlInterface(), and NodeManagerCommand::getHtmlInterface().
|
|
Gets a node that may be worth connecting to. The order of priority of nodes returned is:
Definition at line 127 of file catcher.cpp. Referenced by LinkLayerInterface::peerConnectImpl().
|
|
Return the node found in the table if it is a duplicate, NULL otherwise.
Definition at line 30 of file catcher.cpp. Referenced by addNode().
|
|
Read Catcher configuration from file.
Definition at line 299 of file catcher.cpp. |
|
Read host list from default host list file.
Definition at line 288 of file catcher.cpp. Referenced by GlobalObjects::init().
|
|
Search the node list for the specified IP address. A pointer to the node found is returned in the second parameter. If nothing has been found, the second parameter is set to NULL.
Definition at line 361 of file catcher.cpp. Referenced by LinkLayerInterface::accept(), NodeManagerCommand::addNode(), NodeManagerCommand::run(), and ConnectionManagerCommand::run().
|
|
Write the Catcher configuration to a file.
Definition at line 340 of file catcher.cpp. |
|
Save node list to default host file.
Definition at line 330 of file catcher.cpp. Referenced by NodeManagerCommand::addNode(), addNode(), deleteNode(), and GlobalObjects::destroyImpl().
|
|
Reimplemented from BasicObject. Definition at line 375 of file catcher.cpp. |
|
|
|
Pointer to an array of pointers to Nodes. This is a list of all known nodes. We must do it this way because MaxHosts is configurable.
|
|
Mutex for the node list.
|
|
|