A Discrete-Event Network Simulator
API
packet-data-calculators.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 Drexel University
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: Joe Kopena (tjkopena@cs.drexel.edu)
19  */
20 
21 #ifndef PACKET_DATA_CALCULATORS_H
22 #define PACKET_DATA_CALCULATORS_H
23 
24 #include "ns3/packet.h"
25 #include "ns3/mac48-address.h"
26 #include "ns3/data-calculator.h"
27 #include "ns3/basic-data-calculators.h"
28 
29 namespace ns3 {
30 
37 class PacketCounterCalculator : public CounterCalculator<uint32_t> {
38 public:
40  virtual ~PacketCounterCalculator();
41 
46  static TypeId GetTypeId (void);
47 
54  void PacketUpdate (std::string path, Ptr<const Packet> packet);
55 
64  void FrameUpdate (std::string path, Ptr<const Packet> packet,
65  Mac48Address realto);
66 
67 protected:
68  virtual void DoDispose (void);
69 
70  // end class PacketCounterCalculator
71 };
72 
73 
81  public MinMaxAvgTotalCalculator<uint32_t>
82 {
83 public:
86 
91  static TypeId GetTypeId (void);
92 
99  void PacketUpdate (std::string path, Ptr<const Packet> packet);
100 
108  void FrameUpdate (std::string path, Ptr<const Packet> packet,
109  Mac48Address realto);
110 
111 protected:
112  virtual void DoDispose (void);
113 
114  // end class PacketSizeMinMaxAvgTotalCalculator
115 };
116 
117 
118 // end namespace ns3
119 };
120 
121 
122 #endif /* PACKET_DATA_CALCULATORS_H */
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet stats by the size of the packet.
virtual void DoDispose(void)
Destructor implementation.
static TypeId GetTypeId(void)
Register this type.
A stat for collecting packet size statistics: min, max and average.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Template class MinMaxAvgTotalCalculator.
void PacketUpdate(std::string path, Ptr< const Packet > packet)
Increments the packet counter by one.
an EUI-48 address
Definition: mac48-address.h:43
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet stats by the size of the packet.
A stat for counting packets.
void FrameUpdate(std::string path, Ptr< const Packet > packet, Mac48Address realto)
Increments the packet counter by one.
Template class CounterCalculator.
static TypeId GetTypeId(void)
Register this type.
virtual void DoDispose(void)
Destructor implementation.
a unique identifier for an interface.
Definition: type-id.h:58