#include <wireless_channel_manager.hpp>
Public Types | |
typedef boost::shared_ptr< WirelessChannelManager > | WirelessChannelManagerPtr |
Smart pointer that clients should use. | |
Public Member Functions | |
void | recvSignal (PhysicalLayerPtr sender, WirelessCommSignalPtr signal) |
Receive a signal from a physical layer that will sent on all channels to which the sender is attached as a sender. | |
void | passSignalToReceiver (PhysicalLayerPtr receiver, WirelessCommSignalPtr signal) const |
When the signal is finished, pass it on to the receiver if it was the captured signal for that receiver. | |
bool | attachAsSender (PhysicalLayerPtr physicalLayer, t_uint channelId) |
Add the physical layer as a sender on the given channel. | |
bool | attachAsListener (PhysicalLayerPtr physicalLayer, t_uint channelId) |
Add the physical layer as a listener of the given channel. | |
bool | detachAsSender (PhysicalLayerPtr physicalLayer, t_uint channelId) |
Remove the physical layer as a sender on the given channel. | |
bool | detachAsListener (PhysicalLayerPtr physicalLayer, t_uint channelId) |
Remove the physical layer as a listener of the given channel. | |
void | addChannel (t_uint channelId, WirelessChannelPtr channel) |
Add the given channel to this manager with the specified ID. | |
bool | removeChannel (t_uint channelId) |
Remove the channel with the given ID from this manager. | |
Static Public Member Functions | |
static WirelessChannelManagerPtr | create () |
A factory method to ensure that all objects are created via new since we are using smart pointers. | |
Protected Member Functions | |
WirelessChannelManager () | |
A constructor. |
Definition at line 36 of file wireless_channel_manager.hpp.
void WirelessChannelManager::addChannel | ( | t_uint | channelId, | |
WirelessChannelPtr | channel | |||
) |
Add the given channel to this manager with the specified ID.
If a different already exists with the specified ID, it will be replaced with the newly specified channel.
channelId | the ID to identify the channel. | |
channel | a pointer to the channel to be added. |
Definition at line 295 of file wireless_channel_manager.cpp.
bool WirelessChannelManager::attachAsListener | ( | PhysicalLayerPtr | physicalLayer, | |
t_uint | channelId | |||
) |
Add the physical layer as a listener of the given channel.
physicalLayer | a pointer to the physical layer. | |
channelId | the ID of the channel on which the physical layer will listen. |
Definition at line 249 of file wireless_channel_manager.cpp.
bool WirelessChannelManager::attachAsSender | ( | PhysicalLayerPtr | physicalLayer, | |
t_uint | channelId | |||
) |
Add the physical layer as a sender on the given channel.
physicalLayer | a pointer to the physical layer. | |
channelId | the ID of the channel on which the physical layer will transmit. |
Definition at line 203 of file wireless_channel_manager.cpp.
bool WirelessChannelManager::detachAsListener | ( | PhysicalLayerPtr | physicalLayer, | |
t_uint | channelId | |||
) |
Remove the physical layer as a listener of the given channel.
physicalLayer | a pointer to the physical layer. | |
channelId | the ID of the channel from which the physical layer will stop listening. |
Definition at line 267 of file wireless_channel_manager.cpp.
bool WirelessChannelManager::detachAsSender | ( | PhysicalLayerPtr | physicalLayer, | |
t_uint | channelId | |||
) |
Remove the physical layer as a sender on the given channel.
physicalLayer | a pointer to the physical layer. | |
channelId | the ID of the channel from which the physical layer will be removed. |
Definition at line 221 of file wireless_channel_manager.cpp.
void WirelessChannelManager::passSignalToReceiver | ( | PhysicalLayerPtr | receiver, | |
WirelessCommSignalPtr | signal | |||
) | const |
When the signal is finished, pass it on to the receiver if it was the captured signal for that receiver.
receiver | the physical layer that may potentially receive the signal. | |
signal | the signal that may be received. |
Definition at line 184 of file wireless_channel_manager.cpp.
References WirelessCommSignal::create().
void WirelessChannelManager::recvSignal | ( | PhysicalLayerPtr | sender, | |
WirelessCommSignalPtr | signal | |||
) |
Receive a signal from a physical layer that will sent on all channels to which the sender is attached as a sender.
sender | a pointer to the physical layer sending the signal. | |
signal | the signal being sent. |
Definition at line 56 of file wireless_channel_manager.cpp.
bool WirelessChannelManager::removeChannel | ( | t_uint | channelId | ) |
Remove the channel with the given ID from this manager.
channelId | the ID of the channel to be removed. |
Definition at line 302 of file wireless_channel_manager.cpp.