📄 a00506.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>OpenDDS: OpenDDS::DCPS::DataSampleListElement Struct 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.4.7 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </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="classes.html"><span>Alphabetical List</span></a></li>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="a01301.html">OpenDDS</a>::<a class="el" href="a01275.html">DCPS</a>::<a class="el" href="a00506.html">DataSampleListElement</a></div>
<h1>OpenDDS::DCPS::DataSampleListElement Struct Reference</h1><!-- doxytag: class="OpenDDS::DCPS::DataSampleListElement" --><code>#include <DataSampleList.h></code>
<p>
Collaboration diagram for OpenDDS::DCPS::DataSampleListElement:<p><center><img src="a02653.png" border="0" usemap="#a02654" alt="Collaboration graph"></center>
<map name="a02654">
<area href="a00626.html" shape="rect" coords="131,8,395,32" alt="">
<area href="a00758.html" shape="rect" coords="120,56,405,80" alt="">
<area href="a00726.html" shape="rect" coords="211,104,315,128" alt="">
<area href="a00539.html" shape="rect" coords="5,152,520,176" alt="">
<area href="a00552.html" shape="rect" coords="172,211,353,235" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="a00016.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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#bf10be3ee8e47873a0822691fc01976d">DataSampleListElement</a> (<a class="el" href="a00552.html">PublicationId</a> publication_id, <a class="el" href="a00758.html">TransportSendListener</a> *send_listner, <a class="el" href="a00626.html">PublicationInstance</a> *handle, <a class="el" href="a00539.html">TransportSendElementAllocator</a> *allocator)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#c26473bb2f8f6eb5485c2d51bab575ca">DataSampleListElement</a> (const <a class="el" href="a00506.html">DataSampleListElement</a> &elem)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#531712a0ca1359138b3f2ebd37b51ebb">~DataSampleListElement</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00506.html">DataSampleListElement</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#8f7c8b1933b5ba98ed6dc28a3ec44167">operator=</a> (<a class="el" href="a00506.html">DataSampleListElement</a> const &elem)</td></tr>
<tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a01275.html#9d715b1ddec04f309a43af83d2874fa1">DataSample</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#84ed51a91984428551a915a02c673c0b">sample_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00552.html">PublicationId</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#40ac6e2da1b979102676af6834ac8b6a">publication_id_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Publication Id used downstream. <a href="#40ac6e2da1b979102676af6834ac8b6a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CORBA::ULong </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#25bdb3a2c72937099ce9c4c85df925b8">num_subs_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00552.html">OpenDDS::DCPS::RepoId</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#824a02ba0172b6cd9a3e51358858d6bb">subscription_ids_</a> [<a class="el" href="a01275.html#8909f91738dcf3340bfab7dea73f50b9">OpenDDS::DCPS::MAX_READERS_PER_ELEM</a>]</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a01275.html#b42673d0e0c5ea25e5f314c8d17657ed">CoherencyGroup</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#168797fbdbd309aabff615392f0765c1">group_id_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">::<a class="el" href="a00726.html">DDS::Time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#7f00aa1336a44e4f126355dd720e2572">source_timestamp_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Timestamp for the sample when it was first written. <a href="#7f00aa1336a44e4f126355dd720e2572"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00506.html">DataSampleListElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#087c8a73a163e36397e3f80e4e82b8ad">previous_sample_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Thread of all data within a DataWriter. <a href="#087c8a73a163e36397e3f80e4e82b8ad"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00506.html">DataSampleListElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#9afa21ade3f348c9b902f944feb3e8ac">next_sample_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00506.html">DataSampleListElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#f64334331741bf0dbfd3642c71c89064">next_instance_sample_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Thread of data within the instance. <a href="#f64334331741bf0dbfd3642c71c89064"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00506.html">DataSampleListElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#84c305b5e8843f6753ed47c1b3a3e91b">next_send_sample_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Thread of data being unsent/sending/sent/released. <a href="#84c305b5e8843f6753ed47c1b3a3e91b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00506.html">DataSampleListElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#4deaa5de2bb13135f36ccc8420b247de">previous_send_sample_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00758.html">TransportSendListener</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#bda26609799397c79f4b7c43cd59f5ad">send_listener_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#93c372ffe3bf66ac40696b71a46299de">space_available_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The flag indicates space availability for this waiting DataSample. <a href="#93c372ffe3bf66ac40696b71a46299de"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00626.html">PublicationInstance</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#a239a7489a7079ae5fee79623c2f13ee">handle_</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00539.html">TransportSendElementAllocator</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00506.html#eacf64943a947aad3d78d9bcaacb8b2d">transport_send_element_allocator_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocator for the <a class="el" href="a00757.html">TransportSendElement</a>. <a href="#eacf64943a947aad3d78d9bcaacb8b2d"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
List elements include the marshaled message, the publication Id and Instance handle for downstream processing, and three separate threads allowing the elements to reside simultaneously on four different lists of data:<p>
next_sample_ / previous_sample<ul>
<li>the next sample of data in the DataWriter. This thread is used to traverse elements in the order in which they were written to the DataWriter (within PRESENTATION.access_scope==TOPIC). This thread will be used to hold the element in one of four different lists in the <a class="el" href="a00775.html">WriteDataContainer</a>: the unsent_data_ list, the sending_data_ list, the sent_data_ list, or the released_data_ list at different times during its lifetime. This has a double link to allow removal of elements from internal locations in the list.</li></ul>
<p>
next_instance_sample_<ul>
<li>the next sample of data in the instance within the DataWriter. This thread is used to traverse elements in the order in which they were written to the instance (within PRESENTAION.access_scope==INSTANCE). It is mainly used on the send side to count the depth of instance data and to allow the removal of elements by instance.</li></ul>
<p>
next_send_sample_/previous_send_sample_<ul>
<li>the next sample of data to be sent. This thread is used external to the container to maintain a list of data samples that are to be transmitted over the transport layer. The Publisher may use this thread to maintain a list of samples to be sent with PRESENTATION.access_scope==GROUP by obtaining data from each DataWriter as it becomes available and concatentating the data in the order in which it was written.</li></ul>
<p>
We thread this single element rather than having multiple smaller lists in order to allow us to allocat once and have the element contained in all of the lists in which it will be held during its lifetime. These three threads will at times hold the element in three separate lists simultaneously. The next_sample_ thread will be used in the container to hold the element in one of three different lists at different times, so a single thread is all that is required for all of those lists.<p>
NOTE: this is what we want to pass into the enqueue method of the container, since we want to centralize the allocation/deallocation so that we can minimize locking. By grabbing a single lock, allocating the buffer/Data_Block/Message_Block/DataSampleListElement at the same time, we only pay once for all of the allocations. They are all presumably from a cache (for the most part) anyway, so it should be fairly quick.
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="bf10be3ee8e47873a0822691fc01976d"></a><!-- doxytag: member="OpenDDS::DCPS::DataSampleListElement::DataSampleListElement" ref="bf10be3ee8e47873a0822691fc01976d" args="(PublicationId publication_id, TransportSendListener *send_listner, PublicationInstance *handle, TransportSendElementAllocator *allocator)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ACE_INLINE OpenDDS::DCPS::DataSampleListElement::DataSampleListElement </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00552.html">PublicationId</a> </td>
<td class="paramname"> <em>publication_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00758.html">TransportSendListener</a> * </td>
<td class="paramname"> <em>send_listner</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00626.html">PublicationInstance</a> * </td>
<td class="paramname"> <em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00539.html">TransportSendElementAllocator</a> * </td>
<td class="paramname"> <em>allocator</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="c26473bb2f8f6eb5485c2d51bab575ca"></a><!-- doxytag: member="OpenDDS::DCPS::DataSampleListElement::DataSampleListElement" ref="c26473bb2f8f6eb5485c2d51bab575ca" args="(const DataSampleListElement &elem)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ACE_INLINE OpenDDS::DCPS::DataSampleListElement::DataSampleListElement </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="a00506.html">DataSampleListElement</a> & </td>
<td class="paramname"> <em>elem</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="531712a0ca1359138b3f2ebd37b51ebb"></a><!-- doxytag: member="OpenDDS::DCPS::DataSampleListElement::~DataSampleListElement" ref="531712a0ca1359138b3f2ebd37b51ebb" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ACE_INLINE OpenDDS::DCPS::DataSampleListElement::~DataSampleListElement </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="8f7c8b1933b5ba98ed6dc28a3ec44167"></a><!-- doxytag: member="OpenDDS::DCPS::DataSampleListElement::operator=" ref="8f7c8b1933b5ba98ed6dc28a3ec44167" args="(DataSampleListElement const &elem)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ACE_INLINE <a class="el" href="a00506.html">DataSampleListElement</a> & OpenDDS::DCPS::DataSampleListElement::operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00506.html">DataSampleListElement</a> const & </td>
<td class="paramname"> <em>elem</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="168797fbdbd309aabff615392f0765c1"></a><!-- doxytag: member="OpenDDS::DCPS::DataSampleListElement::group_id_" ref="168797fbdbd309aabff615392f0765c1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a01275.html#b42673d0e0c5ea25e5f314c8d17657ed">CoherencyGroup</a> <a class="el" href="a00506.html#168797fbdbd309aabff615392f0765c1">OpenDDS::DCPS::DataSampleListElement::group_id_</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Group Id used downstream. This is not used in the first implementation (INSTANCE level)
</div>
</div><p>
<a class="anchor" name="a239a7489a7079ae5fee79623c2f13ee"></a><!-- doxytag: member="OpenDDS::DCPS::DataSampleListElement::handle_" ref="a239a7489a7079ae5fee79623c2f13ee" args="" -->
<div class="memitem">
<div class="memproto">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -