A Discrete-Event Network Simulator
API
packet-burst.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  */
20 
21 #ifndef PACKET_BURST_H
22 #define PACKET_BURST_H
23 
24 #include <stdint.h>
25 #include <list>
26 #include "ns3/object.h"
27 
28 namespace ns3 {
29 
30 class Packet;
31 
35 class PacketBurst : public Object
36 {
37 public:
42  static TypeId GetTypeId (void);
43  PacketBurst (void);
44  virtual ~PacketBurst (void);
48  Ptr<PacketBurst> Copy (void) const;
53  void AddPacket (Ptr<Packet> packet);
57  std::list<Ptr<Packet> > GetPackets (void) const;
61  uint32_t GetNPackets (void) const;
65  uint32_t GetSize (void) const;
66 
71  std::list<Ptr<Packet> >::const_iterator Begin (void) const;
76  std::list<Ptr<Packet> >::const_iterator End (void) const;
77 
83  typedef void (* TracedCallback)(Ptr<const PacketBurst> burst);
84 
85 
86 private:
87  void DoDispose (void);
88  std::list<Ptr<Packet> > m_packets;
89 };
90 } // namespace ns3
91 
92 #endif /* PACKET_BURST */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
std::list< Ptr< Packet > > m_packets
the list of packets in the burst
Definition: packet-burst.h:88
Forward calls to a chain of Callback.
std::list< Ptr< Packet > > GetPackets(void) const
Definition: packet-burst.cc:92
uint32_t GetNPackets(void) const
Definition: packet-burst.cc:99
std::list< Ptr< Packet > >::const_iterator End(void) const
Returns an iterator to the end of the burst.
void DoDispose(void)
Destructor implementation.
Definition: packet-burst.cc:61
void AddPacket(Ptr< Packet > packet)
add a packet to the list of packet
Definition: packet-burst.cc:82
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~PacketBurst(void)
Definition: packet-burst.cc:49
static TypeId GetTypeId(void)
Get the type ID.
Definition: packet-burst.cc:34
std::list< Ptr< Packet > >::const_iterator Begin(void) const
Returns an iterator to the begin of the burst.
Ptr< PacketBurst > Copy(void) const
Definition: packet-burst.cc:67
this class implement a burst as a list of packets
Definition: packet-burst.h:35
A base class which provides memory management and object aggregation.
Definition: object.h:87
uint32_t GetSize(void) const
a unique identifier for an interface.
Definition: type-id.h:58