output stream object inherits from simple ref count

This commit is contained in:
Craig Dowell
2010-02-08 23:32:23 -08:00
parent d0d718e2f2
commit c4900d84bf
4 changed files with 5 additions and 15 deletions
-12
View File
@@ -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<Object> ()
.AddConstructor<OutputStreamObject> ()
;
return tid;
}
OutputStreamObject::OutputStreamObject ()
: m_ostream (0)
{
+3 -2
View File
@@ -22,6 +22,7 @@
#include <ostream>
#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<OutputStreamObject>
{
public:
static TypeId GetTypeId (void);
+1 -1
View File
@@ -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<OutputStreamObject> streamObject = CreateObject<OutputStreamObject> ();
Ptr<OutputStreamObject> streamObject = Create<OutputStreamObject> ();
streamObject->SetStream (ofstream);
//
+1
View File
@@ -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"),