View | Details | Raw Unified | Return to bug 2987
Collapse All | Expand All

(-)a/src/core/model/event-id.cc (+6 lines)
 Lines 50-55   EventId::EventId (const Ptr<EventImpl> &impl, uint64_t ts, uint32_t context, uin Link Here 
50
  NS_LOG_FUNCTION (this << impl << ts << context << uid);
50
  NS_LOG_FUNCTION (this << impl << ts << context << uid);
51
}
51
}
52
void
52
void
53
EventId::Remove (void)
54
{
55
  NS_LOG_FUNCTION (this);
56
  Simulator::Remove (*this);
57
}
58
void
53
EventId::Cancel (void)
59
EventId::Cancel (void)
54
{
60
{
55
  NS_LOG_FUNCTION (this);
61
  NS_LOG_FUNCTION (this);
(-)a/src/core/model/event-id.h (+5 lines)
 Lines 63-68   public: Link Here 
63
   * \param [in] uid The unique id for this EventId.
63
   * \param [in] uid The unique id for this EventId.
64
   */
64
   */
65
  EventId (const Ptr<EventImpl> &impl, uint64_t ts, uint32_t context, uint32_t uid);
65
  EventId (const Ptr<EventImpl> &impl, uint64_t ts, uint32_t context, uint32_t uid);
66
  /**
67
   * This method is syntactic sugar for the ns3::Simulator::Remove
68
   * method.
69
   */
70
  void Remove (void);
66
  /**
71
  /**
67
   * This method is syntactic sugar for the ns3::Simulator::Cancel
72
   * This method is syntactic sugar for the ns3::Simulator::Cancel
68
   * method.
73
   * method.
(-)a/src/wifi/model/wifi-radio-energy-model.cc (-2 / +1 lines)
 Lines 440-446   WifiRadioEnergyModel::HandleEnergyChanged (void) Link Here 
440
  NS_LOG_DEBUG ("WifiRadioEnergyModel:Energy is changed!");
440
  NS_LOG_DEBUG ("WifiRadioEnergyModel:Energy is changed!");
441
  if (m_currentState != WifiPhyState::OFF)
441
  if (m_currentState != WifiPhyState::OFF)
442
    {
442
    {
443
      m_switchToOffEvent.Cancel ();
443
      m_switchToOffEvent.Remove ();
444
      Time durationToOff = GetMaximumTimeInState (m_currentState);
444
      Time durationToOff = GetMaximumTimeInState (m_currentState);
445
      m_switchToOffEvent = Simulator::Schedule (durationToOff, &WifiRadioEnergyModel::ChangeState, this, WifiPhyState::OFF);
445
      m_switchToOffEvent = Simulator::Schedule (durationToOff, &WifiRadioEnergyModel::ChangeState, this, WifiPhyState::OFF);
446
    }
446
    }
447
- 

Return to bug 2987