Created
November 16, 2014 19:44
-
-
Save MarioPerezEsteso/64e31b6dee225f09d3c6 to your computer and use it in GitHub Desktop.
Source file for computers in OMNeT++ simulation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <omnetpp.h> | |
class computer : public cSimpleModule { | |
protected: | |
virtual void initialize(); | |
virtual void handleMessage(cMessage *msg); | |
}; | |
Define_Module(computer); | |
void computer::initialize() { | |
if (strcmp("computer1", getName()) == 0) { | |
cMessage *msg = new cMessage("tictocMsg"); | |
send(msg, "out"); | |
} | |
} | |
void computer::handleMessage(cMessage *msg) { | |
send(msg, "out"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment