Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/spirit/phoenix/doc/organization.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 5.0 KB
Line 
1<html>
2<head>
3<!-- Generated by the Spirit (http://spirit.sf.net) QuickDoc -->
4<title>Organization</title>
5<link rel="stylesheet" href="theme/style.css" type="text/css">
6<link rel="prev" href="polymorphic_functions.html">
7<link rel="next" href="actors.html">
8</head>
9<body>
10<table width="100%" height="48" border="0" background="theme/bkd2.gif" cellspacing="2">
11  <tr>
12    <td width="10">
13    </td>
14    <td width="85%">
15      <font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Organization</b></font>
16    </td>
17    <td width="112"><a href="http://spirit.sf.net"><img src="theme/spirit.gif" align="right" border="0"></a></td>
18  </tr>
19</table>
20<br>
21<table border="0">
22  <tr>
23    <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
24    <td width="30"><a href="polymorphic_functions.html"><img src="theme/l_arr.gif" border="0"></a></td>
25    <td width="20"><a href="actors.html"><img src="theme/r_arr.gif" border="0"></a></td>
26   </tr>
27</table>
28<p>
29The framework is organized in five (5) layers.</p>
30<code><pre>
31                 <span class=special>+-----------+
32                 |  </span><span class=identifier>binders  </span><span class=special>|
33                 +-----------+-----------+------------+
34                 | </span><span class=identifier>functions </span><span class=special>| </span><span class=identifier>operators </span><span class=special>| </span><span class=identifier>statements </span><span class=special>|
35    +------------+-----------+-----------+------------+
36    | </span><span class=identifier>primitives </span><span class=special>|             </span><span class=identifier>composite              </span><span class=special>|
37    +------------+------------------------------------+
38    |                     </span><span class=identifier>actor                       </span><span class=special>|
39    +-------------------------------------------------+
40    |                     </span><span class=identifier>tuples                      </span><span class=special>|
41    +-------------------------------------------------+
42</span></pre></code>
43<p>
44The lowest level is the tuples library. Knowledge of tuples is not at all required in order to use the framework. In a nutshell, this small sub-library provides a mechanism for bundling heterogeneous types together. This is an implementation detail. Yet, in itself, it is quite useful in other applications as well. A more detailed explanation will be given later.</p>
45<p>
46Actors are the main concept behind the framework. Lazy functions are abstracted as actors which are actually polymorphic functors. There are only 2 kinds of actors:</p>
47<ol><li>primitives</li><li>composites.</li></ol><p>
48Composites are composed of zero or more actors. Each actor in a composite can again be another composite. Primitives are atomic units and are not decomposable.</p>
49<p>
50(lazy) functions, (lazy) operators and (lazy) statements are built on top of composites. To put it more accurately, a lazy function (lazy operators and statements are just specialized forms of lazy functions) has two stages:</p>
51<ol><li>(lazy) partial evaluation </li><li>final evaluation </li></ol><p>
52The first stage is handled by a set of generator functions, generator functors and generator operator overloads. These are your front ends (in the client's perspective). These generators create the actors that can be passed on just like any other function pointer or functor object. The second stage, the actual function call, can be invoked or executed anytime just like any other function. These are the back-ends (often, the final invocation is never actually seen by the client).</p>
53<p>
54Binders, built on top of functions, create lazy functions from simple monomorphic (STL like) functors, function pointers, member function pointers or member variable pointers for deferred evaluation (variables are accessed through a function call that returns a reference to the data. These binders are built on top of (lazy) functions.</p>
55<p>
56The framework's architecture is completely orthogonal. The relationship between the layers is totally acyclic. Lower layers do not depend nor know the existence of higher layers. Modules in a layer do not depend on other modules in the same layer. This means for example that the client can completely discard binders if she does not need it; or perhaps take out lazy-operators and lazy-statements and just use lazy-functions, which is desireable in a pure FP application.</p>
57<table border="0">
58  <tr>
59    <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
60    <td width="30"><a href="polymorphic_functions.html"><img src="theme/l_arr.gif" border="0"></a></td>
61    <td width="20"><a href="actors.html"><img src="theme/r_arr.gif" border="0"></a></td>
62   </tr>
63</table>
64<br>
65<hr size="1">
66<p class="copyright">Copyright &copy; 2001-2002 Joel de Guzman<br>
67  <br>
68<font size="2">Use, modification and distribution is subject to the Boost Software
69    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
70    http://www.boost.org/LICENSE_1_0.txt) </font> </p>
71</body>
72</html>
Note: See TracBrowser for help on using the repository browser.