|
|
| 76 |
NetDeviceContainer |
76 |
NetDeviceContainer |
| 77 |
Wifi80211pHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const |
77 |
Wifi80211pHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const |
| 78 |
{ |
78 |
{ |
| 79 |
bool isWaveMacHelper = false; |
79 |
QosWaveMacHelper const * qosMac = dynamic_cast <QosWaveMacHelper const *> (&macHelper); |
| 80 |
try |
80 |
if (qosMac == 0) |
| 81 |
{ |
81 |
{ |
| 82 |
const QosWaveMacHelper& qosMac = dynamic_cast<const QosWaveMacHelper&> (macHelper); |
82 |
NqosWaveMacHelper const * nqosMac = dynamic_cast <NqosWaveMacHelper const *> (&macHelper); |
| 83 |
isWaveMacHelper = true; |
83 |
if (nqosMac == 0) |
| 84 |
NS_UNUSED (qosMac); |
84 |
{ |
| 85 |
} |
85 |
NS_FATAL_ERROR ("the macHelper should be either QosWaveMacHelper or NqosWaveMacHelper" |
| 86 |
catch (const std::bad_cast &) |
86 |
", or should be the subclass of QosWaveMacHelper or NqosWaveMacHelper"); |
| 87 |
{ |
87 |
} |
| 88 |
|
88 |
NS_UNUSED (nqosMac); |
| 89 |
} |
89 |
} |
| 90 |
|
90 |
|
| 91 |
try |
91 |
NS_UNUSED (qosMac); |
| 92 |
{ |
|
|
| 93 |
const NqosWaveMacHelper& nqosMac = dynamic_cast<const NqosWaveMacHelper&> (macHelper); |
| 94 |
isWaveMacHelper = true; |
| 95 |
NS_UNUSED (nqosMac); |
| 96 |
} |
| 97 |
catch (const std::bad_cast &) |
| 98 |
{ |
| 99 |
|
| 100 |
} |
| 101 |
|
| 102 |
if (!isWaveMacHelper) |
| 103 |
{ |
| 104 |
NS_FATAL_ERROR ("the macHelper should be either QosWaveMacHelper or NqosWaveMacHelper" |
| 105 |
", or should be the subclass of QosWaveMacHelper or NqosWaveMacHelper"); |
| 106 |
} |
| 107 |
|
| 108 |
return WifiHelper::Install (phyHelper, macHelper, c); |
92 |
return WifiHelper::Install (phyHelper, macHelper, c); |
| 109 |
} |
93 |
} |
| 110 |
|
94 |
|