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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: L. Felipe Perrone (perrone@bucknell.edu)
18 * Tiago G. Rodrigues (tgr002@bucknell.edu)
19 */
20
21#ifndef PROBE_H
22#define PROBE_H
23
25
26#include "ns3/nstime.h"
27
28namespace ns3
29{
30
31/**
32 * \ingroup probes
33 *
34 * Base class for probes.
35 *
36 * This class provides general functionality to control each
37 * probe and the data generated by it.
38 */
39
41{
42 public:
43 /**
44 * \brief Get the type ID.
45 * \return the object TypeId
46 */
47 static TypeId GetTypeId();
48 Probe();
49 ~Probe() override;
50
51 /**
52 * \return true if Probe is currently enabled
53 */
54 bool IsEnabled() const override;
55
56 /**
57 * \brief connect to a trace source attribute provided by a given object
58 *
59 * \param traceSource the name of the attribute TraceSource to connect to
60 * \param obj ns3::Object to connect to
61 * \return true if the trace source was successfully connected
62 */
63 virtual bool ConnectByObject(std::string traceSource, Ptr<Object> obj) = 0;
64
65 /**
66 * \brief connect to a trace source provided by a config path
67 *
68 * \param path Config path to bind to
69 *
70 * Note, if an invalid path is provided, the probe will not be connected
71 * to anything.
72 */
73 virtual void ConnectByPath(std::string path) = 0;
74
75 protected:
76 /// Time when logging starts.
78
79 /// Time when logging stops.
81};
82
83} // namespace ns3
84
85#endif // PROBE_H
Base class for data collection framework objects.
Base class for probes.
Definition: probe.h:41
Time m_start
Time when logging starts.
Definition: probe.h:77
static TypeId GetTypeId()
Get the type ID.
Definition: probe.cc:35
bool IsEnabled() const override
Definition: probe.cc:65
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:80
~Probe() override
Definition: probe.cc:59
virtual void ConnectByPath(std::string path)=0
connect to a trace source provided by a config path
Probe()
Definition: probe.cc:54
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.