Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 94774a05d4f99367afd97b8b4adf565d > files > 924

libfilezilla-devel-0.19.3-1.mga7.armv7hl.rpm

\hypertarget{classfz_1_1event__loop}{}\section{event\+\_\+loop Class Reference}
\label{classfz_1_1event__loop}\index{event\_loop@{event\_loop}}


A threaded event loop that supports sending events and timers.  




{\ttfamily \#include $<$event\+\_\+loop.\+hpp$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1event__loop_aa8bf23a99b230dbdaa8da251d79d7ca5}\label{classfz_1_1event__loop_aa8bf23a99b230dbdaa8da251d79d7ca5}} 
enum {\bfseries loop\+\_\+option} \{ {\bfseries threadless}
 \}
\item 
\mbox{\Hypertarget{classfz_1_1event__loop_a3ddd95aca0dfd0ed58a3a3380e524ef5}\label{classfz_1_1event__loop_a3ddd95aca0dfd0ed58a3a3380e524ef5}} 
typedef std\+::deque$<$ std\+::pair$<$ \mbox{\hyperlink{classfz_1_1event__handler}{event\+\_\+handler}} $\ast$, \mbox{\hyperlink{classfz_1_1event__base}{event\+\_\+base}} $\ast$ $>$ $>$ {\bfseries Events}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1event__loop_aba9c0aee4f613b1d9f81c8053cc3ed5b}\label{classfz_1_1event__loop_aba9c0aee4f613b1d9f81c8053cc3ed5b}} 
\mbox{\hyperlink{classfz_1_1event__loop_aba9c0aee4f613b1d9f81c8053cc3ed5b}{event\+\_\+loop}} ()
\begin{DoxyCompactList}\small\item\em Spawns a thread and starts the loop. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classfz_1_1event__loop_a9de3594bb729c215072ef95e7e854a5c}\label{classfz_1_1event__loop_a9de3594bb729c215072ef95e7e854a5c}} 
\mbox{\hyperlink{classfz_1_1event__loop_a9de3594bb729c215072ef95e7e854a5c}{event\+\_\+loop}} (\mbox{\hyperlink{classfz_1_1thread__pool}{thread\+\_\+pool}} \&pool)
\begin{DoxyCompactList}\small\item\em Takes a thread from the pool and starts the loop. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classfz_1_1event__loop_a36d9056a8c35a959f34456c07407ca01}\label{classfz_1_1event__loop_a36d9056a8c35a959f34456c07407ca01}} 
{\bfseries event\+\_\+loop} (loop\+\_\+option)
\item 
\mbox{\Hypertarget{classfz_1_1event__loop_a0e7bb032a2b1c70a688d9842f2c1793a}\label{classfz_1_1event__loop_a0e7bb032a2b1c70a688d9842f2c1793a}} 
\mbox{\hyperlink{classfz_1_1event__loop_a0e7bb032a2b1c70a688d9842f2c1793a}{$\sim$event\+\_\+loop}} ()
\begin{DoxyCompactList}\small\item\em Stops the thread. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classfz_1_1event__loop_afe905bfe5406410af732907380d778dc}\label{classfz_1_1event__loop_afe905bfe5406410af732907380d778dc}} 
{\bfseries event\+\_\+loop} (\mbox{\hyperlink{classfz_1_1event__loop}{event\+\_\+loop}} const \&)=delete
\item 
\mbox{\Hypertarget{classfz_1_1event__loop_a128f5a4fe9fe93e2714d62853dd3906c}\label{classfz_1_1event__loop_a128f5a4fe9fe93e2714d62853dd3906c}} 
\mbox{\hyperlink{classfz_1_1event__loop}{event\+\_\+loop}} \& {\bfseries operator=} (\mbox{\hyperlink{classfz_1_1event__loop}{event\+\_\+loop}} const \&)=delete
\item 
void \mbox{\hyperlink{classfz_1_1event__loop_a1e4fcf789fb6066e3597d73dc9af0be1}{filter\+\_\+events}} (std\+::function$<$ bool(Events\+::value\+\_\+type \&)$>$ const \&filter)
\begin{DoxyCompactList}\small\item\em Allows filtering of queued events. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfz_1_1event__loop_aaf2027d55c33ca719fe34e92caf78f7c}{stop}} (bool join=false)
\begin{DoxyCompactList}\small\item\em Stops the loop. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classfz_1_1event__loop_a13a43e6d814de94978c515cb084873b1}\label{classfz_1_1event__loop_a13a43e6d814de94978c515cb084873b1}} 
void \mbox{\hyperlink{classfz_1_1event__loop_a13a43e6d814de94978c515cb084873b1}{run}} ()
\begin{DoxyCompactList}\small\item\em Starts the loop in the caller\textquotesingle{}s thread. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1event__loop_ac977175e23b7a6d1b06e2a26c87cc261}\label{classfz_1_1event__loop_ac977175e23b7a6d1b06e2a26c87cc261}} 
class {\bfseries event\+\_\+handler}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
A threaded event loop that supports sending events and timers. 

Timers have precedence over queued events. Too many or too frequent timers can starve processing queued events.

If the deadlines of multiple timers have expired, they get processed in an unspecified order.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{classfz_1_1event__handler}{event\+\_\+handler}} for a complete usage example. 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{events_8cpp-example}{events.\+cpp}}, and \mbox{\hyperlink{timer_fizzbuzz_8cpp-example}{timer\+\_\+fizzbuzz.\+cpp}}.\end{Desc}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{classfz_1_1event__loop_a1e4fcf789fb6066e3597d73dc9af0be1}\label{classfz_1_1event__loop_a1e4fcf789fb6066e3597d73dc9af0be1}} 
\index{event\_loop@{event\_loop}!filter\_events@{filter\_events}}
\index{filter\_events@{filter\_events}!event\_loop@{event\_loop}}
\subsubsection{\texorpdfstring{filter\_events()}{filter\_events()}}
{\footnotesize\ttfamily void filter\+\_\+events (\begin{DoxyParamCaption}\item[{std\+::function$<$ bool(Events\+::value\+\_\+type \&)$>$ const \&}]{filter }\end{DoxyParamCaption})}



Allows filtering of queued events. 

Puts all queued events through the filter function. The filter function can freely change the passed events. If the filter function returns true, the corresponding event gets removed.

The filter function must not call any function of \mbox{\hyperlink{classfz_1_1event__loop}{event\+\_\+loop}}.

Filtering events is a blocking operation and temporarily pauses the loop. \mbox{\Hypertarget{classfz_1_1event__loop_aaf2027d55c33ca719fe34e92caf78f7c}\label{classfz_1_1event__loop_aaf2027d55c33ca719fe34e92caf78f7c}} 
\index{event\_loop@{event\_loop}!stop@{stop}}
\index{stop@{stop}!event\_loop@{event\_loop}}
\subsubsection{\texorpdfstring{stop()}{stop()}}
{\footnotesize\ttfamily void stop (\begin{DoxyParamCaption}\item[{bool}]{join = {\ttfamily false} }\end{DoxyParamCaption})}



Stops the loop. 

Stops the event loop. It is automatically called by the destructor.

Does not wait for the loop if the join argument isn\textquotesingle{}t set. 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{event__loop_8hpp}{event\+\_\+loop.\+hpp}}\end{DoxyCompactItemize}