A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
core
model
make-event.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
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
*/
19
20
#include "
make-event.h
"
21
#include "
log.h
"
22
29
namespace
ns3
{
30
31
NS_LOG_COMPONENT_DEFINE
(
"MakeEvent"
);
32
33
// This is the only non-templated version of MakeEvent.
34
EventImpl
*
MakeEvent
(
void
(*
f
)(
void
))
35
{
36
NS_LOG_FUNCTION
(
f
);
37
// zero arg version
38
class
EventFunctionImpl0 :
public
EventImpl
39
{
40
public
:
41
typedef
void (*F)(void);
42
43
EventFunctionImpl0 (F
function
)
44
: m_function (
function
)
45
{
46
}
47
virtual
~EventFunctionImpl0 ()
48
{
49
}
50
protected
:
51
virtual
void
Notify (
void
)
52
{
53
(*m_function)();
54
}
55
private
:
56
F m_function;
57
} *ev =
new
EventFunctionImpl0 (
f
);
58
return
ev;
59
}
60
61
}
// namespace ns3
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:213
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
make-event.h
ns3::MakeEvent function declarations and template implementation.
f
double f(double x, void *params)
Definition:
80211b.c:70
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::EventImpl
A simulation event.
Definition:
event-impl.h:44
log.h
Debug message logging.
ns3::MakeEvent
EventImpl * MakeEvent(void(*f)(void))
Make an EventImpl from a function pointer taking varying numbers of arguments.
Definition:
make-event.cc:34
Generated on Wed Nov 7 2018 10:01:49 for ns-3 by
1.8.14