namespace sd::slidesorter::cache
{ /** The request queue stores requests that are described by the Request sortedaccordingtopriorityclassandthenpriority.
*/ class RequestQueue : public sdr::PageUser
{ public: explicit RequestQueue(SharedCacheContext pCacheContext); virtual ~RequestQueue();
/** Insert a request with highest or lowest priority in its priority class.Whentherequestisalreadypresentthenitisfirst removed.Thiseffectisthenare-prioritization. @paramaKey Therequest. @parameRequestClass Thepriorityclassinwhichtoinserttherequestwithhighest orlowestpriority. @parambInsertWithHighestPriority Whenthisflagis<TRUE/>therequestisinsertedwithhighest priorityinitsclass.When<FALSE/>therequestisinserted withlowestpriority.
*/ void AddRequest(CacheKey aKey, RequestPriorityClass eRequestClass);
/** Remove the specified request from the queue. @paramaKey ItisOKwhenthespecifiedrequestisnotamemberofthe queue.
*/ #if OSL_DEBUG_LEVEL >= 2 bool #else void #endif
RemoveRequest(CacheKey aKey);
/** Change the priority class of the specified request.
*/ void ChangeClass(CacheKey aKey, RequestPriorityClass eNewRequestClass);
/** Get the request with the highest priority int the highest priority class.
*/
CacheKey GetFront();
// For debugging.
RequestPriorityClass GetFrontPriorityClass();
/** Really a synonym for RemoveRequest(GetFront());
*/ void PopFront();
/** Returns <TRUE/> when there is no element in the queue.
*/ bool IsEmpty();
/** Remove all requests from the queue. This resets the minimum and maximumprioritiestotheirdefaultvalues.
*/ void Clear();
/** Return the mutex that guards the access to the priority queue.
*/
::osl::Mutex& GetMutex() { return maMutex; }
/** Ensure we don't hand out a page deleted before anyone got a chancetoprocessit
*/ virtualvoid PageInDestruction(const SdrPage& rPage) override;
private:
::osl::Mutex maMutex; class Container;
std::unique_ptr<Container> mpRequestQueue;
SharedCacheContext mpCacheContext;
/** A lower bound of the lowest priority of all elements in the queues. Thestartvalueis0.Itisassignedandthendecreasedeverytime whenanelementisinsertedormarkedastherequestwithlowest priority.
*/ int mnMinimumPriority; /** An upper bound of the highest priority of all elements in the queues. Thestartvalueis1.Itisassignedandthenincreasedeverytime whenanelementisinsertedormarkedastherequestwithhighest priority.
*/ int mnMaximumPriority;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.