A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
show-progress.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2017 Lawrence Livermore National Laboratory
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
* Author: Gustavo Carneiro <gjc@inescporto.pt>
19
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
20
*/
21
22
23
#ifndef SHOW_PROGRESS_H
24
#define SHOW_PROGRESS_H
25
32
#include <iostream>
33
34
#include "
nstime.h
"
35
#include "
system-wall-clock-ms.h
"
36
37
namespace
ns3
{
38
39
69
class
ShowProgress
70
{
71
public
:
77
ShowProgress
(
const
Time
interval =
Seconds
(1.0),
78
std::ostream & os = std::cout);
79
84
void
SetInterval
(
const
Time
interval);
85
94
void
SetTimePrinter
(
TimePrinter
lp);
95
100
void
SetStream
(std::ostream & os);
101
103
void
Start
(
void
);
104
110
void
SetVerbose
(
bool
verbose
);
111
112
113
private
:
115
void
Feedback
(
void
);
116
121
const
int64x64_t
HYSTERESIS
= 1.2;
126
const
int64x64_t
MAXGAIN
= 2.0;
127
128
SystemWallClockMs
m_timer
;
129
Time
m_interval
;
130
Time
m_vtime
;
131
EventId
m_event
;
132
uint64_t
m_eventCount
;
133
134
TimePrinter
m_printer
;
135
std::ostream *
m_os
;
136
bool
m_verbose
;
137
uint64_t
m_repCount
;
138
139
};
// class ShowProgress
140
141
}
// namespace ns3
142
143
#endif
/* SHOW_PROGRESS_H */
ns3::ShowProgress::m_verbose
bool m_verbose
Verbose mode flag.
Definition:
show-progress.h:136
ns3::ShowProgress::m_event
EventId m_event
The next progress event.
Definition:
show-progress.h:131
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::ShowProgress::ShowProgress
ShowProgress(const Time interval=Seconds(1.0), std::ostream &os=std::cout)
Constructor.
Definition:
show-progress.cc:42
ns3::ShowProgress
Periodically print a status message indicating simulator progress.
Definition:
show-progress.h:69
ns3::ShowProgress::m_timer
SystemWallClockMs m_timer
Wallclock timer.
Definition:
show-progress.h:128
ns3::int64x64_t
High precision numerical type, implementing Q64.64 fixed precision.
Definition:
int64x64-128.h:45
ns3::ShowProgress::m_interval
Time m_interval
The target update interval, in wallclock time.
Definition:
show-progress.h:129
ns3::ShowProgress::SetVerbose
void SetVerbose(bool verbose)
Set verbose mode to print real and virtual time intervals.
Definition:
show-progress.cc:78
ns3::ShowProgress::SetStream
void SetStream(std::ostream &os)
Set the output stream to show progress on.
Definition:
show-progress.cc:85
ns3::SystemWallClockMs
Measure elapsed wall clock time in milliseconds.
Definition:
system-wall-clock-ms.h:53
system-wall-clock-ms.h
ns3::SystemWallClockMs declaration.
ns3::ShowProgress::m_os
std::ostream * m_os
The output stream to use.
Definition:
show-progress.h:135
ns3::ShowProgress::MAXGAIN
const int64x64_t MAXGAIN
Maximum growth factor.
Definition:
show-progress.h:126
ns3::ShowProgress::HYSTERESIS
const int64x64_t HYSTERESIS
Hysteresis factor.
Definition:
show-progress.h:121
ns3::ShowProgress::SetInterval
void SetInterval(const Time interval)
Set the target update interval, in wallclock time.
Definition:
show-progress.cc:59
nstime.h
Declaration of classes ns3::Time and ns3::TimeWithUnit, and the TimeValue implementation classes...
ns3::ShowProgress::m_eventCount
uint64_t m_eventCount
Simulator event count.
Definition:
show-progress.h:132
ns3::TimePrinter
void(* TimePrinter)(std::ostream &os)
Function signature for features requiring a time formatter, such as logging or ShowProgress.
Definition:
time-printer.h:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ShowProgress::Start
void Start(void)
Start the progress timer.
Definition:
show-progress.cc:91
ns3::ShowProgress::SetTimePrinter
void SetTimePrinter(TimePrinter lp)
Set the TimePrinter function to be used to prepend progress messages with the simulation time...
Definition:
show-progress.cc:71
ns3::ShowProgress::m_printer
TimePrinter m_printer
The TimePrinter to use.
Definition:
show-progress.h:134
ns3::EventId
An identifier for simulation events.
Definition:
event-id.h:53
ns3::ShowProgress::m_vtime
Time m_vtime
The virtual time interval.
Definition:
show-progress.h:130
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1062
ns3::ShowProgress::Feedback
void Feedback(void)
Show execution progress.
Definition:
show-progress.cc:100
ns3::ShowProgress::m_repCount
uint64_t m_repCount
Count of progress lines printed.
Definition:
show-progress.h:137
verbose
bool verbose
Definition:
openflow-switch.cc:50
src
core
model
show-progress.h
Generated on Wed Aug 21 2019 03:37:02 for ns-3 by
1.8.14