Maintain the event list. More...
#include <scheduler.h>
Classes | |
struct | Event |
struct | EventKey |
Public Member Functions | |
virtual | ~Scheduler ()=0 |
virtual void | Insert (const Event &ev)=0 |
virtual bool | IsEmpty (void) const =0 |
virtual Event | PeekNext (void) const =0 |
virtual void | Remove (const Event &ev)=0 |
virtual Event | RemoveNext (void)=0 |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
Maintain the event list.
This base class specifies the interface used to maintain the event list. If you want to provide a new event list scheduler, you need to create a subclass of this base class and implement all the pure virtual methods defined here.
The only tricky aspect of this API is the memory management of the EventImpl pointer which is a member of the Event data structure. The lifetime of this pointer is assumed to always be longer than the lifetime of the Scheduler class which means that the caller is responsible for ensuring that this invariant holds through calling EventId::Ref and SimpleRefCount::Unref at the right time. Typically, EventId::Ref is called before Insert and SimpleRefCount::Unref is called after a call to one of the Remove methods.
This type is not accessible from the Config system.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Definition at line 53 of file scheduler.h.
|
pure virtual |
Definition at line 31 of file scheduler.cc.
References NS_LOG_FUNCTION.
|
static |
Reimplemented from ns3::Object.
Reimplemented in ns3::CalendarScheduler, ns3::HeapScheduler, ns3::ListScheduler, and ns3::MapScheduler.
Definition at line 37 of file scheduler.cc.
References ns3::TypeId::SetParent().
|
pure virtual |
ev | event to store in the event list |
Implemented in ns3::CalendarScheduler, ns3::ListScheduler, and ns3::MapScheduler.
Referenced by ns3::DefaultSimulatorImpl::ProcessEventsWithContext(), ns3::DefaultSimulatorImpl::Schedule(), ns3::RealtimeSimulatorImpl::Schedule(), ns3::DistributedSimulatorImpl::Schedule(), ns3::DefaultSimulatorImpl::ScheduleNow(), ns3::RealtimeSimulatorImpl::ScheduleNow(), ns3::DistributedSimulatorImpl::ScheduleNow(), ns3::RealtimeSimulatorImpl::ScheduleRealtimeNowWithContext(), ns3::RealtimeSimulatorImpl::ScheduleRealtimeWithContext(), ns3::DefaultSimulatorImpl::ScheduleWithContext(), ns3::RealtimeSimulatorImpl::ScheduleWithContext(), ns3::DistributedSimulatorImpl::ScheduleWithContext(), ns3::DefaultSimulatorImpl::SetScheduler(), ns3::RealtimeSimulatorImpl::SetScheduler(), and ns3::DistributedSimulatorImpl::SetScheduler().
|
pure virtual |
Implemented in ns3::CalendarScheduler, ns3::HeapScheduler, ns3::ListScheduler, and ns3::MapScheduler.
Referenced by ns3::DefaultSimulatorImpl::DoDispose(), ns3::RealtimeSimulatorImpl::DoDispose(), ns3::DistributedSimulatorImpl::DoDispose(), ns3::DefaultSimulatorImpl::IsFinished(), ns3::RealtimeSimulatorImpl::IsFinished(), ns3::DistributedSimulatorImpl::IsFinished(), ns3::RealtimeSimulatorImpl::NextTs(), ns3::DistributedSimulatorImpl::NextTs(), ns3::RealtimeSimulatorImpl::ProcessOneEvent(), ns3::DefaultSimulatorImpl::Run(), ns3::RealtimeSimulatorImpl::Run(), ns3::DistributedSimulatorImpl::Run(), ns3::DefaultSimulatorImpl::SetScheduler(), ns3::RealtimeSimulatorImpl::SetScheduler(), and ns3::DistributedSimulatorImpl::SetScheduler().
|
pure virtual |
This method cannot be invoked if the list is empty.
Implemented in ns3::CalendarScheduler, ns3::HeapScheduler, ns3::ListScheduler, and ns3::MapScheduler.
Referenced by ns3::RealtimeSimulatorImpl::NextTs(), and ns3::DistributedSimulatorImpl::NextTs().
|
pure virtual |
ev | the event to remove |
This methods cannot be invoked if the list is empty.
Implemented in ns3::CalendarScheduler, ns3::ListScheduler, and ns3::MapScheduler.
Referenced by ns3::DefaultSimulatorImpl::Remove(), ns3::RealtimeSimulatorImpl::Remove(), and ns3::DistributedSimulatorImpl::Remove().
|
pure virtual |
This method cannot be invoked if the list is empty. Remove the next earliest event from the event list.
Implemented in ns3::CalendarScheduler, ns3::HeapScheduler, ns3::ListScheduler, and ns3::MapScheduler.
Referenced by ns3::DefaultSimulatorImpl::DoDispose(), ns3::RealtimeSimulatorImpl::DoDispose(), ns3::DistributedSimulatorImpl::DoDispose(), ns3::DefaultSimulatorImpl::ProcessOneEvent(), ns3::RealtimeSimulatorImpl::ProcessOneEvent(), ns3::DistributedSimulatorImpl::ProcessOneEvent(), ns3::DefaultSimulatorImpl::SetScheduler(), ns3::RealtimeSimulatorImpl::SetScheduler(), and ns3::DistributedSimulatorImpl::SetScheduler().