// ---------------------------------------------------------------------- void ExtIfaceProcessor:: timeout(shawn::EventScheduler& es, shawn::EventScheduler::EventHandle eh, double time, shawn::EventScheduler::EventTagHandle& tag_handle) throw() { ExtIfaceWiselibEventTag *tag = dynamic_cast<ExtIfaceWiselibEventTag*>( tag_handle.get() ); if ( state() == Active && tag && tag->delegate() ) tag->delegate()( tag->userdata() ); }
// ---------------------------------------------------------------------- void VirtualLinkControl:: timeout( shawn::EventScheduler&, shawn::EventScheduler::EventHandle, double, shawn::EventScheduler::EventTagHandle& eth ) throw() { std::cout << "TIMEOUT AT " << sc_->world().current_time() << std::endl; VirtualLinkMessage *msg = dynamic_cast<VirtualLinkMessage*>( eth.get() ); if ( msg ) { std::cout << "Got VirtualLinkMessage from " << msg->source << std::endl; } else std::cout << "ETH of unknown type" << std::endl; }
//----------------------------------------------------------------------- void FloodRouting:: timeout( shawn::EventScheduler& es, shawn::EventScheduler::EventHandle eh, double time, shawn::EventScheduler::EventTagHandle& eth ) throw() { //FloodRoutingEventTag* et = static_cast<FloodRoutingEventTag*>( eth.get() ); RoutingEventTag* et = static_cast<RoutingEventTag*>( eth.get() ); Node& owner = et->node_w(); FloodRoutingNodeInfo& rni = node_info_w(owner); if( eh == find_sending_jitter_timer( owner, eh ) ) { // Shrink the jitter timer set bool erased = static_cast<bool>( rni.sending_jitter_timer_w().erase( eh ) ); assert( erased ); // Fetch the message ... FloodRoutingMessage* nfrm = static_cast<FloodRoutingMessage*>( et->message_handle().get() ); // .. and send it! INFORM_ROUTING_OBSERVERS( send_flood_routing_message(*this,owner,*nfrm) ); owner.send( nfrm ); } }