Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 5b095c1dcccf87f92298aa569e0d8cd3 > files > 110

globus-common-doc-14.10-2.fc18.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<!-- THIS FILE IS AUTOMATICALLY GENERATED FROM THE GLOBUS SOURCE CODE
     DO NOT MODIFY.
-->
<title>Globus Reference Manual</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.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__globus__priority__q.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Priority Queue</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structglobus__priority__q__s.html">globus_priority_q_s</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gac7c226bc88e162fee1ce9f6d9e35275b"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#gac7c226bc88e162fee1ce9f6d9e35275b">globus_priority_q_cmp_func_t</a> )(void *priority_1, void *priority_2)</td></tr>
<tr class="separator:gac7c226bc88e162fee1ce9f6d9e35275b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga57d2dcdaf11e5b4b0e23a4ed85cd2477"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structglobus__priority__q__s.html">globus_priority_q_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a></td></tr>
<tr class="separator:ga57d2dcdaf11e5b4b0e23a4ed85cd2477"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga777e24de9ebf5dbf081bce3e11d3b0b2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga777e24de9ebf5dbf081bce3e11d3b0b2">globus_priority_q_init</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q, <a class="el" href="group__globus__priority__q.html#gac7c226bc88e162fee1ce9f6d9e35275b">globus_priority_q_cmp_func_t</a> cmp_func)</td></tr>
<tr class="separator:ga777e24de9ebf5dbf081bce3e11d3b0b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3267c338d8b8c29267a517292c32369d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga3267c338d8b8c29267a517292c32369d">globus_priority_q_destroy</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q)</td></tr>
<tr class="separator:ga3267c338d8b8c29267a517292c32369d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a23773f79537a8551969137a58b166b"><td class="memItemLeft" align="right" valign="top">globus_bool_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga9a23773f79537a8551969137a58b166b">globus_priority_q_empty</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q)</td></tr>
<tr class="separator:ga9a23773f79537a8551969137a58b166b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga714672f2c4e5ca21a927431efe3c7ce7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga714672f2c4e5ca21a927431efe3c7ce7">globus_priority_q_size</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q)</td></tr>
<tr class="separator:ga714672f2c4e5ca21a927431efe3c7ce7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac3d8d3fcd60f6f2d2d920591afab8b1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#gaac3d8d3fcd60f6f2d2d920591afab8b1">globus_priority_q_enqueue</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q, void *datum, void *priority)</td></tr>
<tr class="separator:gaac3d8d3fcd60f6f2d2d920591afab8b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97b65d8995172b56a71ce85d4ec00309"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga97b65d8995172b56a71ce85d4ec00309">globus_priority_q_dequeue</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q)</td></tr>
<tr class="separator:ga97b65d8995172b56a71ce85d4ec00309"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gababe649e6fa982ee7c82c996834d8a5d"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#gababe649e6fa982ee7c82c996834d8a5d">globus_priority_q_first</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q)</td></tr>
<tr class="separator:gababe649e6fa982ee7c82c996834d8a5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga95e3700a86ecb78a0f42e60e523564da"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga95e3700a86ecb78a0f42e60e523564da">globus_priority_q_first_priority</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q)</td></tr>
<tr class="separator:ga95e3700a86ecb78a0f42e60e523564da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3283f57133c0a9618b7973d7d65b906"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#gaf3283f57133c0a9618b7973d7d65b906">globus_priority_q_remove</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q, void *datum)</td></tr>
<tr class="separator:gaf3283f57133c0a9618b7973d7d65b906"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2c66ce8354a843fe45daf7f0d4123082"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__priority__q.html#ga2c66ce8354a843fe45daf7f0d4123082">globus_priority_q_modify</a> (<a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *priority_q, void *datum, void *new_priority)</td></tr>
<tr class="separator:ga2c66ce8354a843fe45daf7f0d4123082"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This module defines a priority queue for globus. It is implemented using a binary heap (minheap) and does NOT have a fifo fallback for like priorities. If you need fifo fallback, you should use a compound priority with the primary priority being the 'real' priority and the secondary being a serial number.</p>
<p>To use this priority queue type, define a comparison function of type globus_priority_q_cmp_func_t and pass that to <a class="el" href="group__globus__priority__q.html#ga777e24de9ebf5dbf081bce3e11d3b0b2" title="Initialize a priority queue.">globus_priority_q_init()</a>.</p>
<p>To add and remove items in priority order, use <a class="el" href="group__globus__priority__q.html#gaac3d8d3fcd60f6f2d2d920591afab8b1" title="Add a Datum to a Priority Queue.">globus_priority_q_enqueue()</a> and <a class="el" href="group__globus__priority__q.html#ga97b65d8995172b56a71ce85d4ec00309" title="Remove a Datum From A Priority Queue.">globus_priority_q_dequeue()</a> respectively.</p>
<p>To remove a datum ignoring its priority, use <a class="el" href="group__globus__priority__q.html#gaf3283f57133c0a9618b7973d7d65b906" title="Remove an Arbitrary Datum from a Priority Queue.">globus_priority_q_remove()</a>.</p>
<p>To inspect the first element and its priority, use <a class="el" href="group__globus__priority__q.html#gababe649e6fa982ee7c82c996834d8a5d" title="Get the Highest-Priority Datum From a Priority Queue.">globus_priority_q_first()</a> and <a class="el" href="group__globus__priority__q.html#ga95e3700a86ecb78a0f42e60e523564da" title="Get the Highest Priority in Priority Queue.">globus_priority_q_first_priority()</a> respectively.</p>
<p>To determine whether a queue is empty or the number of data in it, use <a class="el" href="group__globus__priority__q.html#ga9a23773f79537a8551969137a58b166b" title="Priority Queue Empty Predicate.">globus_priority_q_empty()</a> and <a class="el" href="group__globus__priority__q.html#ga714672f2c4e5ca21a927431efe3c7ce7" title="Priority Queue Size.">globus_priority_q_size()</a>.</p>
<p>To modify the priority of a datum already in the queue, use <a class="el" href="group__globus__priority__q.html#ga2c66ce8354a843fe45daf7f0d4123082" title="Modify the Priority of Datum.">globus_priority_q_modify()</a>.</p>
<p>When finished with the queue, use <a class="el" href="group__globus__priority__q.html#ga3267c338d8b8c29267a517292c32369d" title="Destroy a Priority Queue.">globus_priority_q_destroy()</a> to free data associated with the priority queue. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="gac7c226bc88e162fee1ce9f6d9e35275b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* globus_priority_q_cmp_func_t)(void *priority_1, void *priority_2)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Priority Comparison Predicate. </p>
<p>This type is used to implement comparison of two priorities for inserting items into the priority queue. A function of this type is passed to <a class="el" href="group__globus__priority__q.html#ga777e24de9ebf5dbf081bce3e11d3b0b2" title="Initialize a priority queue.">globus_priority_q_init()</a> to determine how priorities are computed in a newly created priority queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_1</td><td>First priority to compare </td></tr>
    <tr><td class="paramname">priority_2</td><td>Second priority to compare</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">&gt;</td><td>0 The priority of priority_1 is less than that of priority_2. </td></tr>
    <tr><td class="paramname">&lt;</td><td>0 The priority of priority_1 is greater than that of priority_2. </td></tr>
    <tr><td class="paramname">=</td><td>0 The priorities of priority_1 and priority_2 are the same. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga57d2dcdaf11e5b4b0e23a4ed85cd2477"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structglobus__priority__q__s.html">globus_priority_q_s</a>  <a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Priority Queue Structure. </p>
<p>A pointer to a structure of this type is passed to all functions in the <a class="el" href="group__globus__priority__q.html">Priority Queue </a> module. It is not intended to be inspected or modified outside of this API. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga777e24de9ebf5dbf081bce3e11d3b0b2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_priority_q_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#gac7c226bc88e162fee1ce9f6d9e35275b">globus_priority_q_cmp_func_t</a>&#160;</td>
          <td class="paramname"><em>cmp_func</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a priority queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga777e24de9ebf5dbf081bce3e11d3b0b2" title="Initialize a priority queue.">globus_priority_q_init()</a> function initializes a globus_priority_q_t structure for use with the other functions in the <a class="el" href="group__globus__priority__q.html">Priority Queue </a> module. If this function returns GLOBUS_SUCCESS, the caller is responsible for deallocating the members of this structure when it is no longer needed by passing it to <a class="el" href="group__globus__priority__q.html#ga3267c338d8b8c29267a517292c32369d" title="Destroy a Priority Queue.">globus_priority_q_destroy()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue structure to initialize. </td></tr>
    <tr><td class="paramname">cmp_func</td><td>Pointer to a function which computes the relative relationship between two priorities. See the documentation of <a class="el" href="group__globus__priority__q.html#gac7c226bc88e162fee1ce9f6d9e35275b" title="Priority Comparison Predicate.">globus_priority_q_cmp_func_t</a> for details on how to implement that function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">GLOBUS_SUCCESS</td><td>Success </td></tr>
    <tr><td class="paramname">GLOBUS_FAILURE</td><td>Failure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3267c338d8b8c29267a517292c32369d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_priority_q_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a Priority Queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga3267c338d8b8c29267a517292c32369d" title="Destroy a Priority Queue.">globus_priority_q_destroy()</a> function destroys the contents of a priority queue. After this function returns, the structure pointed to by priority_q is invalid and must not be passed to any functions in the <a class="el" href="group__globus__priority__q.html">Priority Queue </a> module other <a class="el" href="group__globus__priority__q.html#ga777e24de9ebf5dbf081bce3e11d3b0b2" title="Initialize a priority queue.">globus_priority_q_init()</a>.</p>
<p>Note that this function does not call any destructors for the data inserted into the priority queue, so the caller must be sure to either have other references to those data or free them before calling this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority_q to destroy.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">GLOBUS_SUCCESS</td><td>Success </td></tr>
    <tr><td class="paramname">GLOBUS_FAILURE</td><td>Failure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9a23773f79537a8551969137a58b166b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">globus_bool_t globus_priority_q_empty </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Priority Queue Empty Predicate. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga9a23773f79537a8551969137a58b166b" title="Priority Queue Empty Predicate.">globus_priority_q_empty()</a> function checks the given priority queue to determine if it is empty. It is considered empty if it has been initialized via <a class="el" href="group__globus__priority__q.html#ga777e24de9ebf5dbf081bce3e11d3b0b2" title="Initialize a priority queue.">globus_priority_q_init()</a> and there are no items which have been inserted via <a class="el" href="group__globus__priority__q.html#gaac3d8d3fcd60f6f2d2d920591afab8b1" title="Add a Datum to a Priority Queue.">globus_priority_q_enqueue()</a> which have not been removed by calling <a class="el" href="group__globus__priority__q.html#gaf3283f57133c0a9618b7973d7d65b906" title="Remove an Arbitrary Datum from a Priority Queue.">globus_priority_q_remove()</a> or <a class="el" href="group__globus__priority__q.html#ga97b65d8995172b56a71ce85d4ec00309" title="Remove a Datum From A Priority Queue.">globus_priority_q_dequeue()</a>. If it is empty, this function returns GLOBUS_TRUE; otherwise it returns GLOBUS_FALSE.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to check</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">GLOBUS_TRUE</td><td>The priority queue is empty </td></tr>
    <tr><td class="paramname">GLOBUS_FALSE</td><td>The priority queue is not empty, or the priority queue is invalid </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga714672f2c4e5ca21a927431efe3c7ce7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_priority_q_size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Priority Queue Size. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga714672f2c4e5ca21a927431efe3c7ce7" title="Priority Queue Size.">globus_priority_q_size()</a> function returns the size of the priority queue, that is, the number of elements that are currently enqueued in it. The special value GLOBUS_FAILURE is returned if a null pointer is passed to this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to check</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the number of elements in the queue, or GLOBUS_FAILURE if the priority_q pointer is invalid. </dd></dl>

</div>
</div>
<a class="anchor" id="gaac3d8d3fcd60f6f2d2d920591afab8b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_priority_q_enqueue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>datum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>priority</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a Datum to a Priority Queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#gaac3d8d3fcd60f6f2d2d920591afab8b1" title="Add a Datum to a Priority Queue.">globus_priority_q_enqueue()</a> function inserts a datum into the priority queue based on its priority. When an item is inserted, the pointers to both the datum and the priority are copied into the priority_q data structure, so neither may be freed until the datum is removed from the priority queue, or undefined behavior may occur.</p>
<p>Note that there is no fifo fallback for priorities, so the order of two items with equivalent priorities is not specified relative to each other. To enable fifo fallback, use a compound priority that includes a priority level and a sequence number as the value pointed to by the priority parameter and pass a suitable comparison function to initialize the priority queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to insert datum into </td></tr>
    <tr><td class="paramname">datum</td><td>The datum to insert into the queue </td></tr>
    <tr><td class="paramname">priority</td><td>The priority of the datum</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">GLOBUS_SUCCESS</td><td>Success </td></tr>
    <tr><td class="paramname">GLOBUS_FAILURE</td><td>Failure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga97b65d8995172b56a71ce85d4ec00309"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* globus_priority_q_dequeue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove a Datum From A Priority Queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga97b65d8995172b56a71ce85d4ec00309" title="Remove a Datum From A Priority Queue.">globus_priority_q_dequeue()</a> function removes the highest-priority datum from the given priority queue and returns it. If the priority_q pointer is NULL or the priority queue is empty, this function returns NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to remove from.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the highest-priority datum from the priority queue. </dd></dl>

</div>
</div>
<a class="anchor" id="gababe649e6fa982ee7c82c996834d8a5d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* globus_priority_q_first </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the Highest-Priority Datum From a Priority Queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#gababe649e6fa982ee7c82c996834d8a5d" title="Get the Highest-Priority Datum From a Priority Queue.">globus_priority_q_first()</a> function returns the highest-priority datum from the priority queue pointed to by priority_q. The datum is not removed from the queue; to do that, use <a class="el" href="group__globus__priority__q.html#ga97b65d8995172b56a71ce85d4ec00309" title="Remove a Datum From A Priority Queue.">globus_priority_q_dequeue()</a> instead. If the priority_q pointer is NULL or the queue is empty, this function returns NULL. The priority queue retains a reference to the returned datum, so the pointer value returned must not freed until the datum is removed from the queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to inspect </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the highest-priority datum from the priority queue. </dd></dl>

</div>
</div>
<a class="anchor" id="ga95e3700a86ecb78a0f42e60e523564da"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* globus_priority_q_first_priority </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the Highest Priority in Priority Queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga95e3700a86ecb78a0f42e60e523564da" title="Get the Highest Priority in Priority Queue.">globus_priority_q_first_priority()</a> function returns the value of highest priority in the priority queue (not the datum associated with that priority). If the priority_q pointer is NULL or empty, this function returns NULL. The priority queue retains a reference to the returned priority, so the pointer value returned must not be freed until the datum associated with it is removed from the queue.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to inspect </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the highest priority value in the priority queue. </dd></dl>

</div>
</div>
<a class="anchor" id="gaf3283f57133c0a9618b7973d7d65b906"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* globus_priority_q_remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>datum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove an Arbitrary Datum from a Priority Queue. </p>
<p>The <a class="el" href="group__globus__priority__q.html#gaf3283f57133c0a9618b7973d7d65b906" title="Remove an Arbitrary Datum from a Priority Queue.">globus_priority_q_remove()</a> function removes the highest-priority instance of the specified datum from the priority queue and returns the datum if it is found. If the priority_q is NULL or the datum is not found, this function returns NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to modify </td></tr>
    <tr><td class="paramname">datum</td><td>Pointer to the datum to search for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns datum if it was present in the priority queue </dd></dl>

</div>
</div>
<a class="anchor" id="ga2c66ce8354a843fe45daf7f0d4123082"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* globus_priority_q_modify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__globus__priority__q.html#ga57d2dcdaf11e5b4b0e23a4ed85cd2477">globus_priority_q_t</a> *&#160;</td>
          <td class="paramname"><em>priority_q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>datum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>new_priority</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Modify the Priority of Datum. </p>
<p>The <a class="el" href="group__globus__priority__q.html#ga2c66ce8354a843fe45daf7f0d4123082" title="Modify the Priority of Datum.">globus_priority_q_modify()</a> function modifies the priority of the highest-priority instance of datum in the priority queue so that it new_priority. The old priority of the datum is returned. If the priority_q is NULL or the datum is not present, this function returns NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">priority_q</td><td>Pointer to the priority queue to modify </td></tr>
    <tr><td class="paramname">datum</td><td>Pointer to the datum whose priority is being modified </td></tr>
    <tr><td class="paramname">new_priority</td><td>Pointer to the new priority</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This function returns the old priority of datum. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<hr>
<p align="center">
<a href="http://www.globus.org/toolkit/about.html" target="_top">about globus</a> |
<a href="http://www.globus.org/toolkit/" target="_top">globus toolkit</a> |
<a href="https://dev.globus.org/wiki/Welcome/" target="_top">dev.globus</a>
<br>
<br>
Comments? <a href="mailto:webmaster@globus.org">webmaster@globus.org</a>
</body>
</html>