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.
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
virtual void NotifyNewAggregate (void)
virtual void DoStart (void)
virtual void DoDispose (void)
 Object (const Object &o)

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.

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

Reimplemented from ns3::Object.

References ns3::TypeId::SetParent().

void ns3::MpiReceiver::Receive ( Ptr< Packet p)

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: