OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2015 Bucknell 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: Li Li (ll024@bucknell.edu) |
| 19 */ |
| 20 |
| 21 #include <cmath> |
| 22 #include <cfloat> |
| 23 |
| 24 #include "ns3/object.h" |
| 25 #include "ns3/log.h" |
| 26 #include "ns3/boolean.h" |
| 27 #include "ns3/uinteger.h" |
| 28 #include "ns3/simulator.h" |
| 29 #include "ns3/collector.h" |
| 30 |
| 31 |
| 32 NS_LOG_COMPONENT_DEFINE ("Collector"); |
| 33 |
| 34 namespace ns3 { |
| 35 |
| 36 NS_OBJECT_ENSURE_REGISTERED (Collector); |
| 37 |
| 38 TypeId |
| 39 Collector::GetTypeId (void) |
| 40 { |
| 41 static TypeId tid = TypeId ("ns3::Collector") |
| 42 .SetParent<DataCollectionObject> (); |
| 43 return tid; |
| 44 } |
| 45 |
| 46 Collector::Collector () |
| 47 { |
| 48 NS_LOG_FUNCTION (this); |
| 49 } |
| 50 |
| 51 Collector::~Collector () |
| 52 { |
| 53 NS_LOG_FUNCTION (this); |
| 54 } |
| 55 |
| 56 void |
| 57 Collector::TraceSinkBoolean (bool oldValue, bool newValue) |
| 58 { |
| 59 NS_LOG_FUNCTION (this << oldValue << newValue); |
| 60 TraceSinkDouble (oldValue, newValue); |
| 61 } |
| 62 |
| 63 void |
| 64 Collector::TraceSinkUinteger32 (uint32_t oldValue, uint32_t newValue) |
| 65 { |
| 66 NS_LOG_FUNCTION (this << oldValue << newValue); |
| 67 TraceSinkDouble (oldValue, newValue); |
| 68 } |
| 69 |
| 70 void |
| 71 Collector::TraceSinkUinteger16 (uint16_t oldValue, uint16_t newValue) |
| 72 { |
| 73 NS_LOG_FUNCTION (this << oldValue << newValue); |
| 74 TraceSinkDouble (oldValue, newValue); |
| 75 } |
| 76 |
| 77 void |
| 78 Collector::TraceSinkUinteger8 (uint8_t oldValue, uint8_t newValue) |
| 79 { |
| 80 NS_LOG_FUNCTION (this << oldValue << newValue); |
| 81 TraceSinkDouble (oldValue, newValue); |
| 82 } |
| 83 |
| 84 void |
| 85 Collector::TraceSinkSequenceNumber32 (SequenceNumber32 &oldValue, SequenceNumber
32 &newValue) |
| 86 { |
| 87 NS_LOG_FUNCTION (this << oldValue << newValue); |
| 88 TraceSinkDouble (oldValue.GetValue (), newValue.GetValue ()); |
| 89 } |
| 90 |
| 91 void |
| 92 Collector::TraceSinkTime (Time &oldValue, Time &newValue) |
| 93 { |
| 94 NS_LOG_FUNCTION (this << oldValue << newValue); |
| 95 TraceSinkDouble (oldValue.GetSeconds (), newValue.GetSeconds ()); |
| 96 } |
| 97 |
| 98 } |
OLD | NEW |