Probe to translate from a TraceSource to two more easily parsed TraceSources. More...
#include "satellite-sinr-probe.h"
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... | |
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 52 of file satellite-sinr-probe.h.
typedef void(* ns3::SatSinrProbe::SinrCallback) (double sinr, const Address &from) |
Callback signature for SINR and an address.
sinr | composite SINR (in dB) |
from | the address of the node where the signal originates from |
Definition at line 112 of file satellite-sinr-probe.h.
ns3::SatSinrProbe::SatSinrProbe | ( | ) |
Default constructor.
Definition at line 66 of file satellite-sinr-probe.cc.
|
virtual |
Destructor for SatSinrProbe.
Definition at line 71 of file satellite-sinr-probe.cc.
|
virtual |
connect to a trace source attribute provided by a given object
traceSource | the name of the attribute TraceSource to connect to |
obj | ns3::Object to connect to |
Definition at line 96 of file satellite-sinr-probe.cc.
References TraceSink().
|
virtual |
connect to a trace source provided by a config path
path | Config path to bind to |
Note, if an invalid path is provided, the probe will not be connected to anything.
Definition at line 107 of file satellite-sinr-probe.cc.
References TraceSink().
|
static |
Get the type ID.
Definition at line 48 of file satellite-sinr-probe.cc.
References m_output, and m_outputSinr.
void ns3::SatSinrProbe::SetValue | ( | double | sinrDb, |
const Address & | address | ||
) |
Set a probe value.
sinrDb | set the traced SINR equal to this |
address | set the socket address for the traced packet equal to this |
Definition at line 77 of file satellite-sinr-probe.cc.
References m_address, m_output, m_outputSinr, and m_sinr.
|
static |
Set a probe value by its name in the Config system.
path | config path to access the probe |
sinrDb | set the traced SINR equal to this |
address | set the socket address for the traced packet equal to this |
Definition at line 87 of file satellite-sinr-probe.cc.
|
private |
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
sinrDb | the traced SINR |
address | the socket address for the traced packet |
Definition at line 115 of file satellite-sinr-probe.cc.
References m_address, m_output, m_outputSinr, and m_sinr.
Referenced by ConnectByObject(), and ConnectByPath().
|
private |
The socket address for the traced packet.
Definition at line 134 of file satellite-sinr-probe.h.
Referenced by SetValue(), and TraceSink().
|
private |
Output trace, the SINR and source address.
Definition at line 126 of file satellite-sinr-probe.h.
Referenced by GetTypeId(), SetValue(), and TraceSink().
|
private |
Output trace, previous SINR and current SINR.
Definition at line 128 of file satellite-sinr-probe.h.
Referenced by GetTypeId(), SetValue(), and TraceSink().
|
private |
The traced SINR.
Definition at line 131 of file satellite-sinr-probe.h.
Referenced by SetValue(), and TraceSink().