A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
uinteger-8-probe.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Bucknell University
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: L. Felipe Perrone (perrone@bucknell.edu)
7
* Tiago G. Rodrigues (tgr002@bucknell.edu)
8
*
9
* Modified by: Mitch Watrous (watrous@u.washington.edu)
10
*/
11
12
#ifndef UINTEGER_8_PROBE_H
13
#define UINTEGER_8_PROBE_H
14
15
#include "
probe.h
"
16
17
#include "ns3/callback.h"
18
#include "ns3/traced-value.h"
19
20
namespace
ns3
21
{
22
23
/**
24
* \ingroup probes
25
*
26
* This class is designed to probe an underlying ns3 TraceSource exporting
27
* an uint8_t. This probe exports a trace source "Output" of type uint8_t.
28
* The Output trace source emits a value when either the trace source
29
* emits a new value, or when SetValue () is called.
30
*
31
* The current value of the probe can be polled with the GetValue () method.
32
*/
33
class
Uinteger8Probe
:
public
Probe
34
{
35
public
:
36
/**
37
* \brief Get the type ID.
38
* \return the object TypeId
39
*/
40
static
TypeId
GetTypeId
();
41
Uinteger8Probe
();
42
~Uinteger8Probe
()
override
;
43
44
/**
45
* \return the most recent value
46
*/
47
uint8_t
GetValue
()
const
;
48
49
/**
50
* \param value set the traced uint8_t to a new value
51
*/
52
void
SetValue
(uint8_t value);
53
54
/**
55
* \brief Set a probe value by its name in the Config system
56
*
57
* \param path Config path to access the probe
58
* \param value set the traced uint8_t to a new value
59
*/
60
static
void
SetValueByPath
(std::string path, uint8_t value);
61
62
/**
63
* \brief connect to a trace source attribute provided by a given object
64
*
65
* \param traceSource the name of the attribute TraceSource to connect to
66
* \param obj ns3::Object to connect to
67
* \return true if the trace source was successfully connected
68
*/
69
bool
ConnectByObject
(std::string traceSource,
Ptr<Object>
obj)
override
;
70
71
/**
72
* \brief connect to a trace source provided by a config path
73
*
74
* \param path Config path to bind to
75
*
76
* Note, if an invalid path is provided, the probe will not be connected
77
* to anything.
78
*/
79
void
ConnectByPath
(std::string path)
override
;
80
81
private
:
82
/**
83
* \brief Method to connect to an underlying ns3::TraceSource of type uint8_t
84
*
85
* \param oldData previous value of the uint8_t
86
* \param newData new value of the uint8_t
87
*/
88
void
TraceSink
(uint8_t oldData, uint8_t newData);
89
90
TracedValue<uint8_t>
m_output
;
//!< Output trace source.
91
};
92
93
}
// namespace ns3
94
95
#endif
// UINTEGER_8_PROBE_H
ns3::Probe
Base class for probes.
Definition
probe.h:30
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TracedValue
Trace classes with value semantics.
Definition
traced-value.h:105
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::Uinteger8Probe
This class is designed to probe an underlying ns3 TraceSource exporting an uint8_t.
Definition
uinteger-8-probe.h:34
ns3::Uinteger8Probe::~Uinteger8Probe
~Uinteger8Probe() override
Definition
uinteger-8-probe.cc:46
ns3::Uinteger8Probe::GetValue
uint8_t GetValue() const
Definition
uinteger-8-probe.cc:52
ns3::Uinteger8Probe::SetValue
void SetValue(uint8_t value)
Definition
uinteger-8-probe.cc:59
ns3::Uinteger8Probe::Uinteger8Probe
Uinteger8Probe()
Definition
uinteger-8-probe.cc:40
ns3::Uinteger8Probe::SetValueByPath
static void SetValueByPath(std::string path, uint8_t value)
Set a probe value by its name in the Config system.
Definition
uinteger-8-probe.cc:66
ns3::Uinteger8Probe::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
uinteger-8-probe.cc:27
ns3::Uinteger8Probe::TraceSink
void TraceSink(uint8_t oldData, uint8_t newData)
Method to connect to an underlying ns3::TraceSource of type uint8_t.
Definition
uinteger-8-probe.cc:94
ns3::Uinteger8Probe::m_output
TracedValue< uint8_t > m_output
Output trace source.
Definition
uinteger-8-probe.h:90
ns3::Uinteger8Probe::ConnectByPath
void ConnectByPath(std::string path) override
connect to a trace source provided by a config path
Definition
uinteger-8-probe.cc:86
ns3::Uinteger8Probe::ConnectByObject
bool ConnectByObject(std::string traceSource, Ptr< Object > obj) override
connect to a trace source attribute provided by a given object
Definition
uinteger-8-probe.cc:75
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
probe.h
src
stats
model
uinteger-8-probe.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0