author | Mitch Watrous <watrous@u.washington.edu> |
Wed, 18 May 2011 17:24:04 -0700 | |
changeset 7241 | 0a7a16b599e8 |
parent 7085 | 5feb5c87d56f |
child 10193 | 55b354910100 |
permissions | -rw-r--r-- |
7085 | 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 |
// Provides an interface to aggregate to MPI-compatible NetDevices |
|
20 |
||
21 |
#ifndef NS3_MPI_RECEIVER_H |
|
22 |
#define NS3_MPI_RECEIVER_H |
|
23 |
||
24 |
#include "ns3/object.h" |
|
25 |
#include "ns3/packet.h" |
|
26 |
||
27 |
namespace ns3 { |
|
28 |
||
29 |
/** |
|
7241
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7085
diff
changeset
|
30 |
* \ingroup mpi |
0a7a16b599e8
Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
7085
diff
changeset
|
31 |
* |
7085 | 32 |
* Class to aggregate to a NetDevice if it supports MPI capability |
33 |
* |
|
34 |
* MpiInterface::ReceiveMessages () needs to send packets to a NetDevice |
|
35 |
* Receive() method. Since each NetDevice's Receive() method is specific |
|
36 |
* to the derived class, and since we do not know whether such a NetDevice |
|
37 |
* is MPI-capable, we aggregate one of these objects to each MPI-capable |
|
38 |
* device. In addition, we must hook up a NetDevice::Receive() method |
|
39 |
* to the callback. So the two steps to enable MPI capability are to |
|
40 |
* aggregate this object to a NetDevice, and to set the callback. |
|
41 |
*/ |
|
42 |
class MpiReceiver : public Object |
|
43 |
{ |
|
44 |
public: |
|
45 |
static TypeId GetTypeId (void); |
|
46 |
virtual ~MpiReceiver (); |
|
47 |
||
48 |
/** |
|
49 |
* \brief Direct an incoming packet to the device Receive() method |
|
50 |
* \param p Packet to receive |
|
51 |
*/ |
|
52 |
void Receive (Ptr<Packet> p); |
|
53 |
/** |
|
54 |
* \brief Set the receive callback to get packets to net devices |
|
55 |
* \param callback the callback itself |
|
56 |
*/ |
|
57 |
void SetReceiveCallback (Callback<void, Ptr<Packet> > callback); |
|
58 |
private: |
|
59 |
Callback<void, Ptr<Packet> > m_rxCallback; |
|
60 |
}; |
|
61 |
||
62 |
} // namespace ns3 |
|
63 |
||
64 |
#endif /* NS3_MPI_RECEIVER_H */ |