From c4900d84bf6c4ee88fecb02505425f02c3d64edb Mon Sep 17 00:00:00 2001 From: Craig Dowell Date: Mon, 8 Feb 2010 23:32:23 -0800 Subject: [PATCH] output stream object inherits from simple ref count --- src/common/output-stream-object.cc | 12 ------------ src/common/output-stream-object.h | 5 +++-- src/helper/trace-helper.cc | 2 +- test.py | 1 + 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/common/output-stream-object.cc b/src/common/output-stream-object.cc index 49f438e96..36916a149 100644 --- a/src/common/output-stream-object.cc +++ b/src/common/output-stream-object.cc @@ -23,18 +23,6 @@ NS_LOG_COMPONENT_DEFINE ("OutputStreamObject"); namespace ns3 { -NS_OBJECT_ENSURE_REGISTERED (OutputStreamObject); - -TypeId -OutputStreamObject::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::OutputStreamObject") - .SetParent () - .AddConstructor () - ; - return tid; -} - OutputStreamObject::OutputStreamObject () : m_ostream (0) { diff --git a/src/common/output-stream-object.h b/src/common/output-stream-object.h index 302a76e58..d28b24015 100644 --- a/src/common/output-stream-object.h +++ b/src/common/output-stream-object.h @@ -22,6 +22,7 @@ #include #include "ns3/object.h" #include "ns3/ptr.h" +#include "ns3/simple-ref-count.h" namespace ns3 { @@ -58,7 +59,7 @@ namespace ns3 { * Ptr<> wouldn't understand the operators and we would have to dereference it * to access the underlying object methods. Since we would have to dereference * the Ptr<>, we don't bother and just expect the user to Get a saved pointer - * to an ostream and dereference it him- or herself. As in: + * to an ostream and dereference it him or herself. As in: * * \verbatim * void @@ -69,7 +70,7 @@ namespace ns3 { * } * \endverbatim */ -class OutputStreamObject : public Object +class OutputStreamObject : public SimpleRefCount { public: static TypeId GetTypeId (void); diff --git a/src/helper/trace-helper.cc b/src/helper/trace-helper.cc index f689e5f82..e3bcdb811 100644 --- a/src/helper/trace-helper.cc +++ b/src/helper/trace-helper.cc @@ -205,7 +205,7 @@ AsciiTraceHelper::CreateFileStream (std::string filename, std::string filemode) NS_ABORT_MSG_UNLESS (ofstream->is_open (), "AsciiTraceHelper::CreateFileStream(): Unable to Open " << filename << " for mode " << filemode); - Ptr streamObject = CreateObject (); + Ptr streamObject = Create (); streamObject->SetStream (ofstream); // diff --git a/test.py b/test.py index 9415135b1..81fa14b75 100755 --- a/test.py +++ b/test.py @@ -135,6 +135,7 @@ example_tests = [ ("tutorial/third", "True", "True"), ("tutorial/fourth", "True", "True"), ("tutorial/fifth", "True", "True"), + ("tutorial/sixth", "True", "True"), ("udp/udp-echo", "True", "True"),