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
event-impl.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
9
#include "
event-impl.h
"
10
11
#include "
log.h
"
12
13
/**
14
* \file
15
* \ingroup events
16
* ns3::EventImpl definitions.
17
*/
18
19
namespace
ns3
20
{
21
22
NS_LOG_COMPONENT_DEFINE
(
"EventImpl"
);
23
24
EventImpl::~EventImpl
()
25
{
26
NS_LOG_FUNCTION
(
this
);
27
}
28
29
EventImpl::EventImpl
()
30
: m_cancel(false)
31
{
32
NS_LOG_FUNCTION
(
this
);
33
}
34
35
void
36
EventImpl::Invoke
()
37
{
38
NS_LOG_FUNCTION
(
this
);
39
if
(!
m_cancel
)
40
{
41
Notify
();
42
}
43
}
44
45
void
46
EventImpl::Cancel
()
47
{
48
NS_LOG_FUNCTION
(
this
);
49
m_cancel
=
true
;
50
}
51
52
bool
53
EventImpl::IsCancelled
()
54
{
55
NS_LOG_FUNCTION
(
this
);
56
return
m_cancel
;
57
}
58
59
}
// namespace ns3
ns3::EventImpl::EventImpl
EventImpl()
Default constructor.
Definition
event-impl.cc:29
ns3::EventImpl::Invoke
void Invoke()
Called by the simulation engine to notify the event that it is time to execute.
Definition
event-impl.cc:36
ns3::EventImpl::Notify
virtual void Notify()=0
Implementation for Invoke().
ns3::EventImpl::Cancel
void Cancel()
Marks the event as 'canceled'.
Definition
event-impl.cc:46
ns3::EventImpl::~EventImpl
virtual ~EventImpl()=0
Destructor.
Definition
event-impl.cc:24
ns3::EventImpl::m_cancel
bool m_cancel
Has this event been cancelled.
Definition
event-impl.h:69
ns3::EventImpl::IsCancelled
bool IsCancelled()
Definition
event-impl.cc:53
event-impl.h
ns3::EventImpl declarations.
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition
log-macros-enabled.h:229
log.h
Debug message logging.
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
model
event-impl.cc
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0