29 #include "ns3/satellite-frame-user-load-probe.h"
31 #include "ns3/callback.h"
32 #include "ns3/config.h"
34 #include "ns3/names.h"
35 #include "ns3/simulator.h"
37 NS_LOG_COMPONENT_DEFINE(
"SatFrameUserLoadProbe");
42 NS_OBJECT_ENSURE_REGISTERED(SatFrameUserLoadProbe);
48 TypeId(
"ns3::SatFrameUserLoadProbe")
50 .AddConstructor<SatFrameUserLoadProbe>()
51 .AddTraceSource(
"Output",
52 "The frame ID and the number of scheduled users that serve as the "
53 "output for this probe",
55 "ns3::SatFrameUserLoadProbe::FrameUserLoadCallback");
61 NS_LOG_FUNCTION(
this);
66 NS_LOG_FUNCTION(
this);
72 NS_LOG_FUNCTION(
this << frameId << utCount);
79 NS_LOG_FUNCTION(path << frameId << utCount);
80 Ptr<SatFrameUserLoadProbe> probe = Names::Find<SatFrameUserLoadProbe>(path);
81 NS_ASSERT_MSG(probe,
"Error: Can't find probe for path " << path);
82 probe->SetValue(frameId, utCount);
88 NS_LOG_FUNCTION(
this << traceSource << obj);
89 NS_LOG_DEBUG(
"Name of probe (if any) in names database: " << Names::FindPath(obj));
91 obj->TraceConnectWithoutContext(traceSource,
99 NS_LOG_FUNCTION(
this << path);
100 NS_LOG_DEBUG(
"Name of probe to search for in config database: " << path);
107 NS_LOG_FUNCTION(
this << frameId << utCount);
TracedCallback< uint32_t, uint32_t > m_output
Output trace, the frame ID and number of scheduled users.
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)
connect to a trace source attribute provided by a given object
void SetValue(uint32_t frameId, uint32_t utCount)
Set a probe value.
static TypeId GetTypeId()
Get the type ID.
SatFrameUserLoadProbe()
Default constructor.
static void SetValueByPath(std::string path, uint32_t frameId, uint32_t utCount)
Set a probe value by its name in the Config system.
virtual ~SatFrameUserLoadProbe()
Destructor for SatFrameUserLoadProbe.
void TraceSink(uint32_t frameId, uint32_t utCount)
Method to connect to an underlying ns3::TraceSource with arguments of type uint32_t and uint32_t.
virtual void ConnectByPath(std::string path)
connect to a trace source provided by a config path
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.