Changeset 3057
- Timestamp:
- Apr 23, 2009, 7:18:10 PM (16 years ago)
- Location:
- source/ariba/overlay/modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/modules/OverlayInterface.cpp
r3056 r3057 60 60 } 61 61 62 void OverlayInterface::onLinkUp(const LinkID& lnk, const NodeID& remote){ 63 } 64 65 void OverlayInterface::onLinkDown(const LinkID& lnk, const NodeID& remote){ 66 } 67 68 void OverlayInterface::onLinkChanged(const LinkID& lnk, const NodeID& remote){ 69 } 70 71 void OverlayInterface::onLinkFail(const LinkID& lnk, const NodeID& remote){ 72 } 73 74 void OverlayInterface::onLinkQoSChanged(const LinkID& lnk, const NodeID& remote, const LinkProperties& prop){ 75 } 76 77 bool OverlayInterface::onLinkRequest(const NodeID& remote, const DataMessage& msg){ 78 } 79 80 void OverlayInterface::onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk){ 81 } 82 62 83 }} // namespace ariba, overlay -
source/ariba/overlay/modules/OverlayInterface.h
r3055 r3057 80 80 virtual NodeList getKnownNodes() const = 0; 81 81 82 // functions from CommunicationListener that we _can_ use as overlay 83 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote); 84 virtual void onLinkDown(const LinkID& lnk, const NodeID& remote); 85 virtual void onLinkChanged(const LinkID& lnk, const NodeID& remote); 86 virtual void onLinkFail(const LinkID& lnk, const NodeID& remote); 87 virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote, const LinkProperties& prop); 88 virtual bool onLinkRequest(const NodeID& remote, const DataMessage& msg); 89 virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk = LinkID::UNSPECIFIED); 90 82 91 protected: 83 92 BaseOverlay& baseoverlay; -
source/ariba/overlay/modules/onehop/OneHop.cpp
r3056 r3057 58 58 59 59 OneHop::~OneHop(){ 60 61 60 deleteOverlay(); 62 61 } … … 163 162 } 164 163 165 void OneHop::onLinkDown( const LinkID& link, const NodeID& local, const NodeID& remote ){ 164 165 void OneHop::onLinkDown(const LinkID& lnk, const NodeID& remote){ 166 166 167 167 // … … 175 175 176 176 for( ; i != iend; i++ ){ 177 if( i->second == l ink ){177 if( i->second == lnk ){ 178 178 overlayNodes.erase( i ); 179 179 break; … … 182 182 } 183 183 184 void OneHop::onLinkUp(const LinkID& l ink, const NodeID& local, const NodeID& remote){184 void OneHop::onLinkUp(const LinkID& lnk, const NodeID& remote){ 185 185 186 186 // … … 189 189 // 190 190 191 if( l ink != bootstrapLink ){191 if( lnk != bootstrapLink ){ 192 192 if( pendingLinks > 0 ) pendingLinks--; 193 193 if( pendingLinks == 0 ) state = OneHopStateCompleted; … … 201 201 202 202 state = OneHopStateJoinListingRequested; 203 baseoverlay.sendMessage( &onemsg, l ink );204 } 205 206 bool OneHop::receiveMessage(const Message* message, const LinkID& link, const NodeID& node){207 208 OneHopMessage* onemsg = const_cast<Message*>(message)->decapsulate<OneHopMessage>();209 if( onemsg == NULL ) return false;203 baseoverlay.sendMessage( &onemsg, lnk ); 204 } 205 206 void OneHop::onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk){ 207 208 OneHopMessage* onemsg = msg.getMessage()->convert<OneHopMessage>(); 209 if( onemsg == NULL ) return; 210 210 211 211 // … … 217 217 NodeListingRequest* request = onemsg->decapsulate<NodeListingRequest>(); 218 218 219 logging_info( "onehop received node listing request from node " << node.toString() );219 logging_info( "onehop received node listing request from node " << remote.toString() ); 220 220 221 221 // … … 223 223 // 224 224 225 overlayNodes.insert( make_pair( node, link) );225 overlayNodes.insert( make_pair(remote, lnk) ); 226 226 227 227 // … … 249 249 250 250 onehopReply.encapsulate( &listingReply ); 251 baseoverlay.sendMessage( &onehopReply, l ink );251 baseoverlay.sendMessage( &onehopReply, lnk ); 252 252 253 253 // … … 256 256 // 257 257 258 eventsReceiver->onNodeJoin( node );258 eventsReceiver->onNodeJoin( remote ); 259 259 260 260 } // if( request != NULL ) … … 268 268 NodeListingReply* reply = onemsg->decapsulate<NodeListingReply>(); 269 269 270 logging_debug( "received node listing reply from node " << node.toString()270 logging_debug( "received node listing reply from node " << remote.toString() 271 271 << " with all overlay nodes. connecting to all of them" ); 272 272 -
source/ariba/overlay/modules/onehop/OneHop.h
r3055 r3057 85 85 86 86 // 87 // see CommunicationListener.h andOverlayInterface.h87 // see CommunicationListener.h or OverlayInterface.h 88 88 // 89 89 90 virtual void onLinkUp( const LinkID& link, const NodeID& local, const NodeID& remote);91 virtual void onLinkDown( const LinkID& link, const NodeID& local, const NodeID& remote);92 virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& node);90 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote); 91 virtual void onLinkDown(const LinkID& lnk, const NodeID& remote); 92 virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk = LinkID::UNSPECIFIED); 93 93 94 94 private:
Note:
See TracChangeset
for help on using the changeset viewer.