~\newline


\begin{DoxyDate}{Date}
2012 (created)
\end{DoxyDate}
\hypertarget{eina_cxx_main_toc}{}\section{Table of Contents}\label{eina_cxx_main_toc}
\begin{DoxyItemize}
\item \mbox{\hyperlink{eo_main_eo_main_intro}{Introduction}} \item \mbox{\hyperlink{eo_main_eo_main_compiling}{How to compile}} \item \mbox{\hyperlink{eo_main_eo_main_next_steps}{Next Steps}} \item \mbox{\hyperlink{eo_main_eo_main_intro_example}{Introductory Example}} \item \mbox{\hyperlink{eo_main_eo_lifecycle_debug}{Debug Object Lifecycle}}\end{DoxyItemize}
\hypertarget{eo_main_eo_main_intro}{}\section{Introduction}\label{eo_main_eo_main_intro}
The Eo generic object system. It was designed to be the base object system for the E\+FL.\hypertarget{eo_main_eo_main_compiling}{}\section{How to compile}\label{eo_main_eo_main_compiling}
Eo is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the {\ttfamily pkg-\/config} script outputs. For example\+:

Compiling C or C++ files into object files\+:

\begin{DoxyVerb}  gcc -c -o main.o main.c `pkg-config --cflags eo`\end{DoxyVerb}


Linking object files into a binary executable\+:

\begin{DoxyVerb}  gcc -o my_application main.o `pkg-config --libs eo`\end{DoxyVerb}


See \mbox{\hyperlink{pkgconfig}{pkgconfig}}\hypertarget{eo_main_eo_main_next_steps}{}\section{Next Steps}\label{eo_main_eo_main_next_steps}
After you understood what Eo is and installed it in your system you should proceed understanding the programming interface.

Recommended reading\+:

\begin{DoxyItemize}
\item \mbox{\hyperlink{group__Efl__Class__Base}{Eo\textquotesingle{}s Base class.}} \item \mbox{\hyperlink{group__Efl__Class}{Efl Class}} \item \mbox{\hyperlink{group__Efl__Events}{Eo\textquotesingle{}s Event Handling}} \item Eo\+\_\+\+Composite\+\_\+\+Objects\end{DoxyItemize}
\hypertarget{eo_main_eo_lifecycle_debug}{}\section{Debug Object Lifecycle}\label{eo_main_eo_lifecycle_debug}
When dealing with objects it\textquotesingle{}s important to investigate the object lifecycle\+: when it was created, when it was deleted. This is not that trivial since objects can have extra references added with \mbox{\hyperlink{group__Eo_gaffddb0c86a9ec682a6f65fc6cb4c231d}{efl\+\_\+ref()}} as well as removed with \mbox{\hyperlink{group__Eo_gad40b0c8447d0b5e094ba3f26df54e4c9}{efl\+\_\+unref()}}, efl\+\_\+parent\+\_\+set() to N\+U\+LL or efl\+\_\+del().

To aid development process and debug memory leaks and invalid access, we provide eo\+\_\+debug script helper that will preload libeo\+\_\+dbg.\+so, run as\+:

\begin{DoxyVerb}  export EO_LIFECYCLE_DEBUG=1
  export EINA_LOG_LEVELS=eo_lifecycle:4
  eo_debug my_app
* \end{DoxyVerb}


This will print out all the objects that were created and deleted, as well as keep the stack trace that originated those, if a double free or user-\/after-\/free occurs it will print out the backtrace where the object was created and where it was deleted. If only errors should be displayed, decrease the log level to 2\+:

\begin{DoxyVerb}  export EO_LIFECYCLE_DEBUG=1
  export EINA_LOG_LEVELS=eo_lifecycle:2  # just critical, error and warning
  eo_debug my_app
* \end{DoxyVerb}


Keep in mind that the log will consume memory for all objects and that main loop primitives such as timers, jobs, promises and futures are all objects, being created in large numbers, thus consuming lots of memory.

To address that log pollution and memory consumption, one can select just handful classes to be logged using {\ttfamily E\+O\+\_\+\+L\+I\+F\+E\+C\+Y\+C\+L\+E\+\_\+\+D\+E\+B\+UG} with a list of comma-\/separated class names. If {\ttfamily E\+O\+\_\+\+L\+I\+F\+E\+C\+Y\+C\+L\+E\+\_\+\+D\+E\+B\+UG=1} or {\ttfamily E\+O\+\_\+\+L\+I\+F\+E\+C\+Y\+C\+L\+E\+\_\+\+D\+E\+B\+UG=$\ast$}, then all classes are logged, otherwise just the classes listed will be (whitelist).

\begin{DoxyVerb}  # Log only 2 classes: Efl_Loop and Efl_Net_Dialer_Tcp
  export EO_LIFECYCLE_DEBUG=Efl_Loop,Efl_Net_Dialer_Tcp
  export EINA_LOG_LEVELS=eo_lifecycle:4
  eo_debug my_app
* \end{DoxyVerb}


Another approach is to log all but few classes, also known as blacklist. This is done with another environment variable {\ttfamily E\+O\+\_\+\+L\+I\+F\+E\+C\+Y\+C\+L\+E\+\_\+\+N\+O\+\_\+\+D\+E\+B\+UG=class1},class2.

\begin{DoxyVerb}  # Log all but Efl_Future, Efl_Promise and Efl_Loop_Timer
  export EO_LIFECYCLE_NO_DEBUG=Efl_Future,Efl_Promise,Efl_Loop_Timer
  export EINA_LOG_LEVELS=eo_lifecycle:4
  eo_debug my_app
* \end{DoxyVerb}
\hypertarget{eo_main_eo_main_intro_example}{}\section{Introductory Example}\label{eo_main_eo_main_intro_example}
\mbox{\hyperlink{Eo_Tutorial}{Eo Tutorial}} 