Changeset 3690 for source/ariba/overlay/modules/onehop/OneHop.h
- Timestamp:
- May 26, 2009, 1:40:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/onehop/OneHop.h
r3057 r3690 1 // [Licen ce]1 // [License] 2 2 // The Ariba-Underlay Copyright 3 3 // … … 35 35 // official policies, either expressed or implied, of the Institute of 36 36 // Telematics. 37 // [Licen ce]37 // [License] 38 38 39 39 #ifndef _ONE_HOP_H … … 42 42 #include <map> 43 43 #include "ariba/overlay/modules/OverlayInterface.h" 44 #include "ariba/overlay/modules/onehop/messages/OneHopMessage.h"45 #include "ariba/overlay/modules/onehop/messages/NodeListingRequest.h"46 #include "ariba/overlay/modules/onehop/messages/NodeListingReply.h"47 44 #include "ariba/utility/logging/Logging.h" 48 45 49 46 using std::map; 50 using ariba::overlay::OverlayInterface;51 using ariba::overlay::OneHopMessage;52 using ariba::overlay::NodeListingRequest;53 using ariba::overlay::NodeListingReply;54 47 55 48 namespace ariba { 56 49 namespace overlay { 57 50 58 class OneHop 51 class OneHop: public OverlayInterface { 59 52 use_logging_h( OneHop ); 60 53 public: 61 OneHop( 62 BaseOverlay& _overlay, 63 const NodeID& _nodeid, 64 OverlayStructureEvents* _eventsReceiver 65 ); 54 OneHop(BaseOverlay& _overlay, const NodeID& _nodeid, 55 OverlayStructureEvents* _eventsReceiver); 66 56 67 57 virtual ~OneHop(); 68 58 69 59 protected: 60 /// @see OverlayInterface.h 61 virtual void createOverlay(); 70 62 71 // 72 // OverlayInterface.h 73 // 74 75 virtual void createOverlay(); 63 /// @see OverlayInterface.h 76 64 virtual void deleteOverlay(); 77 65 78 virtual void joinOverlay(const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED); 66 /// @see OverlayInterface.h 67 virtual void joinOverlay(const EndpointDescriptor& boot = 68 EndpointDescriptor::UNSPECIFIED); 69 70 /// @see OverlayInterface.h 79 71 virtual void leaveOverlay(); 80 72 81 virtual const EndpointDescriptor& resolveNode( const NodeID& node );82 virtual void routeMessage( const NodeID& destnode, Message* msg);73 /// @see OverlayInterface.h 74 virtual const EndpointDescriptor& resolveNode(const NodeID& node); 83 75 76 /// @see OverlayInterface.h 77 virtual void routeMessage(const NodeID& destnode, Message* msg); 78 79 /// @see OverlayInterface.h 84 80 virtual NodeList getKnownNodes() const; 85 81 86 // 87 // see CommunicationListener.h or OverlayInterface.h 88 // 82 /// @see CommunicationListener.h or @see OverlayInterface.h 83 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote); 89 84 90 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);85 /// @see CommunicationListener.h or @see OverlayInterface.h 91 86 virtual void onLinkDown(const LinkID& lnk, const NodeID& remote); 92 virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk = LinkID::UNSPECIFIED); 87 88 /// @see CommunicationListener.h or @see OverlayInterface.h 89 virtual void onMessage(const DataMessage& msg, const NodeID& remote, 90 const LinkID& lnk = LinkID::UNSPECIFIED); 93 91 94 92 private: 95 96 /** 97 * The other nodes in the overlay 98 */ 99 typedef map<const NodeID,const LinkID> OverlayNodeMapping; 93 /// The other nodes in the overlay 94 typedef map<const NodeID, const LinkID> OverlayNodeMapping; 100 95 OverlayNodeMapping overlayNodes; 101 96 102 /** 103 * The current state of the overlay 104 */ 97 /// The current state of the overlay 105 98 typedef enum _OneHopState { 106 OneHopStateInvalid 107 OneHopStateJoinInitiated 108 OneHopStateJoinListingRequested 109 OneHopStateCompleted 99 OneHopStateInvalid = 0, 100 OneHopStateJoinInitiated = 1, 101 OneHopStateJoinListingRequested = 2, 102 OneHopStateCompleted = 3, 110 103 } OneHopState; 111 104 112 105 OneHopState state; 113 114 106 uint16_t pendingLinks; 115 107 LinkID bootstrapLink; 116 117 108 }; 118 109
Note:
See TracChangeset
for help on using the changeset viewer.