A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
virtual ~TraceSourceAccessor ()
 Destructor.
 
virtual bool Connect (ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
 Connect a Callback to a TraceSource with a context string.
 
virtual bool ConnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const =0
 Connect a Callback to a TraceSource (without context.)
 
virtual bool Disconnect (ObjectBase *obj, std::string context, const CallbackBase &cb) const =0
 Disconnect a Callback from a TraceSource with a context string.
 
virtual bool DisconnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const =0
 Disconnect a Callback from a TraceSource (without context).
 
- Public Member Functions inherited from ns3::SimpleRefCount< TraceSourceAccessor >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

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: