Logtalk 2.15.5 files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@955 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura
2003-12-30 13:33:51 +00:00
parent 80fd1bcc91
commit f26a3b6ca9
205 changed files with 3961 additions and 3026 deletions

View File

@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/css" href="../styles.css" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Profiling programs</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Logtalk tutorial: profiling programs</title>
<link rel="stylesheet" href="../styles.css" type="text/css" />
</head>
<body>
<hr />
<h1><a class="back" title="Return to index" href="index.html#profiling">Profiling programs</a></h1>
<div class="navtop">
<a href="../index.html">contents</a> &gt; <a href="index.html">tutorial</a>
</div>
<h1>Profiling programs</h1>
<p>
In this example, we will illustrate the use of:
@@ -27,8 +31,7 @@ In this example, we will illustrate the use of:
by defining a simple profiler that prints the starting and ending time for processing a message sent to an object.
</p>
<hr />
<h2><a class="back" title="Return to index" name="events" href="index.html#profiling_events">Messages as events</a></h2>
<h2>Messages as events<a name="events"></a></h2>
<p>
In a pure object-oriented system, all computations start by sending messages to objects. We can thus define an <em>event</em> as the sending of a message to an object. An event can then be specified by the tuple <code>(Object, Message, Sender)</code>. This definition can be refined by interpreting the sending of a message and the return of the control to the object that has sent the message as two distinct events. We call these events respectively <code>before</code> and <code>after</code>. Therefore, we end up by representing an event by the tuple <code>(Event, Object, Message, Sender)</code>. For instance, if we send the message:
@@ -53,8 +56,7 @@ Note that the second event is only generated if the message succeeds. If the mes
Events are automatically generated by the message sending mechanisms for each public message sent using the <a title="Consult reference manual" href="../refman/control/to_object2.html"><code>::/2</code></a> operator.
</p>
<hr />
<h2><a class="back" title="Return to index" name="monitors" href="index.html#profiling_monitors">Profilers as monitors</a></h2>
<h2>Profilers as monitors<a name="monitors"></a></h2>
<p>
A monitor is an object that reacts whenever a spied event occurs. The monitor actions are defined by two event handlers: <a title="Consult reference manual" href="../refman/methods/before3.html"><code>before/3</code></a> for <code>before</code> events and <a title="Consult reference manual" href="../refman/methods/after3.html"><code>after/3</code></a> for <code>after</code> events. These predicates are automatically called by the message sending mechanisms when an event registered for the monitor occurs.
@@ -133,8 +135,7 @@ built-in predicate:
This call will abolish all events defined over the object <code>foo</code> assigned to the <code>stop_watch</code> monitor.
</p>
<hr />
<h2><a class="back" title="Return to index" name="summary" href="index.html#profiling_summary">Summary</a></h2>
<h2>Summary<a name="summary"></a></h2>
<ul>
<li>An event is defined as the sending of a (public) message to an object.</li>
@@ -152,15 +153,16 @@ This call will abolish all events defined over the object <code>foo</code> assig
<li>Three built-in predicates, <a title="Consult reference manual" href="../refman/builtins/define_events5.html"><code>define_events/5</code></a>, <a title="Consult reference manual" href="../refman/builtins/current_event5.html"><code>current_event/5</code></a>, and <a title="Consult reference manual" href="../refman/builtins/abolish_events5.html"><code>abolish_events/5</code></a>, enables us define, query, and abolish both events and monitors.</li>
</ul>
<hr />
<p class="center">
<strong><a href="reflection.html">Previous</a> | <a href="index.html">Next</a> | <a href="index.html">Table of Contents</a> | <a href="../bibliography.html">Bibliography</a> | <a href="../glossary.html">Glossary</a></strong>
</p>
<p class="center">
Last updated on: August 6, 2002
</p>
<hr />
<div class="navbottom">
<a href="reflection.html">previous</a> | <a href="../glossary.html">glossary</a> | <a href="index.html">next</a>
</div>
<div class="copyright">
Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://www.logtalk.org">Logtalk.org</a>
</div>
<div class="footer">
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: December 23, 2003</span></p>
</div>
</body>
</html>