From bc949ffea7cdbb899cc5f51ea9788fed51f6473f Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Mon, 10 Apr 2017 17:15:05 -0400 Subject: [PATCH] implement event class --- readme.md | 1 - src/event.cpp | 13 +++++++++++++ src/event.h | 11 +++++------ src/pQueue.cpp | 1 - src/pQueue.h | 8 -------- 5 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 src/pQueue.cpp delete mode 100644 src/pQueue.h diff --git a/readme.md b/readme.md index fce41c4..3b14e0c 100644 --- a/readme.md +++ b/readme.md @@ -2,5 +2,4 @@ # TODO * implement vector file parsing -* develop pQueue class * define all classes more completely diff --git a/src/event.cpp b/src/event.cpp index e69de29..d5a29a5 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -0,0 +1,13 @@ +#include "event.h" + +using namespace std; + +event::event(event, value, setTime, wire) : evNum(event), evValue(value), + evTime(setTime), wireNum(wire) {} + +bool event::operator<(const event &e1, const event &e2) { + if(e1.evTime == e2.evTime) { + return e1.evNum > e2.evNum; + } + return e1.evTime > e2.evTime; +} diff --git a/src/event.h b/src/event.h index b18d13f..f7822b0 100644 --- a/src/event.h +++ b/src/event.h @@ -2,12 +2,11 @@ #define EVENT class event { - /* TODO: - * event number - * value - * time - * wire number - */ + public: + event(event, value, setTime, wire); + bool operator<(const event &e1, const event &e2); + private: + int evNum, evValue, evTime, wireNum; }; #endif // !EVENT diff --git a/src/pQueue.cpp b/src/pQueue.cpp deleted file mode 100644 index e8699b4..0000000 --- a/src/pQueue.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pQueue.h" diff --git a/src/pQueue.h b/src/pQueue.h deleted file mode 100644 index a5c8b34..0000000 --- a/src/pQueue.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef pQUEUE -#define pQUEUE - -class pQueue { - //TODO -}; - -#endif // !pQUEUE