#include <link_layer.hpp>
Inheritance diagram for LinkLayer:
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 |
This class contains a MAC object and could handle functions like ARP as well.
Definition at line 24 of file link_layer.hpp.
bool LinkLayer::channelIsBusy | ( | ) |
Queries the underlying physical layer to determine whether 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.
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.
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.
direction | the direction the packet was sent. | |
packet | a pointer to the received packet. | |
sendingLayerIdx | the index of the layer that sent 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.
direction | the direction the packet was sent. | |
packet | a pointer to the received 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.
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.
this
object. Implements CommunicationLayer.
Definition at line 143 of file link_layer.hpp.