--- a/samples/main-header.cc Tue Aug 07 08:36:31 2007 +0200
+++ b/samples/main-header.cc Wed Aug 08 09:12:55 2007 +0200
@@ -17,13 +17,13 @@
void SetData (uint16_t data);
uint16_t GetData (void) const;
+
+ std::string GetName (void) const;
+ void Print (std::ostream &os) const;
+ void Serialize (Buffer::Iterator start) const;
+ uint32_t Deserialize (Buffer::Iterator start);
+ uint32_t GetSerializedSize (void) const;
private:
- virtual std::string DoGetName (void) const;
- virtual void PrintTo (std::ostream &os) const;
- virtual void SerializeTo (Buffer::Iterator start) const;
- virtual uint32_t DeserializeFrom (Buffer::Iterator start);
- virtual uint32_t GetSerializedSize (void) const;
-
uint16_t m_data;
};
@@ -47,14 +47,14 @@
}
std::string
-MyHeader::DoGetName (void) const
+MyHeader::GetName (void) const
{
// This string is used to identify the type of
// my header by the packet printing routines.
return "MYHEADER";
}
void
-MyHeader::PrintTo (std::ostream &os) const
+MyHeader::Print (std::ostream &os) const
{
// This method is invoked by the packet printing
// routines to print the content of my header.
@@ -67,14 +67,14 @@
return 2;
}
void
-MyHeader::SerializeTo (Buffer::Iterator start) const
+MyHeader::Serialize (Buffer::Iterator start) const
{
// we can serialize two bytes at the start of the buffer.
// we write them in network byte order.
start.WriteHtonU16 (m_data);
}
uint32_t
-MyHeader::DeserializeFrom (Buffer::Iterator start)
+MyHeader::Deserialize (Buffer::Iterator start)
{
// we can deserialize two bytes from the start of the buffer.
// we read them in network byte order and store them