Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
doc: use sections instead of rubric
[simgrid.git] / docs / source / app_s4u.rst
index fd8bc9ab2933937b45c5c79493f2682af5fa7db4..74fb609f32ff6eb2e6c85cd7050bbbc74b89ceea 100644 (file)
@@ -5,7 +5,7 @@ The S4U Interface
 
 .. raw:: html
 
-   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
+   <object id="TOC" data="graphical-toc.svg" type="image/svg+xml"></object>
    <script>
    window.onload=function() { // Wait for the SVG to be loaded before changing it
      var elem=document.querySelector("#TOC").contentDocument.getElementById("ActorBox")
@@ -28,7 +28,7 @@ releases. When this happens, compiling your code will produce
 deprecation warnings for 4 releases (one year) before the removal of
 the old symbols. 
 If you want an API that will never ever evolve in the future, you
-should use the deprecated MSG API instead. 
+should use the :ref:`deprecated MSG API <MSG_doc>` instead. 
 
 Main Concepts
 *************
@@ -369,16 +369,19 @@ shouldn't), using :cpp:func:`simgrid::s4u::Host::destroy`.
 
 .. include:: ../../examples/README.rst
 
-C++ API Reference
-*****************
+API Reference
+*************
 
 .. _API_s4u_this_actor:
 
-=========================
-namespace s4u::this_actor
-=========================
+==================================
+Interacting with the current actor
+==================================
+
+Static methods working on the current actor (see :ref:`API_s4u_Actor`).
 
 .. doxygennamespace:: simgrid::s4u::this_actor
+
 .. _API_s4u_Activity:
 
 =============
@@ -392,18 +395,153 @@ s4u::Activity
 
 .. _API_s4u_Actor:
 
-==========
-s4u::Actor
-==========
+===========
+class Actor
+===========
 
 .. doxygentypedef:: ActorPtr
 
 .. doxygentypedef:: aid_t
 
-.. doxygenclass:: simgrid::s4u::Actor
-   :members:
-   :protected-members:
-   :undoc-members:
+.. autodoxyclass:: simgrid::s4u::Actor
+
+Creating actors
+---------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, const std::function< void()> &code)
+      .. autodoxymethod:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, F code)
+      .. autodoxymethod:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, F code, Args... args)
+      .. autodoxymethod:: simgrid::s4u::Actor::create(const std::string &name, s4u::Host *host, const std::string &function, std::vector< std::string > args)
+
+      .. autodoxymethod:: simgrid::s4u::Actor::init(const std::string &name, s4u::Host *host)
+      .. autodoxymethod:: simgrid::s4u::Actor::start(const std::function< void()> &code)
+
+   .. group-tab:: Python
+
+      .. automethod:: simgrid.Actor.create
+
+Searching specific actors
+-------------------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Actor::by_pid(aid_t pid)
+      .. autodoxymethod:: simgrid::s4u::Actor::self()
+
+   .. group-tab:: Python
+
+      .. automethod:: simgrid.Actor.by_pid
+      .. automethod:: simgrid.Actor.self
+
+Querying info about actors
+--------------------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Actor::get_cname
+      .. autodoxymethod:: simgrid::s4u::Actor::get_name
+      .. autodoxymethod:: simgrid::s4u::Actor::get_pid
+      .. autodoxymethod:: simgrid::s4u::Actor::get_ppid
+      .. autodoxymethod:: simgrid::s4u::Actor::get_properties() const
+      .. autodoxymethod:: simgrid::s4u::Actor::get_property(const std::string &key) const
+      .. autodoxymethod:: simgrid::s4u::Actor::set_property(const std::string &key, const std::string &value) 
+
+      .. autodoxymethod:: simgrid::s4u::Actor::get_host
+      .. autodoxymethod:: simgrid::s4u::Actor::migrate
+
+      .. autodoxymethod:: simgrid::s4u::Actor::get_refcount()
+      .. autodoxymethod:: simgrid::s4u::Actor::get_impl()
+
+   .. group-tab:: Python
+                  
+      .. autoattribute:: simgrid.Actor.name
+      .. autoattribute:: simgrid.Actor.host
+      .. autoattribute:: simgrid.Actor.pid
+      .. autoattribute:: simgrid.Actor.ppid
+
+      .. automethod:: simgrid.Actor.migrate
+
+Suspending and resuming actors
+------------------------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Actor::suspend()
+      .. autodoxymethod:: simgrid::s4u::Actor::resume()
+      .. autodoxymethod:: simgrid::s4u::Actor::is_suspended()
+
+   .. group-tab:: Python
+
+      .. automethod:: simgrid.Actor.resume
+      .. automethod:: simgrid.Actor.suspend
+      .. automethod:: simgrid.Actor.is_suspended
+
+Killing actors
+--------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Actor::kill()
+      .. autodoxymethod:: simgrid::s4u::Actor::kill_all()
+      .. autodoxymethod:: simgrid::s4u::Actor::set_kill_time(double time)
+      .. autodoxymethod:: simgrid::s4u::Actor::get_kill_time()
+
+      .. autodoxymethod:: simgrid::s4u::Actor::restart()
+      .. autodoxymethod:: simgrid::s4u::Actor::daemonize()
+      .. autodoxymethod:: simgrid::s4u::Actor::is_daemon
+
+   .. group-tab:: Python
+
+      .. automethod:: simgrid.Actor.kill
+      .. automethod:: simgrid.Actor.kill_all
+
+      .. automethod:: simgrid.Actor.daemonize
+      .. automethod:: simgrid.Actor.is_daemon
+
+Reacting to the end of actors
+-----------------------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Actor::on_exit(const std::function< void(bool)> &fun)
+      .. autodoxymethod:: simgrid::s4u::Actor::join()
+      .. autodoxymethod:: simgrid::s4u::Actor::join(double timeout)
+      .. autodoxymethod:: simgrid::s4u::Actor::set_auto_restart(bool autorestart)
+
+   .. group-tab:: Python
+
+      .. automethod:: simgrid.Actor.join
+
+Signals
+-------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxyvar:: simgrid::s4u::Actor::on_creation
+      .. autodoxyvar:: simgrid::s4u::Actor::on_suspend
+      .. autodoxyvar:: simgrid::s4u::Actor::on_resume
+      .. autodoxyvar:: simgrid::s4u::Actor::on_sleep
+      .. autodoxyvar:: simgrid::s4u::Actor::on_wake_up
+      .. autodoxyvar:: simgrid::s4u::Actor::on_migration_start
+      .. autodoxyvar:: simgrid::s4u::Actor::on_migration_end
+      .. autodoxyvar:: simgrid::s4u::Actor::on_termination
+      .. autodoxyvar:: simgrid::s4u::Actor::on_destruction
 
 .. _API_s4u_Barrier:
 
@@ -682,3 +820,7 @@ Class Mailbox
 
 .. autoclass:: simgrid.Mailbox
    :members:
+
+.. |hr| raw:: html
+
+   <hr />