ns-3
ns3::MpiReceiver Class Reference

#include <mpi-receiver.h>

Inheritance diagram for ns3::MpiReceiver:
Collaboration diagram for ns3::MpiReceiver:

List of all members.

Public Member Functions

void Receive (Ptr< Packet > p)
 Direct an incoming packet to the device Receive() method.
void SetReceiveCallback (Callback< void, Ptr< Packet > > callback)
 Set the receive callback to get packets to net devices.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Object.

Detailed Description

Class to aggregate to a NetDevice if it supports MPI capability

MpiInterface::ReceiveMessages () needs to send packets to a NetDevice Receive() method. Since each NetDevice's Receive() method is specific to the derived class, and since we do not know whether such a NetDevice is MPI-capable, we aggregate one of these objects to each MPI-capable device. In addition, we must hook up a NetDevice::Receive() method to the callback. So the two steps to enable MPI capability are to aggregate this object to a NetDevice, and to set the callback.


Member Function Documentation

TypeId ns3::MpiReceiver::GetTypeId ( void  ) [static]

This method returns the TypeId associated to ns3::Object.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::Object.

References ns3::TypeId::SetParent().

Direct an incoming packet to the device Receive() method.

Parameters:
pPacket to receive

References NS_ASSERT.

Referenced by ns3::MpiInterface::ReceiveMessages().

void ns3::MpiReceiver::SetReceiveCallback ( Callback< void, Ptr< Packet > >  callback)

Set the receive callback to get packets to net devices.

Parameters:
callbackthe callback itself

The documentation for this class was generated from the following files: