diff --git a/src/common/packet.cc b/src/common/packet.cc index 965aef584..5caacc09e 100644 --- a/src/common/packet.cc +++ b/src/common/packet.cc @@ -144,7 +144,7 @@ Packet::EnableMetadata (void) } Buffer -Packet::Serialize (void) +Packet::Serialize (void) const { Buffer buffer = m_buffer.CreateFullCopy (); buffer.AddAtStart (4); diff --git a/src/common/packet.h b/src/common/packet.h index 03400ca03..f4b0af11d 100644 --- a/src/common/packet.h +++ b/src/common/packet.h @@ -281,7 +281,30 @@ public: */ static void EnableMetadata (void); - Buffer Serialize (void); + /** + * \returns a byte buffer + * + * This method creates a serialized representation of a Packet object + * ready to be transmitted over a network to another system. This + * serialized representation contains a copy of the packet byte buffer, + * the tag list, and the packet metadata (if there is one). + * + * This method will typically be used by parallel simulations where + * the simulated system is partitioned and each partition runs on + * a different CPU. + */ + Buffer Serialize (void) const; + /** + * \param a byte buffer + * + * This method reads a byte buffer as created by Packet::Serialize + * and restores the state of the Packet to what it was prio to + * calling Serialize. + * + * This method will typically be used by parallel simulations where + * the simulated system is partitioned and each partition runs on + * a different CPU. + */ void Deserialize (Buffer buffer); private: Packet (Buffer buffer, Tags tags, PacketMetadata metadata);