From 7dbcf72cb1de893aa2b86ccbc70e698bccf76718 Mon Sep 17 00:00:00 2001 From: wqking Date: Thu, 28 Oct 2021 21:11:57 +0800 Subject: [PATCH] Updated documents --- doc/eventqueue.md | 2 +- doc/orderedqueuelist.md | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) 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