I3Multicast Class Reference

Simple module to test I3 multicast capabilities. More...

Inheritance diagram for I3Multicast:
I3BaseApp

List of all members.

Public Member Functions

void initializeApp (int stage)
 App initialization - should be overwritten by application.
void initializeI3 ()
 Application I3 initialize - should be overwritten by application.
void deliver (I3Trigger &trigger, I3IdentifierStack &stack, cPacket *msg)
 Delivers packets coming from I3 - should be overwritten by application.
void handleTimerEvent (cMessage *msg)
 Handles timers - should be overwritten by application.

Public Attributes

cMessage * sendPacketTimer

Detailed Description

Simple module to test I3 multicast capabilities.

All nodes register the same identifier, then one node sends a message to that identifier. All participating nodes receive the packet .

Definition at line 33 of file I3Multicast.cc.


Member Function Documentation

void I3Multicast::deliver ( I3Trigger trigger,
I3IdentifierStack stack,
cPacket *  msg 
) [virtual]

Delivers packets coming from I3 - should be overwritten by application.

Parameters:
trigger Application trigger to which the packet was sent
stack Identifier stack passed from I3
msg Arriving message

Reimplemented from I3BaseApp.

Definition at line 58 of file I3Multicast.cc.

00059 {
00060     getParentModule()->bubble("Got a message!");
00061     delete msg;
00062 }

void I3Multicast::handleTimerEvent ( cMessage *  msg  )  [virtual]

Handles timers - should be overwritten by application.

Parameters:
msg Timer to be handled

Reimplemented from I3BaseApp.

Definition at line 64 of file I3Multicast.cc.

00065 {
00066     if (msg == sendPacketTimer) {
00067         cPacket *cmsg = new cPacket("woot");
00068         I3Identifier id("whee");
00069 
00070         getParentModule()->bubble("Sending message!");
00071         sendPacket(id, cmsg);
00072         scheduleAt(simTime() + 20, sendPacketTimer);
00073     } else delete msg;
00074 }

void I3Multicast::initializeApp ( int  stage  )  [virtual]

App initialization - should be overwritten by application.

I3 related commands should go in initializeI3.

Parameters:
stage Initialization stage passed from initialize()

Reimplemented from I3BaseApp.

Definition at line 44 of file I3Multicast.cc.

00045 {
00046 }

void I3Multicast::initializeI3 (  )  [virtual]

Application I3 initialize - should be overwritten by application.

Reimplemented from I3BaseApp.

Definition at line 48 of file I3Multicast.cc.

00049 {
00050     sendPacketTimer = new cMessage("packet timer");
00051     scheduleAt(simTime() + 20, sendPacketTimer);
00052 
00053     I3Identifier identifier("whee");
00054     insertTrigger(identifier);
00055 }


Member Data Documentation

Definition at line 36 of file I3Multicast.cc.

Referenced by handleTimerEvent(), and initializeI3().


The documentation for this class was generated from the following file:
Generated on Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3