simple_trigger.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. Copyright (C) 2004-2008 The Trustees of Indiana University.
  2. Use, modification and distribution is subject to the Boost Software
  3. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. http://www.boost.org/LICENSE_1_0.txt)
  5. ============================
  6. |Logo| Simple Triggers
  7. ============================
  8. .. contents::
  9. Introduction
  10. ------------
  11. Triggers in the `process group`_ interface are used to asynchronously
  12. receive and process messages destined for distributed data
  13. structures. The trigger interface is relatively versatile, permitting
  14. one to attach any function object to handle requests. The
  15. ``simple_trigger`` function simplifies a common case for triggers:
  16. attaching a trigger that invokes a specific member function of the
  17. distributed data structure.
  18. Where Defined
  19. -------------
  20. Header ``<boost/graph/parallel/simple_trigger.hpp>``
  21. Reference
  22. ---------
  23. ::
  24. template<typename ProcessGroup, typename Class, typename T>
  25. void
  26. simple_trigger(ProcessGroup& pg, int tag, Class* self,
  27. void (Class::*pmf)(int source, int tag, const T& data,
  28. trigger_receive_context context))
  29. template<typename ProcessGroup, typename Class, typename T, typename Result>
  30. void
  31. simple_trigger(ProcessGroup& pg, int tag, Class* self,
  32. Result (Class::*pmf)(int source, int tag, const T& data,
  33. trigger_receive_context context))
  34. The ``simple_trigger`` function registers a trigger that invokes the
  35. given member function (``pmf``) on the object ``self`` whenever a
  36. message is received. If the member function has a return value, then
  37. the trigger has a reply, and can only be used via out-of-band sends
  38. that expect a reply. Otherwise, the member function returns ``void``,
  39. and the function is registered as a normal trigger.
  40. -----------------------------------------------------------------------------
  41. Copyright (C) 2007 Douglas Gregor
  42. Copyright (C) 2007 Matthias Troyer
  43. .. |Logo| image:: pbgl-logo.png
  44. :align: middle
  45. :alt: Parallel BGL
  46. :target: http://www.osl.iu.edu/research/pbgl
  47. .. _process group: process_group.html