A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
probe.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2011 Bucknell University
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Authors: L. Felipe Perrone (perrone@bucknell.edu)
19
* Tiago G. Rodrigues (tgr002@bucknell.edu)
20
*/
21
22
#include "ns3/probe.h"
23
#include "ns3/object.h"
24
#include "ns3/simulator.h"
25
#include "ns3/log.h"
26
27
NS_LOG_COMPONENT_DEFINE
(
"Probe"
);
28
29
namespace
ns3 {
30
31
NS_OBJECT_ENSURE_REGISTERED
(Probe);
32
33
TypeId
34
Probe::GetTypeId
()
35
{
36
static
TypeId
tid =
TypeId
(
"ns3::Probe"
)
37
.
SetParent
<
DataCollectionObject
> ()
38
.AddAttribute (
"Start"
,
39
"Time data collection starts"
,
40
TimeValue
(Seconds (0)),
41
MakeTimeAccessor (&
Probe::m_start
),
42
MakeTimeChecker
())
43
.AddAttribute (
"Stop"
,
44
"Time when data collection stops. The special time value of 0 disables this attribute"
,
45
TimeValue
(Seconds (0)),
46
MakeTimeAccessor (&
Probe::m_stop
),
47
MakeTimeChecker
())
48
;
49
return
tid;
50
}
51
52
Probe::Probe
()
53
{
54
NS_LOG_FUNCTION
(
this
);
55
}
56
57
Probe::~Probe
()
58
{
59
NS_LOG_FUNCTION
(
this
);
60
}
61
62
bool
63
Probe::IsEnabled
(
void
)
const
64
{
65
return
(
DataCollectionObject::IsEnabled
()
66
&&
Simulator::Now
() >=
m_start
67
&& (
m_stop
== Seconds (0) ||
Simulator::Now
() <
m_stop
));
68
69
}
70
71
}
// namespace ns3
src
stats
model
probe.cc
Generated on Fri Aug 30 2013 01:43:02 for ns-3 by
1.8.1.2