summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/pollevent.cc19
-rw-r--r--base/pollevent.hh5
2 files changed, 24 insertions, 0 deletions
diff --git a/base/pollevent.cc b/base/pollevent.cc
index 45a32581f..619bda887 100644
--- a/base/pollevent.cc
+++ b/base/pollevent.cc
@@ -38,6 +38,9 @@
#include "base/misc.hh"
#include "base/pollevent.hh"
#include "sim/universe.hh"
+#include "sim/serialize.hh"
+
+using namespace std;
PollQueue pollQueue;
@@ -76,6 +79,22 @@ PollEvent::enable()
queue->copy();
}
+void
+PollEvent::serialize(ostream &os)
+{
+ SERIALIZE_SCALAR(pfd.fd);
+ SERIALIZE_SCALAR(pfd.events);
+ SERIALIZE_SCALAR(enabled);
+}
+
+void
+PollEvent::unserialize(Checkpoint *cp, const std::string &section)
+{
+ UNSERIALIZE_SCALAR(pfd.fd);
+ UNSERIALIZE_SCALAR(pfd.events);
+ UNSERIALIZE_SCALAR(enabled);
+}
+
/////////////////////////////////////////////////////
//
PollQueue::PollQueue()
diff --git a/base/pollevent.hh b/base/pollevent.hh
index 393c53996..7ea5b83f4 100644
--- a/base/pollevent.hh
+++ b/base/pollevent.hh
@@ -33,6 +33,8 @@
#include <poll.h>
#include "sim/universe.hh"
+class Checkpoint;
+
class PollEvent
{
private:
@@ -52,6 +54,9 @@ class PollEvent
virtual void process(int revent) = 0;
bool queued() { return queue != 0; }
+
+ virtual void serialize(std::ostream &os);
+ virtual void unserialize(Checkpoint *cp, const std::string &section);
};
class PollQueue