Index: src/stats/model/collector.cc |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/src/stats/model/collector.cc |
@@ -0,0 +1,98 @@ |
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
+/* |
+ * Copyright (c) 2015 Bucknell University |
+ * |
+ * This program is free software; you can redistribute it and/or modify |
+ * it under the terms of the GNU General Public License version 2 as |
+ * published by the Free Software Foundation; |
+ * |
+ * This program is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ * GNU General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU General Public License |
+ * along with this program; if not, write to the Free Software |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+ * |
+ * Author: Li Li (ll024@bucknell.edu) |
+ */ |
+ |
+#include <cmath> |
+#include <cfloat> |
buherman
2015/06/29 08:53:53
cmath and cfloat are not needed in this file.
|
+ |
+#include "ns3/object.h" |
+#include "ns3/log.h" |
+#include "ns3/boolean.h" |
+#include "ns3/uinteger.h" |
+#include "ns3/simulator.h" |
+#include "ns3/collector.h" |
+ |
+ |
+NS_LOG_COMPONENT_DEFINE ("Collector"); |
+ |
+namespace ns3 { |
+ |
+NS_OBJECT_ENSURE_REGISTERED (Collector); |
+ |
+TypeId |
+Collector::GetTypeId (void) |
+{ |
+ static TypeId tid = TypeId ("ns3::Collector") |
+ .SetParent<DataCollectionObject> (); |
+ return tid; |
+} |
+ |
+Collector::Collector () |
+{ |
+ NS_LOG_FUNCTION (this); |
+} |
+ |
+Collector::~Collector () |
+{ |
+ NS_LOG_FUNCTION (this); |
+} |
+ |
+void |
+Collector::TraceSinkBoolean (bool oldValue, bool newValue) |
+{ |
+ NS_LOG_FUNCTION (this << oldValue << newValue); |
+ TraceSinkDouble (oldValue, newValue); |
+} |
+ |
+void |
+Collector::TraceSinkUinteger32 (uint32_t oldValue, uint32_t newValue) |
+{ |
+ NS_LOG_FUNCTION (this << oldValue << newValue); |
+ TraceSinkDouble (oldValue, newValue); |
+} |
+ |
+void |
+Collector::TraceSinkUinteger16 (uint16_t oldValue, uint16_t newValue) |
+{ |
+ NS_LOG_FUNCTION (this << oldValue << newValue); |
+ TraceSinkDouble (oldValue, newValue); |
+} |
+ |
+void |
+Collector::TraceSinkUinteger8 (uint8_t oldValue, uint8_t newValue) |
+{ |
+ NS_LOG_FUNCTION (this << oldValue << newValue); |
+ TraceSinkDouble (oldValue, newValue); |
+} |
+ |
+void |
+Collector::TraceSinkSequenceNumber32 (SequenceNumber32 &oldValue, SequenceNumber32 &newValue) |
+{ |
+ NS_LOG_FUNCTION (this << oldValue << newValue); |
+ TraceSinkDouble (oldValue.GetValue (), newValue.GetValue ()); |
+} |
+ |
+void |
+Collector::TraceSinkTime (Time &oldValue, Time &newValue) |
+{ |
+ NS_LOG_FUNCTION (this << oldValue << newValue); |
+ TraceSinkDouble (oldValue.GetSeconds (), newValue.GetSeconds ()); |
+} |
+ |
+} |