EventQueue

class EventQueue

The EventQueue class is when events are queued to execute, but have not yet executed.

Some events may be ‘de-listed’ from the Event Queue if thier trigger changes back to ‘false’, if they are set persistent=False.

Public Types

typedef std::list<rrllvm::Event> _Sequence
typedef std::less<_Sequence::value_type> _Compare
typedef _Sequence::const_iterator const_iterator
typedef _Sequence::iterator iterator
typedef _Sequence::const_reference const_reference

Public Functions

bool eraseExpiredEvents()

remove expired events from the queue.

bool hasCurrentEvents()

are any events current (delay == 0 and triggered or persistant)

bool applyEvents()

assign all of the top most events with the same priority and remove them from the queue.

Returns:

true if any events were assigned, false otherwise.

uint size() const

number of events in the queue

const_reference top()

event with lowest time to assignment and highest priority.

void push(const Event &e)

insert a new event into the queue.

The queue is re-sorted.

double getNextPendingEventTime()

the time the next event is sceduled to be assigned.

void saveState(std::ostream &out)
void loadState(std::istream &in, LLVMExecutableModel &model)

Private Members

_Sequence sequence

the data structure that holds the collection of events.

Currently use a list, sortable and constant time insertion.

_Compare comp

Friends

friend std::ostream &operator<<(std::ostream &stream, const EventQueue &queue)