\hypertarget{group__Ecore__Poller__Group}{}\doxysection{Ecore Poll functions}
\label{group__Ecore__Poller__Group}\index{Ecore Poll functions@{Ecore Poll functions}}


Ecore poller provides infrastructure for the creation of pollers.  


\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Ecore__Poller__Group_ga0e967ed90714bea99df9ac0337b414bb}\label{group__Ecore__Poller__Group_ga0e967ed90714bea99df9ac0337b414bb}} 
typedef struct \+\_\+\+Ecore\+\_\+\+Poller {\bfseries Ecore\+\_\+\+Poller}
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}} \{ \mbox{\hyperlink{group__Ecore__Poller__Group_gga40d67f547376373ee34363b825874088a022dfec751388e380cf01621bd0f797f}{ECORE\+\_\+\+POLLER\+\_\+\+CORE}} = 0
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Ecore\+\_\+\+Poller $\ast$ \mbox{\hyperlink{group__Ecore__Poller__Group_ga9ce7d4becc2fb4cc08e07e659c332f27}{ecore\+\_\+poller\+\_\+add}} (\mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}} type, int interval, \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}} func, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Creates a poller to call the given function at a particular tick interval. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Ecore__Poller__Group_ga5284994ef29eb44342f9dc87c855139b}{ecore\+\_\+poller\+\_\+del}} (Ecore\+\_\+\+Poller $\ast$poller)
\begin{DoxyCompactList}\small\item\em Deletes the specified poller from the timer list. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Ecore__Poller__Group_ga466dff0c7fb7eb0f5b4e5a3825fa10ac}{ecore\+\_\+poller\+\_\+poll\+\_\+interval\+\_\+set}} (\mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}} type, double poll\+\_\+time)
\begin{DoxyCompactList}\small\item\em Sets the time(in seconds) between ticks for the given poller type. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{group__Ecore__Poller__Group_ga72031680ab8f5385639389ac0591e272}{ecore\+\_\+poller\+\_\+poll\+\_\+interval\+\_\+get}} (\mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}} type)
\begin{DoxyCompactList}\small\item\em Gets the time(in seconds) between ticks for the given poller type. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Ecore__Poller__Group_gae9acf938d0e3b3ee84509d0c04ed628a}{ecore\+\_\+poller\+\_\+poller\+\_\+interval\+\_\+set}} (Ecore\+\_\+\+Poller $\ast$obj, int interval)
\begin{DoxyCompactList}\small\item\em Polling interval rate of the poller. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Ecore__Poller__Group_ga1c80d050bf17021f26ed531cd53ca510}{ecore\+\_\+poller\+\_\+poller\+\_\+interval\+\_\+get}} (const Ecore\+\_\+\+Poller $\ast$obj)
\begin{DoxyCompactList}\small\item\em Polling interval rate of the poller. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Ecore poller provides infrastructure for the creation of pollers. 

Pollers are, in essence, callbacks that share a single timer per type. Because not all pollers need to be called at the same frequency the user may specify the frequency in ticks(each expiration of the shared timer is called a tick, in ecore poller parlance) for each added poller. Ecore pollers should only be used when the poller doesn\textquotesingle{}t have specific requirements on the exact times to poll.

This architecture means that the main loop is only woken up once to handle all pollers of that type, this will save power as the CPU has more of a chance to go into a low power state the longer it is asleep for, so this should be used in situations where power usage is a concern.

For now only 1 core poller type is supported\+: ECORE\+\_\+\+POLLER\+\_\+\+CORE, the default interval for ECORE\+\_\+\+POLLER\+\_\+\+CORE is 0.\+125(or 1/8th) second.

The creation of a poller is extremely simple and only requires one line\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{group__Ecore__Poller__Group_ga9ce7d4becc2fb4cc08e07e659c332f27}{ecore\_poller\_add}}(\mbox{\hyperlink{group__Ecore__Poller__Group_gga40d67f547376373ee34363b825874088a022dfec751388e380cf01621bd0f797f}{ECORE\_POLLER\_CORE}},\ 1,\ my\_poller\_function,\ NULL);}

\end{DoxyCode}
 This sample creates a poller to call {\ttfamily my\+\_\+poller\+\_\+function} at every tick with {\ttfamily NULL} as data.

Example\+: \begin{DoxyItemize}
\item \mbox{\hyperlink{ecore_poller_example_c}{ecore poller -\/ Repetitive polling tasks}} \end{DoxyItemize}


\doxysubsection{Enumeration Type Documentation}
\mbox{\Hypertarget{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}\label{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}} 
\index{Ecore Poll functions@{Ecore Poll functions}!Ecore\_Poller\_Type@{Ecore\_Poller\_Type}}
\index{Ecore\_Poller\_Type@{Ecore\_Poller\_Type}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{Ecore\_Poller\_Type}{Ecore\_Poller\_Type}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{ECORE\_POLLER\_CORE@{ECORE\_POLLER\_CORE}!Ecore Poll functions@{Ecore Poll functions}}\index{Ecore Poll functions@{Ecore Poll functions}!ECORE\_POLLER\_CORE@{ECORE\_POLLER\_CORE}}}\mbox{\Hypertarget{group__Ecore__Poller__Group_gga40d67f547376373ee34363b825874088a022dfec751388e380cf01621bd0f797f}\label{group__Ecore__Poller__Group_gga40d67f547376373ee34363b825874088a022dfec751388e380cf01621bd0f797f}} 
ECORE\+\_\+\+POLLER\+\_\+\+CORE&The core poller interval. \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Ecore__Poller__Group_ga9ce7d4becc2fb4cc08e07e659c332f27}\label{group__Ecore__Poller__Group_ga9ce7d4becc2fb4cc08e07e659c332f27}} 
\index{Ecore Poll functions@{Ecore Poll functions}!ecore\_poller\_add@{ecore\_poller\_add}}
\index{ecore\_poller\_add@{ecore\_poller\_add}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{ecore\_poller\_add()}{ecore\_poller\_add()}}
{\footnotesize\ttfamily Ecore\+\_\+\+Poller $\ast$ ecore\+\_\+poller\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}}}]{type,  }\item[{int}]{interval,  }\item[{\mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga8a36ef1ac24bfa317a7826617264e530}{Ecore\+\_\+\+Task\+\_\+\+Cb}}}]{func,  }\item[{const void $\ast$}]{data }\end{DoxyParamCaption})}



Creates a poller to call the given function at a particular tick interval. 


\begin{DoxyParams}{Parameters}
{\em type} & The ticker type to attach the poller to. Must be ECORE\+\_\+\+POLLER\+\_\+\+CORE. \\
\hline
{\em interval} & The poll interval. \\
\hline
{\em func} & The poller function. \\
\hline
{\em data} & Data to pass to {\itshape func} when it is called. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A poller object on success, {\ttfamily NULL} otherwise.
\end{DoxyReturn}
This function adds {\itshape func} as a poller callback that will be called every {\itshape interval} ticks together with other pollers of type {\itshape type}. {\itshape func} will be passed the {\ttfamily data} pointer as a parameter.

The {\ttfamily interval} must be between 1 and 32768 inclusive, and must be a power of 2 (i.\+e. 1, 2, 4, 8, 16, ... 16384, 32768). The exact tick in which {\itshape func} will be called is undefined, as only the interval between calls can be defined. Ecore will endeavor to keep pollers synchronized and to call as many in 1 wakeup event as possible. If {\itshape interval} is not a power of two, the closest power of 2 greater than {\itshape interval} will be used.

When the poller {\ttfamily func} is called, it must return a value of either {\ttfamily ECORE\+\_\+\+CALLBACK\+\_\+\+RENEW}(or {\ttfamily 1}) or {\ttfamily ECORE\+\_\+\+CALLBACK\+\_\+\+CANCEL}(or {\ttfamily 0}). If it returns {\ttfamily 1}, it will be called again at the next tick, or if it returns {\ttfamily 0} it will be deleted automatically making any references/handles for it invalid. \begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_poller_example_8c-example}{ecore\+\_\+poller\+\_\+example.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\+\_\+\+INLIST\+\_\+\+GET}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_ga2cbaa546cd6224dde756d43a603ef463}{eina\+\_\+inlist\+\_\+prepend()}}, and \mbox{\hyperlink{group__Eina__Lock__Group_ga2974eb3f18404edcc375910cc7e4859c}{EINA\+\_\+\+MAIN\+\_\+\+LOOP\+\_\+\+CHECK\+\_\+\+RETURN\+\_\+\+VAL}}.



Referenced by \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\+\_\+init()}}, and \mbox{\hyperlink{group__Elm__Prefs_ga8f845185f5505ac07369e89c5d2abcad}{elm\+\_\+prefs\+\_\+data\+\_\+autosave\+\_\+set()}}.

\mbox{\Hypertarget{group__Ecore__Poller__Group_ga5284994ef29eb44342f9dc87c855139b}\label{group__Ecore__Poller__Group_ga5284994ef29eb44342f9dc87c855139b}} 
\index{Ecore Poll functions@{Ecore Poll functions}!ecore\_poller\_del@{ecore\_poller\_del}}
\index{ecore\_poller\_del@{ecore\_poller\_del}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{ecore\_poller\_del()}{ecore\_poller\_del()}}
{\footnotesize\ttfamily void $\ast$ ecore\+\_\+poller\+\_\+del (\begin{DoxyParamCaption}\item[{Ecore\+\_\+\+Poller $\ast$}]{poller }\end{DoxyParamCaption})}



Deletes the specified poller from the timer list. 


\begin{DoxyParams}{Parameters}
{\em poller} & The poller to delete. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The data pointer set for the timer when \mbox{\hyperlink{group__Ecore__Poller__Group_ga9ce7d4becc2fb4cc08e07e659c332f27}{ecore\+\_\+poller\+\_\+add}} was called on success, {\ttfamily NULL} otherwise.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
{\itshape poller} must be a valid handle. If the poller function has already returned {\ttfamily 0}, the handle is no longer valid (and does not need to be deleted). 
\end{DoxyNote}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_poller_example_8c-example}{ecore\+\_\+poller\+\_\+example.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eina__Lock__Group_ga2974eb3f18404edcc375910cc7e4859c}{EINA\+\_\+\+MAIN\+\_\+\+LOOP\+\_\+\+CHECK\+\_\+\+RETURN\+\_\+\+VAL}}.



Referenced by \mbox{\hyperlink{group__Elm__Prefs_ga8f845185f5505ac07369e89c5d2abcad}{elm\+\_\+prefs\+\_\+data\+\_\+autosave\+\_\+set()}}, and \mbox{\hyperlink{group__Elm__Prefs_ga8e1e70c36f02027d6446c6188b9f954e}{elm\+\_\+prefs\+\_\+data\+\_\+save()}}.

\mbox{\Hypertarget{group__Ecore__Poller__Group_ga466dff0c7fb7eb0f5b4e5a3825fa10ac}\label{group__Ecore__Poller__Group_ga466dff0c7fb7eb0f5b4e5a3825fa10ac}} 
\index{Ecore Poll functions@{Ecore Poll functions}!ecore\_poller\_poll\_interval\_set@{ecore\_poller\_poll\_interval\_set}}
\index{ecore\_poller\_poll\_interval\_set@{ecore\_poller\_poll\_interval\_set}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{ecore\_poller\_poll\_interval\_set()}{ecore\_poller\_poll\_interval\_set()}}
{\footnotesize\ttfamily void ecore\+\_\+poller\+\_\+poll\+\_\+interval\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}}}]{type,  }\item[{double}]{poll\+\_\+time }\end{DoxyParamCaption})}



Sets the time(in seconds) between ticks for the given poller type. 


\begin{DoxyParams}{Parameters}
{\em type} & The poller type to adjust. \\
\hline
{\em poll\+\_\+time} & The time(in seconds) between ticks of the timer.\\
\hline
\end{DoxyParams}
This will adjust the time between ticks of the given timer type defined by {\ttfamily type} to the time period defined by {\ttfamily poll\+\_\+time}. \begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_poller_example_8c-example}{ecore\+\_\+poller\+\_\+example.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eina__Lock__Group_ga6900a2b986f5536b73210e2560675cb0}{EINA\+\_\+\+MAIN\+\_\+\+LOOP\+\_\+\+CHECK\+\_\+\+RETURN}}.

\mbox{\Hypertarget{group__Ecore__Poller__Group_ga72031680ab8f5385639389ac0591e272}\label{group__Ecore__Poller__Group_ga72031680ab8f5385639389ac0591e272}} 
\index{Ecore Poll functions@{Ecore Poll functions}!ecore\_poller\_poll\_interval\_get@{ecore\_poller\_poll\_interval\_get}}
\index{ecore\_poller\_poll\_interval\_get@{ecore\_poller\_poll\_interval\_get}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{ecore\_poller\_poll\_interval\_get()}{ecore\_poller\_poll\_interval\_get()}}
{\footnotesize\ttfamily double ecore\+\_\+poller\+\_\+poll\+\_\+interval\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Ecore__Poller__Group_ga40d67f547376373ee34363b825874088}{Ecore\+\_\+\+Poller\+\_\+\+Type}}}]{type }\end{DoxyParamCaption})}



Gets the time(in seconds) between ticks for the given poller type. 


\begin{DoxyParams}{Parameters}
{\em type} & The poller type to query. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The time in seconds between ticks of the poller timer.
\end{DoxyReturn}
This will get the time between ticks of the specified poller timer. 

References \mbox{\hyperlink{group__Eina__Lock__Group_ga2974eb3f18404edcc375910cc7e4859c}{EINA\+\_\+\+MAIN\+\_\+\+LOOP\+\_\+\+CHECK\+\_\+\+RETURN\+\_\+\+VAL}}.

\mbox{\Hypertarget{group__Ecore__Poller__Group_gae9acf938d0e3b3ee84509d0c04ed628a}\label{group__Ecore__Poller__Group_gae9acf938d0e3b3ee84509d0c04ed628a}} 
\index{Ecore Poll functions@{Ecore Poll functions}!ecore\_poller\_poller\_interval\_set@{ecore\_poller\_poller\_interval\_set}}
\index{ecore\_poller\_poller\_interval\_set@{ecore\_poller\_poller\_interval\_set}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{ecore\_poller\_poller\_interval\_set()}{ecore\_poller\_poller\_interval\_set()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} ecore\+\_\+poller\+\_\+poller\+\_\+interval\+\_\+set (\begin{DoxyParamCaption}\item[{Ecore\+\_\+\+Poller $\ast$}]{obj,  }\item[{int}]{interval }\end{DoxyParamCaption})}



Polling interval rate of the poller. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em interval} & The tick interval; must be a power of 2 and \texorpdfstring{$<$}{<}= 32768.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily true} on success, {\ttfamily false} on failure. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{ecore_poller_example_8c-example}{ecore\+\_\+poller\+\_\+example.\+c}}.\end{Desc}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_ga5bc991428e75557c6195f6b9e38321fb}{EINA\+\_\+\+INLIST\+\_\+\+GET}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_ga2cbaa546cd6224dde756d43a603ef463}{eina\+\_\+inlist\+\_\+prepend()}}, \mbox{\hyperlink{group__Eina__Inline__List__Group_gaf885b08d5b5a750a901f3780d3c65338}{eina\+\_\+inlist\+\_\+remove()}}, \mbox{\hyperlink{group__Eina__Lock__Group_ga2974eb3f18404edcc375910cc7e4859c}{EINA\+\_\+\+MAIN\+\_\+\+LOOP\+\_\+\+CHECK\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

\mbox{\Hypertarget{group__Ecore__Poller__Group_ga1c80d050bf17021f26ed531cd53ca510}\label{group__Ecore__Poller__Group_ga1c80d050bf17021f26ed531cd53ca510}} 
\index{Ecore Poll functions@{Ecore Poll functions}!ecore\_poller\_poller\_interval\_get@{ecore\_poller\_poller\_interval\_get}}
\index{ecore\_poller\_poller\_interval\_get@{ecore\_poller\_poller\_interval\_get}!Ecore Poll functions@{Ecore Poll functions}}
\doxysubsubsection{\texorpdfstring{ecore\_poller\_poller\_interval\_get()}{ecore\_poller\_poller\_interval\_get()}}
{\footnotesize\ttfamily int ecore\+\_\+poller\+\_\+poller\+\_\+interval\+\_\+get (\begin{DoxyParamCaption}\item[{const Ecore\+\_\+\+Poller $\ast$}]{obj }\end{DoxyParamCaption})}



Polling interval rate of the poller. 

\begin{DoxyReturn}{Returns}
The tick interval; must be a power of 2 and \texorpdfstring{$<$}{<}= 32768. 
\end{DoxyReturn}


References \mbox{\hyperlink{group__Eina__Lock__Group_ga2974eb3f18404edcc375910cc7e4859c}{EINA\+\_\+\+MAIN\+\_\+\+LOOP\+\_\+\+CHECK\+\_\+\+RETURN\+\_\+\+VAL}}.

