A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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
10#ifndef PROBE_H
11#define PROBE_H
12
14
15#include "ns3/nstime.h"
16
17namespace ns3
18{
19
20/**
21 * \ingroup probes
22 *
23 * Base class for probes.
24 *
25 * This class provides general functionality to control each
26 * probe and the data generated by it.
27 */
28
30{
31 public:
32 /**
33 * \brief Get the type ID.
34 * \return the object TypeId
35 */
36 static TypeId GetTypeId();
37 Probe();
38 ~Probe() override;
39
40 /**
41 * \return true if Probe is currently enabled
42 */
43 bool IsEnabled() const override;
44
45 /**
46 * \brief connect to a trace source attribute provided by a given object
47 *
48 * \param traceSource the name of the attribute TraceSource to connect to
49 * \param obj ns3::Object to connect to
50 * \return true if the trace source was successfully connected
51 */
52 virtual bool ConnectByObject(std::string traceSource, Ptr<Object> obj) = 0;
53
54 /**
55 * \brief connect to a trace source provided by a config path
56 *
57 * \param path Config path to bind to
58 *
59 * Note, if an invalid path is provided, the probe will not be connected
60 * to anything.
61 */
62 virtual void ConnectByPath(std::string path) = 0;
63
64 protected:
65 /// Time when logging starts.
67
68 /// Time when logging stops.
70};
71
72} // namespace ns3
73
74#endif // PROBE_H
Base class for data collection framework objects.
Base class for probes.
Definition probe.h:30
Time m_start
Time when logging starts.
Definition probe.h:66
static TypeId GetTypeId()
Get the type ID.
Definition probe.cc:24
bool IsEnabled() const override
Definition probe.cc:54
virtual bool ConnectByObject(std::string traceSource, Ptr< Object > obj)=0
connect to a trace source attribute provided by a given object
Time m_stop
Time when logging stops.
Definition probe.h:69
~Probe() override
Definition probe.cc:48
virtual void ConnectByPath(std::string path)=0
connect to a trace source provided by a config path
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.