A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
core
model
des-metrics.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2016 LLNL
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: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
19
*/
20
21
#ifndef DESMETRICS_H
22
#define DESMETRICS_H
23
30
#include "
nstime.h
"
31
#include "
singleton.h
"
32
#include "
system-mutex.h
"
33
34
#include <stdint.h>
// uint32_t
35
#include <fstream>
36
#include <string>
37
#include <vector>
38
39
namespace
ns3
{
40
108
class
DesMetrics
:
public
Singleton
<DesMetrics>
109
{
110
public
:
111
121
void
Initialize
(std::vector<std::string> args, std::string outDir =
""
);
122
129
void
Trace
(
const
Time
& now,
const
Time
& delay);
130
138
void
TraceWithContext
(uint32_t context,
const
Time
& now,
const
Time
& delay);
139
143
~DesMetrics
(
void
);
144
145
private
:
146
148
void
Close
(
void
);
149
156
static
std::string
m_outputDir
;
157
158
bool
m_initialized
;
159
std::ofstream
m_os
;
160
char
m_separator
;
161
163
SystemMutex
m_mutex
;
164
165
};
// class DesMetrics
166
167
168
}
// namespace ns3
169
170
#endif
/* DESMETRICS_H */
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
singleton.h
ns3::Singleton declaration and template implementation.
ns3::DesMetrics::m_os
std::ofstream m_os
The output JSON trace file stream.
Definition:
des-metrics.h:159
ns3::DesMetrics::Close
void Close(void)
Close the output file.
Definition:
des-metrics.cc:144
ns3::Singleton
A template singleton.
Definition:
singleton.h:63
system-mutex.h
System-independent mutex primitive, ns3::SystemMutex, and ns3::CriticalSection.
ns3::DesMetrics::Initialize
void Initialize(std::vector< std::string > args, std::string outDir="")
Open the DesMetrics trace file and print the header.
Definition:
des-metrics.cc:42
ns3::DesMetrics
Event trace data collector for the DES Metrics project.
Definition:
des-metrics.h:108
ns3::DesMetrics::~DesMetrics
~DesMetrics(void)
Destructor, closes the trace file.
Definition:
des-metrics.cc:138
ns3::DesMetrics::m_separator
char m_separator
The separator between event records.
Definition:
des-metrics.h:160
nstime.h
Declaration of classes ns3::Time and ns3::TimeWithUnit, and the TimeValue implementation classes...
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::DesMetrics::m_mutex
SystemMutex m_mutex
Mutex to control access to the output file.
Definition:
des-metrics.h:163
ns3::DesMetrics::TraceWithContext
void TraceWithContext(uint32_t context, const Time &now, const Time &delay)
Trace an event (with context) at the time it is scheduled.
Definition:
des-metrics.cc:105
ns3::DesMetrics::m_initialized
bool m_initialized
Have we been initialized.
Definition:
des-metrics.h:158
ns3::SystemMutex
A class which provides a relatively platform-independent Mutual Exclusion thread synchronization prim...
Definition:
system-mutex.h:58
ns3::DesMetrics::Trace
void Trace(const Time &now, const Time &delay)
Trace an event to self at the time it is scheduled.
Definition:
des-metrics.cc:99
ns3::DesMetrics::m_outputDir
static std::string m_outputDir
Cache the last-used output directory.
Definition:
des-metrics.h:156
Generated on Wed Nov 7 2018 10:01:49 for ns-3 by
1.8.14