OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 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 | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 15 matching lines...) Expand all Loading... |
26 static TypeId tid = TypeId ("ns3::MpiReceiver") | 26 static TypeId tid = TypeId ("ns3::MpiReceiver") |
27 .SetParent<Object> () | 27 .SetParent<Object> () |
28 .AddConstructor <MpiReceiver> (); | 28 .AddConstructor <MpiReceiver> (); |
29 return tid; | 29 return tid; |
30 } | 30 } |
31 | 31 |
32 MpiReceiver::~MpiReceiver () | 32 MpiReceiver::~MpiReceiver () |
33 { | 33 { |
34 } | 34 } |
35 | 35 |
36 void | 36 void |
37 MpiReceiver::SetReceiveCallback (Callback<void, Ptr<Packet> > callback) | 37 MpiReceiver::SetReceiveCallback (Callback<void, Ptr<Packet> > callback) |
38 { | 38 { |
39 m_rxCallback = callback; | 39 m_rxCallback = callback; |
40 } | 40 } |
41 | 41 |
42 void | 42 void |
43 MpiReceiver::Receive (Ptr<Packet> p) | 43 MpiReceiver::Receive (Ptr<Packet> p) |
44 { | 44 { |
45 NS_ASSERT (!m_rxCallback.IsNull ()); | 45 NS_ASSERT (!m_rxCallback.IsNull ()); |
46 m_rxCallback (p); | 46 m_rxCallback (p); |
47 } | 47 } |
48 | 48 |
49 void | 49 void |
50 MpiReceiver::DoDispose(void) | 50 MpiReceiver::DoDispose(void) |
51 { | 51 { |
52 m_rxCallback = MakeNullCallback<void, Ptr<Packet> >(); | 52 m_rxCallback = MakeNullCallback<void, Ptr<Packet> >(); |
53 } | 53 } |
54 | 54 |
55 } // namespace ns3 | 55 } // namespace ns3 |
OLD | NEW |