A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
node-printer.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Lawrence Livermore National Laboratory
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
7
*/
8
9
#include "
node-printer.h
"
10
11
#include "
log.h
"
12
#include "
simulator.h
"
// GetContext()
13
14
#include <iomanip>
15
16
/**
17
* \file
18
* \ingroup simulator
19
* ns3::DefaultNodePrinter implementation.
20
*/
21
22
namespace
ns3
23
{
24
25
NS_LOG_COMPONENT_DEFINE
(
"NodePrinter"
);
26
27
void
28
DefaultNodePrinter
(std::ostream& os)
29
{
30
if
(
Simulator::GetContext
() ==
Simulator::NO_CONTEXT
)
31
{
32
os <<
"-1"
;
33
}
34
else
35
{
36
os <<
Simulator::GetContext
();
37
}
38
}
39
40
}
// namespace ns3
ns3::Simulator::NO_CONTEXT
@ NO_CONTEXT
Flag for events not associated with any particular context.
Definition
simulator.h:199
ns3::Simulator::GetContext
static uint32_t GetContext()
Get the current simulation context.
Definition
simulator.cc:307
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
ns3::DefaultNodePrinter
void DefaultNodePrinter(std::ostream &os)
Default node id printer implementation.
Definition
node-printer.cc:28
log.h
Debug message logging.
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
node-printer.h
Declaration of ns3::NodePrinter function pointer type and ns3::DefaultNodePrinter function.
simulator.h
ns3::Simulator declaration.
src
core
model
node-printer.cc
Generated on Wed Oct 9 2024 01:03:22 for ns-3 by
1.11.0