Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > bfea28f33e7373c31a33dc7387b2a0be > files > 29

loki-lib-doc-0.1.7-2.fc12.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Loki: Loki::CheckForNoThrow&lt; Host &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="a00192.html">Loki</a>::<a class="el" href="a00021.html">CheckForNoThrow</a>
  </div>
</div>
<div class="contents">
<h1>Loki::CheckForNoThrow&lt; Host &gt; Class Template Reference</h1><!-- doxytag: class="Loki::CheckForNoThrow" --><code>#include &lt;Checker.h&gt;</code>
<p>

<p>
<a href="a00296.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;class Host&gt;<br>
 class Loki::CheckForNoThrow&lt; Host &gt;</h3>

<dl class="user" compact><dt><b>ContractChecker and StaticChecker Overview</b></dt><dd>The <a class="el" href="a00029.html">ContractChecker</a> and <a class="el" href="a00134.html">StaticChecker</a> classes have two purposes:<ul>
<li>provide a mechanism by which programmers can determine which functions violate class/data invariants,</li><li>and determine which exception safety a function provides.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Class &amp; Data Invariants</b></dt><dd>The <a class="el" href="a00029.html">ContractChecker</a> and <a class="el" href="a00134.html">StaticChecker</a> define invariants as "expressions that are true for particular data". They uses a function which returns true if all data are valid, and returns false if any datum is invalid. This is called the validator function, and the host class or function provides a pointer to it. The validator could also assert for any invariant which fails rather than return false. If the validator is a static member function, you can use it with checkers in any function, but especially standalone functions and class static functions. If the validator is a non-static member function, you can use it only within non-static member functions.</dd></dl>
<dl class="user" compact><dt><b>Exception Safety Levels</b></dt><dd>Years ago, David Abrahams formalized a framework for assessing the exception safety level a function provides. His framework describes three levels of guarantees. Any function which does not provide any of these levels is considered unsafe. <a class="el" href="a00029.html">ContractChecker</a> and <a class="el" href="a00134.html">StaticChecker</a> determine a function's safety level through the use of policy classes. Checker's policy classes can show if a function provides any of these three guarantees. Since there is no universal way to detect leaks, this facility provides no mechanism for finding leaks, but users may create their own validators which do. StaticChecker's policy classes only provide direct checking for the no-throw and invariant guarantees. With some finesse, a programmer can write a validator for <a class="el" href="a00134.html">StaticChecker</a> that checks for the Strong guarantee.</dd></dl>
<ul>
<li>No-throw guarantee: A function will not throw any exceptions.</li><li>Strong guarantee: A function will not change data if an exception occurs. (Which I call the no-change guarantee.)</li><li>Basic guarantee: A function will not leak resources and data will remain in a valid state if an exception occurs. (Which I call either the no-leak or no-break guarantee depending on context.)</li></ul>
<p>
<dl class="user" compact><dt><b>Exception Safety Level:</b></dt><dd>This exception-checking policy class for <a class="el" href="a00029.html">ContractChecker</a> asserts if an exception exists. Host classes can use this to show that a member function provides the no-throw exception safety guarantees.</dd></dl>
<dl class="user" compact><dt><b>Requirements For Host Class:</b></dt><dd>This policy imposes no requirements on a host class. </dd></dl>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a00147.html">Checker.h</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 29 18:51:42 2009 for Loki by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>