output stream object inherits from simple ref count
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user