src/common/trailer.cc
changeset 150 663120712cd9
parent 131 f4fb87e77034
child 180 3e6bfa625fb7
equal deleted inserted replaced
149:d5b12472c5e2 150:663120712cd9
     1 /* -*- Mode:NS3; -*- */
     1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
     2 /*
     2 /*
     3  * Copyright (c) 2005 INRIA
     3  * Copyright (c) 2005 INRIA
     4  * All rights reserved.
     4  * All rights reserved.
     5  *
     5  *
     6  * This program is free software; you can redistribute it and/or modify
     6  * This program is free software; you can redistribute it and/or modify
    23 #include <cassert>
    23 #include <cassert>
    24 
    24 
    25 namespace ns3 {
    25 namespace ns3 {
    26 
    26 
    27 Trailer::Trailer ()
    27 Trailer::Trailer ()
    28     : m_isDeserialized (false) {}
    28   : m_isDeserialized (false) {}
    29 
    29 
    30 void 
    30 void 
    31 Trailer::Print (std::ostream &os) const
    31 Trailer::Print (std::ostream &os) const
    32 {
    32 {
    33     PrintTo (os);
    33   PrintTo (os);
    34 }
    34 }
    35 uint32_t
    35 uint32_t
    36 Trailer::GetSize (void) const
    36 Trailer::GetSize (void) const
    37 {
    37 {
    38     return GetSerializedSize ();
    38   return GetSerializedSize ();
    39 }
    39 }
    40 void 
    40 void 
    41 Trailer::Serialize (Buffer::Iterator start) const
    41 Trailer::Serialize (Buffer::Iterator start) const
    42 {
    42 {
    43     SerializeTo (start);
    43   SerializeTo (start);
    44 }
    44 }
    45 void 
    45 void 
    46 Trailer::Deserialize (Buffer::Iterator start)
    46 Trailer::Deserialize (Buffer::Iterator start)
    47 {
    47 {
    48     DeserializeFrom (start);
    48   DeserializeFrom (start);
    49     m_isDeserialized = true;
    49   m_isDeserialized = true;
    50 }
    50 }
    51 bool 
    51 bool 
    52 Trailer::IsDeserialized (void) const
    52 Trailer::IsDeserialized (void) const
    53 {
    53 {
    54     return m_isDeserialized;
    54   return m_isDeserialized;
    55 }
    55 }
    56 
    56 
    57 
    57 
    58 
    58 
    59 Trailer::~Trailer ()
    59 Trailer::~Trailer ()
    60 {}
    60 {}
    61 
    61 
    62 std::ostream& operator<< (std::ostream& os, Trailer const& trailer)
    62 std::ostream& operator<< (std::ostream& os, Trailer const& trailer)
    63 {
    63 {
    64     trailer.Print (os);
    64   trailer.Print (os);
    65     return os;
    65   return os;
    66 }
    66 }
    67 
    67 
    68 }; // namespace ns3
    68 }; // namespace ns3