sim: Add macros to serialize objects into a section
authorAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 7 Jul 2015 08:51:04 +0000 (09:51 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 7 Jul 2015 08:51:04 +0000 (09:51 +0100)
Add the SERIALIZE_OBJ / UNSERIALIZE_OBJ macros that serialize an
object into a subsection of the current checkpoint section.

src/sim/serialize.hh

index a0d4bafe7490eaf6155b3ef1d1ceb498a059187a..ea2bd2928747442d03f85bdb48d48dfbd3c9a633 100644 (file)
@@ -186,6 +186,8 @@ void fromSimObject(T &t, SimObject *s)
         eventQueue()->checkpointReschedule(&event);     \
     } while(0)
 
+#define SERIALIZE_OBJ(obj) obj.serializeSection(cp, #obj)
+#define UNSERIALIZE_OBJ(obj) obj.unserializeSection(cp, #obj)
 
 #define SERIALIZE_OBJPTR(objptr)        paramOut(cp, #objptr, (objptr)->name())