implement ScheduleNow and ScheduleDestroy methods

This commit is contained in:
Mathieu Lacage
2006-10-28 21:21:55 +02:00
parent ebd16ea6fc
commit fecf0c1494

View File

@@ -197,12 +197,26 @@ SimulatorPrivate::Schedule (Time const &time, EventImpl *event)
void
SimulatorPrivate::ScheduleNow (EventImpl *event)
{
//XXX
uint64_t ns = m_currentNs;
Scheduler::EventKey key = {ns, m_uid};
if (m_logEnable)
{
m_log << "i "<<m_currentUid<<" "<<m_currentNs<<" "
<<m_uid<<" "<<time.ApproximateToNanoSeconds () << std::endl;
}
m_uid++;
return m_events->Insert (event, key);
}
void
SimulatorPrivate::ScheduleDestroy (EventImpl *event)
{
//XXX
m_destroy.push_back (std::make_pair (event, m_uid));
if (m_logEnable)
{
m_log << "id " << m_currentUid << " " << Now ().Ns () << " "
<< m_uid << std::endl;
}
m_uid++;
}
Time