![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <Wire.hpp>


Public Member Functions | |
| Wire (const wns::pyconfig::View &config) | |
| Constructor. | |
WireInterface | |
| void | addReceiver (ReceiverInterface *r, const wns::service::dll::UnicastAddress &macAddress) |
| Receiver need to register themselves via this method. | |
| simTimeType | blockedSince () const |
| Returns the time for which the medium has been blocked. | |
| void | sendData (const BroadcastTransmissionPtr &bt, simTimeType duration) |
| Send data (Unicast Transmission). | |
| void | sendData (const UnicastTransmissionPtr &ut, simTimeType duration) |
| Send data (Unicast Transmission). | |
| void | stopTransmission (const wns::osi::PDUPtr &pdu) |
| Cancel a transmission before it is finished. | |
Private Types | |
| typedef std::map < wns::service::dll::UnicastAddress, ReceiverInterface * > | Address2ReceiverContainer |
| typedef std::map < wns::osi::PDUPtr, wns::events::scheduler::IEventPtr > | TransmissionEndEventContainer |
| typedef std::map < wns::osi::PDUPtr, TransmissionPtr > | Transmissions |
Private Member Functions | |
| template<typename TRANSMISSIONTYPE> | |
| void | addTransmissionEndEvent (const TRANSMISSIONTYPE &t, simTimeType arrivalTime) |
| Stores and sends the event together with the PDU of the Transmission. | |
| void | checkForCollision (const TransmissionPtr &t) |
| Checks if a transmission collided with another transmission. | |
| bool | isFree () const |
| Used to check if the wire is free. | |
| void | removeTransmissionEndEvent (const TransmissionPtr &transmission) |
| Remove event according to its PDU. | |
| template<typename TRANSMISSIONTYPE> | |
| wns::simulator::Time | sendDataGeneric (const TRANSMISSIONTYPE &transmission, simTimeType duration) |
| void | signalCopperFreeAgainToReceivers () |
| Calls onCopperFreeAgain of each connected receiver. | |
| void | stopTransmission (const BroadcastTransmissionPtr &bt) |
| Stops a broadcast transmission (called on finished transmission). | |
| void | stopTransmission (const UnicastTransmissionPtr &ut) |
| Stops a unicast transmission (called on finished transmission). | |
Private Attributes | |
| Address2ReceiverContainer | addressMapping |
| Associative container: Allows mapping of Layer 2 addresses to a copper::Receiver. | |
| wns::logger::Logger | logger |
| Logger instance. | |
| std::string | name |
| Name of the Wire. | |
| std::list< ReceiverInterface * > | receivers |
| Stores connected receives (used for non-round-robin tasks). | |
| wns::RoundRobin < ReceiverInterface * > | roundRobin |
| Round robin container to realize round robin signalling in signalCopperFreeAgainToReceivers. | |
| simTimeType | timeWireBlocked |
| the time when the wire was blocked by a transmission | |
| TransmissionEndEventContainer | transmissionEndEvents |
| Associative container: key=PDU, value=TransmissionEndEvent. | |
| Transmissions | transmissions |
| Keep all active transmissions. | |
Classes | |
| class | TransmissionEndEvent |
| Signale the end of transmission for the different transmission types (broadcast, unicast). More... | |
| class | TransmissionEndEventBase |
| Event to be scheduled at start of a transmission to signal the end of a transmission. More... | |
Definition at line 128 of file Wire.hpp.
typedef std::map<wns::service::dll::UnicastAddress, ReceiverInterface*> copper::Wire::Address2ReceiverContainer [private] |
typedef std::map< wns::osi::PDUPtr, wns::events::scheduler::IEventPtr > copper::Wire::TransmissionEndEventContainer [private] |
typedef std::map< wns::osi::PDUPtr, TransmissionPtr > copper::Wire::Transmissions [private] |
| Wire::Wire | ( | const wns::pyconfig::View & | config | ) | [explicit] |
| void Wire::addReceiver | ( | ReceiverInterface * | r, | |
| const wns::service::dll::UnicastAddress & | macAddress | |||
| ) | [virtual] |
| void copper::Wire::addTransmissionEndEvent | ( | const TRANSMISSIONTYPE & | t, | |
| simTimeType | arrivalTime | |||
| ) | [inline, private] |
| simTimeType Wire::blockedSince | ( | ) | const [virtual] |
Three different groups of return values must be distinguished:
Implements copper::WireInterface.
| void Wire::checkForCollision | ( | const TransmissionPtr & | t | ) | [private] |
| void Wire::removeTransmissionEndEvent | ( | const TransmissionPtr & | transmission | ) | [private] |
| void copper::Wire::sendData | ( | const BroadcastTransmissionPtr & | ut, | |
| simTimeType | duration | |||
| ) | [virtual] |
| ut | Data (unicast) to be sent | |
| duration | The duration of the data transmission |
Implements copper::WireInterface.
| void Wire::sendData | ( | const UnicastTransmissionPtr & | ut, | |
| simTimeType | duration | |||
| ) | [virtual] |
| ut | Data (unicast) to be sent | |
| duration | The duration of the data transmission |
Implements copper::WireInterface.
| wns::simulator::Time copper::Wire::sendDataGeneric | ( | const TRANSMISSIONTYPE & | transmission, | |
| simTimeType | duration | |||
| ) | [inline, private] |
| void Wire::signalCopperFreeAgainToReceivers | ( | ) | [private] |
| void copper::Wire::stopTransmission | ( | const BroadcastTransmissionPtr & | bt | ) | [private] |
This one is called by TransmissionEndEvent
| void copper::Wire::stopTransmission | ( | const UnicastTransmissionPtr & | ut | ) | [private] |
This one is called by TransmissionEndEvent
| void Wire::stopTransmission | ( | const wns::osi::PDUPtr & | pdu | ) |
wns::logger::Logger copper::Wire::logger [private] |
std::string copper::Wire::name [private] |
std::list<ReceiverInterface*> copper::Wire::receivers [private] |
wns::RoundRobin<ReceiverInterface*> copper::Wire::roundRobin [private] |
simTimeType copper::Wire::timeWireBlocked [private] |
Transmissions copper::Wire::transmissions [private] |
1.5.5