Add support for serialization
--HG-- extra : convert_revision : ff6c93ee2f4e6aeb5a824958c52f62d6c2a1cdfd
This commit is contained in:
parent
101aa8090a
commit
9dac0d3c56
2 changed files with 24 additions and 0 deletions
|
@ -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 §ion)
|
||||
{
|
||||
UNSERIALIZE_SCALAR(pfd.fd);
|
||||
UNSERIALIZE_SCALAR(pfd.events);
|
||||
UNSERIALIZE_SCALAR(enabled);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//
|
||||
PollQueue::PollQueue()
|
||||
|
|
|
@ -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 §ion);
|
||||
};
|
||||
|
||||
class PollQueue
|
||||
|
|
Loading…
Reference in a new issue