Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > c9cfbd1355daacaf3b34517a6d7b18cc > files > 294

libdap-doc-3.11.0-2.fc15.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libdap++: Sequence.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libdap++&#160;<span id="projectnumber">Updated for version 3.8.2</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <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="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('Sequence_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>Sequence.cc</h1>  </div>
</div>
<div class="contents">
<a href="Sequence_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-basic-offset:4 -*-</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="comment">// This file is part of libdap, A C++ implementation of the OPeNDAP Data</span>
<a name="l00004"></a>00004 <span class="comment">// Access Protocol.</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="comment">// Copyright (c) 2002,2003 OPeNDAP, Inc.</span>
<a name="l00007"></a>00007 <span class="comment">// Author: James Gallagher &lt;jgallagher@opendap.org&gt;</span>
<a name="l00008"></a>00008 <span class="comment">//</span>
<a name="l00009"></a>00009 <span class="comment">// This library is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">//</span>
<a name="l00014"></a>00014 <span class="comment">// This library is distributed in the hope that it will be useful,</span>
<a name="l00015"></a>00015 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00016"></a>00016 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00017"></a>00017 <span class="comment">// Lesser General Public License for more details.</span>
<a name="l00018"></a>00018 <span class="comment">//</span>
<a name="l00019"></a>00019 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>
<a name="l00020"></a>00020 <span class="comment">// License along with this library; if not, write to the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00022"></a>00022 <span class="comment">//</span>
<a name="l00023"></a>00023 <span class="comment">// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="comment">// (c) COPYRIGHT URI/MIT 1994-1999</span>
<a name="l00026"></a>00026 <span class="comment">// Please read the full copyright statement in the file COPYRIGHT_URI.</span>
<a name="l00027"></a>00027 <span class="comment">//</span>
<a name="l00028"></a>00028 <span class="comment">// Authors:</span>
<a name="l00029"></a>00029 <span class="comment">//      jhrg,jimg       James Gallagher &lt;jgallagher@gso.uri.edu&gt;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="comment">// Implementation for the class Structure</span>
<a name="l00032"></a>00032 <span class="comment">//</span>
<a name="l00033"></a>00033 <span class="comment">// jhrg 9/14/94</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;algorithm&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="comment">//#define DODS_DEBUG</span>
<a name="l00043"></a>00043 <span class="comment">//#define DODS_DEBUG2</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="Byte_8h.html">Byte.h</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="Int16_8h.html">Int16.h</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="UInt16_8h.html">UInt16.h</a>&quot;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &quot;<a class="code" href="Int32_8h.html">Int32.h</a>&quot;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &quot;<a class="code" href="UInt32_8h.html">UInt32.h</a>&quot;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &quot;<a class="code" href="Float32_8h.html">Float32.h</a>&quot;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &quot;<a class="code" href="Float64_8h.html">Float64.h</a>&quot;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &quot;<a class="code" href="Str_8h.html">Str.h</a>&quot;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &quot;<a class="code" href="Url_8h.html">Url.h</a>&quot;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &quot;<a class="code" href="Array_8h.html">Array.h</a>&quot;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include &quot;<a class="code" href="Structure_8h.html">Structure.h</a>&quot;</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include &quot;<a class="code" href="Sequence_8h.html">Sequence.h</a>&quot;</span>
<a name="l00057"></a>00057 <span class="preprocessor">#include &quot;<a class="code" href="Grid_8h.html">Grid.h</a>&quot;</span>
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 <span class="preprocessor">#include &quot;<a class="code" href="debug_8h.html">debug.h</a>&quot;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &quot;<a class="code" href="Error_8h.html">Error.h</a>&quot;</span>
<a name="l00061"></a>00061 <span class="preprocessor">#include &quot;<a class="code" href="InternalErr_8h.html">InternalErr.h</a>&quot;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#include &quot;<a class="code" href="Sequence_8h.html">Sequence.h</a>&quot;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &quot;<a class="code" href="DDS_8h.html">DDS.h</a>&quot;</span>
<a name="l00064"></a>00064 <span class="preprocessor">#include &quot;<a class="code" href="DataDDS_8h.html">DataDDS.h</a>&quot;</span>
<a name="l00065"></a>00065 <span class="preprocessor">#include &quot;<a class="code" href="util_8h.html">util.h</a>&quot;</span>
<a name="l00066"></a>00066 <span class="preprocessor">#include &quot;<a class="code" href="InternalErr_8h.html">InternalErr.h</a>&quot;</span>
<a name="l00067"></a>00067 <span class="preprocessor">#include &quot;<a class="code" href="escaping_8h.html">escaping.h</a>&quot;</span>
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 <span class="keyword">using namespace </span>std;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="keyword">namespace </span>libdap {
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> end_of_sequence = 0xA5; <span class="comment">// binary pattern 1010 0101</span>
<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> start_of_instance = 0x5A; <span class="comment">// binary pattern 0101 1010</span>
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="comment">// Private member functions</span>
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="keywordtype">void</span>
<a name="l00079"></a>00079 Sequence::_duplicate(<span class="keyword">const</span> Sequence &amp;s)
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081     d_row_number = s.d_row_number;
<a name="l00082"></a>00082     d_starting_row_number = s.d_starting_row_number;
<a name="l00083"></a>00083     d_ending_row_number = s.d_ending_row_number;
<a name="l00084"></a>00084     d_row_stride = s.d_row_stride;
<a name="l00085"></a>00085     d_leaf_sequence = s.d_leaf_sequence;
<a name="l00086"></a>00086     d_unsent_data = s.d_unsent_data;
<a name="l00087"></a>00087     d_wrote_soi = s.d_wrote_soi;
<a name="l00088"></a>00088     d_top_most = s.d_top_most;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090     Sequence &amp;cs = <span class="keyword">const_cast&lt;</span>Sequence &amp;<span class="keyword">&gt;</span>(s);
<a name="l00091"></a>00091 
<a name="l00092"></a>00092     <span class="comment">// Copy the template BaseType objects.</span>
<a name="l00093"></a>00093     <span class="keywordflow">for</span> (Vars_iter i = cs.var_begin(); i != cs.var_end(); i++) {
<a name="l00094"></a>00094         add_var((*i)) ;
<a name="l00095"></a>00095     }
<a name="l00096"></a>00096 
<a name="l00097"></a>00097     <span class="comment">// Copy the BaseType objects used to hold values.</span>
<a name="l00098"></a>00098     <span class="keywordflow">for</span> (vector&lt;BaseTypeRow *&gt;::iterator rows_iter = cs.d_values.begin();
<a name="l00099"></a>00099          rows_iter != cs.d_values.end();
<a name="l00100"></a>00100          rows_iter++) {
<a name="l00101"></a>00101         <span class="comment">// Get the current BaseType Row</span>
<a name="l00102"></a>00102         <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *src_bt_row_ptr = *rows_iter;
<a name="l00103"></a>00103         <span class="comment">// Create a new row.</span>
<a name="l00104"></a>00104         <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *dest_bt_row_ptr = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a>;
<a name="l00105"></a>00105         <span class="comment">// Copy the BaseType objects from a row to new BaseType objects.</span>
<a name="l00106"></a>00106         <span class="comment">// Push new BaseType objects onto new row.</span>
<a name="l00107"></a>00107         <span class="keywordflow">for</span> (BaseTypeRow::iterator bt_row_iter = src_bt_row_ptr-&gt;begin();
<a name="l00108"></a>00108              bt_row_iter != src_bt_row_ptr-&gt;end();
<a name="l00109"></a>00109              bt_row_iter++) {
<a name="l00110"></a>00110             BaseType *src_bt_ptr = *bt_row_iter;
<a name="l00111"></a>00111             BaseType *dest_bt_ptr = src_bt_ptr-&gt;ptr_duplicate();
<a name="l00112"></a>00112             dest_bt_row_ptr-&gt;push_back(dest_bt_ptr);
<a name="l00113"></a>00113         }
<a name="l00114"></a>00114         <span class="comment">// Push new row onto d_values.</span>
<a name="l00115"></a>00115         d_values.push_back(dest_bt_row_ptr);
<a name="l00116"></a>00116     }
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118 
<a name="l00119"></a>00119 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00120"></a>00120 write_end_of_sequence(Marshaller &amp;m)
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122     m.put_opaque( (<span class="keywordtype">char</span> *)&amp;end_of_sequence, 1 ) ;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00126"></a>00126 write_start_of_instance(Marshaller &amp;m)
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128     m.put_opaque( (<span class="keywordtype">char</span> *)&amp;start_of_instance, 1 ) ;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>
<a name="l00132"></a>00132 read_marker(UnMarshaller &amp;um)
<a name="l00133"></a>00133 {
<a name="l00134"></a>00134     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> marker;
<a name="l00135"></a>00135     um.get_opaque( (<span class="keywordtype">char</span> *)&amp;marker, 1 ) ;
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <span class="keywordflow">return</span> marker;
<a name="l00138"></a>00138 }
<a name="l00139"></a>00139 
<a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">bool</span>
<a name="l00141"></a>00141 is_start_of_instance(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> marker)
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143     <span class="keywordflow">return</span> (marker == start_of_instance);
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146 <span class="keyword">static</span> <span class="keywordtype">bool</span>
<a name="l00147"></a>00147 is_end_of_sequence(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> marker)
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149     <span class="keywordflow">return</span> (marker == end_of_sequence);
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 
<a name="l00152"></a>00152 <span class="comment">// Public member functions</span>
<a name="l00153"></a>00153 
<a name="l00162"></a><a class="code" href="classlibdap_1_1Sequence.html#a92b97c9d8c1431fd7e619186a557d875">00162</a> Sequence::Sequence(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n) : <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a>(n, <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>),
<a name="l00163"></a>00163         d_row_number(-1), d_starting_row_number(-1),
<a name="l00164"></a>00164         d_row_stride(1), d_ending_row_number(-1),
<a name="l00165"></a>00165         d_unsent_data(false), d_wrote_soi(false),
<a name="l00166"></a>00166         d_leaf_sequence(false), d_top_most(false)
<a name="l00167"></a>00167 {}
<a name="l00168"></a>00168 
<a name="l00179"></a><a class="code" href="classlibdap_1_1Sequence.html#ab5a772197dc7c62037cca19b27bacba6">00179</a> <a class="code" href="classlibdap_1_1Sequence.html#a92b97c9d8c1431fd7e619186a557d875" title="The Sequence constructor.">Sequence::Sequence</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;d)
<a name="l00180"></a>00180     : <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a>(n, d, <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>),
<a name="l00181"></a>00181       d_row_number(-1), d_starting_row_number(-1),
<a name="l00182"></a>00182       d_row_stride(1), d_ending_row_number(-1),
<a name="l00183"></a>00183       d_unsent_data(false), d_wrote_soi(false),
<a name="l00184"></a>00184       d_leaf_sequence(false), d_top_most(false)
<a name="l00185"></a>00185 {}
<a name="l00186"></a>00186 
<a name="l00188"></a><a class="code" href="classlibdap_1_1Sequence.html#a26c7416d7314d45aee035d09ef3db49c">00188</a> <a class="code" href="classlibdap_1_1Sequence.html#a92b97c9d8c1431fd7e619186a557d875" title="The Sequence constructor.">Sequence::Sequence</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a> &amp;rhs) : <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a>(rhs)
<a name="l00189"></a>00189 {
<a name="l00190"></a>00190     _duplicate(rhs);
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192 
<a name="l00193"></a>00193 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00194"></a><a class="code" href="classlibdap_1_1Sequence.html#aacf58704fe079b65130800589e59fa9e">00194</a> <a class="code" href="classlibdap_1_1Sequence.html#aacf58704fe079b65130800589e59fa9e">Sequence::ptr_duplicate</a>()
<a name="l00195"></a>00195 {
<a name="l00196"></a>00196     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classlibdap_1_1Sequence.html#a92b97c9d8c1431fd7e619186a557d875" title="The Sequence constructor.">Sequence</a>(*<span class="keyword">this</span>);
<a name="l00197"></a>00197 }
<a name="l00198"></a>00198 
<a name="l00199"></a>00199 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00200"></a>00200 delete_bt(<a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *bt_ptr)
<a name="l00201"></a>00201 {
<a name="l00202"></a>00202     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;In delete_bt: &quot;</span> &lt;&lt; bt_ptr &lt;&lt; endl);
<a name="l00203"></a>00203     <span class="keyword">delete</span> bt_ptr; bt_ptr = 0;
<a name="l00204"></a>00204 }
<a name="l00205"></a>00205 
<a name="l00206"></a>00206 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00207"></a>00207 delete_rows(<a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *bt_row_ptr)
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;In delete_rows: &quot;</span> &lt;&lt; bt_row_ptr &lt;&lt; endl);
<a name="l00210"></a>00210 
<a name="l00211"></a>00211     for_each(bt_row_ptr-&gt;begin(), bt_row_ptr-&gt;end(), delete_bt);
<a name="l00212"></a>00212 
<a name="l00213"></a>00213     <span class="keyword">delete</span> bt_row_ptr; bt_row_ptr = 0;
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215 
<a name="l00216"></a><a class="code" href="classlibdap_1_1Sequence.html#a8a90ca537aeb073da447e4bd55c072a4">00216</a> <a class="code" href="classlibdap_1_1Sequence.html#a8a90ca537aeb073da447e4bd55c072a4">Sequence::~Sequence</a>()
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering Sequence::~Sequence&quot;</span> &lt;&lt; endl);
<a name="l00219"></a>00219     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00220"></a>00220         <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp = *i ;
<a name="l00221"></a>00221         <span class="keyword">delete</span> btp ; btp = 0;
<a name="l00222"></a>00222     }
<a name="l00223"></a>00223 
<a name="l00224"></a>00224     for_each(d_values.begin(), d_values.end(), delete_rows);
<a name="l00225"></a>00225     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;exiting Sequence::~Sequence&quot;</span> &lt;&lt; endl);
<a name="l00226"></a>00226 }
<a name="l00227"></a>00227 
<a name="l00228"></a>00228 <a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a> &amp;
<a name="l00229"></a><a class="code" href="classlibdap_1_1Sequence.html#a8edd3c82bd969c6f286607731a597aeb">00229</a> <a class="code" href="classlibdap_1_1Sequence.html#a8edd3c82bd969c6f286607731a597aeb">Sequence::operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a> &amp;rhs)
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231     <span class="keywordflow">if</span> (<span class="keyword">this</span> == &amp;rhs)
<a name="l00232"></a>00232         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00233"></a>00233 
<a name="l00234"></a>00234     <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Constructor.html">Constructor</a> &amp;<span class="keyword">&gt;</span>(*this) = rhs; <span class="comment">// run Constructor=</span>
<a name="l00235"></a>00235 
<a name="l00236"></a>00236     _duplicate(rhs);
<a name="l00237"></a>00237 
<a name="l00238"></a>00238     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00239"></a>00239 }
<a name="l00240"></a>00240 
<a name="l00241"></a>00241 <span class="keywordtype">string</span>
<a name="l00242"></a><a class="code" href="classlibdap_1_1Sequence.html#a24016ba1d3b9b755699959abf0219ff1">00242</a> <a class="code" href="classlibdap_1_1Sequence.html#a24016ba1d3b9b755699959abf0219ff1">Sequence::toString</a>()
<a name="l00243"></a>00243 {
<a name="l00244"></a>00244     ostringstream oss;
<a name="l00245"></a>00245 
<a name="l00246"></a>00246     oss &lt;&lt; <a class="code" href="classlibdap_1_1Sequence.html#a24016ba1d3b9b755699959abf0219ff1">BaseType::toString</a>();
<a name="l00247"></a>00247 
<a name="l00248"></a>00248     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00249"></a>00249         oss &lt;&lt; (*i)-&gt;toString();
<a name="l00250"></a>00250     }
<a name="l00251"></a>00251 
<a name="l00252"></a>00252     oss &lt;&lt; endl;
<a name="l00253"></a>00253 
<a name="l00254"></a>00254     <span class="keywordflow">return</span> oss.str();
<a name="l00255"></a>00255 }
<a name="l00256"></a>00256 
<a name="l00257"></a>00257 <span class="keywordtype">int</span>
<a name="l00258"></a><a class="code" href="classlibdap_1_1Sequence.html#ac954b8bf5119d75b0b441fa7d89fbd2f">00258</a> <a class="code" href="classlibdap_1_1Sequence.html#ac954b8bf5119d75b0b441fa7d89fbd2f" title="Count the members of constructor types.">Sequence::element_count</a>(<span class="keywordtype">bool</span> leaves)
<a name="l00259"></a>00259 {
<a name="l00260"></a>00260     <span class="keywordflow">if</span> (!leaves)
<a name="l00261"></a>00261         <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.size();
<a name="l00262"></a>00262     <span class="keywordflow">else</span> {
<a name="l00263"></a>00263         <span class="keywordtype">int</span> i = 0;
<a name="l00264"></a>00264         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l00265"></a>00265             i += (*iter)-&gt;element_count(<span class="keyword">true</span>);
<a name="l00266"></a>00266         }
<a name="l00267"></a>00267         <span class="keywordflow">return</span> i;
<a name="l00268"></a>00268     }
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270 
<a name="l00271"></a>00271 <span class="keywordtype">bool</span>
<a name="l00272"></a><a class="code" href="classlibdap_1_1Sequence.html#aae52bdb038d59fbce4f8f6128dfc4559">00272</a> <a class="code" href="classlibdap_1_1Sequence.html#aae52bdb038d59fbce4f8f6128dfc4559" title="Check to see whether this variable can be printed simply.">Sequence::is_linear</a>()
<a name="l00273"></a>00273 {
<a name="l00274"></a>00274     <span class="keywordtype">bool</span> linear = <span class="keyword">true</span>;
<a name="l00275"></a>00275     <span class="keywordtype">bool</span> seq_found = <span class="keyword">false</span>;
<a name="l00276"></a>00276     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); linear &amp;&amp; iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l00277"></a>00277         <span class="keywordflow">if</span> ((*iter)-&gt;type() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>) {
<a name="l00278"></a>00278             <span class="comment">// A linear sequence cannot have more than one child seq. at any</span>
<a name="l00279"></a>00279             <span class="comment">// one level. If we&#39;ve already found a seq at this level, return</span>
<a name="l00280"></a>00280             <span class="comment">// false.</span>
<a name="l00281"></a>00281             <span class="keywordflow">if</span> (seq_found) {
<a name="l00282"></a>00282                 linear = <span class="keyword">false</span>;
<a name="l00283"></a>00283                 <span class="keywordflow">break</span>;
<a name="l00284"></a>00284             }
<a name="l00285"></a>00285             seq_found = <span class="keyword">true</span>;
<a name="l00286"></a>00286             linear = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a> *<span class="keyword">&gt;</span>((*iter))-&gt;<a class="code" href="classlibdap_1_1Sequence.html#aae52bdb038d59fbce4f8f6128dfc4559" title="Check to see whether this variable can be printed simply.">is_linear</a>();
<a name="l00287"></a>00287         }
<a name="l00288"></a>00288         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*iter)-&gt;type() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad93eb0a69e67742f061966ce594b9a6c">dods_structure_c</a>) {
<a name="l00289"></a>00289             linear = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Structure.html" title="Holds a structure (aggregate) type.">Structure</a>*<span class="keyword">&gt;</span>((*iter))-&gt;<a class="code" href="classlibdap_1_1Sequence.html#aae52bdb038d59fbce4f8f6128dfc4559" title="Check to see whether this variable can be printed simply.">is_linear</a>();
<a name="l00290"></a>00290         }
<a name="l00291"></a>00291         <span class="keywordflow">else</span> {
<a name="l00292"></a>00292             <span class="comment">// A linear sequence cannot have Arrays, Lists or Grids.</span>
<a name="l00293"></a>00293             linear = (*iter)-&gt;is_simple_type();
<a name="l00294"></a>00294         }
<a name="l00295"></a>00295     }
<a name="l00296"></a>00296 
<a name="l00297"></a>00297     <span class="keywordflow">return</span> linear;
<a name="l00298"></a>00298 }
<a name="l00299"></a>00299 
<a name="l00300"></a>00300 <span class="keywordtype">void</span>
<a name="l00301"></a><a class="code" href="classlibdap_1_1Sequence.html#ac98c3b73dfc584423d2fa90c6152b4eb">00301</a> <a class="code" href="classlibdap_1_1Sequence.html#ac98c3b73dfc584423d2fa90c6152b4eb">Sequence::set_send_p</a>(<span class="keywordtype">bool</span> state)
<a name="l00302"></a>00302 {
<a name="l00303"></a>00303     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00304"></a>00304         (*i)-&gt;set_send_p(state);
<a name="l00305"></a>00305     }
<a name="l00306"></a>00306 
<a name="l00307"></a>00307     <a class="code" href="classlibdap_1_1Sequence.html#ac98c3b73dfc584423d2fa90c6152b4eb">BaseType::set_send_p</a>(state);
<a name="l00308"></a>00308 }
<a name="l00309"></a>00309 
<a name="l00310"></a>00310 <span class="keywordtype">void</span>
<a name="l00311"></a><a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb">00311</a> <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">Sequence::set_read_p</a>(<span class="keywordtype">bool</span> state)
<a name="l00312"></a>00312 {
<a name="l00313"></a>00313     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00314"></a>00314         (*i)-&gt;set_read_p(state);
<a name="l00315"></a>00315     }
<a name="l00316"></a>00316 
<a name="l00317"></a>00317     <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">BaseType::set_read_p</a>(state);
<a name="l00318"></a>00318 }
<a name="l00319"></a>00319 
<a name="l00320"></a>00320 <span class="keywordtype">void</span>
<a name="l00321"></a><a class="code" href="classlibdap_1_1Sequence.html#af600cb78f1a48f7de6b401b17de5f1ef">00321</a> <a class="code" href="classlibdap_1_1Sequence.html#af600cb78f1a48f7de6b401b17de5f1ef">Sequence::set_in_selection</a>(<span class="keywordtype">bool</span> state)
<a name="l00322"></a>00322 {
<a name="l00323"></a>00323     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00324"></a>00324         (*i)-&gt;set_in_selection(state);
<a name="l00325"></a>00325     }
<a name="l00326"></a>00326 
<a name="l00327"></a>00327     <a class="code" href="classlibdap_1_1Sequence.html#af600cb78f1a48f7de6b401b17de5f1ef">BaseType::set_in_selection</a>(state);
<a name="l00328"></a>00328 }
<a name="l00329"></a>00329 
<a name="l00339"></a>00339 <span class="keywordtype">void</span>
<a name="l00340"></a><a class="code" href="classlibdap_1_1Sequence.html#ac0108a453693288fe51e813a80a94198">00340</a> <a class="code" href="classlibdap_1_1Sequence.html#ac0108a453693288fe51e813a80a94198" title="Adds a variable to the Sequence.">Sequence::add_var</a>(<a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *bt, <a class="code" href="namespacelibdap.html#addcb1d714cdecb877c65ff6d2fde0695" title="Names the parts of multi-section constructor data types.">Part</a>)
<a name="l00341"></a>00341 {
<a name="l00342"></a>00342     <span class="keywordflow">if</span> (!bt)
<a name="l00343"></a>00343         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__,
<a name="l00344"></a>00344                           <span class="stringliteral">&quot;Cannot add variable: NULL pointer&quot;</span>);
<a name="l00345"></a>00345     <span class="comment">// Jose Garcia</span>
<a name="l00346"></a>00346     <span class="comment">// We append a copy of bt so the owner of bt is free to deallocate</span>
<a name="l00347"></a>00347 
<a name="l00348"></a>00348     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *bt_copy = bt-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a0b130311c9901fb8a7ab11ea19090ef0">ptr_duplicate</a>();
<a name="l00349"></a>00349     bt_copy-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a5b6a39f6ce6594fa74f3fc899ac9a966">set_parent</a>(<span class="keyword">this</span>);
<a name="l00350"></a>00350     <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.push_back(bt_copy);
<a name="l00351"></a>00351 }
<a name="l00352"></a>00352 
<a name="l00353"></a>00353 <span class="comment">// Deprecated</span>
<a name="l00354"></a>00354 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00355"></a><a class="code" href="classlibdap_1_1Sequence.html#a26cbbe0d1d9f59875a9d5612b7f1f12b">00355</a> <a class="code" href="classlibdap_1_1Sequence.html#ac385089cc14e10118ffba659e104d066" title="Returns a pointer to a member of a constructor class.">Sequence::var</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n, <a class="code" href="classlibdap_1_1BaseType.html#ae9c6e71855b90a0e552713011c9ab81f">btp_stack</a> &amp;s)
<a name="l00356"></a>00356 {
<a name="l00357"></a>00357     <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a> = <a class="code" href="namespacelibdap.html#a376f9593431111a80ef78c98b8f4a0e2">www2id</a>(n);
<a name="l00358"></a>00358 
<a name="l00359"></a>00359     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp = m_exact_match(name, &amp;s);
<a name="l00360"></a>00360     <span class="keywordflow">if</span> (btp)
<a name="l00361"></a>00361         <span class="keywordflow">return</span> btp;
<a name="l00362"></a>00362 
<a name="l00363"></a>00363     <span class="keywordflow">return</span> m_leaf_match(name, &amp;s);
<a name="l00364"></a>00364 }
<a name="l00365"></a>00365 
<a name="l00366"></a>00366 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00367"></a><a class="code" href="classlibdap_1_1Sequence.html#ac385089cc14e10118ffba659e104d066">00367</a> <a class="code" href="classlibdap_1_1Sequence.html#ac385089cc14e10118ffba659e104d066" title="Returns a pointer to a member of a constructor class.">Sequence::var</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name, <span class="keywordtype">bool</span> exact_match, <a class="code" href="classlibdap_1_1BaseType.html#ae9c6e71855b90a0e552713011c9ab81f">btp_stack</a> *s)
<a name="l00368"></a>00368 {
<a name="l00369"></a>00369     <span class="keywordtype">string</span> n = <a class="code" href="namespacelibdap.html#a376f9593431111a80ef78c98b8f4a0e2">www2id</a>(name);
<a name="l00370"></a>00370 
<a name="l00371"></a>00371     <span class="keywordflow">if</span> (exact_match)
<a name="l00372"></a>00372         <span class="keywordflow">return</span> m_exact_match(n, s);
<a name="l00373"></a>00373     <span class="keywordflow">else</span>
<a name="l00374"></a>00374         <span class="keywordflow">return</span> m_leaf_match(n, s);
<a name="l00375"></a>00375 }
<a name="l00376"></a>00376 
<a name="l00377"></a>00377 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00378"></a>00378 Sequence::m_leaf_match(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name, btp_stack *s)
<a name="l00379"></a>00379 {
<a name="l00380"></a>00380     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00381"></a>00381         <span class="keywordflow">if</span> ((*i)-&gt;name() == <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>) {
<a name="l00382"></a>00382             <span class="keywordflow">if</span> (s)
<a name="l00383"></a>00383                 s-&gt;push(static_cast&lt;BaseType *&gt;(<span class="keyword">this</span>));
<a name="l00384"></a>00384             <span class="keywordflow">return</span> *i;
<a name="l00385"></a>00385         }
<a name="l00386"></a>00386         <span class="keywordflow">if</span> ((*i)-&gt;is_constructor_type()) {
<a name="l00387"></a>00387             <a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822" title="The BaseType constructor.">BaseType</a> *btp = (*i)-&gt;var(name, <span class="keyword">false</span>, s);
<a name="l00388"></a>00388             <span class="keywordflow">if</span> (btp) {
<a name="l00389"></a>00389                 <span class="keywordflow">if</span> (s)
<a name="l00390"></a>00390                     s-&gt;push(static_cast&lt;BaseType *&gt;(<span class="keyword">this</span>));
<a name="l00391"></a>00391                 <span class="keywordflow">return</span> btp;
<a name="l00392"></a>00392             }
<a name="l00393"></a>00393         }
<a name="l00394"></a>00394     }
<a name="l00395"></a>00395 
<a name="l00396"></a>00396     <span class="keywordflow">return</span> 0;
<a name="l00397"></a>00397 }
<a name="l00398"></a>00398 
<a name="l00399"></a>00399 BaseType *
<a name="l00400"></a>00400 Sequence::m_exact_match(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name, btp_stack *s)
<a name="l00401"></a>00401 {
<a name="l00402"></a>00402     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00403"></a>00403         <span class="keywordflow">if</span> ((*i)-&gt;name() == <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>) {
<a name="l00404"></a>00404             <span class="keywordflow">if</span> (s)
<a name="l00405"></a>00405                 s-&gt;push(static_cast&lt;BaseType *&gt;(<span class="keyword">this</span>));
<a name="l00406"></a>00406             <span class="keywordflow">return</span> *i;
<a name="l00407"></a>00407         }
<a name="l00408"></a>00408     }
<a name="l00409"></a>00409 
<a name="l00410"></a>00410     string::size_type dot_pos = name.find(<span class="stringliteral">&quot;.&quot;</span>); <span class="comment">// zero-based index of `.&#39;</span>
<a name="l00411"></a>00411     <span class="keywordflow">if</span> (dot_pos != string::npos) {
<a name="l00412"></a>00412         <span class="keywordtype">string</span> aggregate = name.substr(0, dot_pos);
<a name="l00413"></a>00413         <span class="keywordtype">string</span> field = name.substr(dot_pos + 1);
<a name="l00414"></a>00414 
<a name="l00415"></a>00415         <a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822" title="The BaseType constructor.">BaseType</a> *agg_ptr = <a class="code" href="classlibdap_1_1Sequence.html#ac385089cc14e10118ffba659e104d066" title="Returns a pointer to a member of a constructor class.">var</a>(aggregate);
<a name="l00416"></a>00416         <span class="keywordflow">if</span> (agg_ptr) {
<a name="l00417"></a>00417             <span class="keywordflow">if</span> (s)
<a name="l00418"></a>00418                 s-&gt;push(static_cast&lt;BaseType *&gt;(<span class="keyword">this</span>));
<a name="l00419"></a>00419             <span class="keywordflow">return</span> agg_ptr-&gt;var(field, <span class="keyword">true</span>, s); <span class="comment">// recurse</span>
<a name="l00420"></a>00420         }
<a name="l00421"></a>00421         <span class="keywordflow">else</span>
<a name="l00422"></a>00422             <span class="keywordflow">return</span> 0;  <span class="comment">// qualified names must be *fully* qualified</span>
<a name="l00423"></a>00423     }
<a name="l00424"></a>00424 
<a name="l00425"></a>00425     <span class="keywordflow">return</span> 0;
<a name="l00426"></a>00426 }
<a name="l00427"></a>00427 
<a name="l00432"></a>00432 <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *
<a name="l00433"></a><a class="code" href="classlibdap_1_1Sequence.html#af034547151c98b59dee6d2d6cb1a954b">00433</a> <a class="code" href="classlibdap_1_1Sequence.html#af034547151c98b59dee6d2d6cb1a954b" title="Get a whole row from the sequence.">Sequence::row_value</a>(<span class="keywordtype">size_t</span> row)
<a name="l00434"></a>00434 {
<a name="l00435"></a>00435     <span class="keywordflow">if</span> (row &gt;= d_values.size())
<a name="l00436"></a>00436         <span class="keywordflow">return</span> 0;
<a name="l00437"></a>00437     <span class="keywordflow">return</span> d_values[row];
<a name="l00438"></a>00438 }
<a name="l00439"></a>00439 
<a name="l00446"></a>00446 <span class="keywordtype">void</span>
<a name="l00447"></a><a class="code" href="classlibdap_1_1Sequence.html#aa581124c5883b3c020a843ddc5566192">00447</a> <a class="code" href="classlibdap_1_1Sequence.html#aa581124c5883b3c020a843ddc5566192">Sequence::set_value</a>(<a class="code" href="namespacelibdap.html#ad2918a01a28d16d423b047e2d312f760">SequenceValues</a> &amp;values)
<a name="l00448"></a>00448 {
<a name="l00449"></a>00449     d_values = values;
<a name="l00450"></a>00450 }
<a name="l00451"></a>00451 
<a name="l00454"></a>00454 <a class="code" href="namespacelibdap.html#ad2918a01a28d16d423b047e2d312f760">SequenceValues</a>
<a name="l00455"></a><a class="code" href="classlibdap_1_1Sequence.html#a1efebfab9247785a056d085b1f3aab41">00455</a> <a class="code" href="classlibdap_1_1Sequence.html#a1efebfab9247785a056d085b1f3aab41">Sequence::value</a>()
<a name="l00456"></a>00456 {
<a name="l00457"></a>00457     <span class="keywordflow">return</span> d_values;
<a name="l00458"></a>00458 }
<a name="l00459"></a>00459 
<a name="l00465"></a>00465 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00466"></a><a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269">00466</a> <a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269" title="Get the BaseType pointer to the named variable of a given row.">Sequence::var_value</a>(<span class="keywordtype">size_t</span> row, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;name)
<a name="l00467"></a>00467 {
<a name="l00468"></a>00468     <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *bt_row_ptr = <a class="code" href="classlibdap_1_1Sequence.html#af034547151c98b59dee6d2d6cb1a954b" title="Get a whole row from the sequence.">row_value</a>(row);
<a name="l00469"></a>00469     <span class="keywordflow">if</span> (!bt_row_ptr)
<a name="l00470"></a>00470         <span class="keywordflow">return</span> 0;
<a name="l00471"></a>00471 
<a name="l00472"></a>00472     BaseTypeRow::iterator bt_row_iter = bt_row_ptr-&gt;begin();
<a name="l00473"></a>00473     BaseTypeRow::iterator bt_row_end = bt_row_ptr-&gt;end();
<a name="l00474"></a>00474     <span class="keywordflow">while</span> (bt_row_iter != bt_row_end &amp;&amp; (*bt_row_iter)-&gt;name() != <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>)
<a name="l00475"></a>00475         ++bt_row_iter;
<a name="l00476"></a>00476 
<a name="l00477"></a>00477     <span class="keywordflow">if</span> (bt_row_iter == bt_row_end)
<a name="l00478"></a>00478         <span class="keywordflow">return</span> 0;
<a name="l00479"></a>00479     <span class="keywordflow">else</span>
<a name="l00480"></a>00480         <span class="keywordflow">return</span> *bt_row_iter;
<a name="l00481"></a>00481 }
<a name="l00482"></a>00482 
<a name="l00488"></a>00488 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00489"></a><a class="code" href="classlibdap_1_1Sequence.html#a75cd422251a9c49294e25f2971164638">00489</a> <a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269" title="Get the BaseType pointer to the named variable of a given row.">Sequence::var_value</a>(<span class="keywordtype">size_t</span> row, <span class="keywordtype">size_t</span> i)
<a name="l00490"></a>00490 {
<a name="l00491"></a>00491     <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *bt_row_ptr = <a class="code" href="classlibdap_1_1Sequence.html#af034547151c98b59dee6d2d6cb1a954b" title="Get a whole row from the sequence.">row_value</a>(row);
<a name="l00492"></a>00492     <span class="keywordflow">if</span> (!bt_row_ptr)
<a name="l00493"></a>00493         <span class="keywordflow">return</span> 0;
<a name="l00494"></a>00494 
<a name="l00495"></a>00495     <span class="keywordflow">if</span> (i &gt;= bt_row_ptr-&gt;size())
<a name="l00496"></a>00496         <span class="keywordflow">return</span> 0;
<a name="l00497"></a>00497 
<a name="l00498"></a>00498     <span class="keywordflow">return</span> (*bt_row_ptr)[i];
<a name="l00499"></a>00499 }
<a name="l00500"></a>00500 
<a name="l00501"></a>00501 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00502"></a><a class="code" href="classlibdap_1_1Sequence.html#a501edaf93b113fcd227280543fb3ba10">00502</a> <a class="code" href="classlibdap_1_1Sequence.html#a501edaf93b113fcd227280543fb3ba10" title="Returns the size of the class instance data.">Sequence::width</a>()
<a name="l00503"></a>00503 {
<a name="l00504"></a>00504     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sz = 0;
<a name="l00505"></a>00505 
<a name="l00506"></a>00506     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l00507"></a>00507         sz += (*i)-&gt;width();
<a name="l00508"></a>00508     }
<a name="l00509"></a>00509 
<a name="l00510"></a>00510     <span class="keywordflow">return</span> sz;
<a name="l00511"></a>00511 }
<a name="l00512"></a>00512 
<a name="l00513"></a>00513 <span class="comment">// This version returns -1. Each API-specific subclass should define a more</span>
<a name="l00514"></a>00514 <span class="comment">// reasonable version. jhrg 5/24/96</span>
<a name="l00515"></a>00515 
<a name="l00531"></a>00531 <span class="keywordtype">int</span>
<a name="l00532"></a><a class="code" href="classlibdap_1_1Sequence.html#a3ece45051c6f6f27c14082b0be07fb8f">00532</a> <a class="code" href="classlibdap_1_1Sequence.html#a3ece45051c6f6f27c14082b0be07fb8f">Sequence::length</a>()
<a name="l00533"></a>00533 {
<a name="l00534"></a>00534     <span class="keywordflow">return</span> -1;
<a name="l00535"></a>00535 }
<a name="l00536"></a>00536 
<a name="l00537"></a>00537 
<a name="l00538"></a>00538 <span class="keywordtype">int</span>
<a name="l00539"></a><a class="code" href="classlibdap_1_1Sequence.html#af2085366f0bb90822e1b85108b44df1b">00539</a> <a class="code" href="classlibdap_1_1Sequence.html#af2085366f0bb90822e1b85108b44df1b">Sequence::number_of_rows</a>()
<a name="l00540"></a>00540 {
<a name="l00541"></a>00541     <span class="keywordflow">return</span> d_values.size();
<a name="l00542"></a>00542 }
<a name="l00543"></a>00543 
<a name="l00547"></a>00547 <span class="keywordtype">void</span>
<a name="l00548"></a><a class="code" href="classlibdap_1_1Sequence.html#ad555ad129354768a042f4e94f36f299a">00548</a> <a class="code" href="classlibdap_1_1Sequence.html#ad555ad129354768a042f4e94f36f299a" title="Rest the row number counter.">Sequence::reset_row_number</a>()
<a name="l00549"></a>00549 {
<a name="l00550"></a>00550     d_row_number = -1;
<a name="l00551"></a>00551 }
<a name="l00552"></a>00552 
<a name="l00553"></a>00553 <span class="comment">// Notes:</span>
<a name="l00554"></a>00554 <span class="comment">// Assume that read() is implemented so that, when reading data for a nested</span>
<a name="l00555"></a>00555 <span class="comment">// sequence, only the outer most level is *actually* read.</span>
<a name="l00556"></a>00556 <span class="comment">// This is a consequence of our current (12/7/99) implementation of</span>
<a name="l00557"></a>00557 <span class="comment">// the JGOFS server (which is the only server to actually use nested</span>
<a name="l00558"></a>00558 <span class="comment">// sequences). 12/7/99 jhrg</span>
<a name="l00559"></a>00559 <span class="comment">//</span>
<a name="l00560"></a>00560 <span class="comment">// Stop assuming this. This logic is being moved into the JGOFS server</span>
<a name="l00561"></a>00561 <span class="comment">// itself. 6/1/2001 jhrg</span>
<a name="l00562"></a>00562 
<a name="l00563"></a>00563 <span class="comment">// The read() function returns a boolean value, with TRUE</span>
<a name="l00564"></a>00564 <span class="comment">// indicating that read() should be called again because there&#39;s</span>
<a name="l00565"></a>00565 <span class="comment">// more data to read, and FALSE indicating there&#39;s no more data</span>
<a name="l00566"></a>00566 <span class="comment">// to read. Note that this behavior is necessary to properly</span>
<a name="l00567"></a>00567 <span class="comment">// handle variables that contain Sequences. Jose Garcia If an</span>
<a name="l00568"></a>00568 <span class="comment">// error exists while reading, the implementers of the surrogate</span>
<a name="l00569"></a>00569 <span class="comment">// library SHOULD throw an Error object which will propagate</span>
<a name="l00570"></a>00570 <span class="comment">// beyond this point to to the original caller.</span>
<a name="l00571"></a>00571 <span class="comment">// Jose Garcia</span>
<a name="l00572"></a>00572 
<a name="l00605"></a>00605 <span class="keywordtype">bool</span>
<a name="l00606"></a><a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">00606</a> <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">Sequence::read_row</a>(<span class="keywordtype">int</span> row, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00607"></a>00607                    <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <span class="keywordtype">bool</span> ce_eval)
<a name="l00608"></a>00608 {
<a name="l00609"></a>00609     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering Sequence::read_row for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00610"></a>00610     <span class="keywordflow">if</span> (row &lt; d_row_number)
<a name="l00611"></a>00611         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(<span class="stringliteral">&quot;Trying to back up inside a sequence!&quot;</span>);
<a name="l00612"></a>00612 
<a name="l00613"></a>00613     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;read_row: row number &quot;</span> &lt;&lt; row
<a name="l00614"></a>00614               &lt;&lt; <span class="stringliteral">&quot;, current row &quot;</span> &lt;&lt; d_row_number &lt;&lt; endl);
<a name="l00615"></a>00615     <span class="keywordflow">if</span> (row == d_row_number)
<a name="l00616"></a>00616     {
<a name="l00617"></a>00617         <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Leaving Sequence::read_row for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00618"></a>00618         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00619"></a>00619     }
<a name="l00620"></a>00620 
<a name="l00621"></a>00621     dds.<a class="code" href="classlibdap_1_1DDS.html#a8cd9b6a34f5e1a49665de3189e141de8">timeout_on</a>();
<a name="l00622"></a>00622 
<a name="l00623"></a>00623     <span class="keywordtype">int</span> eof = 0;  <span class="comment">// Start out assuming EOF is false.</span>
<a name="l00624"></a>00624     <span class="keywordflow">while</span> (!eof &amp;&amp; d_row_number &lt; row) {
<a name="l00625"></a>00625         <span class="keywordflow">if</span> (!<a class="code" href="classlibdap_1_1BaseType.html#a38ff819a432217c55db2e9071928d20c" title="Has this variable been read?">read_p</a>()) {
<a name="l00626"></a>00626             eof = (<a class="code" href="classlibdap_1_1BaseType.html#a1da003c53f2e663223f603ab3fbd7c8e" title="Read data into a local buffer.">read</a>() == <span class="keyword">false</span>);
<a name="l00627"></a>00627         }
<a name="l00628"></a>00628 
<a name="l00629"></a>00629         <span class="comment">// Advance the row number if ce_eval is false (we&#39;re not supposed to</span>
<a name="l00630"></a>00630         <span class="comment">// evaluate the selection) or both ce_eval and the selection are</span>
<a name="l00631"></a>00631         <span class="comment">// true.</span>
<a name="l00632"></a>00632         <span class="keywordflow">if</span> (!eof &amp;&amp; (!ce_eval || eval.<a class="code" href="classlibdap_1_1ConstraintEvaluator.html#aa0066a57cf00c975f6ccbc2e90c64742" title="Evaluate a boolean-valued constraint expression. This is main method for the evaluator ans is called ...">eval_selection</a>(dds, <a class="code" href="classlibdap_1_1BaseType.html#a9f102f5cc17ac7d2d80f9921e10d3baf" title="Returns the name of the dataset used to create this instance.">dataset</a>())))
<a name="l00633"></a>00633             d_row_number++;
<a name="l00634"></a>00634 
<a name="l00635"></a>00635         <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">false</span>); <span class="comment">// ...so that the next instance will be read</span>
<a name="l00636"></a>00636     }
<a name="l00637"></a>00637 
<a name="l00638"></a>00638     <span class="comment">// Once we finish the above loop, set read_p to true so that the caller</span>
<a name="l00639"></a>00639     <span class="comment">// knows that data *has* been read. This is how the read() methods of the</span>
<a name="l00640"></a>00640     <span class="comment">// elements of the sequence know to not call read() but instead look for</span>
<a name="l00641"></a>00641     <span class="comment">// data values inside themselves.</span>
<a name="l00642"></a>00642     <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">true</span>);
<a name="l00643"></a>00643 
<a name="l00644"></a>00644     dds.<a class="code" href="classlibdap_1_1DDS.html#a6740f99a5fc64640505924c5603ace0a">timeout_off</a>();
<a name="l00645"></a>00645 
<a name="l00646"></a>00646     <span class="comment">// Return true if we have valid data, false if we&#39;ve read to the EOF.</span>
<a name="l00647"></a>00647     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Leaving Sequence::read_row for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()
<a name="l00648"></a>00648               &lt;&lt; <span class="stringliteral">&quot; with &quot;</span> &lt;&lt; (eof == 0) &lt;&lt; endl);
<a name="l00649"></a>00649     <span class="keywordflow">return</span> eof == 0;
<a name="l00650"></a>00650 }
<a name="l00651"></a>00651 
<a name="l00652"></a>00652 <span class="comment">// Private. This is used to process constraints on the rows of a sequence.</span>
<a name="l00653"></a>00653 <span class="comment">// Starting with 3.2 we support constraints like Sequence[10:2:20]. This</span>
<a name="l00654"></a>00654 <span class="comment">// odd-looking logic first checks if d_ending_row_number is the sentinel</span>
<a name="l00655"></a>00655 <span class="comment">// value of -1. If so, the sequence was not constrained by row number and</span>
<a name="l00656"></a>00656 <span class="comment">// this method should never return true (which indicates that we&#39;re at the</span>
<a name="l00657"></a>00657 <span class="comment">// end of a row-number constraint). If d_ending_row_number is not -1, then is</span>
<a name="l00658"></a>00658 <span class="comment">// \e i at the end point? 6/1/2001 jhrg</span>
<a name="l00659"></a>00659 <span class="keyword">inline</span> <span class="keywordtype">bool</span>
<a name="l00660"></a>00660 Sequence::is_end_of_rows(<span class="keywordtype">int</span> i)
<a name="l00661"></a>00661 {
<a name="l00662"></a>00662     <span class="keywordflow">return</span> ((d_ending_row_number == -1) ? <span class="keyword">false</span> : (i &gt; d_ending_row_number));
<a name="l00663"></a>00663 }
<a name="l00664"></a>00664 
<a name="l00725"></a>00725 <span class="keywordtype">bool</span>
<a name="l00726"></a><a class="code" href="classlibdap_1_1Sequence.html#ad89a496720935e04e472a75ce7804065">00726</a> <a class="code" href="classlibdap_1_1Sequence.html#ad89a496720935e04e472a75ce7804065">Sequence::serialize</a>(<a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00727"></a>00727                     <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshal/serialize dap data objects">Marshaller</a> &amp;m, <span class="keywordtype">bool</span> ce_eval)
<a name="l00728"></a>00728 {
<a name="l00729"></a>00729     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering Sequence::serialize for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00730"></a>00730 
<a name="l00731"></a>00731     <span class="comment">// Special case leaf sequences!</span>
<a name="l00732"></a>00732     <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1Sequence.html#a3cb03f3ccb14372106e91461b468c1bd">is_leaf_sequence</a>())
<a name="l00733"></a>00733         <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Sequence.html#a1e28f9c0d173929383e1ffc2002e66ce">serialize_leaf</a>(dds, eval, m, ce_eval);
<a name="l00734"></a>00734     <span class="keywordflow">else</span>
<a name="l00735"></a>00735         <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Sequence.html#a30fcc5756f357e1c14f3fafac66e0a30">serialize_parent_part_one</a>(dds, eval, m);
<a name="l00736"></a>00736 }
<a name="l00737"></a>00737 
<a name="l00738"></a>00738 <span class="comment">// We know this is not a leaf Sequence. That means that this Sequence holds</span>
<a name="l00739"></a>00739 <span class="comment">// another Sequence as one of its fields _and_ that child Sequence triggers</span>
<a name="l00740"></a>00740 <span class="comment">// the actual transmission of values.</span>
<a name="l00741"></a>00741 
<a name="l00742"></a>00742 <span class="keywordtype">bool</span>
<a name="l00743"></a><a class="code" href="classlibdap_1_1Sequence.html#a30fcc5756f357e1c14f3fafac66e0a30">00743</a> <a class="code" href="classlibdap_1_1Sequence.html#a30fcc5756f357e1c14f3fafac66e0a30">Sequence::serialize_parent_part_one</a>(<a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00744"></a>00744                                     <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshal/serialize dap data objects">Marshaller</a> &amp;m)
<a name="l00745"></a>00745 {
<a name="l00746"></a>00746     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering serialize_parent_part_one for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00747"></a>00747 
<a name="l00748"></a>00748     <span class="keywordtype">int</span> i = (d_starting_row_number != -1) ? d_starting_row_number : 0;
<a name="l00749"></a>00749 
<a name="l00750"></a>00750     <span class="comment">// read_row returns true if valid data was read, false if the EOF was</span>
<a name="l00751"></a>00751     <span class="comment">// found. 6/1/2001 jhrg</span>
<a name="l00752"></a>00752     <span class="comment">// Since this is a parent sequence, read the row ignoring the CE (all of</span>
<a name="l00753"></a>00753     <span class="comment">// the CE clauses will be evaluated by the leaf sequence).</span>
<a name="l00754"></a>00754     <span class="keywordtype">bool</span> status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, <span class="keyword">false</span>);
<a name="l00755"></a>00755     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::serialize_parent_part_one::read_row() status: &quot;</span> &lt;&lt; status &lt;&lt; endl);
<a name="l00756"></a>00756 
<a name="l00757"></a>00757     <span class="keywordflow">while</span> (status &amp;&amp; !is_end_of_rows(i)) {
<a name="l00758"></a>00758         i += d_row_stride;
<a name="l00759"></a>00759 
<a name="l00760"></a>00760         <span class="comment">// DBG(cerr &lt;&lt; &quot;Writing Start of Instance marker&quot; &lt;&lt; endl);</span>
<a name="l00761"></a>00761         <span class="comment">// write_start_of_instance(sink);</span>
<a name="l00762"></a>00762 
<a name="l00763"></a>00763         <span class="comment">// In this loop serialize will signal an error with an exception.</span>
<a name="l00764"></a>00764         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l00765"></a>00765             <span class="comment">// Only call serialize for child Sequences; the leaf sequence</span>
<a name="l00766"></a>00766             <span class="comment">// will trigger the transmission of values for its parents (this</span>
<a name="l00767"></a>00767             <span class="comment">// sequence and maybe others) once it gets soem valid data to</span>
<a name="l00768"></a>00768             <span class="comment">// send.</span>
<a name="l00769"></a>00769             <span class="comment">// Note that if the leaf sequence has no variables in the current</span>
<a name="l00770"></a>00770             <span class="comment">// projection, its serialize() method will never be called and that&#39;s</span>
<a name="l00771"></a>00771             <span class="comment">// the method that triggers actually sending values. Thus the leaf</span>
<a name="l00772"></a>00772             <span class="comment">// sequence must be the lowest level sequence with values whose send_p</span>
<a name="l00773"></a>00773             <span class="comment">// property is true.</span>
<a name="l00774"></a>00774             <span class="keywordflow">if</span> ((*iter)-&gt;send_p() &amp;&amp; (*iter)-&gt;type() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l00775"></a>00775                 (*iter)-&gt;serialize(eval, dds, m);
<a name="l00776"></a>00776         }
<a name="l00777"></a>00777 
<a name="l00778"></a>00778         <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">false</span>); <span class="comment">// ...so this will read the next instance</span>
<a name="l00779"></a>00779 
<a name="l00780"></a>00780         status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, <span class="keyword">false</span>);
<a name="l00781"></a>00781         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::serialize_parent_part_one::read_row() status: &quot;</span> &lt;&lt; status &lt;&lt; endl);
<a name="l00782"></a>00782     }
<a name="l00783"></a>00783     <span class="comment">// Reset current row number for next nested sequence element.</span>
<a name="l00784"></a>00784     d_row_number = -1;
<a name="l00785"></a>00785 
<a name="l00786"></a>00786     <span class="comment">// Always write the EOS marker? 12/23/04 jhrg</span>
<a name="l00787"></a>00787     <span class="comment">// Yes. According to DAP2, a completely empty response is signalled by</span>
<a name="l00788"></a>00788     <span class="comment">// a return value of only the EOS marker for the outermost sequence.</span>
<a name="l00789"></a>00789     <span class="keywordflow">if</span> (d_top_most || d_wrote_soi) {
<a name="l00790"></a>00790         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Writing End of Sequence marker&quot;</span> &lt;&lt; endl);
<a name="l00791"></a>00791         write_end_of_sequence(m);
<a name="l00792"></a>00792         d_wrote_soi = <span class="keyword">false</span>;
<a name="l00793"></a>00793     }
<a name="l00794"></a>00794 
<a name="l00795"></a>00795     <span class="keywordflow">return</span> <span class="keyword">true</span>;  <span class="comment">// Signal errors with exceptions.</span>
<a name="l00796"></a>00796 }
<a name="l00797"></a>00797 
<a name="l00798"></a>00798 <span class="comment">// If we are here then we know that this is &#39;parent sequence&#39; and that the</span>
<a name="l00799"></a>00799 <span class="comment">// leaf seq has found valid data to send. We also know that</span>
<a name="l00800"></a>00800 <span class="comment">// serialize_parent_part_one has been called so data are in the instance&#39;s</span>
<a name="l00801"></a>00801 <span class="comment">// fields. This is wheree we send data. Whereas ..._part_one() contains a</span>
<a name="l00802"></a>00802 <span class="comment">// loop to iterate over all of rows in a parent sequence, this does not. This</span>
<a name="l00803"></a>00803 <span class="comment">// method assumes that the serialize_leaf() will call it each time it needs</span>
<a name="l00804"></a>00804 <span class="comment">// to be called.</span>
<a name="l00805"></a>00805 <span class="comment">//</span>
<a name="l00806"></a>00806 <span class="comment">// NB: This code only works if the child sequences appear after all other</span>
<a name="l00807"></a>00807 <span class="comment">// variables.</span>
<a name="l00808"></a>00808 <span class="keywordtype">void</span>
<a name="l00809"></a><a class="code" href="classlibdap_1_1Sequence.html#a7e73cc4aecdca6ca600a5ce81fe1780c">00809</a> <a class="code" href="classlibdap_1_1Sequence.html#a7e73cc4aecdca6ca600a5ce81fe1780c">Sequence::serialize_parent_part_two</a>(<a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00810"></a>00810                                     <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshal/serialize dap data objects">Marshaller</a> &amp;m)
<a name="l00811"></a>00811 {
<a name="l00812"></a>00812     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering serialize_parent_part_two for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00813"></a>00813 
<a name="l00814"></a>00814     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp = <a class="code" href="classlibdap_1_1BaseType.html#aeabb771d731dbcef92fff731fb429f85">get_parent</a>();
<a name="l00815"></a>00815     <span class="keywordflow">if</span> (btp &amp;&amp; btp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l00816"></a>00816         dynamic_cast&lt;Sequence&amp;&gt;(*btp).serialize_parent_part_two(dds, eval, m);
<a name="l00817"></a>00817 
<a name="l00818"></a>00818     <span class="keywordflow">if</span> (d_unsent_data) {
<a name="l00819"></a>00819         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Writing Start of Instance marker&quot;</span> &lt;&lt; endl);
<a name="l00820"></a>00820         d_wrote_soi = <span class="keyword">true</span>;
<a name="l00821"></a>00821         write_start_of_instance(m);
<a name="l00822"></a>00822 
<a name="l00823"></a>00823         <span class="comment">// In this loop serialize will signal an error with an exception.</span>
<a name="l00824"></a>00824         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l00825"></a>00825             <span class="comment">// Send all the non-sequence variables</span>
<a name="l00826"></a>00826             <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::serialize_parent_part_two(), serializing &quot;</span>
<a name="l00827"></a>00827                 &lt;&lt; (*iter)-&gt;name() &lt;&lt; endl);
<a name="l00828"></a>00828             <span class="keywordflow">if</span> ((*iter)-&gt;send_p() &amp;&amp; (*iter)-&gt;type() != <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>) {
<a name="l00829"></a>00829                 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Send P is true, sending &quot;</span> &lt;&lt; (*iter)-&gt;name() &lt;&lt; endl);
<a name="l00830"></a>00830                 (*iter)-&gt;serialize(eval, dds, m, <span class="keyword">false</span>);
<a name="l00831"></a>00831             }
<a name="l00832"></a>00832         }
<a name="l00833"></a>00833 
<a name="l00834"></a>00834         d_unsent_data = <span class="keyword">false</span>;              <span class="comment">// read should set this.</span>
<a name="l00835"></a>00835     }
<a name="l00836"></a>00836 }
<a name="l00837"></a>00837 
<a name="l00838"></a>00838 <span class="comment">// This code is only run by a leaf sequence. Note that a one level sequence</span>
<a name="l00839"></a>00839 <span class="comment">// is also a leaf sequence.</span>
<a name="l00840"></a>00840 <span class="keywordtype">bool</span>
<a name="l00841"></a><a class="code" href="classlibdap_1_1Sequence.html#a1e28f9c0d173929383e1ffc2002e66ce">00841</a> <a class="code" href="classlibdap_1_1Sequence.html#a1e28f9c0d173929383e1ffc2002e66ce">Sequence::serialize_leaf</a>(<a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00842"></a>00842                          <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshal/serialize dap data objects">Marshaller</a> &amp;m, <span class="keywordtype">bool</span> ce_eval)
<a name="l00843"></a>00843 {
<a name="l00844"></a>00844     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering Sequence::serialize_leaf for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00845"></a>00845     <span class="keywordtype">int</span> i = (d_starting_row_number != -1) ? d_starting_row_number : 0;
<a name="l00846"></a>00846 
<a name="l00847"></a>00847     <span class="comment">// read_row returns true if valid data was read, false if the EOF was</span>
<a name="l00848"></a>00848     <span class="comment">// found. 6/1/2001 jhrg</span>
<a name="l00849"></a>00849     <span class="keywordtype">bool</span> status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, ce_eval);
<a name="l00850"></a>00850     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::serialize_leaf::read_row() status: &quot;</span> &lt;&lt; status &lt;&lt; endl);
<a name="l00851"></a>00851 
<a name="l00852"></a>00852     <span class="comment">// Once the first valid (satisfies the CE) row of the leaf sequence has</span>
<a name="l00853"></a>00853     <span class="comment">// been read, we know we&#39;re going to send data. Send the current instance</span>
<a name="l00854"></a>00854     <span class="comment">// of the parent/ancestor sequences now, if there are any. We only need</span>
<a name="l00855"></a>00855     <span class="comment">// to do this once, hence it&#39;s not inside the while loop, but we only</span>
<a name="l00856"></a>00856     <span class="comment">// send the parent seq data _if_ there&#39;s data in the leaf to send, that&#39;s</span>
<a name="l00857"></a>00857     <span class="comment">// why we wait until after the first call to read_row() here in the leaf</span>
<a name="l00858"></a>00858     <span class="comment">// sequence.</span>
<a name="l00859"></a>00859     <span class="comment">//</span>
<a name="l00860"></a>00860     <span class="comment">// NB: It&#39;s important to only call serialize_parent_part_two() for a</span>
<a name="l00861"></a>00861     <span class="comment">// Sequence that really is the parent of a leaf sequence. The fancy cast</span>
<a name="l00862"></a>00862     <span class="comment">// will throw and exception if btp is not a Sequence, but doesn&#39;t test</span>
<a name="l00863"></a>00863     <span class="comment">// that it&#39;s a parent sequence as we&#39;ve defined them here.</span>
<a name="l00864"></a>00864     <span class="keywordflow">if</span> (status &amp;&amp; !is_end_of_rows(i)) {
<a name="l00865"></a>00865         <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp = <a class="code" href="classlibdap_1_1BaseType.html#aeabb771d731dbcef92fff731fb429f85">get_parent</a>();
<a name="l00866"></a>00866         <span class="keywordflow">if</span> (btp &amp;&amp; btp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l00867"></a>00867             dynamic_cast&lt;Sequence&amp;&gt;(*btp).serialize_parent_part_two(dds,
<a name="l00868"></a>00868                                                                     eval, m);
<a name="l00869"></a>00869     }
<a name="l00870"></a>00870 
<a name="l00871"></a>00871     d_wrote_soi = <span class="keyword">false</span>;
<a name="l00872"></a>00872     <span class="keywordflow">while</span> (status &amp;&amp; !is_end_of_rows(i)) {
<a name="l00873"></a>00873         i += d_row_stride;
<a name="l00874"></a>00874 
<a name="l00875"></a>00875         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Writing Start of Instance marker&quot;</span> &lt;&lt; endl);
<a name="l00876"></a>00876         d_wrote_soi = <span class="keyword">true</span>;
<a name="l00877"></a>00877         write_start_of_instance(m);
<a name="l00878"></a>00878 
<a name="l00879"></a>00879         <span class="comment">// In this loop serialize will signal an error with an exception.</span>
<a name="l00880"></a>00880         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l00881"></a>00881             <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::serialize_leaf(), serializing &quot;</span>
<a name="l00882"></a>00882                 &lt;&lt; (*iter)-&gt;name() &lt;&lt; endl);
<a name="l00883"></a>00883             <span class="keywordflow">if</span> ((*iter)-&gt;send_p()) {
<a name="l00884"></a>00884                 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Send P is true, sending &quot;</span> &lt;&lt; (*iter)-&gt;name() &lt;&lt; endl);
<a name="l00885"></a>00885                 (*iter)-&gt;serialize(eval, dds, m, <span class="keyword">false</span>);
<a name="l00886"></a>00886             }
<a name="l00887"></a>00887         }
<a name="l00888"></a>00888 
<a name="l00889"></a>00889         <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">false</span>); <span class="comment">// ...so this will read the next instance</span>
<a name="l00890"></a>00890 
<a name="l00891"></a>00891         status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, ce_eval);
<a name="l00892"></a>00892         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::serialize_leaf::read_row() status: &quot;</span> &lt;&lt; status &lt;&lt; endl);
<a name="l00893"></a>00893     }
<a name="l00894"></a>00894 
<a name="l00895"></a>00895     <span class="comment">// Only write the EOS marker if there&#39;s a matching Start Of Instnace</span>
<a name="l00896"></a>00896     <span class="comment">// Marker in the stream.</span>
<a name="l00897"></a>00897     <span class="keywordflow">if</span> (d_wrote_soi || d_top_most) {
<a name="l00898"></a>00898         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Writing End of Sequence marker&quot;</span> &lt;&lt; endl);
<a name="l00899"></a>00899         write_end_of_sequence(m);
<a name="l00900"></a>00900     }
<a name="l00901"></a>00901 
<a name="l00902"></a>00902     <span class="keywordflow">return</span> <span class="keyword">true</span>;  <span class="comment">// Signal errors with exceptions.</span>
<a name="l00903"></a>00903 }
<a name="l00904"></a>00904 
<a name="l00927"></a>00927 <span class="keywordtype">void</span>
<a name="l00928"></a><a class="code" href="classlibdap_1_1Sequence.html#aaa428c1a32fea386549399dd19b756ac">00928</a> <a class="code" href="classlibdap_1_1Sequence.html#aaa428c1a32fea386549399dd19b756ac">Sequence::intern_data</a>(<a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds)
<a name="l00929"></a>00929 {
<a name="l00930"></a>00930     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Sequence::intern_data - for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00931"></a>00931     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    intern_data, values: &quot;</span> &lt;&lt; &amp;d_values &lt;&lt; endl);
<a name="l00932"></a>00932 
<a name="l00933"></a>00933     <span class="comment">// Why use a stack instead of return values? We need the stack because</span>
<a name="l00934"></a>00934     <span class="comment">// Sequences neted three of more levels deep will loose the middle</span>
<a name="l00935"></a>00935     <span class="comment">// instances when the intern_data_parent_part_two() code is run.</span>
<a name="l00936"></a>00936     <a class="code" href="classlibdap_1_1Sequence.html#afa1dc14e98a94efc8944cdb08214a166">sequence_values_stack_t</a> sequence_values_stack;
<a name="l00937"></a>00937 
<a name="l00938"></a>00938     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    pushing d_values of &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; &amp;d_values
<a name="l00939"></a>00939               &lt;&lt; <span class="stringliteral">&quot;) on stack; size: &quot;</span> &lt;&lt; sequence_values_stack.size() &lt;&lt; endl);
<a name="l00940"></a>00940     sequence_values_stack.push(&amp;d_values);
<a name="l00941"></a>00941 
<a name="l00942"></a>00942     <a class="code" href="classlibdap_1_1Sequence.html#ac193f301017ed380059b94907f9e0be4">intern_data_private</a>(eval, dds, sequence_values_stack);
<a name="l00943"></a>00943 }
<a name="l00944"></a>00944 
<a name="l00945"></a>00945 <span class="keywordtype">void</span>
<a name="l00946"></a><a class="code" href="classlibdap_1_1Sequence.html#ac193f301017ed380059b94907f9e0be4">00946</a> <a class="code" href="classlibdap_1_1Sequence.html#ac193f301017ed380059b94907f9e0be4">Sequence::intern_data_private</a>(<a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval,
<a name="l00947"></a>00947                               <a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00948"></a>00948                               <a class="code" href="classlibdap_1_1Sequence.html#afa1dc14e98a94efc8944cdb08214a166">sequence_values_stack_t</a> &amp;sequence_values_stack)
<a name="l00949"></a>00949 {
<a name="l00950"></a>00950     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering intern_data_private for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00951"></a>00951 
<a name="l00952"></a>00952     <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1Sequence.html#a3cb03f3ccb14372106e91461b468c1bd">is_leaf_sequence</a>())
<a name="l00953"></a>00953         <a class="code" href="classlibdap_1_1Sequence.html#a25f2ba65cd6ff7553988739a5c1a08d4">intern_data_for_leaf</a>(dds, eval, sequence_values_stack);
<a name="l00954"></a>00954     <span class="keywordflow">else</span>
<a name="l00955"></a>00955         <a class="code" href="classlibdap_1_1Sequence.html#a6593f7531b7b2a307f5fe4a7bb276225">intern_data_parent_part_one</a>(dds, eval, sequence_values_stack);
<a name="l00956"></a>00956 }
<a name="l00957"></a>00957 
<a name="l00958"></a>00958 <span class="keywordtype">void</span>
<a name="l00959"></a><a class="code" href="classlibdap_1_1Sequence.html#a6593f7531b7b2a307f5fe4a7bb276225">00959</a> <a class="code" href="classlibdap_1_1Sequence.html#a6593f7531b7b2a307f5fe4a7bb276225">Sequence::intern_data_parent_part_one</a>(<a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp; dds,
<a name="l00960"></a>00960                                       <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp; eval,
<a name="l00961"></a>00961                                       <a class="code" href="classlibdap_1_1Sequence.html#afa1dc14e98a94efc8944cdb08214a166">sequence_values_stack_t</a> &amp;
<a name="l00962"></a>00962                                       sequence_values_stack)
<a name="l00963"></a>00963 {
<a name="l00964"></a>00964     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering intern_data_parent_part_one for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l00965"></a>00965 
<a name="l00966"></a>00966     <span class="keywordtype">int</span> i = (<a class="code" href="classlibdap_1_1Sequence.html#ad15a2b640e4bee850577ca9500ad31c3" title="Get the starting row number.">get_starting_row_number</a>() != -1) ? <a class="code" href="classlibdap_1_1Sequence.html#ad15a2b640e4bee850577ca9500ad31c3" title="Get the starting row number.">get_starting_row_number</a>() : 0;
<a name="l00967"></a>00967 
<a name="l00968"></a>00968     <span class="comment">// read_row returns true if valid data was read, false if the EOF was</span>
<a name="l00969"></a>00969     <span class="comment">// found. 6/1/2001 jhrg</span>
<a name="l00970"></a>00970     <span class="comment">// Since this is a parent sequence, read the row ignoring the CE (all of</span>
<a name="l00971"></a>00971     <span class="comment">// the CE clauses will be evaluated by the leaf sequence).</span>
<a name="l00972"></a>00972     <span class="keywordtype">bool</span> status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, <span class="keyword">false</span>);
<a name="l00973"></a>00973 
<a name="l00974"></a>00974     <span class="comment">// Grab the current size of the value stack. We do this because it is</span>
<a name="l00975"></a>00975     <span class="comment">// possible that no nested sequences for this row happened to be</span>
<a name="l00976"></a>00976     <span class="comment">// selected because of a constract evaluation or the last row is not</span>
<a name="l00977"></a>00977     <span class="comment">// selected because of a constraint evaluation. In either case, no</span>
<a name="l00978"></a>00978     <span class="comment">// nested sequence d_values are pused onto the stack, so there is</span>
<a name="l00979"></a>00979     <span class="comment">// nothing to pop at the end of this function. pcw 07/14/08</span>
<a name="l00980"></a>00980     SequenceValues::size_type orig_stack_size = sequence_values_stack.size() ;
<a name="l00981"></a>00981 
<a name="l00982"></a>00982     <span class="keywordflow">while</span> (status
<a name="l00983"></a>00983            &amp;&amp; (<a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>() == -1
<a name="l00984"></a>00984                || i &lt;= <a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>()))
<a name="l00985"></a>00985     {
<a name="l00986"></a>00986         i += <a class="code" href="classlibdap_1_1Sequence.html#ae1461dd491795a2d6b0bd3112aca8550" title="Get the row stride.">get_row_stride</a>();
<a name="l00987"></a>00987         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>(); iter != <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>(); iter++) {
<a name="l00988"></a>00988             <span class="keywordflow">if</span> ((*iter)-&gt;send_p()) {
<a name="l00989"></a>00989                 <span class="keywordflow">switch</span> ((*iter)-&gt;type()) {
<a name="l00990"></a>00990                 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>:
<a name="l00991"></a>00991                     <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a>&amp;<span class="keyword">&gt;</span>(**iter).<a class="code" href="classlibdap_1_1Sequence.html#ac193f301017ed380059b94907f9e0be4">intern_data_private</a>(
<a name="l00992"></a>00992                             eval, dds, sequence_values_stack);
<a name="l00993"></a>00993                     <span class="keywordflow">break</span>;
<a name="l00994"></a>00994 
<a name="l00995"></a>00995                 <span class="keywordflow">default</span>:
<a name="l00996"></a>00996                     (*iter)-&gt;intern_data(eval, dds);
<a name="l00997"></a>00997                     <span class="keywordflow">break</span>;
<a name="l00998"></a>00998                 }
<a name="l00999"></a>00999             }
<a name="l01000"></a>01000         }
<a name="l01001"></a>01001 
<a name="l01002"></a>01002         <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">false</span>);      <span class="comment">// ...so this will read the next instance</span>
<a name="l01003"></a>01003 
<a name="l01004"></a>01004         status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, <span class="keyword">false</span>);
<a name="l01005"></a>01005     }
<a name="l01006"></a>01006 
<a name="l01007"></a>01007     <span class="comment">// Reset current row number for next nested sequence element.</span>
<a name="l01008"></a>01008     <a class="code" href="classlibdap_1_1Sequence.html#ad555ad129354768a042f4e94f36f299a" title="Rest the row number counter.">reset_row_number</a>();
<a name="l01009"></a>01009 
<a name="l01010"></a>01010     <span class="comment">// if the size of the stack is larger than the original size (retrieved</span>
<a name="l01011"></a>01011     <span class="comment">// above) then pop the top set of d_values from the stack. If it&#39;s the</span>
<a name="l01012"></a>01012     <span class="comment">// same, then no nested sequences, or possible the last nested sequence,</span>
<a name="l01013"></a>01013     <span class="comment">// were pushed onto the stack, so there is nothing to pop.</span>
<a name="l01014"></a>01014     <span class="keywordflow">if</span>( sequence_values_stack.size() &gt; orig_stack_size )
<a name="l01015"></a>01015     {
<a name="l01016"></a>01016         <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    popping d_values (&quot;</span> &lt;&lt; sequence_values_stack.top()
<a name="l01017"></a>01017              &lt;&lt; <span class="stringliteral">&quot;) off stack; size: &quot;</span> &lt;&lt; sequence_values_stack.size() &lt;&lt; endl);
<a name="l01018"></a>01018         sequence_values_stack.pop();
<a name="l01019"></a>01019     }
<a name="l01020"></a>01020     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Leaving intern_data_parent_part_one for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01021"></a>01021 }
<a name="l01022"></a>01022 
<a name="l01023"></a>01023 <span class="keywordtype">void</span>
<a name="l01024"></a><a class="code" href="classlibdap_1_1Sequence.html#abf937ace290ad55a995d1baf5a05232b">01024</a> <a class="code" href="classlibdap_1_1Sequence.html#abf937ace290ad55a995d1baf5a05232b">Sequence::intern_data_parent_part_two</a>(<a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l01025"></a>01025                               <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval,
<a name="l01026"></a>01026                               <a class="code" href="classlibdap_1_1Sequence.html#afa1dc14e98a94efc8944cdb08214a166">sequence_values_stack_t</a> &amp;sequence_values_stack)
<a name="l01027"></a>01027 {
<a name="l01028"></a>01028     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering intern_data_parent_part_two for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01029"></a>01029 
<a name="l01030"></a>01030     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp = <a class="code" href="classlibdap_1_1BaseType.html#aeabb771d731dbcef92fff731fb429f85">get_parent</a>();
<a name="l01031"></a>01031     <span class="keywordflow">if</span> (btp &amp;&amp; btp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>) {
<a name="l01032"></a>01032         <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a>&amp;<span class="keyword">&gt;</span>(*btp).<a class="code" href="classlibdap_1_1Sequence.html#abf937ace290ad55a995d1baf5a05232b">intern_data_parent_part_two</a>(
<a name="l01033"></a>01033                                       dds, eval, sequence_values_stack);
<a name="l01034"></a>01034     }
<a name="l01035"></a>01035 
<a name="l01036"></a>01036     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    stack size: &quot;</span> &lt;&lt; sequence_values_stack.size() &lt;&lt; endl);
<a name="l01037"></a>01037     <a class="code" href="namespacelibdap.html#ad2918a01a28d16d423b047e2d312f760">SequenceValues</a> *values = sequence_values_stack.top();
<a name="l01038"></a>01038     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    using values = &quot;</span> &lt;&lt; (<span class="keywordtype">void</span> *)values &lt;&lt; endl);
<a name="l01039"></a>01039 
<a name="l01040"></a>01040     <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1Sequence.html#a1e361197948ce131e14e35454b2178b7" title="Get the unsent data property.">get_unsent_data</a>()) {
<a name="l01041"></a>01041         <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *row_data = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a>;
<a name="l01042"></a>01042 
<a name="l01043"></a>01043         <span class="comment">// In this loop transfer_data will signal an error with an exception.</span>
<a name="l01044"></a>01044         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>(); iter != <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>(); iter++) {
<a name="l01045"></a>01045 
<a name="l01046"></a>01046             <span class="keywordflow">if</span> ((*iter)-&gt;send_p() &amp;&amp; (*iter)-&gt;type() != <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>) {
<a name="l01047"></a>01047                 row_data-&gt;push_back((*iter)-&gt;ptr_duplicate());
<a name="l01048"></a>01048             }
<a name="l01049"></a>01049             <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*iter)-&gt;send_p()) { <span class="comment">//Sequence; must be the last variable</span>
<a name="l01050"></a>01050                 <a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a> *tmp = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a>*<span class="keyword">&gt;</span>((*iter)-&gt;ptr_duplicate());
<a name="l01051"></a>01051                 <span class="keywordflow">if</span> (!tmp)
<a name="l01052"></a>01052                     <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__, <span class="stringliteral">&quot;Expected a Sequence.&quot;</span>);
<a name="l01053"></a>01053                 row_data-&gt;push_back(tmp);
<a name="l01054"></a>01054                 <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    pushing d_values of &quot;</span> &lt;&lt; tmp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()
<a name="l01055"></a>01055                      &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; &amp;(tmp-&gt;d_values)
<a name="l01056"></a>01056                      &lt;&lt; <span class="stringliteral">&quot;) on stack; size: &quot;</span> &lt;&lt; sequence_values_stack.size()
<a name="l01057"></a>01057                      &lt;&lt; endl);
<a name="l01058"></a>01058                 <span class="comment">// This pushes the d_values field of the newly created leaf</span>
<a name="l01059"></a>01059                 <span class="comment">// Sequence onto the stack. The code then returns to intern</span>
<a name="l01060"></a>01060                 <span class="comment">// _data_for_leaf() where this value will be used.</span>
<a name="l01061"></a>01061                 sequence_values_stack.push(&amp;(tmp-&gt;d_values));
<a name="l01062"></a>01062             }
<a name="l01063"></a>01063         }
<a name="l01064"></a>01064 
<a name="l01065"></a>01065         <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    pushing values for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()
<a name="l01066"></a>01066                   &lt;&lt; <span class="stringliteral">&quot; to &quot;</span> &lt;&lt; values &lt;&lt; endl);
<a name="l01067"></a>01067         values-&gt;push_back(row_data);
<a name="l01068"></a>01068         <a class="code" href="classlibdap_1_1Sequence.html#ad7820138d2f1c9c8ff7dfa632dff60c2" title="Set the unsent data property.">set_unsent_data</a>(<span class="keyword">false</span>);
<a name="l01069"></a>01069     }
<a name="l01070"></a>01070     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Leaving intern_data_parent_part_two for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01071"></a>01071 }
<a name="l01072"></a>01072 
<a name="l01073"></a>01073 <span class="keywordtype">void</span>
<a name="l01074"></a><a class="code" href="classlibdap_1_1Sequence.html#a25f2ba65cd6ff7553988739a5c1a08d4">01074</a> <a class="code" href="classlibdap_1_1Sequence.html#a25f2ba65cd6ff7553988739a5c1a08d4">Sequence::intern_data_for_leaf</a>(<a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l01075"></a>01075                                <a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval,
<a name="l01076"></a>01076                                <a class="code" href="classlibdap_1_1Sequence.html#afa1dc14e98a94efc8944cdb08214a166">sequence_values_stack_t</a> &amp;sequence_values_stack)
<a name="l01077"></a>01077 {
<a name="l01078"></a>01078     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Entering intern_data_for_leaf for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01079"></a>01079 
<a name="l01080"></a>01080     <span class="keywordtype">int</span> i = (<a class="code" href="classlibdap_1_1Sequence.html#ad15a2b640e4bee850577ca9500ad31c3" title="Get the starting row number.">get_starting_row_number</a>() != -1) ? <a class="code" href="classlibdap_1_1Sequence.html#ad15a2b640e4bee850577ca9500ad31c3" title="Get the starting row number.">get_starting_row_number</a>() : 0;
<a name="l01081"></a>01081 
<a name="l01082"></a>01082     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    reading row &quot;</span> &lt;&lt; i &lt;&lt; endl);
<a name="l01083"></a>01083     <span class="keywordtype">bool</span> status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, <span class="keyword">true</span>);
<a name="l01084"></a>01084     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    status: &quot;</span> &lt;&lt; status &lt;&lt; endl);
<a name="l01085"></a>01085     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    ending row number: &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>() &lt;&lt; endl);
<a name="l01086"></a>01086 
<a name="l01087"></a>01087     <span class="keywordflow">if</span> (status &amp;&amp; (<a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>() == -1 || i &lt;= <a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>())) {
<a name="l01088"></a>01088         <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp = <a class="code" href="classlibdap_1_1BaseType.html#aeabb771d731dbcef92fff731fb429f85">get_parent</a>();
<a name="l01089"></a>01089         <span class="keywordflow">if</span> (btp &amp;&amp; btp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>) {
<a name="l01090"></a>01090             <span class="comment">// This call will read the values for the parent sequences and</span>
<a name="l01091"></a>01091             <span class="comment">// then allocate a new instance for the leaf and push that onto</span>
<a name="l01092"></a>01092             <span class="comment">// the stack.</span>
<a name="l01093"></a>01093             <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a>&amp;<span class="keyword">&gt;</span>(*btp).<a class="code" href="classlibdap_1_1Sequence.html#abf937ace290ad55a995d1baf5a05232b">intern_data_parent_part_two</a>(
<a name="l01094"></a>01094                                             dds, eval, sequence_values_stack);
<a name="l01095"></a>01095         }
<a name="l01096"></a>01096 
<a name="l01097"></a>01097         <span class="comment">// intern_data_parent_part_two pushes the d_values field of the leaf</span>
<a name="l01098"></a>01098         <span class="comment">// onto the stack, so this operation grabs that value and then loads</span>
<a name="l01099"></a>01099         <span class="comment">// data into it.</span>
<a name="l01100"></a>01100         <a class="code" href="namespacelibdap.html#ad2918a01a28d16d423b047e2d312f760">SequenceValues</a> *values = sequence_values_stack.top();
<a name="l01101"></a>01101         <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    using values = &quot;</span> &lt;&lt; values &lt;&lt; endl);
<a name="l01102"></a>01102 
<a name="l01103"></a>01103         <span class="keywordflow">while</span> (status &amp;&amp; (<a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>() == -1
<a name="l01104"></a>01104                           || i &lt;= <a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">get_ending_row_number</a>())) {
<a name="l01105"></a>01105             i += <a class="code" href="classlibdap_1_1Sequence.html#ae1461dd491795a2d6b0bd3112aca8550" title="Get the row stride.">get_row_stride</a>();
<a name="l01106"></a>01106 
<a name="l01107"></a>01107             <span class="comment">// Copy data from the object&#39;s fields to this new BaeTypeRow instance</span>
<a name="l01108"></a>01108             <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *row_data = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a>;
<a name="l01109"></a>01109             <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>(); iter != <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>(); iter++) {
<a name="l01110"></a>01110                 <span class="keywordflow">if</span> ((*iter)-&gt;send_p()) {
<a name="l01111"></a>01111                     row_data-&gt;push_back((*iter)-&gt;ptr_duplicate());
<a name="l01112"></a>01112                 }
<a name="l01113"></a>01113             }
<a name="l01114"></a>01114 
<a name="l01115"></a>01115             <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    pushing values for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()
<a name="l01116"></a>01116                       &lt;&lt; <span class="stringliteral">&quot; to &quot;</span> &lt;&lt; values &lt;&lt; endl);
<a name="l01117"></a>01117             <span class="comment">// Save the row_data to values().</span>
<a name="l01118"></a>01118             values-&gt;push_back(row_data);
<a name="l01119"></a>01119 
<a name="l01120"></a>01120             <a class="code" href="classlibdap_1_1Sequence.html#a79e5a9f5c44763e61964b7ec500edfeb" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">false</span>);      <span class="comment">// ...so this will read the next instance</span>
<a name="l01121"></a>01121             <span class="comment">// Read the ith row into this object&#39;s fields</span>
<a name="l01122"></a>01122             status = <a class="code" href="classlibdap_1_1Sequence.html#a62d79555aa03b0a862314ccfdad090f8">read_row</a>(i, dds, eval, <span class="keyword">true</span>);
<a name="l01123"></a>01123         }
<a name="l01124"></a>01124 
<a name="l01125"></a>01125         <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;    popping d_values (&quot;</span> &lt;&lt; sequence_values_stack.top()
<a name="l01126"></a>01126              &lt;&lt; <span class="stringliteral">&quot;) off stack; size: &quot;</span> &lt;&lt; sequence_values_stack.size() &lt;&lt; endl);
<a name="l01127"></a>01127         sequence_values_stack.pop();
<a name="l01128"></a>01128     }
<a name="l01129"></a>01129     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Leaving intern_data_for_leaf for &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01130"></a>01130 }
<a name="l01131"></a>01131 
<a name="l01152"></a>01152 <span class="keywordtype">bool</span>
<a name="l01153"></a><a class="code" href="classlibdap_1_1Sequence.html#adf58298f58caf27d467ad41b7ecbb6ec">01153</a> <a class="code" href="classlibdap_1_1Sequence.html#adf58298f58caf27d467ad41b7ecbb6ec" title="Deserialize (read from the network) the entire Sequence.">Sequence::deserialize</a>(<a class="code" href="classlibdap_1_1UnMarshaller.html" title="abstract base class used to unmarshall/deserialize dap data objects">UnMarshaller</a> &amp;um, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> *dds, <span class="keywordtype">bool</span> reuse)
<a name="l01154"></a>01154 {
<a name="l01155"></a>01155     <a class="code" href="classlibdap_1_1DataDDS.html" title="Holds a DAP2 DDS.">DataDDS</a> *dd = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1DataDDS.html" title="Holds a DAP2 DDS.">DataDDS</a> *<span class="keyword">&gt;</span>(dds);
<a name="l01156"></a>01156     <span class="keywordflow">if</span> (!dd)
<a name="l01157"></a>01157         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(<span class="stringliteral">&quot;Expected argument &#39;dds&#39; to be a DataDDS!&quot;</span>);
<a name="l01158"></a>01158 
<a name="l01159"></a>01159     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Reading from server/protocol version: &quot;</span>
<a name="l01160"></a>01160          &lt;&lt; dd-&gt;<a class="code" href="classlibdap_1_1DataDDS.html#a856b3990ae7b3571b940d23ede69d30e">get_protocol_major</a>() &lt;&lt; <span class="stringliteral">&quot;.&quot;</span> &lt;&lt; dd-&gt;<a class="code" href="classlibdap_1_1DataDDS.html#a2a5320f49d536c58f17cb8bff5cb1431">get_protocol_minor</a>()
<a name="l01161"></a>01161          &lt;&lt; endl);
<a name="l01162"></a>01162 
<a name="l01163"></a>01163     <span class="comment">// Check for old servers.</span>
<a name="l01164"></a>01164     <span class="keywordflow">if</span> (dd-&gt;<a class="code" href="classlibdap_1_1DataDDS.html#a856b3990ae7b3571b940d23ede69d30e">get_protocol_major</a>() &lt; 2) {
<a name="l01165"></a>01165         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;The protocl version (&quot;</span>) + dd-&gt;<a class="code" href="classlibdap_1_1DataDDS.html#af43fc4392606e00c25ad9d8af7fc2a8f">get_protocol</a>()
<a name="l01166"></a>01166                     + <span class="stringliteral">&quot;) indicates that this\nis an old server which may not correctly transmit Sequence variables.\nContact the server administrator.&quot;</span>);
<a name="l01167"></a>01167     }
<a name="l01168"></a>01168 
<a name="l01169"></a>01169     <span class="keywordflow">while</span> (<span class="keyword">true</span>) {
<a name="l01170"></a>01170         <span class="comment">// Grab the sequence stream&#39;s marker.</span>
<a name="l01171"></a>01171         <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> marker = read_marker(um);
<a name="l01172"></a>01172         <span class="keywordflow">if</span> (is_end_of_sequence(marker))
<a name="l01173"></a>01173             <span class="keywordflow">break</span>;  <span class="comment">// EXIT the while loop here!!!</span>
<a name="l01174"></a>01174         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (is_start_of_instance(marker)) {
<a name="l01175"></a>01175             d_row_number++;
<a name="l01176"></a>01176             <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Reading row &quot;</span> &lt;&lt; d_row_number &lt;&lt; <span class="stringliteral">&quot; of &quot;</span>
<a name="l01177"></a>01177                  &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01178"></a>01178             <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a> *bt_row_ptr = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#acf78ec36b2d70d02d8eea5cd50253922">BaseTypeRow</a>;
<a name="l01179"></a>01179             <span class="comment">// Read the instance&#39;s values, building up the row</span>
<a name="l01180"></a>01180             <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l01181"></a>01181                 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *bt_ptr = (*iter)-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a0b130311c9901fb8a7ab11ea19090ef0">ptr_duplicate</a>();
<a name="l01182"></a>01182                 bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#aa14891b5342c1ce06399343de8b716d0" title="Receive data from the net.">deserialize</a>(um, dds, reuse);
<a name="l01183"></a>01183                 <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Deserialized &quot;</span> &lt;&lt; bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; <span class="stringliteral">&quot; (&quot;</span>
<a name="l01184"></a>01184                      &lt;&lt; bt_ptr &lt;&lt; <span class="stringliteral">&quot;) = &quot;</span>);
<a name="l01185"></a>01185                 <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a94edd5b610afb1432144158740710488" title="Prints the value of the variable.">print_val</a>(stderr, <span class="stringliteral">&quot;&quot;</span>));
<a name="l01186"></a>01186                 bt_row_ptr-&gt;push_back(bt_ptr);
<a name="l01187"></a>01187             }
<a name="l01188"></a>01188             <span class="comment">// Append this row to those accumulated.</span>
<a name="l01189"></a>01189             d_values.push_back(bt_row_ptr);
<a name="l01190"></a>01190         }
<a name="l01191"></a>01191         <span class="keywordflow">else</span>
<a name="l01192"></a>01192             <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;I could not read the expected Sequence data stream marker!&quot;</span>);
<a name="l01193"></a>01193     };
<a name="l01194"></a>01194 
<a name="l01195"></a>01195     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l01196"></a>01196 }
<a name="l01197"></a>01197 
<a name="l01198"></a>01198 <span class="comment">// Return the current row number.</span>
<a name="l01199"></a>01199 
<a name="l01211"></a>01211 <span class="keywordtype">int</span>
<a name="l01212"></a><a class="code" href="classlibdap_1_1Sequence.html#ad15a2b640e4bee850577ca9500ad31c3">01212</a> <a class="code" href="classlibdap_1_1Sequence.html#ad15a2b640e4bee850577ca9500ad31c3" title="Get the starting row number.">Sequence::get_starting_row_number</a>()
<a name="l01213"></a>01213 {
<a name="l01214"></a>01214     <span class="keywordflow">return</span> d_starting_row_number;
<a name="l01215"></a>01215 }
<a name="l01216"></a>01216 
<a name="l01227"></a>01227 <span class="keywordtype">int</span>
<a name="l01228"></a><a class="code" href="classlibdap_1_1Sequence.html#ae1461dd491795a2d6b0bd3112aca8550">01228</a> <a class="code" href="classlibdap_1_1Sequence.html#ae1461dd491795a2d6b0bd3112aca8550" title="Get the row stride.">Sequence::get_row_stride</a>()
<a name="l01229"></a>01229 {
<a name="l01230"></a>01230     <span class="keywordflow">return</span> d_row_stride;
<a name="l01231"></a>01231 }
<a name="l01232"></a>01232 
<a name="l01244"></a>01244 <span class="keywordtype">int</span>
<a name="l01245"></a><a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392">01245</a> <a class="code" href="classlibdap_1_1Sequence.html#ae1489f3bc8bb269e51831add438aa392" title="Get the ending row number.">Sequence::get_ending_row_number</a>()
<a name="l01246"></a>01246 {
<a name="l01247"></a>01247     <span class="keywordflow">return</span> d_ending_row_number;
<a name="l01248"></a>01248 }
<a name="l01249"></a>01249 
<a name="l01258"></a>01258 <span class="keywordtype">void</span>
<a name="l01259"></a><a class="code" href="classlibdap_1_1Sequence.html#af182686c5766d73e5d896eecaadb96bc">01259</a> <a class="code" href="classlibdap_1_1Sequence.html#af182686c5766d73e5d896eecaadb96bc">Sequence::set_row_number_constraint</a>(<span class="keywordtype">int</span> start, <span class="keywordtype">int</span> stop, <span class="keywordtype">int</span> stride)
<a name="l01260"></a>01260 {
<a name="l01261"></a>01261     <span class="keywordflow">if</span> (stop &lt; start)
<a name="l01262"></a>01262         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<a class="code" href="Error_8h.html#a5806d25bc779e86c285438e687669803">malformed_expr</a>, <span class="stringliteral">&quot;Starting row number must precede the ending row number.&quot;</span>);
<a name="l01263"></a>01263 
<a name="l01264"></a>01264     d_starting_row_number = start;
<a name="l01265"></a>01265     d_row_stride = stride;
<a name="l01266"></a>01266     d_ending_row_number = stop;
<a name="l01267"></a>01267 }
<a name="l01268"></a>01268 
<a name="l01271"></a>01271 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l01272"></a><a class="code" href="classlibdap_1_1Sequence.html#a05f44d885d230f502c9d9ef081804c0e">01272</a> <a class="code" href="classlibdap_1_1Sequence.html#a05f44d885d230f502c9d9ef081804c0e">Sequence::val2buf</a>(<span class="keywordtype">void</span> *, <span class="keywordtype">bool</span>)
<a name="l01273"></a>01273 {
<a name="l01274"></a>01274     <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__, <span class="stringliteral">&quot;Never use this method; see the programmer&#39;s guide documentation.&quot;</span>);
<a name="l01275"></a>01275     <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(<a class="code" href="classlibdap_1_1Sequence.html#a92b97c9d8c1431fd7e619186a557d875" title="The Sequence constructor.">Sequence</a>);
<a name="l01276"></a>01276 }
<a name="l01277"></a>01277 
<a name="l01282"></a>01282 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l01283"></a><a class="code" href="classlibdap_1_1Sequence.html#a5372388bfc9d295889386ce2203ce86b">01283</a> <a class="code" href="classlibdap_1_1Sequence.html#a5372388bfc9d295889386ce2203ce86b">Sequence::buf2val</a>(<span class="keywordtype">void</span> **)
<a name="l01284"></a>01284 {
<a name="l01285"></a>01285     <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__, <span class="stringliteral">&quot;Use Sequence::var_value() or Sequence::row_value() in place of Sequence::buf2val()&quot;</span>);
<a name="l01286"></a>01286     <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(<a class="code" href="classlibdap_1_1Sequence.html#a92b97c9d8c1431fd7e619186a557d875" title="The Sequence constructor.">Sequence</a>);
<a name="l01287"></a>01287 }
<a name="l01288"></a>01288 
<a name="l01289"></a>01289 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l01290"></a>01290 <span class="preprocessor"></span><span class="keywordtype">void</span>
<a name="l01291"></a>01291 <a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">Sequence::print_one_row</a>(FILE *out, <span class="keywordtype">int</span> row, <span class="keywordtype">string</span> space,
<a name="l01292"></a>01292                         <span class="keywordtype">bool</span> print_row_num)
<a name="l01293"></a>01293 {
<a name="l01294"></a>01294     <span class="keywordflow">if</span> (print_row_num)
<a name="l01295"></a>01295         fprintf(out, <span class="stringliteral">&quot;\n%s%d: &quot;</span>, space.c_str(), row) ;
<a name="l01296"></a>01296 
<a name="l01297"></a>01297     fprintf(out, <span class="stringliteral">&quot;{ &quot;</span>) ;
<a name="l01298"></a>01298 
<a name="l01299"></a>01299     <span class="keywordtype">int</span> elements = <a class="code" href="classlibdap_1_1Sequence.html#ac954b8bf5119d75b0b441fa7d89fbd2f" title="Count the members of constructor types.">element_count</a>() - 1;
<a name="l01300"></a>01300     <span class="keywordtype">int</span> j;
<a name="l01301"></a>01301     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *bt_ptr;
<a name="l01302"></a>01302     <span class="comment">// Print first N-1 elements of the row.</span>
<a name="l01303"></a>01303     <span class="keywordflow">for</span> (j = 0; j &lt; elements; ++j) {
<a name="l01304"></a>01304         bt_ptr = <a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269" title="Get the BaseType pointer to the named variable of a given row.">var_value</a>(row, j);
<a name="l01305"></a>01305         <span class="keywordflow">if</span> (bt_ptr) {  <span class="comment">// data</span>
<a name="l01306"></a>01306             <span class="keywordflow">if</span> (bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l01307"></a>01307                 dynamic_cast&lt;Sequence*&gt;(bt_ptr)-&gt;print_val_by_rows
<a name="l01308"></a>01308                 (out, space + <span class="stringliteral">&quot;    &quot;</span>, <span class="keyword">false</span>, print_row_num);
<a name="l01309"></a>01309             <span class="keywordflow">else</span>
<a name="l01310"></a>01310                 bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a94edd5b610afb1432144158740710488" title="Prints the value of the variable.">print_val</a>(out, space, <span class="keyword">false</span>);
<a name="l01311"></a>01311             fprintf(out, <span class="stringliteral">&quot;, &quot;</span>) ;
<a name="l01312"></a>01312         }
<a name="l01313"></a>01313     }
<a name="l01314"></a>01314 
<a name="l01315"></a>01315     <span class="comment">// Print Nth element; end with a `}.&#39;</span>
<a name="l01316"></a>01316     bt_ptr = <a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269" title="Get the BaseType pointer to the named variable of a given row.">var_value</a>(row, j);
<a name="l01317"></a>01317     <span class="keywordflow">if</span> (bt_ptr) {  <span class="comment">// data</span>
<a name="l01318"></a>01318         <span class="keywordflow">if</span> (bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l01319"></a>01319             dynamic_cast&lt;Sequence*&gt;(bt_ptr)-&gt;print_val_by_rows
<a name="l01320"></a>01320             (out, space + <span class="stringliteral">&quot;    &quot;</span>, <span class="keyword">false</span>, print_row_num);
<a name="l01321"></a>01321         <span class="keywordflow">else</span>
<a name="l01322"></a>01322             bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a94edd5b610afb1432144158740710488" title="Prints the value of the variable.">print_val</a>(out, space, <span class="keyword">false</span>);
<a name="l01323"></a>01323     }
<a name="l01324"></a>01324 
<a name="l01325"></a>01325     fprintf(out, <span class="stringliteral">&quot; }&quot;</span>) ;
<a name="l01326"></a>01326 }
<a name="l01327"></a>01327 <span class="preprocessor">#endif</span>
<a name="l01328"></a>01328 <span class="preprocessor"></span>
<a name="l01329"></a>01329 <span class="keywordtype">void</span>
<a name="l01330"></a><a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">01330</a> <a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">Sequence::print_one_row</a>(ostream &amp;out, <span class="keywordtype">int</span> row, <span class="keywordtype">string</span> space,
<a name="l01331"></a>01331                         <span class="keywordtype">bool</span> print_row_num)
<a name="l01332"></a>01332 {
<a name="l01333"></a>01333     <span class="keywordflow">if</span> (print_row_num)
<a name="l01334"></a>01334         out &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; space &lt;&lt; row &lt;&lt; <span class="stringliteral">&quot;: &quot;</span> ;
<a name="l01335"></a>01335 
<a name="l01336"></a>01336     out &lt;&lt; <span class="stringliteral">&quot;{ &quot;</span> ;
<a name="l01337"></a>01337 
<a name="l01338"></a>01338     <span class="keywordtype">int</span> elements = <a class="code" href="classlibdap_1_1Sequence.html#ac954b8bf5119d75b0b441fa7d89fbd2f" title="Count the members of constructor types.">element_count</a>();
<a name="l01339"></a>01339     <span class="keywordtype">int</span> j = 0;
<a name="l01340"></a>01340     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *bt_ptr = 0;
<a name="l01341"></a>01341 
<a name="l01342"></a>01342     <span class="comment">// This version of print_one_row() works for both data read with</span>
<a name="l01343"></a>01343     <span class="comment">// deserialize(), where each variable is assumed to have valid data, and</span>
<a name="l01344"></a>01344     <span class="comment">// intern_data(), where some/many variables do not. Because of that, it&#39;s</span>
<a name="l01345"></a>01345     <span class="comment">// not correct to assume that all of the elements will be printed, which</span>
<a name="l01346"></a>01346     <span class="comment">// is what the old code did.</span>
<a name="l01347"></a>01347     <span class="comment">// Print the first value</span>
<a name="l01348"></a>01348     <span class="keywordflow">while</span> (j &lt; elements &amp;&amp; !bt_ptr) {
<a name="l01349"></a>01349         bt_ptr = <a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269" title="Get the BaseType pointer to the named variable of a given row.">var_value</a>(row, j++);
<a name="l01350"></a>01350         <span class="keywordflow">if</span> (bt_ptr) {  <span class="comment">// data</span>
<a name="l01351"></a>01351             <span class="keywordflow">if</span> (bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l01352"></a>01352                 dynamic_cast&lt;Sequence*&gt;(bt_ptr)-&gt;print_val_by_rows
<a name="l01353"></a>01353                      (out, space + <span class="stringliteral">&quot;    &quot;</span>, <span class="keyword">false</span>, print_row_num);
<a name="l01354"></a>01354             <span class="keywordflow">else</span>
<a name="l01355"></a>01355                 bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a94edd5b610afb1432144158740710488" title="Prints the value of the variable.">print_val</a>(out, space, <span class="keyword">false</span>);
<a name="l01356"></a>01356         }
<a name="l01357"></a>01357     }
<a name="l01358"></a>01358 
<a name="l01359"></a>01359     <span class="comment">// Print the remaining values</span>
<a name="l01360"></a>01360     <span class="keywordflow">while</span> (j &lt; elements) {
<a name="l01361"></a>01361         bt_ptr = <a class="code" href="classlibdap_1_1Sequence.html#ab17e4f1aedda0b734442001b5c81f269" title="Get the BaseType pointer to the named variable of a given row.">var_value</a>(row, j++);
<a name="l01362"></a>01362         <span class="keywordflow">if</span> (bt_ptr) {  <span class="comment">// data</span>
<a name="l01363"></a>01363             out &lt;&lt; <span class="stringliteral">&quot;, &quot;</span>;
<a name="l01364"></a>01364             <span class="keywordflow">if</span> (bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>)
<a name="l01365"></a>01365                 dynamic_cast&lt;Sequence*&gt;(bt_ptr)-&gt;print_val_by_rows
<a name="l01366"></a>01366                         (out, space + <span class="stringliteral">&quot;    &quot;</span>, <span class="keyword">false</span>, print_row_num);
<a name="l01367"></a>01367             <span class="keywordflow">else</span>
<a name="l01368"></a>01368                 bt_ptr-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a94edd5b610afb1432144158740710488" title="Prints the value of the variable.">print_val</a>(out, space, <span class="keyword">false</span>);
<a name="l01369"></a>01369         }
<a name="l01370"></a>01370     }
<a name="l01371"></a>01371 
<a name="l01372"></a>01372     out &lt;&lt; <span class="stringliteral">&quot; }&quot;</span> ;
<a name="l01373"></a>01373 }
<a name="l01374"></a>01374 
<a name="l01375"></a>01375 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l01376"></a>01376 <span class="preprocessor"></span><span class="keywordtype">void</span>
<a name="l01377"></a>01377 <a class="code" href="classlibdap_1_1Sequence.html#ab9e02fc99e9739e565b4e59377acf56d">Sequence::print_val_by_rows</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p,
<a name="l01378"></a>01378                             <span class="keywordtype">bool</span> print_row_numbers)
<a name="l01379"></a>01379 {
<a name="l01380"></a>01380     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l01381"></a>01381         <a class="code" href="classlibdap_1_1Constructor.html#ab7fb094be8da2a9f80f6d3b85e452934" title="Print an ASCII representation of the variable structure.">print_decl</a>(out, space, <span class="keyword">false</span>);
<a name="l01382"></a>01382         fprintf(out, <span class="stringliteral">&quot; = &quot;</span>) ;
<a name="l01383"></a>01383     }
<a name="l01384"></a>01384 
<a name="l01385"></a>01385     fprintf(out, <span class="stringliteral">&quot;{ &quot;</span>) ;
<a name="l01386"></a>01386 
<a name="l01387"></a>01387     <span class="keywordtype">int</span> rows = <a class="code" href="classlibdap_1_1Sequence.html#af2085366f0bb90822e1b85108b44df1b">number_of_rows</a>() - 1;
<a name="l01388"></a>01388     <span class="keywordtype">int</span> i;
<a name="l01389"></a>01389     <span class="keywordflow">for</span> (i = 0; i &lt; rows; ++i) {
<a name="l01390"></a>01390         <a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">print_one_row</a>(out, i, space, print_row_numbers);
<a name="l01391"></a>01391         fprintf(out, <span class="stringliteral">&quot;, &quot;</span>) ;
<a name="l01392"></a>01392     }
<a name="l01393"></a>01393     <a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">print_one_row</a>(out, i, space, print_row_numbers);
<a name="l01394"></a>01394 
<a name="l01395"></a>01395     fprintf(out, <span class="stringliteral">&quot; }&quot;</span>) ;
<a name="l01396"></a>01396 
<a name="l01397"></a>01397     <span class="keywordflow">if</span> (print_decl_p)
<a name="l01398"></a>01398         fprintf(out, <span class="stringliteral">&quot;;\n&quot;</span>) ;
<a name="l01399"></a>01399 }
<a name="l01400"></a>01400 <span class="preprocessor">#endif</span>
<a name="l01401"></a>01401 <span class="preprocessor"></span>
<a name="l01402"></a>01402 <span class="keywordtype">void</span>
<a name="l01403"></a><a class="code" href="classlibdap_1_1Sequence.html#ab9e02fc99e9739e565b4e59377acf56d">01403</a> <a class="code" href="classlibdap_1_1Sequence.html#ab9e02fc99e9739e565b4e59377acf56d">Sequence::print_val_by_rows</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p,
<a name="l01404"></a>01404                             <span class="keywordtype">bool</span> print_row_numbers)
<a name="l01405"></a>01405 {
<a name="l01406"></a>01406     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l01407"></a>01407         <a class="code" href="classlibdap_1_1Constructor.html#ab7fb094be8da2a9f80f6d3b85e452934" title="Print an ASCII representation of the variable structure.">print_decl</a>(out, space, <span class="keyword">false</span>);
<a name="l01408"></a>01408         out &lt;&lt; <span class="stringliteral">&quot; = &quot;</span> ;
<a name="l01409"></a>01409     }
<a name="l01410"></a>01410 
<a name="l01411"></a>01411     out &lt;&lt; <span class="stringliteral">&quot;{ &quot;</span> ;
<a name="l01412"></a>01412 
<a name="l01413"></a>01413     <span class="keywordtype">int</span> rows = <a class="code" href="classlibdap_1_1Sequence.html#af2085366f0bb90822e1b85108b44df1b">number_of_rows</a>() - 1;
<a name="l01414"></a>01414     <span class="keywordtype">int</span> i;
<a name="l01415"></a>01415     <span class="keywordflow">for</span> (i = 0; i &lt; rows; ++i) {
<a name="l01416"></a>01416         <a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">print_one_row</a>(out, i, space, print_row_numbers);
<a name="l01417"></a>01417         out &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> ;
<a name="l01418"></a>01418     }
<a name="l01419"></a>01419     <a class="code" href="classlibdap_1_1Sequence.html#a6bbdd92e1d38e00948592b0764d859ab">print_one_row</a>(out, i, space, print_row_numbers);
<a name="l01420"></a>01420 
<a name="l01421"></a>01421     out &lt;&lt; <span class="stringliteral">&quot; }&quot;</span> ;
<a name="l01422"></a>01422 
<a name="l01423"></a>01423     <span class="keywordflow">if</span> (print_decl_p)
<a name="l01424"></a>01424         out &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span> ;
<a name="l01425"></a>01425 }
<a name="l01426"></a>01426 
<a name="l01427"></a>01427 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l01428"></a>01428 <span class="preprocessor"></span><span class="keywordtype">void</span>
<a name="l01429"></a>01429 <a class="code" href="classlibdap_1_1Sequence.html#a675995a38339e5139b80a4faa1a46824" title="Prints the value of the variable.">Sequence::print_val</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l01430"></a>01430 {
<a name="l01431"></a>01431     <a class="code" href="classlibdap_1_1Sequence.html#ab9e02fc99e9739e565b4e59377acf56d">print_val_by_rows</a>(out, space, print_decl_p, <span class="keyword">false</span>);
<a name="l01432"></a>01432 }
<a name="l01433"></a>01433 <span class="preprocessor">#endif</span>
<a name="l01434"></a>01434 <span class="preprocessor"></span>
<a name="l01435"></a>01435 <span class="keywordtype">void</span>
<a name="l01436"></a><a class="code" href="classlibdap_1_1Sequence.html#a675995a38339e5139b80a4faa1a46824">01436</a> <a class="code" href="classlibdap_1_1Sequence.html#a675995a38339e5139b80a4faa1a46824" title="Prints the value of the variable.">Sequence::print_val</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l01437"></a>01437 {
<a name="l01438"></a>01438     <a class="code" href="classlibdap_1_1Sequence.html#ab9e02fc99e9739e565b4e59377acf56d">print_val_by_rows</a>(out, space, print_decl_p, <span class="keyword">false</span>);
<a name="l01439"></a>01439 }
<a name="l01440"></a>01440 
<a name="l01441"></a>01441 
<a name="l01442"></a>01442 <span class="keywordtype">bool</span>
<a name="l01443"></a><a class="code" href="classlibdap_1_1Sequence.html#ae1200a839ab82343c66bce65390b5ab3">01443</a> <a class="code" href="classlibdap_1_1Sequence.html#ae1200a839ab82343c66bce65390b5ab3" title="Compare an object&amp;#39;s current state with the semantics of its type.">Sequence::check_semantics</a>(<span class="keywordtype">string</span> &amp;msg, <span class="keywordtype">bool</span> all)
<a name="l01444"></a>01444 {
<a name="l01445"></a>01445     <span class="keywordflow">if</span> (!<a class="code" href="classlibdap_1_1BaseType.html#aec503abec2fd3090e7738c0a575491f8" title="Compare an object&amp;#39;s current state with the semantics of its type.">BaseType::check_semantics</a>(msg))
<a name="l01446"></a>01446         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l01447"></a>01447 
<a name="l01448"></a>01448     <span class="keywordflow">if</span> (!<a class="code" href="namespacelibdap.html#afabf64c5d4c1900f1c05ac655895f7ee">unique_names</a>(<a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>, <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>(), <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>(), msg))
<a name="l01449"></a>01449         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l01450"></a>01450 
<a name="l01451"></a>01451     <span class="keywordflow">if</span> (all)
<a name="l01452"></a>01452         <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); i != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); i++) {
<a name="l01453"></a>01453             <span class="keywordflow">if</span> (!(*i)-&gt;check_semantics(msg, <span class="keyword">true</span>)) {
<a name="l01454"></a>01454                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l01455"></a>01455             }
<a name="l01456"></a>01456         }
<a name="l01457"></a>01457 
<a name="l01458"></a>01458     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l01459"></a>01459 }
<a name="l01460"></a>01460 
<a name="l01461"></a>01461 <span class="keywordtype">void</span>
<a name="l01462"></a><a class="code" href="classlibdap_1_1Sequence.html#ab6618d3ef634d6c8ace79ca030c96378">01462</a> <a class="code" href="classlibdap_1_1Sequence.html#ab6618d3ef634d6c8ace79ca030c96378">Sequence::set_leaf_p</a>(<span class="keywordtype">bool</span> state)
<a name="l01463"></a>01463 {
<a name="l01464"></a>01464     d_leaf_sequence = state;
<a name="l01465"></a>01465 }
<a name="l01466"></a>01466 
<a name="l01467"></a>01467 <span class="keywordtype">bool</span>
<a name="l01468"></a><a class="code" href="classlibdap_1_1Sequence.html#a3cb03f3ccb14372106e91461b468c1bd">01468</a> <a class="code" href="classlibdap_1_1Sequence.html#a3cb03f3ccb14372106e91461b468c1bd">Sequence::is_leaf_sequence</a>()
<a name="l01469"></a>01469 {
<a name="l01470"></a>01470     <span class="keywordflow">return</span> d_leaf_sequence;
<a name="l01471"></a>01471 }
<a name="l01472"></a>01472 
<a name="l01497"></a>01497 <span class="keywordtype">void</span>
<a name="l01498"></a><a class="code" href="classlibdap_1_1Sequence.html#a630ae5ad80cc4ddbd1c07e7cae0eec6d">01498</a> <a class="code" href="classlibdap_1_1Sequence.html#a630ae5ad80cc4ddbd1c07e7cae0eec6d" title="Mark the Sequence which holds the leaf elements.">Sequence::set_leaf_sequence</a>(<span class="keywordtype">int</span> lvl)
<a name="l01499"></a>01499 {
<a name="l01500"></a>01500     <span class="keywordtype">bool</span> has_child_sequence = <span class="keyword">false</span>;
<a name="l01501"></a>01501 
<a name="l01502"></a>01502     <span class="keywordflow">if</span> (lvl == 1) d_top_most = <span class="keyword">true</span>;
<a name="l01503"></a>01503 
<a name="l01504"></a>01504     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Processing sequence &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; endl);
<a name="l01505"></a>01505 
<a name="l01506"></a>01506     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> iter = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin(); iter != <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end(); iter++) {
<a name="l01507"></a>01507         <span class="comment">// About the test for send_p(): Only descend into a sequence if it has</span>
<a name="l01508"></a>01508         <span class="comment">// fields that might be sent. Thus if, in a two-level sequence, nothing</span>
<a name="l01509"></a>01509         <span class="comment">// in the lower level is to be sent, the upper level is marked as the</span>
<a name="l01510"></a>01510         <span class="comment">// leaf sequence. This ensures that values _will_ be sent (see the comment</span>
<a name="l01511"></a>01511         <span class="comment">// in serialize_leaf() and serialize_parent_part_one()).</span>
<a name="l01512"></a>01512         <span class="keywordflow">if</span> ((*iter)-&gt;type() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a> &amp;&amp; (*iter)-&gt;send_p()) {
<a name="l01513"></a>01513             <span class="keywordflow">if</span> (has_child_sequence)
<a name="l01514"></a>01514                 <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;This implementation does not support more than one nested sequence at a level. Contact the server administrator.&quot;</span>);
<a name="l01515"></a>01515 
<a name="l01516"></a>01516             has_child_sequence = <span class="keyword">true</span>;
<a name="l01517"></a>01517             <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Sequence.html" title="Holds a sequence.">Sequence</a>&amp;<span class="keyword">&gt;</span>(**iter).<a class="code" href="classlibdap_1_1Sequence.html#a630ae5ad80cc4ddbd1c07e7cae0eec6d" title="Mark the Sequence which holds the leaf elements.">set_leaf_sequence</a>(++lvl);
<a name="l01518"></a>01518         }
<a name="l01519"></a>01519         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((*iter)-&gt;type() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad93eb0a69e67742f061966ce594b9a6c">dods_structure_c</a>) {
<a name="l01520"></a>01520             <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Structure.html" title="Holds a structure (aggregate) type.">Structure</a>&amp;<span class="keyword">&gt;</span>(**iter).<a class="code" href="classlibdap_1_1Structure.html#a69851299078fd4bfc39d722c8cdc3cb9" title="Traverse Structure, set Sequence leaf nodes.">set_leaf_sequence</a>(lvl);
<a name="l01521"></a>01521         }
<a name="l01522"></a>01522     }
<a name="l01523"></a>01523 
<a name="l01524"></a>01524     <span class="keywordflow">if</span> (!has_child_sequence)
<a name="l01525"></a>01525         <a class="code" href="classlibdap_1_1Sequence.html#ab6618d3ef634d6c8ace79ca030c96378">set_leaf_p</a>(<span class="keyword">true</span>);
<a name="l01526"></a>01526     <span class="keywordflow">else</span>
<a name="l01527"></a>01527         <a class="code" href="classlibdap_1_1Sequence.html#ab6618d3ef634d6c8ace79ca030c96378">set_leaf_p</a>(<span class="keyword">false</span>);
<a name="l01528"></a>01528 
<a name="l01529"></a>01529     <a class="code" href="debug_8h.html#ac1f764c266c50f0050e33557004c914c">DBG2</a>(cerr &lt;&lt; <span class="stringliteral">&quot;is_leaf_sequence(): &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1Sequence.html#a3cb03f3ccb14372106e91461b468c1bd">is_leaf_sequence</a>() &lt;&lt; <span class="stringliteral">&quot; (&quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() &lt;&lt; <span class="stringliteral">&quot;)&quot;</span> &lt;&lt; endl);
<a name="l01530"></a>01530 }
<a name="l01531"></a>01531 
<a name="l01540"></a>01540 <span class="keywordtype">void</span>
<a name="l01541"></a><a class="code" href="classlibdap_1_1Sequence.html#acd0961a9479c9224d7b08021bb4d0c36">01541</a> <a class="code" href="classlibdap_1_1Sequence.html#acd0961a9479c9224d7b08021bb4d0c36" title="dumps information about this object">Sequence::dump</a>(ostream &amp;strm)<span class="keyword"> const</span>
<a name="l01542"></a>01542 <span class="keyword"></span>{
<a name="l01543"></a>01543     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;Sequence::dump - (&quot;</span>
<a name="l01544"></a>01544     &lt;&lt; (<span class="keywordtype">void</span> *)<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;)&quot;</span> &lt;&lt; endl ;
<a name="l01545"></a>01545     <a class="code" href="classlibdap_1_1DapIndent.html#a4ed2cce66dbff9ad4320e89142103c6c">DapIndent::Indent</a>() ;
<a name="l01546"></a>01546     <a class="code" href="classlibdap_1_1Sequence.html#acd0961a9479c9224d7b08021bb4d0c36" title="dumps information about this object">Constructor::dump</a>(strm) ;
<a name="l01547"></a>01547     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;# rows deserialized: &quot;</span> &lt;&lt; d_row_number
<a name="l01548"></a>01548          &lt;&lt; endl ;
<a name="l01549"></a>01549     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;bracket notation information:&quot;</span> &lt;&lt; endl ;
<a name="l01550"></a>01550     DapIndent::Indent() ;
<a name="l01551"></a>01551     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;starting row #: &quot;</span> &lt;&lt; d_starting_row_number
<a name="l01552"></a>01552          &lt;&lt; endl ;
<a name="l01553"></a>01553     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;row stride: &quot;</span> &lt;&lt; d_row_stride &lt;&lt; endl ;
<a name="l01554"></a>01554     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;ending row #: &quot;</span> &lt;&lt; d_ending_row_number
<a name="l01555"></a>01555          &lt;&lt; endl ;
<a name="l01556"></a>01556     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ;
<a name="l01557"></a>01557 
<a name="l01558"></a>01558     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;data been sent? &quot;</span> &lt;&lt; d_unsent_data &lt;&lt; endl ;
<a name="l01559"></a>01559     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;start of instance? &quot;</span> &lt;&lt; d_wrote_soi &lt;&lt; endl ;
<a name="l01560"></a>01560     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;is leaf sequence? &quot;</span> &lt;&lt; d_leaf_sequence
<a name="l01561"></a>01561          &lt;&lt; endl ;
<a name="l01562"></a>01562     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;top most in hierarchy? &quot;</span> &lt;&lt; d_top_most
<a name="l01563"></a>01563          &lt;&lt; endl ;
<a name="l01564"></a>01564     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ;
<a name="l01565"></a>01565 }
<a name="l01566"></a>01566 
<a name="l01567"></a>01567 } <span class="comment">// namespace libdap</span>
<a name="l01568"></a>01568 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="Sequence_8cc.html">Sequence.cc</a>      </li>
      <li class="footer">Generated on Tue Feb 8 2011 for libdap++ by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>