More documentation for 1.1 release.
[gem5.git] / dev / etherpkt.cc
index 273b8ee646ddc91de159b48148adda49bb98df80..5dee7dc0df43463981f31e7d8b410dc97e8d4e79 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004 The Regents of The University of Michigan
+ * Copyright (c) 2004-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 #include <iostream>
 
+#include "base/misc.hh"
 #include "dev/etherpkt.hh"
 #include "sim/serialize.hh"
 
 using namespace std;
 
 void
-PacketData::serialize(ostream &os)
+PacketData::serialize(const string &base, ostream &os)
 {
-    SERIALIZE_SCALAR(length);
-    SERIALIZE_ARRAY(data, length);
+    paramOut(os, base + ".length", length);
+    arrayParamOut(os, base + ".data", data, length);
 }
 
 void
-PacketData::unserialize(Checkpoint *cp, const string &section)
+PacketData::unserialize(const string &base, Checkpoint *cp,
+                        const string &section)
 {
-    UNSERIALIZE_SCALAR(length);
-    data = new uint8_t[length];
-    UNSERIALIZE_ARRAY(data, length);
+    paramIn(cp, section, base + ".length", length);
+    if (length)
+        arrayParamIn(cp, section, base + ".data", data, length);
 }