Files
unison/src/common/header.cc

69 lines
1.5 KiB
C++
Raw Normal View History

2006-11-01 13:11:30 +01:00
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2006-10-02 11:23:18 +02:00
/*
* Copyright (c) 2005 INRIA
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#include "header.h"
#include <cassert>
namespace ns3 {
Header::Header ()
2006-11-01 13:11:30 +01:00
: m_isDeserialized (false) {}
2006-10-02 11:23:18 +02:00
void
2006-10-06 13:37:25 +02:00
Header::Print (std::ostream &os) const
2006-10-02 11:23:18 +02:00
{
2006-11-01 13:11:30 +01:00
PrintTo (os);
2006-10-02 11:23:18 +02:00
}
uint32_t
2006-10-06 13:37:25 +02:00
Header::GetSize (void) const
2006-10-02 11:23:18 +02:00
{
2006-11-01 13:11:30 +01:00
return GetSerializedSize ();
2006-10-02 11:23:18 +02:00
}
void
2006-10-06 13:37:25 +02:00
Header::Serialize (Buffer::Iterator start) const
2006-10-02 11:23:18 +02:00
{
2006-11-01 13:11:30 +01:00
SerializeTo (start);
2006-10-02 11:23:18 +02:00
}
void
2006-10-06 13:37:25 +02:00
Header::Deserialize (Buffer::Iterator start)
2006-10-02 11:23:18 +02:00
{
2006-11-01 13:11:30 +01:00
DeserializeFrom (start);
m_isDeserialized = true;
2006-10-02 11:23:18 +02:00
}
bool
2006-10-06 13:37:25 +02:00
Header::IsDeserialized (void) const
2006-10-02 11:23:18 +02:00
{
2006-11-01 13:11:30 +01:00
return m_isDeserialized;
2006-10-02 11:23:18 +02:00
}
Header::~Header ()
{}
std::ostream& operator<< (std::ostream& os, Header const& header)
{
2006-11-01 13:11:30 +01:00
header.Print (os);
return os;
2006-10-02 11:23:18 +02:00
}
}; // namespace ns3