A Discrete-Event Network Simulator
API
ns3::AsciiTraceHelperForDevice Class Referenceabstract

Base class providing common user-level ascii trace operations for helpers representing net devices. More...

#include "trace-helper.h"

+ Inheritance diagram for ns3::AsciiTraceHelperForDevice:

Public Member Functions

 AsciiTraceHelperForDevice ()
 Construct an AsciiTraceHelperForDevice. More...
 
virtual ~AsciiTraceHelperForDevice ()
 Destroy an AsciiTraceHelperForDevice. More...
 
void EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (std::string prefix, std::string ndName, bool explicitFilename=false)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, std::string ndName)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (std::string prefix, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (std::string prefix, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t deviceid)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAsciiAll (std::string prefix)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
void EnableAsciiAll (Ptr< OutputStreamWrapper > stream)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
virtual void EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)=0
 Enable ascii trace output on the indicated net device. More...
 

Private Member Functions

void EnableAsciiImpl (Ptr< OutputStreamWrapper > stream, std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id (implementation) More...
 
void EnableAsciiImpl (Ptr< OutputStreamWrapper > stream, std::string prefix, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container (implementation). More...
 
void EnableAsciiImpl (Ptr< OutputStreamWrapper > stream, std::string prefix, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type (implementation). More...
 
void EnableAsciiImpl (Ptr< OutputStreamWrapper > stream, std::string prefix, std::string ndName, bool explicitFilename)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service (implementation). More...
 
void EnableAsciiImpl (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
 Enable ascii trace output the indicated net device (implementation). More...
 

Detailed Description

Base class providing common user-level ascii trace operations for helpers representing net devices.

Definition at line 641 of file trace-helper.h.

Constructor & Destructor Documentation

ns3::AsciiTraceHelperForDevice::AsciiTraceHelperForDevice ( )
inline

Construct an AsciiTraceHelperForDevice.

Definition at line 647 of file trace-helper.h.

virtual ns3::AsciiTraceHelperForDevice::~AsciiTraceHelperForDevice ( )
inlinevirtual

Destroy an AsciiTraceHelperForDevice.

Definition at line 652 of file trace-helper.h.

References sample-rng-plot::n.

Member Function Documentation

void ns3::AsciiTraceHelperForDevice::EnableAscii ( std::string  prefix,
Ptr< NetDevice nd,
bool  explicitFilename = false 
)

Enable ascii trace output on the indicated net device.

Parameters
prefixFilename prefix to use for ascii files.
ndNet device for which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Definition at line 469 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( Ptr< OutputStreamWrapper stream,
Ptr< NetDevice nd 
)

Enable ascii trace output on the indicated net device.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
ndNet device for which you want to enable tracing.

Definition at line 478 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( std::string  prefix,
std::string  ndName,
bool  explicitFilename = false 
)

Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service.

Parameters
prefixfilename prefix to use for ascii files.
ndNameThe name of the net device in which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Definition at line 487 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( Ptr< OutputStreamWrapper stream,
std::string  ndName 
)

Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
ndNameThe name of the net device in which you want to enable tracing.

Definition at line 496 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( std::string  prefix,
NetDeviceContainer  d 
)

Enable ascii trace output on each device in the container which is of the appropriate type.

Parameters
prefixFilename prefix to use for ascii files.
dcontainer of devices

Definition at line 519 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( Ptr< OutputStreamWrapper stream,
NetDeviceContainer  d 
)

Enable ascii trace output on each device in the container which is of the appropriate type.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
dcontainer of devices

Definition at line 528 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( std::string  prefix,
NodeContainer  n 
)

Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container.

Parameters
prefixFilename prefix to use for ascii files.
ncontainer of nodes.

Definition at line 550 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( Ptr< OutputStreamWrapper stream,
NodeContainer  n 
)

Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
ncontainer of nodes.

Definition at line 559 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( std::string  prefix,
uint32_t  nodeid,
uint32_t  deviceid,
bool  explicitFilename 
)

Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id.

Parameters
prefixFilename prefix to use when creating ascii trace files
nodeidThe node identifier/number of the node on which to enable ascii tracing
deviceidThe device identifier/index of the device on which to enable ascii tracing
explicitFilenameTreat the prefix as an explicit filename if true

Definition at line 613 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAscii ( Ptr< OutputStreamWrapper stream,
uint32_t  nodeid,
uint32_t  deviceid 
)

Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
nodeidThe node identifier/number of the node on which to enable ascii tracing
deviceidThe device identifier/index of the device on which to enable ascii tracing

Definition at line 604 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAsciiAll ( std::string  prefix)

Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation.

Parameters
prefixFilename prefix to use for ascii files.

Definition at line 586 of file trace-helper.cc.

References ns3::NodeContainer::GetGlobal().

Referenced by CourseChangeCallback(), DsdvManetExample::CreateDevices(), DsdvqManetExample::CreateDevices(), MeshTest::CreateNodes(), CwndTracer(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), GenerateTraffic(), IpAddressHelper::PrintIpAddresses(), StackHelper::PrintRoutingTable(), Experiment::Run(), SendPacket(), SetTimeout(), VanetRoutingExperiment::SetupAdhocDevices(), SinkRx(), StateChangeNotification(), TearDownLink(), and Tunnel::Tunnel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::AsciiTraceHelperForDevice::EnableAsciiAll ( Ptr< OutputStreamWrapper stream)

Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.

Definition at line 595 of file trace-helper.cc.

References ns3::NodeContainer::GetGlobal().

+ Here is the call graph for this function:

void ns3::AsciiTraceHelperForDevice::EnableAsciiImpl ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
uint32_t  nodeid,
uint32_t  deviceid,
bool  explicitFilename 
)
private

Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id (implementation)

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixFilename prefix to use for ascii trace files.
nodeidThe node identifier/number of the node on which to enable ascii tracing
deviceidThe device identifier/index of the device on which to enable ascii tracing
explicitFilenameTreat the prefix as an explicit filename if true

Definition at line 626 of file trace-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Node::GetDevice(), ns3::NodeContainer::GetGlobal(), ns3::Node::GetId(), ns3::Node::GetNDevices(), sample-rng-plot::n, and NS_ABORT_MSG_IF.

+ Here is the call graph for this function:

void ns3::AsciiTraceHelperForDevice::EnableAsciiImpl ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
NodeContainer  n 
)
private

Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container (implementation).

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixFilename prefix to use for ascii files.
ncontainer of nodes.

Definition at line 568 of file trace-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Node::GetDevice(), and ns3::Node::GetNDevices().

+ Here is the call graph for this function:

void ns3::AsciiTraceHelperForDevice::EnableAsciiImpl ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
NetDeviceContainer  d 
)
private

Enable ascii trace output on each device in the container which is of the appropriate type (implementation).

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixFilename prefix to use for ascii files.
dcontainer of devices

Definition at line 537 of file trace-helper.cc.

References ns3::NetDeviceContainer::Begin(), and ns3::NetDeviceContainer::End().

+ Here is the call graph for this function:

void ns3::AsciiTraceHelperForDevice::EnableAsciiImpl ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
std::string  ndName,
bool  explicitFilename 
)
private

Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service (implementation).

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixfilename prefix to use for ascii files.
ndNameThe name of the net device in which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Definition at line 505 of file trace-helper.cc.

void ns3::AsciiTraceHelperForDevice::EnableAsciiImpl ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< NetDevice nd,
bool  explicitFilename 
)
private

Enable ascii trace output the indicated net device (implementation).

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixfilename prefix to use for ascii files.
ndNet device for which you want to enable tracing
explicitFilenameTreat the prefix as an explicit filename if true
virtual void ns3::AsciiTraceHelperForDevice::EnableAsciiInternal ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< NetDevice nd,
bool  explicitFilename 
)
pure virtual

Enable ascii trace output on the indicated net device.

The implementation is expected to use a provided Ptr<OutputStreamWrapper> if it is non-null. If the OutputStreamWrapper is null, the implementation is expected to use a provided prefix to construct a new file name for each net device using the rules described in the class overview.

If the prefix is provided, there will be one file per net device created. In this case, adding a trace context to the file would be pointless, so the device implementation is expected to TraceConnectWithoutContext.

If the output stream object is provided, there may be many different devices writing to a single file. In this case, the device adding a trace context could be important, so the device implementation is expected to TraceConnect.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixFilename prefix to use for ascii trace files.
ndNet device for which you want to enable tracing
explicitFilenameTreat the prefix as an explicit filename if true

Implemented in ns3::WimaxHelper, ns3::QKDHelper, ns3::CsmaHelper, ns3::WifiPhyHelper, ns3::LrWpanHelper, ns3::PointToPointHelper, ns3::FdNetDeviceHelper, and ns3::YansWavePhyHelper.


The documentation for this class was generated from the following files: