31 #include "ns3/callback.h"
32 #include "ns3/config.h"
34 #include "ns3/names.h"
35 #include "ns3/simulator.h"
39 NS_LOG_COMPONENT_DEFINE(
"SatFrameSymbolLoadProbe");
44 NS_OBJECT_ENSURE_REGISTERED(SatFrameSymbolLoadProbe);
50 TypeId(
"ns3::SatFrameSymbolLoadProbe")
52 .AddConstructor<SatFrameSymbolLoadProbe>()
53 .AddTraceSource(
"Output",
54 "The frame ID and the ratio of allocated symbols that serve as the "
55 "output for this probe",
57 "ns3::SatFrameSymbolLoadProbe::FrameSymbolLoadCallback");
63 NS_LOG_FUNCTION(
this);
68 NS_LOG_FUNCTION(
this);
74 NS_LOG_FUNCTION(
this << frameId << loadRatio);
81 NS_LOG_FUNCTION(path << frameId << loadRatio);
82 Ptr<SatFrameSymbolLoadProbe> probe = Names::Find<SatFrameSymbolLoadProbe>(path);
83 NS_ASSERT_MSG(probe,
"Error: Can't find probe for path " << path);
84 probe->SetValue(frameId, loadRatio);
90 NS_LOG_FUNCTION(
this << traceSource << obj);
91 NS_LOG_DEBUG(
"Name of probe (if any) in names database: " << Names::FindPath(obj));
92 bool connected = obj->TraceConnectWithoutContext(
101 NS_LOG_FUNCTION(
this << path);
102 NS_LOG_DEBUG(
"Name of probe to search for in config database: " << path);
103 Config::ConnectWithoutContext(path,
110 NS_LOG_FUNCTION(
this << frameId << loadRatio);
void TraceSink(uint32_t frameId, double loadRatio)
Method to connect to an underlying ns3::TraceSource with arguments of type double and const Address&.
SatFrameSymbolLoadProbe()
Default constructor.
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
static TypeId GetTypeId()
Get the type ID.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
virtual ~SatFrameSymbolLoadProbe()
Destructor for SatFrameSymbolLoadProbe.
void SetValue(uint32_t frameId, double loadRatio)
Set a probe value.
TracedCallback< uint32_t, double > m_output
Output trace, the frame ID and ratio of allocated symbols.
static void SetValueByPath(std::string path, uint32_t frameId, double loadRatio)
Set a probe value by its name in the Config system.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.