\doxysubsubsection{Containers}
\hypertarget{group__Eina__Containers__Group}{}\label{group__Eina__Containers__Group}\index{Containers@{Containers}}
\doxysubsubsubsubsection*{Topics}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eina__Array__Group}{Array}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__CList__Group}{Compact List}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Hash__Group}{Hash Table}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Inline__Array__Group}{Inline Array}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Inline__List__Group}{Inline List}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__List__Group}{List}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Matrixsparse__Group}{Sparse Matrix}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Quaternion__Group}{Quaternion}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Rbtree__Group}{Red-\/\+Black tree}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Safepointer__Group}{Safe Pointer}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Trash__Group}{Trash}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Value__Group}{Generic Value Storage}}
\begin{DoxyCompactList}\small\item\em \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsubsection{Detailed Description}


Data types that contains other types. Examples\+: list, array and hash.\hypertarget{group__Eina__Containers__Group_eina_main_Intro}{}\doxysubsubsubsection{\texorpdfstring{Introduction}{Introduction}}\label{group__Eina__Containers__Group_eina_main_Intro}
Containers are data types that hold data and allow iteration over their elements with an \doxylink{group__Eina__Iterator__Group}{Iterator Functions}, or eventually an \doxylink{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(\doxylink{group__Eina__Magic__Group}{Magic}).\hypertarget{group__Eina__Containers__Group_eina_main_Choice}{}\doxysubsubsubsection{\texorpdfstring{Choosing container type}{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}{}\doxysubsubsubsection{\texorpdfstring{Creating custom container types}{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 \doxylink{group__Eina__Array__Group}{Array} is a very good substitute. Similarly there is no queue type however an \doxylink{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 \doxylink{group__Eina__Iterator__Group}{Iterators} and \doxylink{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 \doxylink{struct__Eina__Iterator}{\+\_\+\+Eina\+\_\+\+Iterator} and \doxylink{struct__Eina__Accessor}{\+\_\+\+Eina\+\_\+\+Accessor}. \input{group__Eina__Array__Group}
\input{group__Eina__CList__Group}
\input{group__Eina__Hash__Group}
\input{group__Eina__Inline__Array__Group}
\input{group__Eina__Inline__List__Group}
\input{group__Eina__List__Group}
\input{group__Eina__Matrixsparse__Group}
\input{group__Eina__Quaternion__Group}
\input{group__Eina__Rbtree__Group}
\input{group__Eina__Safepointer__Group}
\input{group__Eina__Trash__Group}
\input{group__Eina__Value__Group}
