]>
Commit | Line | Data |
---|---|---|
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 | ============================ | |
7 | |Logo| Simple Triggers | |
8 | ============================ | |
9 | ||
10 | .. contents:: | |
11 | ||
12 | Introduction | |
13 | ------------ | |
14 | ||
15 | Triggers in the `process group`_ interface are used to asynchronously | |
16 | receive and process messages destined for distributed data | |
17 | structures. The trigger interface is relatively versatile, permitting | |
18 | one to attach any function object to handle requests. The | |
19 | ``simple_trigger`` function simplifies a common case for triggers: | |
20 | attaching a trigger that invokes a specific member function of the | |
21 | distributed data structure. | |
22 | ||
23 | Where Defined | |
24 | ------------- | |
25 | ||
26 | Header ``<boost/graph/parallel/simple_trigger.hpp>`` | |
27 | ||
28 | Reference | |
29 | --------- | |
30 | ||
31 | :: | |
32 | ||
33 | template<typename ProcessGroup, typename Class, typename T> | |
34 | void | |
35 | simple_trigger(ProcessGroup& pg, int tag, Class* self, | |
36 | void (Class::*pmf)(int source, int tag, const T& data, | |
37 | trigger_receive_context context)) | |
38 | ||
39 | template<typename ProcessGroup, typename Class, typename T, typename Result> | |
40 | void | |
41 | simple_trigger(ProcessGroup& pg, int tag, Class* self, | |
42 | Result (Class::*pmf)(int source, int tag, const T& data, | |
43 | trigger_receive_context context)) | |
44 | ||
45 | The ``simple_trigger`` function registers a trigger that invokes the | |
46 | given member function (``pmf``) on the object ``self`` whenever a | |
47 | message is received. If the member function has a return value, then | |
48 | the trigger has a reply, and can only be used via out-of-band sends | |
49 | that expect a reply. Otherwise, the member function returns ``void``, | |
50 | and the function is registered as a normal trigger. | |
51 | ||
52 | ||
53 | ----------------------------------------------------------------------------- | |
54 | ||
55 | Copyright (C) 2007 Douglas Gregor | |
56 | ||
57 | Copyright (C) 2007 Matthias Troyer | |
58 | ||
59 | .. |Logo| image:: pbgl-logo.png | |
60 | :align: middle | |
61 | :alt: Parallel BGL | |
62 | :target: http://www.osl.iu.edu/research/pbgl | |
63 | ||
64 | .. _process group: process_group.html |