A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
mpi-receiver.cc
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* This program is free software; you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License version 2 as
5
* published by the Free Software Foundation;
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
*
16
* Author: George Riley <riley@ece.gatech.edu>
17
*/
18
19
#include "mpi-receiver.h"
20
21
namespace
ns3 {
22
23
TypeId
24
MpiReceiver::GetTypeId (
void
)
25
{
26
static
TypeId tid = TypeId (
"ns3::MpiReceiver"
)
27
.SetParent<Object> ()
28
.AddConstructor <MpiReceiver> ();
29
return
tid;
30
}
31
32
MpiReceiver::~MpiReceiver ()
33
{
34
}
35
36
void
37
MpiReceiver::SetReceiveCallback
(
Callback
<
void
,
Ptr<Packet>
> callback)
38
{
39
m_rxCallback = callback;
40
}
41
42
void
43
MpiReceiver::Receive
(
Ptr<Packet>
p)
44
{
45
NS_ASSERT
(!m_rxCallback.IsNull ());
46
m_rxCallback (p);
47
}
48
49
}
// namespace ns3
ns3::Ptr< Packet >
ns3::Callback
Callback template class.
Definition:
callback.h:369
NS_ASSERT
#define NS_ASSERT(condition)
Definition:
assert.h:64
ns3::MpiReceiver::Receive
void Receive(Ptr< Packet > p)
Direct an incoming packet to the device Receive() method.
Definition:
mpi-receiver.cc:43
ns3::MpiReceiver::SetReceiveCallback
void SetReceiveCallback(Callback< void, Ptr< Packet > > callback)
Set the receive callback to get packets to net devices.
Definition:
mpi-receiver.cc:37
src
mpi
model
mpi-receiver.cc
Generated on Sun Mar 16 2014 11:25:08 for ns-3 by
1.8.6