#include <source/ariba/overlay/modules/onehop/OneHop.h>
Public Member Functions | |
OneHop (BaseOverlay &_overlay, const NodeID &_nodeid, OverlayStructureEvents *_eventsReceiver, const OverlayParameterSet ¶m) | |
virtual | ~OneHop () |
Protected Member Functions | |
virtual void | eventFunction () |
virtual void | createOverlay () |
virtual void | deleteOverlay () |
virtual void | joinOverlay (const EndpointDescriptor &boot=EndpointDescriptor::UNSPECIFIED) |
virtual void | leaveOverlay () |
virtual const EndpointDescriptor & | resolveNode (const NodeID &node) |
virtual void | routeMessage (const NodeID &destnode, Message *msg) |
virtual NodeList | getKnownNodes () const |
virtual void | onLinkUp (const LinkID &lnk, const NodeID &remote) |
virtual void | onLinkDown (const LinkID &lnk, const NodeID &remote) |
virtual void | onMessage (const DataMessage &msg, const NodeID &remote, const LinkID &lnk=LinkID::UNSPECIFIED) |
Private Types | |
enum | _OneHopState { OneHopStateInvalid = 0, OneHopStateJoinInitiated = 1, OneHopStateJoinListingRequested = 2, OneHopStateCompleted = 3 } |
The current state of the overlay. More... | |
typedef map< const NodeID, const LinkID > | OverlayNodeMapping |
The other nodes in the overlay. | |
typedef enum ariba::overlay::OneHop::_OneHopState | OneHopState |
The current state of the overlay. | |
Private Member Functions | |
use_logging_h (OneHop) | |
Private Attributes | |
OverlayNodeMapping | overlayNodes |
OneHopState | state |
uint16_t | pendingLinks |
LinkID | bootstrapLink |
Definition at line 53 of file OneHop.h.
typedef map<const NodeID, const LinkID> ariba::overlay::OneHop::OverlayNodeMapping [private] |
typedef enum ariba::overlay::OneHop::_OneHopState ariba::overlay::OneHop::OneHopState [private] |
The current state of the overlay.
enum ariba::overlay::OneHop::_OneHopState [private] |
ariba::overlay::OneHop::OneHop | ( | BaseOverlay & | _overlay, | |
const NodeID & | _nodeid, | |||
OverlayStructureEvents * | _eventsReceiver, | |||
const OverlayParameterSet & | param | |||
) |
Definition at line 51 of file OneHop.cpp.
References overlayNodes, ariba::utility::Timer::setInterval(), ariba::utility::Timer::start(), and ariba::utility::LinkID::UNSPECIFIED.
ariba::overlay::OneHop::~OneHop | ( | ) | [virtual] |
Definition at line 67 of file OneHop.cpp.
References deleteOverlay(), and ariba::utility::Timer::stop().
ariba::overlay::OneHop::use_logging_h | ( | OneHop | ) | [private] |
void ariba::overlay::OneHop::eventFunction | ( | ) | [protected, virtual] |
Reimplemented from ariba::utility::Timer.
Definition at line 350 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::BaseOverlay::getEndpointDescriptor(), logging_debug, overlayNodes, ariba::communication::EndpointDescriptor::toString(), and ariba::utility::Identifier::toString().
void ariba::overlay::OneHop::createOverlay | ( | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 101 of file OneHop.cpp.
References logging_info, OneHopStateCompleted, and state.
void ariba::overlay::OneHop::deleteOverlay | ( | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 108 of file OneHop.cpp.
References logging_info, OneHopStateInvalid, pendingLinks, and state.
Referenced by ~OneHop().
void ariba::overlay::OneHop::joinOverlay | ( | const EndpointDescriptor & | boot = EndpointDescriptor::UNSPECIFIED |
) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 128 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, bootstrapLink, ariba::overlay::BaseOverlay::establishLink(), logging_info, OneHopStateCompleted, OneHopStateJoinInitiated, ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, pendingLinks, state, ariba::communication::EndpointDescriptor::toString(), and ariba::communication::EndpointDescriptor::UNSPECIFIED.
void ariba::overlay::OneHop::leaveOverlay | ( | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 150 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, logging_info, ariba::overlay::OverlayInterface::nodeid, ariba::overlay::OneHopMessage::OneHopMessageTypeLeave, OneHopStateInvalid, overlayNodes, pendingLinks, ariba::overlay::BaseOverlay::sendMessage(), state, and ariba::utility::LinkID::UNSPECIFIED.
const EndpointDescriptor & ariba::overlay::OneHop::resolveNode | ( | const NodeID & | node | ) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 72 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::BaseOverlay::getEndpointDescriptor(), logging_debug, overlayNodes, ariba::communication::EndpointDescriptor::toString(), ariba::utility::Identifier::toString(), and ariba::communication::EndpointDescriptor::UNSPECIFIED.
void ariba::overlay::OneHop::routeMessage | ( | const NodeID & | destnode, | |
Message * | msg | |||
) | [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 83 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, logging_debug, logging_error, ariba::overlay::OneHopMessage::OneHopMessageTypeRoute, overlayNodes, ariba::overlay::BaseOverlay::sendMessage(), and ariba::utility::Identifier::toString().
OverlayInterface::NodeList ariba::overlay::OneHop::getKnownNodes | ( | ) | const [protected, virtual] |
Implements ariba::overlay::OverlayInterface.
Definition at line 115 of file OneHop.cpp.
References overlayNodes.
void ariba::overlay::OneHop::onLinkUp | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::overlay::OverlayInterface.
Definition at line 201 of file OneHop.cpp.
References ariba::overlay::OverlayInterface::baseoverlay, bootstrapLink, logging_debug, ariba::overlay::OneHopMessage::OneHopMessageTypeListingRequest, OneHopStateCompleted, OneHopStateJoinListingRequested, pendingLinks, ariba::overlay::BaseOverlay::sendMessage(), and state.
void ariba::overlay::OneHop::onLinkDown | ( | const LinkID & | lnk, | |
const NodeID & | remote | |||
) | [protected, virtual] |
Reimplemented from ariba::overlay::OverlayInterface.
Definition at line 181 of file OneHop.cpp.
References logging_debug, OneHopStateInvalid, overlayNodes, state, and ariba::utility::Identifier::toString().
void ariba::overlay::OneHop::onMessage | ( | const DataMessage & | msg, | |
const NodeID & | remote, | |||
const LinkID & | lnk = LinkID::UNSPECIFIED | |||
) | [protected, virtual] |
Reimplemented from ariba::overlay::OverlayInterface.
Definition at line 223 of file OneHop.cpp.
References ariba::overlay::NodeListingReply::add(), ariba::overlay::OverlayInterface::baseoverlay, ariba::overlay::BaseOverlay::dropLink(), ariba::overlay::BaseOverlay::establishLink(), ariba::overlay::OverlayInterface::eventsReceiver, ariba::overlay::BaseOverlay::getEndpointDescriptor(), ariba::overlay::NodeListingReply::getList(), ariba::DataMessage::getMessage(), ariba::overlay::BaseOverlay::incomingRouteMessage(), ariba::overlay::OneHopMessage::isType(), logging_debug, logging_info, ariba::overlay::OverlayInterface::nodeid, ariba::overlay::OneHopMessage::OneHopMessageTypeLeave, ariba::overlay::OneHopMessage::OneHopMessageTypeListingReply, ariba::overlay::OneHopMessage::OneHopMessageTypeListingRequest, ariba::overlay::OneHopMessage::OneHopMessageTypeRoute, ariba::overlay::OverlayStructureEvents::onNodeJoin(), ariba::overlay::OverlayInterface::OVERLAY_SERVICE_ID, overlayNodes, pendingLinks, ariba::overlay::BaseOverlay::sendMessage(), ariba::communication::EndpointDescriptor::toString(), and ariba::utility::Identifier::toString().
Definition at line 101 of file OneHop.h.
Referenced by eventFunction(), getKnownNodes(), leaveOverlay(), OneHop(), onLinkDown(), onMessage(), resolveNode(), and routeMessage().
OneHopState ariba::overlay::OneHop::state [private] |
Definition at line 111 of file OneHop.h.
Referenced by createOverlay(), deleteOverlay(), joinOverlay(), leaveOverlay(), onLinkDown(), and onLinkUp().
uint16_t ariba::overlay::OneHop::pendingLinks [private] |
Definition at line 112 of file OneHop.h.
Referenced by deleteOverlay(), joinOverlay(), leaveOverlay(), onLinkUp(), and onMessage().
LinkID ariba::overlay::OneHop::bootstrapLink [private] |