Skip to content

Instantly share code, notes, and snippets.

@MarioPerezEsteso
Created November 16, 2014 19:44
Show Gist options
  • Save MarioPerezEsteso/64e31b6dee225f09d3c6 to your computer and use it in GitHub Desktop.
Save MarioPerezEsteso/64e31b6dee225f09d3c6 to your computer and use it in GitHub Desktop.
Source file for computers in OMNeT++ simulation.
#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