Click here to Skip to main content
15,885,141 members
Articles / Desktop Programming / MFC

Genetic Algorithm Library

Rate me:
Please Sign up or sign in to vote.
4.93/5 (175 votes)
7 Apr 2012GPL358 min read 437.6K   34.7K   555  
A framework for genetic algorithms
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Genetic Algorithm Library: Threading::GaCriticalSection Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</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>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</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="namespace_threading.html">Threading</a>::<a class="el" href="class_threading_1_1_ga_critical_section.html">GaCriticalSection</a>
  </div>
</div>
<div class="contents">
<h1>Threading::GaCriticalSection Class Reference</h1><!-- doxytag: class="Threading::GaCriticalSection" --><code><a class="el" href="class_threading_1_1_ga_critical_section.html" title="GaCriticalSection class is wrapper class for system synchronization object.">GaCriticalSection</a></code> class is wrapper class for system synchronization object.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;source/Threading.h&gt;</code>
<p>

<p>
<a href="class_threading_1_1_ga_critical_section-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_threading_1_1_ga_critical_section.html#7daa2649efd823014422a74ac9d75635">GaCriticalSection</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor performs system specific initialization of synchronization object if needed.  <a href="#7daa2649efd823014422a74ac9d75635"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_threading_1_1_ga_critical_section.html#6b1c30797be4a1e0dc3c20ef3c601221">~GaCriticalSection</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees resources used by system synchronization object.  <a href="#6b1c30797be4a1e0dc3c20ef3c601221"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_threading_1_1_ga_critical_section.html#4cc96d7ecd66795f00f4f5022fbe8ff7">Lock</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>Lock</code> method acquires synchronization object and prevents other thread to access protected section simultaneously. If another thread had already acquired synchronization object current thread is put to sleep, and is waked when synchronization object is released.  <a href="#4cc96d7ecd66795f00f4f5022fbe8ff7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void GACALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_threading_1_1_ga_critical_section.html#c517b4515febfe15eeb12eb0132a1002">Unlock</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><code>Unlock</code> method release synchronization object and wakes threads which was put to wait for release of the object.  <a href="#c517b4515febfe15eeb12eb0132a1002"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespace_threading.html#a83f689982d39ae995a27164fdd8386e">SysSyncObject</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_threading_1_1_ga_critical_section.html#3a5b834a909b38c83dfa792657ea4e4a">_section</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">System specific object used for synchronization of critical section.  <a href="#3a5b834a909b38c83dfa792657ea4e4a"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<code><a class="el" href="class_threading_1_1_ga_critical_section.html" title="GaCriticalSection class is wrapper class for system synchronization object.">GaCriticalSection</a></code> class is wrapper class for system synchronization object. 
<p>
This class provides basic synchronization and protection from concurrent access to the objects and resources. Built-in synchronizators used in other classes are instances of <code><a class="el" href="class_threading_1_1_ga_critical_section.html" title="GaCriticalSection class is wrapper class for system synchronization object.">GaCriticalSection</a></code> class. <code>LOCK</code> and <code>UNLOCK</code> macros can operate on instances of this class. <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="7daa2649efd823014422a74ac9d75635"></a><!-- doxytag: member="Threading::GaCriticalSection::GaCriticalSection" ref="7daa2649efd823014422a74ac9d75635" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Threading::GaCriticalSection::GaCriticalSection           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor performs system specific initialization of synchronization object if needed. 
<p>

</div>
</div><p>
<a class="anchor" name="6b1c30797be4a1e0dc3c20ef3c601221"></a><!-- doxytag: member="Threading::GaCriticalSection::~GaCriticalSection" ref="6b1c30797be4a1e0dc3c20ef3c601221" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Threading::GaCriticalSection::~GaCriticalSection           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Frees resources used by system synchronization object. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="4cc96d7ecd66795f00f4f5022fbe8ff7"></a><!-- doxytag: member="Threading::GaCriticalSection::Lock" ref="4cc96d7ecd66795f00f4f5022fbe8ff7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Threading::GaCriticalSection::Lock           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>Lock</code> method acquires synchronization object and prevents other thread to access protected section simultaneously. If another thread had already acquired synchronization object current thread is put to sleep, and is waked when synchronization object is released. 
<p>

</div>
</div><p>
<a class="anchor" name="c517b4515febfe15eeb12eb0132a1002"></a><!-- doxytag: member="Threading::GaCriticalSection::Unlock" ref="c517b4515febfe15eeb12eb0132a1002" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GACALL Threading::GaCriticalSection::Unlock           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<code>Unlock</code> method release synchronization object and wakes threads which was put to wait for release of the object. 
<p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="3a5b834a909b38c83dfa792657ea4e4a"></a><!-- doxytag: member="Threading::GaCriticalSection::_section" ref="3a5b834a909b38c83dfa792657ea4e4a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespace_threading.html#a83f689982d39ae995a27164fdd8386e">SysSyncObject</a> <a class="el" href="class_threading_1_1_ga_critical_section.html#3a5b834a909b38c83dfa792657ea4e4a">Threading::GaCriticalSection::_section</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
System specific object used for synchronization of critical section. 
<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>source/<a class="el" href="_threading_8h.html">Threading.h</a></ul>
</div>
<br/><a href="http://www.coolsoft-sd.com/ProductVersion.aspx?vid=9">Genetic Algorithm Library</a><br/><a href="http://www.coolsoft-sd.com/">Coolsoft Software Development</a>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer
Serbia Serbia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions