A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
48  void PacketUpdate (std::string path, Ptr<const Packet> packet);
49 
58  void FrameUpdate (std::string path, Ptr<const Packet> packet,
59  Mac48Address realto);
60 
61 protected:
62  virtual void DoDispose (void);
63 
64  // end class PacketCounterCalculator
65 };
66 
67 
75  public MinMaxAvgTotalCalculator<uint32_t> {
76 public:
79 
86  void PacketUpdate (std::string path, Ptr<const Packet> packet);
87 
95  void FrameUpdate (std::string path, Ptr<const Packet> packet,
96  Mac48Address realto);
97 
98 protected:
99  virtual void DoDispose (void);
100 
101  // end class PacketSizeMinMaxAvgTotalCalculator
102 };
103 
104 
105 // end namespace ns3
106 };
107 
108 
109 #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)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
A stat for collecting packet size statistics: min, max and average.
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:41
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.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...