A Discrete-Event Network Simulator
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
19namespace ns3
20{
21
22NS_LOG_COMPONENT_DEFINE("EventImpl");
23
28
30 : m_cancel(false)
31{
32 NS_LOG_FUNCTION(this);
33}
34
35void
37{
38 NS_LOG_FUNCTION(this);
39 if (!m_cancel)
40 {
41 Notify();
42 }
43}
44
45void
47{
48 NS_LOG_FUNCTION(this);
49 m_cancel = true;
50}
51
52bool
54{
55 NS_LOG_FUNCTION(this);
56 return m_cancel;
57}
58
59} // namespace ns3
EventImpl()
Default constructor.
Definition event-impl.cc:29
void Invoke()
Called by the simulation engine to notify the event that it is time to execute.
Definition event-impl.cc:36
virtual void Notify()=0
Implementation for Invoke().
void Cancel()
Marks the event as 'canceled'.
Definition event-impl.cc:46
virtual ~EventImpl()=0
Destructor.
Definition event-impl.cc:24
bool m_cancel
Has this event been cancelled.
Definition event-impl.h:69
bool IsCancelled()
Definition event-impl.cc:53
ns3::EventImpl declarations.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Debug message logging.
Every class exported by the ns3 library is enclosed in the ns3 namespace.