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
/**
15
* @file
16
* @ingroup simulator
17
* ns3::DefaultNodePrinter implementation.
18
*/
19
20
namespace
ns3
21
{
22
23
NS_LOG_COMPONENT_DEFINE
(
"NodePrinter"
);
24
25
void
26
DefaultNodePrinter
(std::ostream& os)
27
{
28
if
(
Simulator::GetContext
() ==
Simulator::NO_CONTEXT
)
29
{
30
os <<
"-1"
;
31
}
32
else
33
{
34
os <<
Simulator::GetContext
();
35
}
36
}
37
38
}
// namespace ns3
ns3::Simulator::NO_CONTEXT
@ NO_CONTEXT
Flag for events not associated with any particular context.
Definition
simulator.h:207
ns3::Simulator::GetContext
static uint32_t GetContext()
Get the current simulation context.
Definition
simulator.cc:301
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:194
ns3::DefaultNodePrinter
void DefaultNodePrinter(std::ostream &os)
Default node id printer implementation.
Definition
node-printer.cc:26
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
for ns-3 by
1.15.0