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


Data types that contains other types.  


\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Array__Group}{Array}
\begin{DoxyCompactList}\small\item\em These functions provide array management. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__CList__Group}{Compact List}
\begin{DoxyCompactList}\small\item\em Eina\-\_\-\-Clist is a compact (inline) list implementation. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Hash__Group}{Hash Table}
\begin{DoxyCompactList}\small\item\em Hash table management. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Inline__Array__Group}{Inline Array}
\begin{DoxyCompactList}\small\item\em Inline array is a container that stores the data itself not pointers to data, this means there is no memory fragmentation, also for small data types(such as char, short, int, etc.) it's more memory efficient. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Inline__List__Group}{Inline List}
\begin{DoxyCompactList}\small\item\em These functions provide inline list management. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__List__Group}{List}
\begin{DoxyCompactList}\small\item\em These functions provide double linked list management. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Matrixsparse__Group}{Sparse Matrix}
\begin{DoxyCompactList}\small\item\em These functions provide matrix sparse management. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Rbtree__Group}{Red-\/\-Black tree}
\begin{DoxyCompactList}\small\item\em These functions provide Red-\/\-Black trees management. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Trash__Group}{Trash}
\item 
\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}


\subsection{Detailed Description}
Data types that contains other types. Examples\-: list, array and hash.\hypertarget{group__Eina__Containers__Group_eina_main_Intro}{}\subsection{Introduction}\label{group__Eina__Containers__Group_eina_main_Intro}
Containers are data types that hold data and allow iteration over their elements with an \hyperlink{group__Eina__Iterator__Group}{Iterator Functions}, or eventually an \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't} check the validity of data structures given to them(\hyperlink{group__Eina__Magic__Group}{Magic}).\hypertarget{group__Eina__Containers__Group_eina_main_Choice}{}\subsection{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 to be used are\-: \begin{DoxyItemize}
\item List \item Inline list \item Array \item Inline array \item Hash\end{DoxyItemize}
All types have virtues and vices. 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't cause fragmentation and therefore are a good option in memory constrained systems; \item inline lists are the appropriate type to use when the flexibility of a list is required but the overhead of pointer indirection is not acceptable. \begin{DoxyWarning}{Warning}
These are general considerations, every situation is different, don't follow these recommendations blindly.
\end{DoxyWarning}
\end{DoxyItemize}
\hypertarget{group__Eina__Containers__Group_eina_main_Creation}{}\subsection{Creating custom container types}\label{group__Eina__Containers__Group_eina_main_Creation}
\begin{DoxyNote}{Note}
Before creating a custom container check if one of the existing ones doesn't suit your needs. For example, while there is no stack type \hyperlink{group__Eina__Array__Group}{Array} is a very good substitute, similarly there is no queue type however an \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 \hyperlink{group__Eina__Iterator__Group}{Iterators} and \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 \hyperlink{struct__Eina__Iterator}{\-\_\-\-Eina\-\_\-\-Iterator} and \hyperlink{struct__Eina__Accessor}{\-\_\-\-Eina\-\_\-\-Accessor}. 