ns3::SatSinrProbe Class Reference

Probe to translate from a TraceSource to two more easily parsed TraceSources. More...

#include "satellite-sinr-probe.h"

+ Inheritance diagram for ns3::SatSinrProbe:
+ Collaboration diagram for ns3::SatSinrProbe:

Public Types

typedef void(* SinrCallback) (double sinr, const Address &from)
 Callback signature for SINR and an address. More...
 

Public Member Functions

 SatSinrProbe ()
 Default constructor. More...
 
virtual ~SatSinrProbe ()
 Destructor for SatSinrProbe. More...
 
virtual bool ConnectByObject (std::string traceSource, Ptr< Object > obj)
 connect to a trace source attribute provided by a given object More...
 
virtual void ConnectByPath (std::string path)
 connect to a trace source provided by a config path More...
 
void SetValue (double sinrDb, const Address &address)
 Set a probe value. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
static void SetValueByPath (std::string path, double sinrDb, const Address &address)
 Set a probe value by its name in the Config system. More...
 

Private Member Functions

void TraceSink (double sinrDb, const Address &address)
 Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&. More...
 

Private Attributes

Address m_address
 The socket address for the traced packet. More...
 
TracedCallback< double, const Address & > m_output
 Output trace, the SINR and source address. More...
 
TracedCallback< double, double > m_outputSinr
 Output trace, previous SINR and current SINR. More...
 
double m_sinr
 The traced SINR. More...
 

Detailed Description

Probe to translate from a TraceSource to two more easily parsed TraceSources.

This class is designed to probe an underlying ns3 TraceSource exporting a SINR information and a socket address. This probe exports a trace source "Output" with arguments of type double and const Address&. This probe exports another trace source "OutputSinr" with arguments of type double, which is the SINR in dB. The trace sources emit values when either the probed trace source emits a new value, or when SetValue () is called.

Definition at line 50 of file satellite-sinr-probe.h.

Member Typedef Documentation

◆ SinrCallback

typedef void(* ns3::SatSinrProbe::SinrCallback) (double sinr, const Address &from)

Callback signature for SINR and an address.

Parameters
sinrcomposite SINR (in dB)
fromthe address of the node where the signal originates from

Definition at line 110 of file satellite-sinr-probe.h.

Constructor & Destructor Documentation

◆ SatSinrProbe()

ns3::SatSinrProbe::SatSinrProbe ( )

Default constructor.

Definition at line 63 of file satellite-sinr-probe.cc.

◆ ~SatSinrProbe()

ns3::SatSinrProbe::~SatSinrProbe ( )
virtual

Destructor for SatSinrProbe.

Definition at line 68 of file satellite-sinr-probe.cc.

Member Function Documentation

◆ ConnectByObject()

bool ns3::SatSinrProbe::ConnectByObject ( std::string  traceSource,
Ptr< Object >  obj 
)
virtual

connect to a trace source attribute provided by a given object

Parameters
traceSourcethe name of the attribute TraceSource to connect to
objns3::Object to connect to
Returns
true if the trace source was successfully connected

Definition at line 93 of file satellite-sinr-probe.cc.

References TraceSink().

+ Here is the call graph for this function:

◆ ConnectByPath()

void ns3::SatSinrProbe::ConnectByPath ( std::string  path)
virtual

connect to a trace source provided by a config path

Parameters
pathConfig path to bind to

Note, if an invalid path is provided, the probe will not be connected to anything.

Definition at line 104 of file satellite-sinr-probe.cc.

References TraceSink().

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::SatSinrProbe::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 45 of file satellite-sinr-probe.cc.

References m_output, and m_outputSinr.

◆ SetValue()

void ns3::SatSinrProbe::SetValue ( double  sinrDb,
const Address &  address 
)

Set a probe value.

Parameters
sinrDbset the traced SINR equal to this
addressset the socket address for the traced packet equal to this

Definition at line 74 of file satellite-sinr-probe.cc.

References m_address, m_output, m_outputSinr, and m_sinr.

◆ SetValueByPath()

void ns3::SatSinrProbe::SetValueByPath ( std::string  path,
double  sinrDb,
const Address &  address 
)
static

Set a probe value by its name in the Config system.

Parameters
pathconfig path to access the probe
sinrDbset the traced SINR equal to this
addressset the socket address for the traced packet equal to this

Definition at line 84 of file satellite-sinr-probe.cc.

◆ TraceSink()

void ns3::SatSinrProbe::TraceSink ( double  sinrDb,
const Address &  address 
)
private

Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.

Parameters
sinrDbthe traced SINR
addressthe socket address for the traced packet

Definition at line 112 of file satellite-sinr-probe.cc.

References m_address, m_output, m_outputSinr, and m_sinr.

Referenced by ConnectByObject(), and ConnectByPath().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_address

Address ns3::SatSinrProbe::m_address
private

The socket address for the traced packet.

Definition at line 132 of file satellite-sinr-probe.h.

Referenced by SetValue(), and TraceSink().

◆ m_output

TracedCallback<double, const Address&> ns3::SatSinrProbe::m_output
private

Output trace, the SINR and source address.

Definition at line 124 of file satellite-sinr-probe.h.

Referenced by GetTypeId(), SetValue(), and TraceSink().

◆ m_outputSinr

TracedCallback<double, double> ns3::SatSinrProbe::m_outputSinr
private

Output trace, previous SINR and current SINR.

Definition at line 126 of file satellite-sinr-probe.h.

Referenced by GetTypeId(), SetValue(), and TraceSink().

◆ m_sinr

double ns3::SatSinrProbe::m_sinr
private

The traced SINR.

Definition at line 129 of file satellite-sinr-probe.h.

Referenced by SetValue(), and TraceSink().


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