git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1667
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
href="http://graal.ens-lyon.fr/~alegrand/articles/Simgrid-Introduction.pdf">slides</a>
may give you some insights on what SimGrid can help you to do and what
are its limitations. Then you definitely should read the \ref
href="http://graal.ens-lyon.fr/~alegrand/articles/Simgrid-Introduction.pdf">slides</a>
may give you some insights on what SimGrid can help you to do and what
are its limitations. Then you definitely should read the \ref
-MSG_examples. There is also a mailing list: <simgrid-user#lists.gforge.inria.fr>.
+MSG_examples. There is also a mailing list: <simgrid-user@lists.gforge.inria.fr>.
\subsection faq_generic Building a generic simulator
\subsection faq_generic Building a generic simulator
(eXtended Bundle of Tools)</b>.
It is a portable library providing some grounding features such as \ref
(eXtended Bundle of Tools)</b>.
It is a portable library providing some grounding features such as \ref
-XBT_log, \ref XBT_ex, \ref XBT_error and \ref XBT_config. XBT also encompass
+XBT_log, \ref XBT_ex and \ref XBT_config. XBT also encompass
the following convenient datastructures: \ref XBT_dynar, \ref XBT_fifo, \ref
XBT_dict, \ref XBT_heap, \ref XBT_set and \ref XBT_swag.
the following convenient datastructures: \ref XBT_dynar, \ref XBT_fifo, \ref
XBT_dict, \ref XBT_heap, \ref XBT_set and \ref XBT_swag.
* \brief A data container consisting in \ref XBT_dict and \ref XBT_dynar
*/
* \brief A data container consisting in \ref XBT_dict and \ref XBT_dynar
*/
-/** \addtogroup XBT_fifo
- \ingroup XBT_API */
+ /** \defgroup XBT_fifo A generic workqueue
+ * \brief This section describes the API to generic workqueue. These functions
+ * provide the same kind of functionnality as dynamic arrays but in time O(1).
+ * However these functions use malloc/free way too much often.
+ */
/** @defgroup XBT_swag A O(1) set datatype
* @brief a O(1) set based on linked lists
/** @defgroup XBT_swag A O(1) set datatype
* @brief a O(1) set based on linked lists
#ifndef _XBT_FIFO_H
#define _XBT_FIFO_H
#ifndef _XBT_FIFO_H
#define _XBT_FIFO_H
+#include "xbt/misc.h" /* BEGIN_DECL */
+
+BEGIN_DECL()
+
+/** \addtogroup XBT_fifo
+ * @{ */
+
+/** @name 1. Constructor/destructor
+ * @{
+ */
/** \brief Bucket structure
/** \brief Bucket structure
*/
typedef struct xbt_fifo_item *xbt_fifo_item_t;
/** \brief FIFO structure
*/
typedef struct xbt_fifo_item *xbt_fifo_item_t;
/** \brief FIFO structure
*/
typedef struct xbt_fifo *xbt_fifo_t;
*/
typedef struct xbt_fifo *xbt_fifo_t;
xbt_fifo_t xbt_fifo_new(void);
void xbt_fifo_free(xbt_fifo_t);
xbt_fifo_t xbt_fifo_new(void);
void xbt_fifo_free(xbt_fifo_t);
+/** @name 2. Perl-like functions
+ * @{
+ */
xbt_fifo_item_t xbt_fifo_push(xbt_fifo_t, void *);
void *xbt_fifo_pop(xbt_fifo_t);
xbt_fifo_item_t xbt_fifo_unshift(xbt_fifo_t, void *);
void *xbt_fifo_shift(xbt_fifo_t);
xbt_fifo_item_t xbt_fifo_push(xbt_fifo_t, void *);
void *xbt_fifo_pop(xbt_fifo_t);
xbt_fifo_item_t xbt_fifo_unshift(xbt_fifo_t, void *);
void *xbt_fifo_shift(xbt_fifo_t);
-
-void xbt_fifo_push_item(xbt_fifo_t, xbt_fifo_item_t);
-xbt_fifo_item_t xbt_fifo_pop_item(xbt_fifo_t);
-void xbt_fifo_unshift_item(xbt_fifo_t, xbt_fifo_item_t);
-xbt_fifo_item_t xbt_fifo_shift_item(xbt_fifo_t);
-
-void xbt_fifo_remove(xbt_fifo_t, void *);
-void xbt_fifo_remove_item(xbt_fifo_t, xbt_fifo_item_t);
-
+int xbt_fifo_size(xbt_fifo_t);
int xbt_fifo_is_in(xbt_fifo_t, void *);
int xbt_fifo_is_in(xbt_fifo_t, void *);
-void **xbt_fifo_to_array(xbt_fifo_t);
-xbt_fifo_t xbt_fifo_copy(xbt_fifo_t);
+/** @name 3. Manipulating directly items
+ *
+ * @{
+ */
xbt_fifo_item_t xbt_fifo_newitem(void);
void xbt_fifo_set_item_content(xbt_fifo_item_t, void *);
void *xbt_fifo_get_item_content(xbt_fifo_item_t);
void xbt_fifo_freeitem(xbt_fifo_item_t);
xbt_fifo_item_t xbt_fifo_newitem(void);
void xbt_fifo_set_item_content(xbt_fifo_item_t, void *);
void *xbt_fifo_get_item_content(xbt_fifo_item_t);
void xbt_fifo_freeitem(xbt_fifo_item_t);
-int xbt_fifo_size(xbt_fifo_t);
+void xbt_fifo_push_item(xbt_fifo_t, xbt_fifo_item_t);
+xbt_fifo_item_t xbt_fifo_pop_item(xbt_fifo_t);
+void xbt_fifo_unshift_item(xbt_fifo_t, xbt_fifo_item_t);
+xbt_fifo_item_t xbt_fifo_shift_item(xbt_fifo_t);
+
+void xbt_fifo_remove(xbt_fifo_t, void *);
+void xbt_fifo_remove_item(xbt_fifo_t, xbt_fifo_item_t);
xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l);
xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i);
xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l);
xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i);
/**
* \brief List iterator
/**
* \brief List iterator
* asserts and stuff
* \param f a list (#xbt_fifo_t)
* \param i a bucket (#xbt_fifo_item_t)
* asserts and stuff
* \param f a list (#xbt_fifo_t)
* \param i a bucket (#xbt_fifo_item_t)
((i)?(n=(type)(xbt_fifo_get_item_content(i))):(NULL)); \
i=xbt_fifo_getNextItem(i))
((i)?(n=(type)(xbt_fifo_get_item_content(i))):(NULL)); \
i=xbt_fifo_getNextItem(i))
+/** @} */
+
+/** @name 4. Miscanaleous
+ *
+ * @{
+ */
+void **xbt_fifo_to_array(xbt_fifo_t);
+xbt_fifo_t xbt_fifo_copy(xbt_fifo_t);
+/** @} */
+
+END_DECL()
/*XBT_LOG_NEW_DEFAULT_SUBCATEGORY(fifo,xbt,"FIFO"); UNUSED SO FAR */
/*XBT_LOG_NEW_DEFAULT_SUBCATEGORY(fifo,xbt,"FIFO"); UNUSED SO FAR */
-/** \defgroup XBT_fifo A generic workqueue
- * \brief This section describes the API to generic workqueue. These functions
- * provide the same kind of functionnality as dynamic arrays but in time O(1).
- * However these functions use malloc/free a way too much often.
- */
-
-/** \name Functions
- * \ingroup XBT_fifo
- */
-/* @{ */
-
/** Constructor
* \return a new fifo
*/
/** Constructor
* \return a new fifo
*/