Documentation ¶
Index ¶
- type EventQueue
- func (p *EventQueue) Insert(v any, priority vrtime.Time) int
- func (p *EventQueue) Len() int
- func (p *EventQueue) MinTime() vrtime.Time
- func (p *EventQueue) Pop() (any, vrtime.Time, int, error)
- func (p *EventQueue) Remove(evt_id int) bool
- func (p *EventQueue) UpdatePriority(evt_id int, newPriority vrtime.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventQueue ¶
type EventQueue struct {
// contains filtered or unexported fields
}
EventQueue represents the queue
func (*EventQueue) Insert ¶
func (p *EventQueue) Insert(v any, priority vrtime.Time) int
Insert inserts a new element into the queue. No action is performed on duplicate elements.
func (*EventQueue) Len ¶
func (p *EventQueue) Len() int
Len returns the number of elements in the queue.
func (*EventQueue) MinTime ¶
func (p *EventQueue) MinTime() vrtime.Time
func (*EventQueue) Pop ¶
Pop removes the element with the highest priority from the queue and returns it. In case of an empty queue, an error is returned.
func (*EventQueue) UpdatePriority ¶
func (p *EventQueue) UpdatePriority(evt_id int, newPriority vrtime.Time)
UpdatePriority changes the priority of a given item. If the specified item is not present in the queue, no action is performed.
Click to show internal directories.
Click to hide internal directories.