\hypertarget{class_ogre_1_1_work_queue}{}\section{Ogre\+:\+:Work\+Queue Class Reference}
\label{class_ogre_1_1_work_queue}\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}


Interface to a general purpose request / response style background work queue.  




{\ttfamily \#include $<$Ogre\+Work\+Queue.\+h$>$}



Inheritance diagram for Ogre\+:\+:Work\+Queue\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=242pt]{class_ogre_1_1_work_queue__inherit__graph}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{class_ogre_1_1_work_queue_1_1_request}{Request}
\begin{DoxyCompactList}\small\item\em General purpose request structure. \end{DoxyCompactList}\item 
class \hyperlink{class_ogre_1_1_work_queue_1_1_request_handler}{Request\+Handler}
\begin{DoxyCompactList}\small\item\em Interface definition for a handler of requests. \end{DoxyCompactList}\item 
struct \hyperlink{struct_ogre_1_1_work_queue_1_1_response}{Response}
\begin{DoxyCompactList}\small\item\em General purpose response structure. \end{DoxyCompactList}\item 
class \hyperlink{class_ogre_1_1_work_queue_1_1_response_handler}{Response\+Handler}
\begin{DoxyCompactList}\small\item\em Interface definition for a handler of responses. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef unsigned long long int \hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID}
\begin{DoxyCompactList}\small\item\em Numeric identifier for a request. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_work_queue_a522d959bdec37026c5ad9eb2e2b189cc}{Work\+Queue} ()
\item 
virtual \hyperlink{class_ogre_1_1_work_queue_a2e7a64f2d114bf2828355e83e43f8172}{$\sim$\+Work\+Queue} ()
\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_aae92816d648918690f76f6fe14f125c0}{abort\+All\+Requests} ()=0
\begin{DoxyCompactList}\small\item\em Abort all previously issued requests. \end{DoxyCompactList}\item 
virtual bool \hyperlink{class_ogre_1_1_work_queue_a96f12a032fddb17f2fc6a0f519c5d479}{abort\+Pending\+Request} (\hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID} id)=0
\begin{DoxyCompactList}\small\item\em Abort request if it is not being processed currently. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_afe710c55a31c661f738abb2cc5c7303e}{abort\+Pending\+Requests\+By\+Channel} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel)=0
\begin{DoxyCompactList}\small\item\em Abort all previously issued requests in a given channel. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_a5c3f58ddc03546ba2a5c510cbca0aae6}{abort\+Request} (\hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID} id)=0
\begin{DoxyCompactList}\small\item\em Abort a previously issued request. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_ac885db05201bde87b65c27e1b7cf8af4}{abort\+Requests\+By\+Channel} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel)=0
\begin{DoxyCompactList}\small\item\em Abort all previously issued requests in a given channel. \end{DoxyCompactList}\item 
virtual \hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID} \hyperlink{class_ogre_1_1_work_queue_ac8abc5abf22d01f0fd86efb43f5f0d39}{add\+Request} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel, \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} request\+Type, const \hyperlink{class_ogre_1_1_any}{Any} \&r\+Data, \hyperlink{namespace_ogre_a119732ea9d1e88bbddc47b4ac0fa21cb}{uint8} retry\+Count=0, bool force\+Synchronous=false, bool idle\+Thread=false)=0
\begin{DoxyCompactList}\small\item\em Add a new request to the queue. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_aa0687acbbe081ba2a3ae3c3bdbfca6ff}{add\+Request\+Handler} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel, \hyperlink{class_ogre_1_1_work_queue_1_1_request_handler}{Request\+Handler} $\ast$rh)=0
\begin{DoxyCompactList}\small\item\em Add a request handler instance to the queue. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_ac7a22c908d9859d29c22fc8b73a7c735}{add\+Response\+Handler} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel, \hyperlink{class_ogre_1_1_work_queue_1_1_response_handler}{Response\+Handler} $\ast$rh)=0
\begin{DoxyCompactList}\small\item\em Add a response handler instance to the queue. \end{DoxyCompactList}\item 
virtual \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} \hyperlink{class_ogre_1_1_work_queue_a9a550b2e870c3cf2fb7dc6732ceed3e5}{get\+Channel} (const \hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String} \&channel\+Name)
\begin{DoxyCompactList}\small\item\em Get a channel ID for a given channel name. \end{DoxyCompactList}\item 
virtual bool \hyperlink{class_ogre_1_1_work_queue_abc8685f2e0f4921468f8cf7cb5f2b2b3}{get\+Requests\+Accepted} () const =0
\begin{DoxyCompactList}\small\item\em Returns whether requests are being accepted right now. \end{DoxyCompactList}\item 
virtual unsigned long \hyperlink{class_ogre_1_1_work_queue_a9b605e17372e8a45eab9471955979d4a}{get\+Response\+Processing\+Time\+Limit} () const =0
\begin{DoxyCompactList}\small\item\em Get the time limit imposed on the processing of responses in a single frame, in milliseconds (0 indicates no limit). \end{DoxyCompactList}\item 
virtual bool \hyperlink{class_ogre_1_1_work_queue_a79a71d8b70010d28043a2fef2c3e2cf8}{is\+Paused} () const =0
\begin{DoxyCompactList}\small\item\em Return whether the queue is paused ie not sending more work to workers. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_aa4c64bf597bd87860dc297f0ac7af463}{process\+Responses} ()=0
\begin{DoxyCompactList}\small\item\em Process the responses in the queue. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_aae885bf0b8988f2353659d896bfa6b78}{remove\+Request\+Handler} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel, \hyperlink{class_ogre_1_1_work_queue_1_1_request_handler}{Request\+Handler} $\ast$rh)=0
\begin{DoxyCompactList}\small\item\em Remove a request handler. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_ab8160c231f7f7706030432c3c585e589}{remove\+Response\+Handler} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} channel, \hyperlink{class_ogre_1_1_work_queue_1_1_response_handler}{Response\+Handler} $\ast$rh)=0
\begin{DoxyCompactList}\small\item\em Remove a \hyperlink{struct_ogre_1_1_work_queue_1_1_response}{Response} handler. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_a414eb873108df39549cc79d8246994d3}{set\+Paused} (bool pause)=0
\begin{DoxyCompactList}\small\item\em Set whether to pause further processing of any requests. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_a1fd22283445612a4d0e020917f1582b9}{set\+Requests\+Accepted} (bool accept)=0
\begin{DoxyCompactList}\small\item\em Set whether to accept new requests or not. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_a9b631e09dcaafb4a341eff307f00feca}{set\+Response\+Processing\+Time\+Limit} (unsigned long ms)=0
\begin{DoxyCompactList}\small\item\em Set the time limit imposed on the processing of responses in a single frame, in milliseconds (0 indicates no limit). \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_a42d64d8891849878e3d1afb66fa0ce19}{shutdown} ()=0
\begin{DoxyCompactList}\small\item\em Shut down the queue. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_work_queue_ad6d7aeeb4b1e4e8eed931cb17d63add3}{startup} (bool force\+Restart=true)=0
\begin{DoxyCompactList}\small\item\em Start up the queue with the options that have been set. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interface to a general purpose request / response style background work queue. 

\begin{DoxyRemark}{Remarks}
A work queue is a simple structure, where requests for work are placed onto the queue, then removed by a worker for processing, then finally a response is placed on the result queue for the originator to pick up at their leisure. The typical use for this is in a threaded environment, although any kind of deferred processing could use this approach to decouple and distribute work over a period of time even if it was single threaded. 
\end{DoxyRemark}
\begin{DoxyParagraph}{}
Work\+Queues also incorporate thread pools. One or more background worker threads can wait on the queue and be notified when a request is waiting to be processed. For maximal thread usage, a \hyperlink{class_ogre_1_1_work_queue}{Work\+Queue} instance should be shared among many sources of work, rather than many work queues being created. This way, you can share a small number of hardware threads among a large number of background tasks. This doesn\textquotesingle{}t mean you have to implement all the request processing in one class, you can plug in many handlers in order to process the requests. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
This is an abstract interface definition; users can subclass this and provide their own implementation if required to centralise task management in their own subsystems. We also provide a default implementation in the form of \hyperlink{class_ogre_1_1_default_work_queue}{Default\+Work\+Queue}. 
\end{DoxyParagraph}


\subsection{Member Typedef Documentation}
\mbox{\Hypertarget{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}\label{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!Request\+ID@{Request\+ID}}
\index{Request\+ID@{Request\+ID}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{Request\+ID}{RequestID}}
{\footnotesize\ttfamily typedef unsigned long long int \hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Ogre\+::\+Work\+Queue\+::\+Request\+ID}}



Numeric identifier for a request. 



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_work_queue_a522d959bdec37026c5ad9eb2e2b189cc}\label{class_ogre_1_1_work_queue_a522d959bdec37026c5ad9eb2e2b189cc}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!Work\+Queue@{Work\+Queue}}
\index{Work\+Queue@{Work\+Queue}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{Work\+Queue()}{WorkQueue()}}
{\footnotesize\ttfamily Ogre\+::\+Work\+Queue\+::\+Work\+Queue (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a2e7a64f2d114bf2828355e83e43f8172}\label{class_ogre_1_1_work_queue_a2e7a64f2d114bf2828355e83e43f8172}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!````~Work\+Queue@{$\sim$\+Work\+Queue}}
\index{````~Work\+Queue@{$\sim$\+Work\+Queue}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{$\sim$\+Work\+Queue()}{~WorkQueue()}}
{\footnotesize\ttfamily virtual Ogre\+::\+Work\+Queue\+::$\sim$\+Work\+Queue (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_work_queue_ad6d7aeeb4b1e4e8eed931cb17d63add3}\label{class_ogre_1_1_work_queue_ad6d7aeeb4b1e4e8eed931cb17d63add3}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!startup@{startup}}
\index{startup@{startup}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{startup()}{startup()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::startup (\begin{DoxyParamCaption}\item[{bool}]{force\+Restart = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Start up the queue with the options that have been set. 


\begin{DoxyParams}{Parameters}
{\em force\+Restart} & If the queue is already running, whether to shut it down and restart. \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_a1a0f33724027da3501c0c8b8182480cf}{Ogre\+::\+Default\+Work\+Queue}, and \hyperlink{class_ogre_1_1_default_work_queue_a1a0f33724027da3501c0c8b8182480cf}{Ogre\+::\+Default\+Work\+Queue}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_aa0687acbbe081ba2a3ae3c3bdbfca6ff}\label{class_ogre_1_1_work_queue_aa0687acbbe081ba2a3ae3c3bdbfca6ff}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!add\+Request\+Handler@{add\+Request\+Handler}}
\index{add\+Request\+Handler@{add\+Request\+Handler}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{add\+Request\+Handler()}{addRequestHandler()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::add\+Request\+Handler (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel,  }\item[{\hyperlink{class_ogre_1_1_work_queue_1_1_request_handler}{Request\+Handler} $\ast$}]{rh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Add a request handler instance to the queue. 

\begin{DoxyRemark}{Remarks}
Every queue must have at least one request handler instance for each channel in which requests are raised. If you add more than one handler per channel, then you must implement can\+Handle\+Request differently in each if you wish them to respond to different requests. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em channel} & The channel for requests you want to handle \\
\hline
{\em rh} & Your handler \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a7fc21f1afa5edb2a919f8ba2febfb1a3}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_aae885bf0b8988f2353659d896bfa6b78}\label{class_ogre_1_1_work_queue_aae885bf0b8988f2353659d896bfa6b78}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!remove\+Request\+Handler@{remove\+Request\+Handler}}
\index{remove\+Request\+Handler@{remove\+Request\+Handler}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{remove\+Request\+Handler()}{removeRequestHandler()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::remove\+Request\+Handler (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel,  }\item[{\hyperlink{class_ogre_1_1_work_queue_1_1_request_handler}{Request\+Handler} $\ast$}]{rh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Remove a request handler. 



Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a1f0847f5d8a4f9e4703a390acacfaa84}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_ac7a22c908d9859d29c22fc8b73a7c735}\label{class_ogre_1_1_work_queue_ac7a22c908d9859d29c22fc8b73a7c735}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!add\+Response\+Handler@{add\+Response\+Handler}}
\index{add\+Response\+Handler@{add\+Response\+Handler}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{add\+Response\+Handler()}{addResponseHandler()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::add\+Response\+Handler (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel,  }\item[{\hyperlink{class_ogre_1_1_work_queue_1_1_response_handler}{Response\+Handler} $\ast$}]{rh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Add a response handler instance to the queue. 

\begin{DoxyRemark}{Remarks}
Every queue must have at least one response handler instance for each channel in which requests are raised. If you add more than one, then you must implement can\+Handle\+Response differently in each if you wish them to respond to different responses. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em channel} & The channel for responses you want to handle \\
\hline
{\em rh} & Your handler \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a9e338627cd72591048b9de5a5f4f9770}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_ab8160c231f7f7706030432c3c585e589}\label{class_ogre_1_1_work_queue_ab8160c231f7f7706030432c3c585e589}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!remove\+Response\+Handler@{remove\+Response\+Handler}}
\index{remove\+Response\+Handler@{remove\+Response\+Handler}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{remove\+Response\+Handler()}{removeResponseHandler()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::remove\+Response\+Handler (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel,  }\item[{\hyperlink{class_ogre_1_1_work_queue_1_1_response_handler}{Response\+Handler} $\ast$}]{rh }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Remove a \hyperlink{struct_ogre_1_1_work_queue_1_1_response}{Response} handler. 



Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_ad8b1cec781199a65accf0024acc2c18a}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_ac8abc5abf22d01f0fd86efb43f5f0d39}\label{class_ogre_1_1_work_queue_ac8abc5abf22d01f0fd86efb43f5f0d39}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!add\+Request@{add\+Request}}
\index{add\+Request@{add\+Request}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{add\+Request()}{addRequest()}}
{\footnotesize\ttfamily virtual \hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID} Ogre\+::\+Work\+Queue\+::add\+Request (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel,  }\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{request\+Type,  }\item[{const \hyperlink{class_ogre_1_1_any}{Any} \&}]{r\+Data,  }\item[{\hyperlink{namespace_ogre_a119732ea9d1e88bbddc47b4ac0fa21cb}{uint8}}]{retry\+Count = {\ttfamily 0},  }\item[{bool}]{force\+Synchronous = {\ttfamily false},  }\item[{bool}]{idle\+Thread = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Add a new request to the queue. 


\begin{DoxyParams}{Parameters}
{\em channel} & The channel this request will go into = 0; the channel is the top-\/level categorisation of the request \\
\hline
{\em request\+Type} & An identifier that\textquotesingle{}s unique within this queue which identifies the type of the request (user decides the actual value) \\
\hline
{\em r\+Data} & The data required by the request process. \\
\hline
{\em retry\+Count} & The number of times the request should be retried if it fails. \\
\hline
{\em force\+Synchronous} & Forces the request to be processed immediately even if threading is enabled. \\
\hline
{\em idle\+Thread} & \hyperlink{class_ogre_1_1_work_queue_1_1_request}{Request} should be processed on the idle thread. Idle requests will be processed on a single worker thread. You should use this in the following situations\+:
\begin{DoxyEnumerate}
\item If a request handler can\textquotesingle{}t process multiple requests in parallel.
\item If you add lot of requests, but you want to keep the game fast.
\item If you have lot of more important threads. (example\+: physics). 
\end{DoxyEnumerate}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The ID of the request that has been added 
\end{DoxyReturn}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_aca9fadb9513b1c44286aeb857615a18f}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a5c3f58ddc03546ba2a5c510cbca0aae6}\label{class_ogre_1_1_work_queue_a5c3f58ddc03546ba2a5c510cbca0aae6}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!abort\+Request@{abort\+Request}}
\index{abort\+Request@{abort\+Request}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{abort\+Request()}{abortRequest()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::abort\+Request (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID}}]{id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Abort a previously issued request. 

If the request is still waiting to be processed, it will be removed from the queue. 
\begin{DoxyParams}{Parameters}
{\em id} & The ID of the previously issued request. \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a634fdd65c89267fc6aeca8e8f6cf5446}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a96f12a032fddb17f2fc6a0f519c5d479}\label{class_ogre_1_1_work_queue_a96f12a032fddb17f2fc6a0f519c5d479}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!abort\+Pending\+Request@{abort\+Pending\+Request}}
\index{abort\+Pending\+Request@{abort\+Pending\+Request}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{abort\+Pending\+Request()}{abortPendingRequest()}}
{\footnotesize\ttfamily virtual bool Ogre\+::\+Work\+Queue\+::abort\+Pending\+Request (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_work_queue_a1908257e726af6caa80f1a6cd5682d76}{Request\+ID}}]{id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Abort request if it is not being processed currently. 


\begin{DoxyParams}{Parameters}
{\em id} & The ID of the previously issued request.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em true} & If request was aborted successfully. \\
\hline
{\em false} & If request is already being processed so it can not be aborted. \\
\hline
\end{DoxyRetVals}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a388ad6e7277319953b9a9982fa2cf4d2}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_ac885db05201bde87b65c27e1b7cf8af4}\label{class_ogre_1_1_work_queue_ac885db05201bde87b65c27e1b7cf8af4}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!abort\+Requests\+By\+Channel@{abort\+Requests\+By\+Channel}}
\index{abort\+Requests\+By\+Channel@{abort\+Requests\+By\+Channel}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{abort\+Requests\+By\+Channel()}{abortRequestsByChannel()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::abort\+Requests\+By\+Channel (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Abort all previously issued requests in a given channel. 

\hyperlink{class_ogre_1_1_any}{Any} requests still waiting to be processed of the given channel, will be removed from the queue. Requests which are processed, but response handler is not called will also be removed. 
\begin{DoxyParams}{Parameters}
{\em channel} & The type of request to be aborted \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_ae8cf46d021a09310d1ab96aa1a2c0d08}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_afe710c55a31c661f738abb2cc5c7303e}\label{class_ogre_1_1_work_queue_afe710c55a31c661f738abb2cc5c7303e}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!abort\+Pending\+Requests\+By\+Channel@{abort\+Pending\+Requests\+By\+Channel}}
\index{abort\+Pending\+Requests\+By\+Channel@{abort\+Pending\+Requests\+By\+Channel}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{abort\+Pending\+Requests\+By\+Channel()}{abortPendingRequestsByChannel()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::abort\+Pending\+Requests\+By\+Channel (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{channel }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Abort all previously issued requests in a given channel. 

\hyperlink{class_ogre_1_1_any}{Any} requests still waiting to be processed of the given channel, will be removed from the queue. It will not remove requests, where the request handler is already called. 
\begin{DoxyParams}{Parameters}
{\em channel} & The type of request to be aborted \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_ac79ce136b644d7b44b55f4e6ec2542a2}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_aae92816d648918690f76f6fe14f125c0}\label{class_ogre_1_1_work_queue_aae92816d648918690f76f6fe14f125c0}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!abort\+All\+Requests@{abort\+All\+Requests}}
\index{abort\+All\+Requests@{abort\+All\+Requests}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{abort\+All\+Requests()}{abortAllRequests()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::abort\+All\+Requests (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Abort all previously issued requests. 

\hyperlink{class_ogre_1_1_any}{Any} requests still waiting to be processed will be removed from the queue. \hyperlink{class_ogre_1_1_any}{Any} requests that are being processed will still complete. 

Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a0c50d7ab19de75a3e378ba46aa8fbf9c}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a414eb873108df39549cc79d8246994d3}\label{class_ogre_1_1_work_queue_a414eb873108df39549cc79d8246994d3}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!set\+Paused@{set\+Paused}}
\index{set\+Paused@{set\+Paused}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{set\+Paused()}{setPaused()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::set\+Paused (\begin{DoxyParamCaption}\item[{bool}]{pause }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Set whether to pause further processing of any requests. 

If true, any further requests will simply be queued and not processed until set\+Paused(false) is called. \hyperlink{class_ogre_1_1_any}{Any} requests which are in the process of being worked on already will still continue. 

Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a7f471c07b8f0fdd002d6c299750a1578}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a79a71d8b70010d28043a2fef2c3e2cf8}\label{class_ogre_1_1_work_queue_a79a71d8b70010d28043a2fef2c3e2cf8}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!is\+Paused@{is\+Paused}}
\index{is\+Paused@{is\+Paused}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{is\+Paused()}{isPaused()}}
{\footnotesize\ttfamily virtual bool Ogre\+::\+Work\+Queue\+::is\+Paused (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}



Return whether the queue is paused ie not sending more work to workers. 



Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_aa8530de81120f7820964029b8de88972}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a1fd22283445612a4d0e020917f1582b9}\label{class_ogre_1_1_work_queue_a1fd22283445612a4d0e020917f1582b9}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!set\+Requests\+Accepted@{set\+Requests\+Accepted}}
\index{set\+Requests\+Accepted@{set\+Requests\+Accepted}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{set\+Requests\+Accepted()}{setRequestsAccepted()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::set\+Requests\+Accepted (\begin{DoxyParamCaption}\item[{bool}]{accept }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Set whether to accept new requests or not. 

If true, requests are added to the queue as usual. If false, requests are silently ignored until set\+Requests\+Accepted(true) is called. 

Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a291e7c92efb374ec208c680375edd2ce}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_abc8685f2e0f4921468f8cf7cb5f2b2b3}\label{class_ogre_1_1_work_queue_abc8685f2e0f4921468f8cf7cb5f2b2b3}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!get\+Requests\+Accepted@{get\+Requests\+Accepted}}
\index{get\+Requests\+Accepted@{get\+Requests\+Accepted}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{get\+Requests\+Accepted()}{getRequestsAccepted()}}
{\footnotesize\ttfamily virtual bool Ogre\+::\+Work\+Queue\+::get\+Requests\+Accepted (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns whether requests are being accepted right now. 



Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_ab49caa9d2a8b18cfb2e9beccd41bdd22}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_aa4c64bf597bd87860dc297f0ac7af463}\label{class_ogre_1_1_work_queue_aa4c64bf597bd87860dc297f0ac7af463}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!process\+Responses@{process\+Responses}}
\index{process\+Responses@{process\+Responses}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{process\+Responses()}{processResponses()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::process\+Responses (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Process the responses in the queue. 

\begin{DoxyRemark}{Remarks}
This method is public, and must be called from the main render thread to \textquotesingle{}pump\textquotesingle{} responses through the system. The method will usually try to clear all responses before returning = 0; however, you can specify a time limit on the response processing to limit the impact of spikes in demand by calling set\+Response\+Processing\+Time\+Limit. 
\end{DoxyRemark}


Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a09a2d91f22689b5aad7967cfb799c63e}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a9b605e17372e8a45eab9471955979d4a}\label{class_ogre_1_1_work_queue_a9b605e17372e8a45eab9471955979d4a}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!get\+Response\+Processing\+Time\+Limit@{get\+Response\+Processing\+Time\+Limit}}
\index{get\+Response\+Processing\+Time\+Limit@{get\+Response\+Processing\+Time\+Limit}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{get\+Response\+Processing\+Time\+Limit()}{getResponseProcessingTimeLimit()}}
{\footnotesize\ttfamily virtual unsigned long Ogre\+::\+Work\+Queue\+::get\+Response\+Processing\+Time\+Limit (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}



Get the time limit imposed on the processing of responses in a single frame, in milliseconds (0 indicates no limit). 



Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a92bfbc2f99623e8df8dd2d611afda1ae}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a9b631e09dcaafb4a341eff307f00feca}\label{class_ogre_1_1_work_queue_a9b631e09dcaafb4a341eff307f00feca}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!set\+Response\+Processing\+Time\+Limit@{set\+Response\+Processing\+Time\+Limit}}
\index{set\+Response\+Processing\+Time\+Limit@{set\+Response\+Processing\+Time\+Limit}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{set\+Response\+Processing\+Time\+Limit()}{setResponseProcessingTimeLimit()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::set\+Response\+Processing\+Time\+Limit (\begin{DoxyParamCaption}\item[{unsigned long}]{ms }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Set the time limit imposed on the processing of responses in a single frame, in milliseconds (0 indicates no limit). 

This sets the maximum time that will be spent in \hyperlink{class_ogre_1_1_work_queue_aa4c64bf597bd87860dc297f0ac7af463}{process\+Responses()} in a single frame. The default is 8ms. 

Implemented in \hyperlink{class_ogre_1_1_default_work_queue_base_a7b7a4119647b82187af2341d96f51e3b}{Ogre\+::\+Default\+Work\+Queue\+Base}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a42d64d8891849878e3d1afb66fa0ce19}\label{class_ogre_1_1_work_queue_a42d64d8891849878e3d1afb66fa0ce19}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!shutdown@{shutdown}}
\index{shutdown@{shutdown}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{shutdown()}{shutdown()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Work\+Queue\+::shutdown (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Shut down the queue. 



Implemented in \hyperlink{class_ogre_1_1_default_work_queue_a74aec1a66a9d5a5639a62ed33747eb76}{Ogre\+::\+Default\+Work\+Queue}, and \hyperlink{class_ogre_1_1_default_work_queue_a74aec1a66a9d5a5639a62ed33747eb76}{Ogre\+::\+Default\+Work\+Queue}.

\mbox{\Hypertarget{class_ogre_1_1_work_queue_a9a550b2e870c3cf2fb7dc6732ceed3e5}\label{class_ogre_1_1_work_queue_a9a550b2e870c3cf2fb7dc6732ceed3e5}} 
\index{Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}!get\+Channel@{get\+Channel}}
\index{get\+Channel@{get\+Channel}!Ogre\+::\+Work\+Queue@{Ogre\+::\+Work\+Queue}}
\subsubsection{\texorpdfstring{get\+Channel()}{getChannel()}}
{\footnotesize\ttfamily virtual \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} Ogre\+::\+Work\+Queue\+::get\+Channel (\begin{DoxyParamCaption}\item[{const \hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String} \&}]{channel\+Name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Get a channel ID for a given channel name. 

\begin{DoxyRemark}{Remarks}
Channels are assigned on a first-\/come, first-\/served basis and are not persistent across application instances. This method allows applications to not worry about channel clashes through manually assigned channel numbers. 
\end{DoxyRemark}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_work_queue_8h}{Ogre\+Work\+Queue.\+h}\end{DoxyCompactItemize}
