LinkLayer Class Reference

This is the link layer in the network stack. More...

#include <link_layer.hpp>

Inheritance diagram for LinkLayer:

CommunicationLayer SimulationEndListener List of all members.

Public Types

typedef boost::shared_ptr<
LinkLayer
LinkLayerPtr
 Smart pointer that clients should use.

Public Member Functions

LinkLayerPtr thisLinkLayer ()
 Gives this pointer as a LinkLayer object.
SimulationEndListenerPtr thisSimulationEndListener ()
 Gives this pointer as a SimulationEndListener object.
virtual void simulationEndHandler ()
 The function called when the simulation ends.
bool recvFromLayer (CommunicationLayer::Directions direction, PacketPtr packet, t_uint sendingLayerIdx)
 Receives a packet from a sending layer.
bool recvFromMacProtocol (CommunicationLayer::Directions direction, PacketPtr packet)
 Receives a packet from the MAC protocol associated with this layer to be sent to the default next layer.
bool channelIsBusy ()
 Queries the underlying physical layer to determine whether the channel is busy.
CommunicationLayer::Types getLayerType () const
 Get the layer type of an object.

Static Public Member Functions

static LinkLayerPtr create (NodePtr node, MacProtocolPtr macProtocol)
 A factory method to ensure that all objects are created via new since we are using smart pointers.

Protected Member Functions

 LinkLayer (NodePtr node, MacProtocolPtr macProtocol)
 A constructor.

Friends

class MacProtocol

Detailed Description

This is the link layer in the network stack.

This class contains a MAC object and could handle functions like ARP as well.

Definition at line 24 of file link_layer.hpp.


Member Function Documentation

bool LinkLayer::channelIsBusy (  ) 

Queries the underlying physical layer to determine whether the channel is busy.

Returns:
true if the channel is busy.

Definition at line 19 of file link_layer.cpp.

References CommunicationLayer::Directions_Lower, CommunicationLayer::getDefaultLayer(), and CommunicationLayer::getLayer().

LinkLayerPtr LinkLayer::create ( NodePtr  node,
MacProtocolPtr  macProtocol 
) [inline, static]

A factory method to ensure that all objects are created via new since we are using smart pointers.

Parameters:
node the owner of this layer.
macProtocol the media access protocol that will be used by this link layer.

Definition at line 123 of file link_layer.hpp.

References Simulator::addSimulationEndListener(), Simulator::instance(), and LinkLayer().

CommunicationLayer::Types LinkLayer::getLayerType (  )  const [inline, virtual]

Get the layer type of an object.

Returns:
the type of the layer.

Implements CommunicationLayer.

Definition at line 149 of file link_layer.hpp.

References CommunicationLayer::Types_Link.

bool LinkLayer::recvFromLayer ( CommunicationLayer::Directions  direction,
PacketPtr  packet,
t_uint  sendingLayerIdx 
) [virtual]

Receives a packet from a sending layer.

Parameters:
direction the direction the packet was sent.
packet a pointer to the received packet.
sendingLayerIdx the index of the layer that sent the packet.
Returns:
true if the specified layer was able to receive the packet.

Reimplemented from CommunicationLayer.

Definition at line 38 of file link_layer.cpp.

bool LinkLayer::recvFromMacProtocol ( CommunicationLayer::Directions  direction,
PacketPtr  packet 
)

Receives a packet from the MAC protocol associated with this layer to be sent to the default next layer.

Parameters:
direction the direction the packet was sent.
packet a pointer to the received packet.
Returns:
true if the specified layer was able to receive the packet.

Definition at line 30 of file link_layer.cpp.

References CommunicationLayer::sendToLayer().

LinkLayerPtr LinkLayer::thisLinkLayer (  )  [inline]

Gives this pointer as a LinkLayer object.

This is used to deal with shared_ptr's, this, and inheritance.

Returns:
a pointer to this object.

Definition at line 137 of file link_layer.hpp.

SimulationEndListenerPtr LinkLayer::thisSimulationEndListener (  )  [inline, virtual]

Gives this pointer as a SimulationEndListener object.

This is used to deal with shared_ptr's, this, and inheritance.

Returns:
a pointer to this object.

Implements CommunicationLayer.

Definition at line 143 of file link_layer.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Dec 12 17:04:40 2006 for rfidsim by  doxygen 1.4.7