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

Control access to objects' trace sources. More...

#include "trace-source-accessor.h"

+ Inheritance diagram for ns3::TraceSourceAccessor:
+ Collaboration diagram for ns3::TraceSourceAccessor:

Public Member Functions

 TraceSourceAccessor ()
 Constructor. More...
 
virtual ~TraceSourceAccessor ()
 Destructor. More...
 
virtual bool Connect (ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
 Connect a Callback to a TraceSource with a context string. More...
 
virtual bool ConnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const =0
 Connect a Callback to a TraceSource (without context.) More...
 
virtual bool Disconnect (ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
 Disconnect a Callback from a TraceSource with a context string. More...
 
virtual bool DisconnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const =0
 Disconnect a Callback from a TraceSource (without context). More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< TraceSourceAccessor >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount () const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 

Detailed Description

Control access to objects' trace sources.

This class abstracts the kind of trace source to which we want to connect and provides services to Connect and Disconnect a sink to a trace source.

Definition at line 47 of file trace-source-accessor.h.

Constructor & Destructor Documentation

◆ TraceSourceAccessor()

ns3::TraceSourceAccessor::TraceSourceAccessor ( )

Constructor.

Definition at line 34 of file trace-source-accessor.cc.

◆ ~TraceSourceAccessor()

ns3::TraceSourceAccessor::~TraceSourceAccessor ( )
virtual

Destructor.

Definition at line 38 of file trace-source-accessor.cc.

Member Function Documentation

◆ Connect()

virtual bool ns3::TraceSourceAccessor::Connect ( ObjectBase obj,
std::string  context,
const CallbackBase cb 
) const
pure virtual

Connect a Callback to a TraceSource with a context string.

The context string will be provided as the first argument to the Callback function.

Parameters
[in]objThe object instance which contains the target trace source.
[in]contextThe context to bind to the user callback.
[in]cbThe callback to connect to the target trace source.
Returns
true unless the connection could not be made, typically because the obj couldn't be cast to the correct type.

◆ ConnectWithoutContext()

virtual bool ns3::TraceSourceAccessor::ConnectWithoutContext ( ObjectBase obj,
const CallbackBase cb 
) const
pure virtual

Connect a Callback to a TraceSource (without context.)

Parameters
[in]objThe object instance which contains the target trace source.
[in]cbThe callback to connect to the target trace source.
Returns
true unless the connection could not be made, typically because the obj couldn't be cast to the correct type.

◆ Disconnect()

virtual bool ns3::TraceSourceAccessor::Disconnect ( ObjectBase obj,
std::string  context,
const CallbackBase cb 
) const
pure virtual

Disconnect a Callback from a TraceSource with a context string.

The context string will be provided as the first argument to the Callback function.

Parameters
[in]objthe object instance which contains the target trace source.
[in]contextthe context which was bound to the user callback.
[in]cbthe callback to disconnect from the target trace source.
Returns
true unless the connection could not be made, typically because the obj couldn't be cast to the correct type.

◆ DisconnectWithoutContext()

virtual bool ns3::TraceSourceAccessor::DisconnectWithoutContext ( ObjectBase obj,
const CallbackBase cb 
) const
pure virtual

Disconnect a Callback from a TraceSource (without context).

Parameters
[in]objThe object instance which contains the target trace source.
[in]cbThe callback to disconnect from the target trace source.
Returns
true unless the connection could not be made, typically because the obj couldn't be cast to the correct type.

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