diff --git a/doc/eventqueue.md b/doc/eventqueue.md index cc7abe9..c2b5d82 100644 --- a/doc/eventqueue.md +++ b/doc/eventqueue.md @@ -129,7 +129,7 @@ template bool processIf(Predictor && predictor); ``` Process the event queue. Before processing an event, the event is passed to `predictor` and the event will be processed only if `predictor` returns true. -`predictor` is a callable object that takes exactly the same arguments as `EventQueue::enqueue` or have no arguments, and returns a boolean value. eventpp will pass the arguments properly. +`predictor` is a callable object(function, lambda, etc) that takes exactly the same arguments as `EventQueue::enqueue` or have no arguments, and returns a boolean value. eventpp will pass the arguments properly. `processIf` returns true if any event was dispatched, false if no event was dispatched. `processIf` has some good use scenarios: 1. Process certain events in certain thread. For example, in a GUI application, the UI related events may be only desired to be processed in the main thread. diff --git a/doc/orderedqueuelist.md b/doc/orderedqueuelist.md index 903ca75..89a1782 100644 --- a/doc/orderedqueuelist.md +++ b/doc/orderedqueuelist.md @@ -13,9 +13,12 @@ ## Description -OrderedQueueList is a utility class that sorts the events in an EventQueue in certain order. -With OrderedQueueList, we can dispatch events in certain order such as in priority order. -This class is used by the QueueList policy. See [document of policies](policies.md) for details. +`OrderedQueueList` is a utility class that sorts the events in an EventQueue in certain order. +With `OrderedQueueList`, we can dispatch events in certain order such as in priority order. +This class is used with the `QueueList` policy. See [document of policies](policies.md) for details and how to implement new `QueueList`. + +Warning: `OrderedQueueList` is not efficient since it simply inherits from `std::list` and sorts the full list on each `splice`. +To use it in performance critical applications, you should implement your own version with sophisticated algorithm. ## API reference