From a4a6081750de4dea9877433891f32109eeabbcd0 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 4 Jan 2020 18:27:03 +0100 Subject: [PATCH] document Barrier in the new way, and document the C version --- docs/source/app_s4u.rst | 27 +++++++++++++++++++++++---- include/simgrid/forward.h | 2 ++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/docs/source/app_s4u.rst b/docs/source/app_s4u.rst index 5828cfb3a7..fac7ad0724 100644 --- a/docs/source/app_s4u.rst +++ b/docs/source/app_s4u.rst @@ -934,21 +934,40 @@ Synchronization Objects .. _API_s4u_Barrier: ================ -⁣  class Barrier +⁣  Barrier ================ -.. doxygentypedef:: BarrierPtr - .. autodoxyclass:: simgrid::s4u::Barrier .. tabs:: .. group-tab:: C++ + .. code-block:: C++ + + #include + + .. doxygentypedef:: BarrierPtr + .. autodoxymethod:: simgrid::s4u::Barrier::Barrier(unsigned int expected_actors) .. autodoxymethod:: simgrid::s4u::Barrier::create(unsigned int expected_actors) .. autodoxymethod:: simgrid::s4u::Barrier::wait() + .. group-tab:: C + + .. code-block:: C + + #include + + .. doxygentypedef:: sg_bar_t + .. cpp:type:: const s4u_Barrier* const_sg_bar_t + + Constant pointer to a SimGrid barrier object. + + .. autodoxymethod:: sg_barrier_init(unsigned int count) + .. autodoxymethod:: sg_barrier_destroy(const_sg_bar_t bar) + .. autodoxymethod:: sg_barrier_wait(sg_bar_t bar) + .. _API_s4u_ConditionVariable: @@ -965,7 +984,7 @@ Basic management .. group-tab:: C++ - .. code-block:: C + .. code-block:: C++ #include diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 517c473b43..5d970790e1 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -233,7 +233,9 @@ typedef struct s_smx_sem* smx_sem_t; #endif +/** Pointer to a SimGrid barrier object */ typedef s4u_Barrier* sg_bar_t; +/** Constant pointer to a SimGrid barrier object */ typedef const s4u_Barrier* const_sg_bar_t; typedef s4u_ConditionVariable* sg_cond_t; typedef const s4u_ConditionVariable* const_sg_cond_t; -- 2.20.1