Concept

Kinetic::EventQueue

Definition

The for priority queues used by the Simulator. The concept basically defines a priority queue which supports deletions and changes of items in the queue (but not their priorities). Items in the queue must implement the Event concept.

Types

Kinetic::EventQueue::Key
The type used to access items in the queue in order to change or delete them.


Kinetic::EventQueue::Priority
The priority type for items in the queue. This is typically the same as Kinetic::Simulator::Time

.

Creation

Kinetic::EventQueue q ( Priority start, Priority end, int size_hint);
Construct a queue which will start at time start and run until time end.

Operations

template <class Event>
Key q.insert ( Priority, Event) Insert an event into the event queue. A Key which can be used to manipulated the event is returned.

void q.erase ( Key) Erase an event from the queue.

template <class Event>
void q.set ( Key, Event) Change the data in the event referred to by the key.

template <class Event>
Event& q.get ( Key) const Access the event referred to by the passed key.

Priority q.priority ( Key) const Return the priority of the event.

bool q.empty () Return true if the queue is empty.

Priority q.next_priority () const Return the priority of the next event in the queue.

void q.process_next () Process the next Event by calling its process method with its Priority.

void q.set_end_priority () Set the priority beyond which to ignore events.

bool q.contains ( Key) const Return true if the queue contains the event and false if it does not. This is used for auditing events and can be slow if needed.

Has Models

Kinetic::Two_list_pointer_event_queue<FunctionKernel>, Kinetic::Heap_pointer_event_queue<FunctionKernel>.