\hypertarget{group__Eina__Containers__Group}{}\doxysection{Containers}
\label{group__Eina__Containers__Group}\index{Containers@{Containers}}


Data types that contains other types.  


\doxysubsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eina__Array__Group}{Array}}
\begin{DoxyCompactList}\small\item\em These functions provide array management. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__CList__Group}{Compact List}}
\begin{DoxyCompactList}\small\item\em Eina\+\_\+\+Clist is a compact (inline) list implementation. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Hash__Group}{Hash Table}}
\begin{DoxyCompactList}\small\item\em Hash table management. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Inline__Array__Group}{Inline Array}}
\begin{DoxyCompactList}\small\item\em Inline array is a container that stores the data itself, not the pointers to the data. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Inline__List__Group}{Inline List}}
\begin{DoxyCompactList}\small\item\em These functions provide inline list management. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__List__Group}{List}}
\begin{DoxyCompactList}\small\item\em These functions provide double linked list management. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Matrixsparse__Group}{Sparse Matrix}}
\begin{DoxyCompactList}\small\item\em These functions manage sparse matrices. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Quaternion__Group}{Quaternion}}
\item 
\mbox{\hyperlink{group__Eina__Rbtree__Group}{Red-\/\+Black tree}}
\begin{DoxyCompactList}\small\item\em These functions provide Red-\/\+Black tree management. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Safepointer__Group}{Safe Pointer}}
\begin{DoxyCompactList}\small\item\em These functions provide a wrapper that protect access to pointers. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Trash__Group}{Trash}}
\begin{DoxyCompactList}\small\item\em This group provides a generic container. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Value__Group}{Generic Value Storage}}
\begin{DoxyCompactList}\small\item\em Abstracts generic data storage and access to it in an extensible and efficient way. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Data types that contains other types. 

Examples\+: list, array and hash.\hypertarget{group__Eina__Containers__Group_eina_main_Intro}{}\doxysubsection{Introduction}\label{group__Eina__Containers__Group_eina_main_Intro}
Containers are data types that hold data and allow iteration over their elements with an \mbox{\hyperlink{group__Eina__Iterator__Group}{Iterator Functions}}, or eventually an \mbox{\hyperlink{group__Eina__Accessor__Group}{Accessor Functions}}.

The containers in eina are designed with performance in mind, one consequence of this is that they {\bfseries{don\textquotesingle{}t}} check the validity of data structures given to them(\mbox{\hyperlink{group__Eina__Magic__Group}{Magic}}).\hypertarget{group__Eina__Containers__Group_eina_main_Choice}{}\doxysubsection{Choosing container type}\label{group__Eina__Containers__Group_eina_main_Choice}
The choice of which container to use in each situation is very important in achieving good performance and readable code. The most common container types used are\+: \begin{DoxyItemize}
\item List \item Inline list \item Array \item Inline array \item Hash\end{DoxyItemize}
All types have pros and cons. The following considerations are good starting point in deciding which container to use\+: \begin{DoxyItemize}
\item Hashes are appropriate for datasets which will be searched often. \item Arrays are good when accessing members by position; \item Lists provide good versatility for adding elements in any position with minimal overhead. \item Inline arrays use very little memory and don\textquotesingle{}t cause fragmentation so are a good option in memory constrained systems. \item Inline lists are the best type to use when list flexibility is required but no pointer indirection overhead can be allowed. \begin{DoxyWarning}{Warning}
These are general considerations. Every situation is different. Don\textquotesingle{}t follow these recommendations blindly.
\end{DoxyWarning}
\end{DoxyItemize}
\hypertarget{group__Eina__Containers__Group_eina_main_Creation}{}\doxysubsection{Creating custom container types}\label{group__Eina__Containers__Group_eina_main_Creation}
\begin{DoxyNote}{Note}
Before creating a custom container check if any of the existing ones suit your needs. For example, while there is no stack type \mbox{\hyperlink{group__Eina__Array__Group}{Array}} is a very good substitute. Similarly there is no queue type however an \mbox{\hyperlink{group__Eina__List__Group}{List}} works very well as a queue.
\end{DoxyNote}
If creating a custom container type, consider allowing access to the data in your container through \mbox{\hyperlink{group__Eina__Iterator__Group}{Iterators}} and \mbox{\hyperlink{group__Eina__Accessor__Group}{Accessors}}. To do so your container should have an iterator creation function and an accessor creation function. These functions should return properly populated \mbox{\hyperlink{struct__Eina__Iterator}{\+\_\+\+Eina\+\_\+\+Iterator}} and \mbox{\hyperlink{struct__Eina__Accessor}{\+\_\+\+Eina\+\_\+\+Accessor}}. 