--- a/src/common/tag.h Tue May 06 14:54:44 2008 -0700
+++ b/src/common/tag.h Tue May 06 14:54:52 2008 -0700
@@ -7,13 +7,34 @@
namespace ns3 {
+/**
+ * \brief tag a set of bytes in a packet
+ *
+ * New kinds of tags can be created by subclassing this base class.
+ */
class Tag : public ObjectBase
{
public:
static TypeId GetTypeId (void);
+ /**
+ * \returns the number of bytes required to serialize the data of the tag.
+ *
+ * This method is typically invoked by Packet::AddTag just prior to calling
+ * Tag::Serialize.
+ */
virtual uint32_t GetSerializedSize (void) const = 0;
+ /**
+ * \param i the buffer to write data into.
+ *
+ * Write the content of the tag in the provided tag buffer.
+ */
virtual void Serialize (TagBuffer i) const = 0;
+ /**
+ * \param i the buffer to read data from.
+ *
+ * Read the content of the tag from the provided tag buffer.
+ */
virtual void Deserialize (TagBuffer i) = 0;
};