1<?xml version="1.0" encoding="utf-8" ?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" /> 7<title>Parallel BGL Simple Triggers</title> 8<link rel="stylesheet" href="../../../../rst.css" type="text/css" /> 9</head> 10<body> 11<div class="document" id="logo-simple-triggers"> 12<h1 class="title"><a class="reference external" href="http://www.osl.iu.edu/research/pbgl"><img align="middle" alt="Parallel BGL" class="align-middle" src="pbgl-logo.png" /></a> Simple Triggers</h1> 13 14<!-- Copyright (C) 2004-2008 The Trustees of Indiana University. 15Use, modification and distribution is subject to the Boost Software 16License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 17http://www.boost.org/LICENSE_1_0.txt) --> 18<div class="contents topic" id="contents"> 19<p class="topic-title first">Contents</p> 20<ul class="simple"> 21<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li> 22<li><a class="reference internal" href="#where-defined" id="id2">Where Defined</a></li> 23<li><a class="reference internal" href="#reference" id="id3">Reference</a></li> 24</ul> 25</div> 26<div class="section" id="introduction"> 27<h1><a class="toc-backref" href="#id1">Introduction</a></h1> 28<p>Triggers in the <a class="reference external" href="process_group.html">process group</a> interface are used to asynchronously 29receive and process messages destined for distributed data 30structures. The trigger interface is relatively versatile, permitting 31one to attach any function object to handle requests. The 32<tt class="docutils literal"><span class="pre">simple_trigger</span></tt> function simplifies a common case for triggers: 33attaching a trigger that invokes a specific member function of the 34distributed data structure.</p> 35</div> 36<div class="section" id="where-defined"> 37<h1><a class="toc-backref" href="#id2">Where Defined</a></h1> 38<p>Header <tt class="docutils literal"><span class="pre"><boost/graph/parallel/simple_trigger.hpp></span></tt></p> 39</div> 40<div class="section" id="reference"> 41<h1><a class="toc-backref" href="#id3">Reference</a></h1> 42<blockquote> 43<pre class="literal-block"> 44template<typename ProcessGroup, typename Class, typename T> 45 void 46 simple_trigger(ProcessGroup& pg, int tag, Class* self, 47 void (Class::*pmf)(int source, int tag, const T& data, 48 trigger_receive_context context)) 49 50template<typename ProcessGroup, typename Class, typename T, typename Result> 51 void 52 simple_trigger(ProcessGroup& pg, int tag, Class* self, 53 Result (Class::*pmf)(int source, int tag, const T& data, 54 trigger_receive_context context)) 55</pre> 56</blockquote> 57<p>The <tt class="docutils literal"><span class="pre">simple_trigger</span></tt> function registers a trigger that invokes the 58given member function (<tt class="docutils literal"><span class="pre">pmf</span></tt>) on the object <tt class="docutils literal"><span class="pre">self</span></tt> whenever a 59message is received. If the member function has a return value, then 60the trigger has a reply, and can only be used via out-of-band sends 61that expect a reply. Otherwise, the member function returns <tt class="docutils literal"><span class="pre">void</span></tt>, 62and the function is registered as a normal trigger.</p> 63<hr class="docutils" /> 64<p>Copyright (C) 2007 Douglas Gregor</p> 65<p>Copyright (C) 2007 Matthias Troyer</p> 66</div> 67</div> 68<div class="footer"> 69<hr class="footer" /> 70Generated on: 2009-05-31 00:21 UTC. 71Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. 72 73</div> 74</body> 75</html> 76