Sophie

Sophie

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

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++: Constructor.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('Constructor_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>Constructor.cc</h1>  </div>
</div>
<div class="contents">
<a href="Constructor_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="comment">// -*- mode: c++; c-basic-offset:4 -*-</span>
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="comment">// This file is part of libdap, A C++ implementation of the OPeNDAP Data</span>
<a name="l00005"></a>00005 <span class="comment">// Access Protocol.</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="comment">// Copyright (c) 2002,2003 OPeNDAP, Inc.</span>
<a name="l00008"></a>00008 <span class="comment">// Author: James Gallagher &lt;jgallagher@opendap.org&gt;</span>
<a name="l00009"></a>00009 <span class="comment">//</span>
<a name="l00010"></a>00010 <span class="comment">// This library is free software; you can redistribute it and/or</span>
<a name="l00011"></a>00011 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00012"></a>00012 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00013"></a>00013 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="comment">// This library is distributed in the hope that it will be useful,</span>
<a name="l00016"></a>00016 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00017"></a>00017 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00018"></a>00018 <span class="comment">// Lesser General Public License for more details.</span>
<a name="l00019"></a>00019 <span class="comment">//</span>
<a name="l00020"></a>00020 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>
<a name="l00021"></a>00021 <span class="comment">// License along with this library; if not, write to the Free Software</span>
<a name="l00022"></a>00022 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00023"></a>00023 <span class="comment">//</span>
<a name="l00024"></a>00024 <span class="comment">// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="comment">// (c) COPYRIGHT URI/MIT 1995-1999</span>
<a name="l00027"></a>00027 <span class="comment">// Please read the full copyright statement in the file COPYRIGHT_URI.</span>
<a name="l00028"></a>00028 <span class="comment">//</span>
<a name="l00029"></a>00029 <span class="comment">// Authors:</span>
<a name="l00030"></a>00030 <span class="comment">//      jhrg,jimg       James Gallagher &lt;jgallagher@gso.uri.edu&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;algorithm&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;functional&gt;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="comment">//#define DODS_DEBUG</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="preprocessor">#include &quot;<a class="code" href="Constructor_8h.html">Constructor.h</a>&quot;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &quot;<a class="code" href="Grid_8h.html">Grid.h</a>&quot;</span>
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="preprocessor">#include &quot;<a class="code" href="debug_8h.html">debug.h</a>&quot;</span>
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="escaping_8h.html">escaping.h</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="Error_8h.html">Error.h</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="InternalErr_8h.html">InternalErr.h</a>&quot;</span>
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 <span class="keyword">using namespace </span>std;
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keyword">namespace </span>libdap {
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 <span class="comment">// Private member functions</span>
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="keywordtype">void</span>
<a name="l00057"></a><a class="code" href="classlibdap_1_1Constructor.html#a81c19aba3541299630c39bfb298522d7">00057</a> Constructor::_duplicate(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a> &amp;)
<a name="l00058"></a>00058 {}
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="comment">// Public member functions</span>
<a name="l00061"></a>00061 
<a name="l00062"></a><a class="code" href="classlibdap_1_1Constructor.html#a0924ca371d5e957a153c4d8732b2a0c5">00062</a> Constructor::Constructor(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n, <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6" title="Identifies the data type.">Type</a> &amp;t)
<a name="l00063"></a>00063         : <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a>(n, t)
<a name="l00064"></a>00064 {}
<a name="l00065"></a>00065 
<a name="l00076"></a><a class="code" href="classlibdap_1_1Constructor.html#a04c18b27e2afa0a0309153e766f39151">00076</a> Constructor::Constructor(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;d, <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6" title="Identifies the data type.">Type</a> &amp;t)
<a name="l00077"></a>00077         : <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a>(n, d, t)
<a name="l00078"></a>00078 {}
<a name="l00079"></a>00079 
<a name="l00080"></a><a class="code" href="classlibdap_1_1Constructor.html#a483aa6ff5e9ea1f6b9e8d3ca617ebb54">00080</a> Constructor::Constructor(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a> &amp;rhs) : <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a>(rhs)
<a name="l00081"></a>00081 {}
<a name="l00082"></a>00082 
<a name="l00083"></a><a class="code" href="classlibdap_1_1Constructor.html#aa948f77ae2fc511e348717e065562f32">00083</a> <a class="code" href="classlibdap_1_1Constructor.html#aa948f77ae2fc511e348717e065562f32">Constructor::~Constructor</a>()
<a name="l00084"></a>00084 {}
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a> &amp;
<a name="l00087"></a><a class="code" href="classlibdap_1_1Constructor.html#ae01fd846f387bcb51643407574fce6d8">00087</a> <a class="code" href="classlibdap_1_1Constructor.html#ae01fd846f387bcb51643407574fce6d8">Constructor::operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Constructor.html">Constructor</a> &amp;rhs)
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089     <span class="keywordflow">if</span> (<span class="keyword">this</span> == &amp;rhs)
<a name="l00090"></a>00090         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00091"></a>00091 
<a name="l00092"></a>00092     <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> &amp;<span class="keyword">&gt;</span>(*this) = rhs; <span class="comment">// run BaseType=</span>
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <a class="code" href="classlibdap_1_1Constructor.html#a81c19aba3541299630c39bfb298522d7">_duplicate</a>(rhs);
<a name="l00095"></a>00095 
<a name="l00096"></a>00096     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098 
<a name="l00100"></a>00100 <a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Constructor::Vars_iter</a>
<a name="l00101"></a><a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">00101</a> <a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">Constructor::var_begin</a>()
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin() ;
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105 
<a name="l00121"></a>00121 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00122"></a>00122 Constructor::find_hdf4_dimension_attribute_home(<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">AttrTable::entry</a> *source)
<a name="l00123"></a>00123 {
<a name="l00124"></a>00124     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *btp;
<a name="l00125"></a>00125     string::size_type i = source-&gt;<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#a36ed731e3d0e620c41157ee8bd96bc42">name</a>.find(<span class="stringliteral">&quot;_dim_&quot;</span>);
<a name="l00126"></a>00126     <span class="keywordflow">if</span> (i != string::npos &amp;&amp; (btp = <a class="code" href="classlibdap_1_1BaseType.html#a4dc4fac1bb6083f6db645f37bfd59b85" title="Returns a pointer to a member of a constructor class.">var</a>(source-&gt;<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#a36ed731e3d0e620c41157ee8bd96bc42">name</a>.substr(0, i)))) {
<a name="l00127"></a>00127         <span class="keywordflow">if</span> (btp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#ad1d57be80c8e89b8a9e59bed48779556" title="Returns true if the instance is a vector (i.e., array) type variable.">is_vector_type</a>()) {
<a name="l00128"></a>00128             <span class="keywordflow">return</span> btp;
<a name="l00129"></a>00129         }
<a name="l00130"></a>00130         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (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#a05ca706d4539ae7b750c3bc7066ab6e6ac41525d2e860d3bcff641eb1fdba41d2">dods_grid_c</a>) {
<a name="l00131"></a>00131             <span class="comment">// For a Grid, the hdf4 handler uses _dim_n for the n-th Map</span>
<a name="l00132"></a>00132             <span class="comment">// i+5 points to the character holding &#39;n&#39;</span>
<a name="l00133"></a>00133             <span class="keywordtype">int</span> n = atoi(source-&gt;<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#a36ed731e3d0e620c41157ee8bd96bc42">name</a>.substr(i + 5).c_str());
<a name="l00134"></a>00134             <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Found a Grid (&quot;</span> &lt;&lt; btp-&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;) and &quot;</span>
<a name="l00135"></a>00135                 &lt;&lt; source-&gt;<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#a36ed731e3d0e620c41157ee8bd96bc42">name</a>.substr(i) &lt;&lt; <span class="stringliteral">&quot;, extracted n: &quot;</span> &lt;&lt; n &lt;&lt; endl);
<a name="l00136"></a>00136             <span class="keywordflow">return</span> *(<span class="keyword">dynamic_cast&lt;</span>Grid&amp;<span class="keyword">&gt;</span>(*btp).map_begin() + n);
<a name="l00137"></a>00137         }
<a name="l00138"></a>00138     }
<a name="l00139"></a>00139 
<a name="l00140"></a>00140     <span class="keywordflow">return</span> 0;
<a name="l00141"></a>00141 }
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 <span class="preprocessor">#if 0</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span>
<a name="l00146"></a>00146 AttrTable *
<a name="l00147"></a>00147 Constructor::find_matching_container(AttrTable::entry *source,
<a name="l00148"></a>00148                                      BaseType **dest_variable)
<a name="l00149"></a>00149 {
<a name="l00150"></a>00150     <span class="comment">// The attribute entry &#39;source&#39; must be a container</span>
<a name="l00151"></a>00151     <span class="keywordflow">if</span> (source-&gt;type != <a class="code" href="namespacelibdap.html#ae4f907cc24469ce7b0fef9e3d7758d2aa0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>)
<a name="l00152"></a>00152         <span class="keywordflow">throw</span> InternalErr(__FILE__, __LINE__, <span class="stringliteral">&quot;Constructor::find_matching_container&quot;</span>);
<a name="l00153"></a>00153 
<a name="l00154"></a>00154     <span class="comment">// Use the name of the attribute container &#39;source&#39; to figure out where</span>
<a name="l00155"></a>00155     <span class="comment">// to put its contents.</span>
<a name="l00156"></a>00156     <a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822" title="The BaseType constructor.">BaseType</a> *btp;
<a name="l00157"></a>00157     <span class="keywordflow">if</span> ((btp = <a class="code" href="classlibdap_1_1BaseType.html#a4dc4fac1bb6083f6db645f37bfd59b85" title="Returns a pointer to a member of a constructor class.">var</a>(source-&gt;name))) {
<a name="l00158"></a>00158         <span class="comment">// ... matches a variable name? Use var&#39;s table</span>
<a name="l00159"></a>00159         *dest_variable = btp;
<a name="l00160"></a>00160         <span class="keywordflow">return</span> &amp;btp-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>();
<a name="l00161"></a>00161     }
<a name="l00162"></a>00162     <span class="comment">// As more special-case attribute containers come to light, add clauses</span>
<a name="l00163"></a>00163     <span class="comment">// here.</span>
<a name="l00164"></a>00164     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((btp = find_hdf4_dimension_attribute_home(source))) {
<a name="l00165"></a>00165         <span class="comment">// ... hdf4 dimension attribute? Make a sub table and use that.</span>
<a name="l00166"></a>00166         <span class="comment">// btp can only be an Array or a Grid Map (which is an array)</span>
<a name="l00167"></a>00167         <span class="keywordflow">if</span> (btp-&gt;get_parent()-&gt;type() == <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ac41525d2e860d3bcff641eb1fdba41d2">dods_grid_c</a>) {
<a name="l00168"></a>00168             <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Found a Grid&quot;</span> &lt;&lt; endl);
<a name="l00169"></a>00169             *dest_variable = btp;
<a name="l00170"></a>00170             <span class="keywordflow">return</span> &amp;btp-&gt;get_attr_table();
<a name="l00171"></a>00171         }
<a name="l00172"></a>00172         <span class="keywordflow">else</span> { <span class="comment">// must be a plain Array</span>
<a name="l00173"></a>00173             string::size_type i = source-&gt;name.find(<span class="stringliteral">&quot;_dim_&quot;</span>);
<a name="l00174"></a>00174             <span class="keywordtype">string</span> ext = source-&gt;name.substr(i + 1);
<a name="l00175"></a>00175             *dest_variable = btp;
<a name="l00176"></a>00176             <span class="keywordflow">return</span> btp-&gt;get_attr_table().append_container(ext);
<a name="l00177"></a>00177         }
<a name="l00178"></a>00178     }
<a name="l00179"></a>00179     <span class="keywordflow">else</span> {
<a name="l00180"></a>00180         <span class="comment">// ... otherwise assume it&#39;s a global attribute.</span>
<a name="l00181"></a>00181         AttrTable *at = <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().find_container(source-&gt;name);
<a name="l00182"></a>00182         <span class="keywordflow">if</span> (!at) {
<a name="l00183"></a>00183             at = <span class="keyword">new</span> AttrTable();       <span class="comment">// Make a new global table if needed</span>
<a name="l00184"></a>00184             <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().append_container(at, source-&gt;name);
<a name="l00185"></a>00185         }
<a name="l00186"></a>00186 
<a name="l00187"></a>00187         *dest_variable = 0;
<a name="l00188"></a>00188         <span class="keywordflow">return</span> at;
<a name="l00189"></a>00189     }
<a name="l00190"></a>00190 }
<a name="l00191"></a>00191 <span class="preprocessor">#endif</span>
<a name="l00192"></a>00192 <span class="preprocessor"></span><span class="preprocessor">#if 0</span>
<a name="l00193"></a>00193 <span class="preprocessor"></span>
<a name="l00210"></a>00210 <span class="keywordtype">void</span>
<a name="l00211"></a>00211 <a class="code" href="classlibdap_1_1Constructor.html#a6ec34211fae83a2a39a32d8c002bc185">Constructor::transfer_attributes</a>(AttrTable::entry * entry)
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Constructor::transfer_attributes, variable: &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;
<a name="l00214"></a>00214         endl);
<a name="l00215"></a>00215     <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Working on the &#39;&quot;</span> &lt;&lt; entry-&gt;
<a name="l00216"></a>00216         <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;&#39; container.&quot;</span> &lt;&lt; endl);
<a name="l00217"></a>00217     <span class="keywordflow">if</span> (entry-&gt;type != <a class="code" href="namespacelibdap.html#ae4f907cc24469ce7b0fef9e3d7758d2aa0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>)
<a name="l00218"></a>00218         <span class="keywordflow">throw</span> InternalErr(__FILE__, __LINE__,
<a name="l00219"></a>00219                           <span class="stringliteral">&quot;Constructor::transfer_attributes&quot;</span>);
<a name="l00220"></a>00220 
<a name="l00221"></a>00221     AttrTable *source = entry-&gt;attributes;
<a name="l00222"></a>00222     <a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822" title="The BaseType constructor.">BaseType</a> *dest_variable = 0;
<a name="l00223"></a>00223     AttrTable *dest = find_matching_container(entry, &amp;dest_variable);
<a name="l00224"></a>00224 
<a name="l00225"></a>00225     <span class="comment">// foreach source attribute in the das_i container</span>
<a name="l00226"></a>00226     <a class="code" href="classlibdap_1_1AttrTable.html#a3647edf8906b672bad7a8c5ffc81d62a">AttrTable::Attr_iter</a> source_p = source-&gt;attr_begin();
<a name="l00227"></a>00227     <span class="keywordflow">while</span> (source_p != source-&gt;attr_end()) {
<a name="l00228"></a>00228         <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr &lt;&lt; <span class="stringliteral">&quot;Working on the &#39;&quot;</span> &lt;&lt; (*source_p)-&gt;
<a name="l00229"></a>00229             <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;&#39; attribute&quot;</span> &lt;&lt; endl);
<a name="l00230"></a>00230 
<a name="l00231"></a>00231         <span class="keywordflow">if</span> ((*source_p)-&gt;type == <a class="code" href="namespacelibdap.html#ae4f907cc24469ce7b0fef9e3d7758d2aa0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>) {
<a name="l00232"></a>00232             <span class="keywordflow">if</span> (dest_variable &amp;&amp; dest_variable-&gt;is_constructor_type()) {
<a name="l00233"></a>00233                 dynamic_cast &lt;Constructor &amp; &gt;(*dest_variable).transfer_attributes(*source_p);
<a name="l00234"></a>00234             }
<a name="l00235"></a>00235             <span class="keywordflow">else</span> {
<a name="l00236"></a>00236                 dest-&gt;append_container(<span class="keyword">new</span> AttrTable(*(*source_p)-&gt;attributes),
<a name="l00237"></a>00237                                        (*source_p)-&gt;name);
<a name="l00238"></a>00238             }
<a name="l00239"></a>00239         }
<a name="l00240"></a>00240         <span class="keywordflow">else</span> {
<a name="l00241"></a>00241             dest-&gt;append_attr(source-&gt;get_name(source_p),
<a name="l00242"></a>00242                               source-&gt;get_type(source_p),
<a name="l00243"></a>00243                               source-&gt;get_attr_vector(source_p));
<a name="l00244"></a>00244         }
<a name="l00245"></a>00245 
<a name="l00246"></a>00246         ++source_p;
<a name="l00247"></a>00247     }
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 <span class="preprocessor">#endif</span>
<a name="l00250"></a>00250 <span class="preprocessor"></span>
<a name="l00260"></a><a class="code" href="classlibdap_1_1Constructor.html#a6ec34211fae83a2a39a32d8c002bc185">00260</a> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Constructor.html#a6ec34211fae83a2a39a32d8c002bc185">Constructor::transfer_attributes</a>(<a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at_container)
<a name="l00261"></a>00261 {
<a name="l00262"></a>00262     <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at = at_container-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a4010172de5c41cd88f2422d5e1975522" title="Get an attribute container.">get_attr_table</a>(<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>());
<a name="l00263"></a>00263 
<a name="l00264"></a>00264     <span class="keywordflow">if</span> (at) {
<a name="l00265"></a>00265         at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#aadba23c830a02aa19c24c2a6f442dfd2">set_is_global_attribute</a>(<span class="keyword">false</span>);
<a name="l00266"></a>00266 
<a name="l00267"></a>00267         <a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Vars_iter</a> <a class="code" href="classlibdap_1_1BaseType.html#a4dc4fac1bb6083f6db645f37bfd59b85" title="Returns a pointer to a member of a constructor class.">var</a> = <a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>();
<a name="l00268"></a>00268         <span class="keywordflow">while</span> (var != <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>()) {
<a name="l00269"></a>00269             (*var)-&gt;transfer_attributes(at);
<a name="l00270"></a>00270             var++;
<a name="l00271"></a>00271         }
<a name="l00272"></a>00272 
<a name="l00273"></a>00273         <span class="comment">// Trick: If an attribute that&#39;s within the container &#39;at&#39; still has its</span>
<a name="l00274"></a>00274         <span class="comment">// is_global_attribute property set, then it&#39;s not really a global attr</span>
<a name="l00275"></a>00275         <span class="comment">// but instead an attribute that belongs to this Constructor.</span>
<a name="l00276"></a>00276         <a class="code" href="classlibdap_1_1AttrTable.html#a3647edf8906b672bad7a8c5ffc81d62a">AttrTable::Attr_iter</a> at_p = at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a8881bb7044577dae3098f4a1d8bf4f2f">attr_begin</a>();
<a name="l00277"></a>00277         <span class="keywordflow">while</span> (at_p != at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a543955729bad6b7a9d1d6b336596b1ba">attr_end</a>()) {
<a name="l00278"></a>00278             <span class="keywordflow">if</span> (at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a2906fea416b22dcdf96df9eb5e21258a">is_global_attribute</a>(at_p)) {
<a name="l00279"></a>00279                 <span class="keywordflow">if</span> (at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#aefcd82370930ba94a288f135d9417a93" title="Get the type of an attribute.">get_attr_type</a>(at_p) == <a class="code" href="namespacelibdap.html#ae4f907cc24469ce7b0fef9e3d7758d2aa0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>)
<a name="l00280"></a>00280                     <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().<a class="code" href="classlibdap_1_1AttrTable.html#a03f3a1197f9529d4c0328830c765cfe1" title="Add a container to the attribute table.">append_container</a>(<span class="keyword">new</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a>(
<a name="l00281"></a>00281                             *at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a4010172de5c41cd88f2422d5e1975522" title="Get an attribute container.">get_attr_table</a>(at_p)), at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>(at_p));
<a name="l00282"></a>00282                 <span class="keywordflow">else</span>
<a name="l00283"></a>00283                     <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().<a class="code" href="classlibdap_1_1AttrTable.html#a7a526505d174c7a2f33e6b57761f8bc4" title="Add an attribute to the table.">append_attr</a>(at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>(at_p),
<a name="l00284"></a>00284                             at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a689563c3beb8e6f571387c5105821f27" title="Get the type name of an attribute within this attribute table.">get_type</a>(at_p), at-&gt;<a class="code" href="classlibdap_1_1AttrTable.html#a7352d886789e9e38d530fc44c6cbef30" title="Get a vector-valued attribute.">get_attr_vector</a>(at_p));
<a name="l00285"></a>00285             }
<a name="l00286"></a>00286             at_p++;
<a name="l00287"></a>00287         }
<a name="l00288"></a>00288 
<a name="l00289"></a>00289     }
<a name="l00290"></a>00290 }
<a name="l00291"></a>00291 
<a name="l00294"></a>00294 <a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Constructor::Vars_iter</a>
<a name="l00295"></a><a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">00295</a> <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">Constructor::var_end</a>()
<a name="l00296"></a>00296 {
<a name="l00297"></a>00297     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end() ;
<a name="l00298"></a>00298 }
<a name="l00299"></a>00299 
<a name="l00301"></a>00301 <a class="code" href="classlibdap_1_1Constructor.html#a6122400e3f40d457751fb0372a650d03">Constructor::Vars_riter</a>
<a name="l00302"></a><a class="code" href="classlibdap_1_1Constructor.html#aa025cf546ca35250454653c1ec684d91">00302</a> <a class="code" href="classlibdap_1_1Constructor.html#aa025cf546ca35250454653c1ec684d91">Constructor::var_rbegin</a>()
<a name="l00303"></a>00303 {
<a name="l00304"></a>00304     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.rbegin();
<a name="l00305"></a>00305 }
<a name="l00306"></a>00306 
<a name="l00309"></a>00309 <a class="code" href="classlibdap_1_1Constructor.html#a6122400e3f40d457751fb0372a650d03">Constructor::Vars_riter</a>
<a name="l00310"></a><a class="code" href="classlibdap_1_1Constructor.html#aede7cf5889e101db1ea8f22c3a84a5d3">00310</a> <a class="code" href="classlibdap_1_1Constructor.html#aede7cf5889e101db1ea8f22c3a84a5d3">Constructor::var_rend</a>()
<a name="l00311"></a>00311 {
<a name="l00312"></a>00312     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.rend();
<a name="l00313"></a>00313 }
<a name="l00314"></a>00314 
<a name="l00318"></a>00318 <a class="code" href="classlibdap_1_1Constructor.html#a2b73df890f61ebb628359c8fd12839b0">Constructor::Vars_iter</a>
<a name="l00319"></a><a class="code" href="classlibdap_1_1Constructor.html#a1e6d8224e04d75e3d2a21263957cd42f">00319</a> <a class="code" href="classlibdap_1_1Constructor.html#a1e6d8224e04d75e3d2a21263957cd42f">Constructor::get_vars_iter</a>(<span class="keywordtype">int</span> i)
<a name="l00320"></a>00320 {
<a name="l00321"></a>00321     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin() + i;
<a name="l00322"></a>00322 }
<a name="l00323"></a>00323 
<a name="l00327"></a>00327 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00328"></a><a class="code" href="classlibdap_1_1Constructor.html#ac2b4b28ed9d6f435129aa599ab809799">00328</a> <a class="code" href="classlibdap_1_1Constructor.html#ac2b4b28ed9d6f435129aa599ab809799">Constructor::get_var_index</a>(<span class="keywordtype">int</span> i)
<a name="l00329"></a>00329 {
<a name="l00330"></a>00330     <span class="keywordflow">return</span> *(<a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin() + i);
<a name="l00331"></a>00331 }
<a name="l00332"></a>00332 
<a name="l00333"></a>00333 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l00334"></a>00334 <span class="preprocessor"></span><span class="keywordtype">void</span>
<a name="l00335"></a>00335 <a class="code" href="classlibdap_1_1Constructor.html#ab7fb094be8da2a9f80f6d3b85e452934" title="Print an ASCII representation of the variable structure.">Constructor::print_decl</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_semi,
<a name="l00336"></a>00336                         <span class="keywordtype">bool</span> constraint_info, <span class="keywordtype">bool</span> constrained)
<a name="l00337"></a>00337 {
<a name="l00338"></a>00338     <span class="keywordflow">if</span> (constrained &amp;&amp; !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>())
<a name="l00339"></a>00339         <span class="keywordflow">return</span>;
<a name="l00340"></a>00340 
<a name="l00341"></a>00341     fprintf(out, <span class="stringliteral">&quot;%s%s {\n&quot;</span>, space.c_str(), <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>().c_str()) ;
<a name="l00342"></a>00342     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a5a585c58a099833c4ca26561963e0f83">Vars_citer</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="l00343"></a>00343         (*i)-&gt;print_decl(out, space + <span class="stringliteral">&quot;    &quot;</span>, <span class="keyword">true</span>,
<a name="l00344"></a>00344                          constraint_info, constrained);
<a name="l00345"></a>00345     }
<a name="l00346"></a>00346     fprintf(out, <span class="stringliteral">&quot;%s} %s&quot;</span>, space.c_str(), <a class="code" href="namespacelibdap.html#afbd709ed83699c11234a213463d16b9c">id2www</a>(<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()).c_str()) ;
<a name="l00347"></a>00347 
<a name="l00348"></a>00348     <span class="keywordflow">if</span> (constraint_info) { <span class="comment">// Used by test drivers only.</span>
<a name="l00349"></a>00349         <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>())
<a name="l00350"></a>00350             cout &lt;&lt; <span class="stringliteral">&quot;: Send True&quot;</span>;
<a name="l00351"></a>00351         <span class="keywordflow">else</span>
<a name="l00352"></a>00352             cout &lt;&lt; <span class="stringliteral">&quot;: Send False&quot;</span>;
<a name="l00353"></a>00353     }
<a name="l00354"></a>00354 
<a name="l00355"></a>00355     <span class="keywordflow">if</span> (print_semi)
<a name="l00356"></a>00356         fprintf(out, <span class="stringliteral">&quot;;\n&quot;</span>) ;
<a name="l00357"></a>00357 }
<a name="l00358"></a>00358 <span class="preprocessor">#endif</span>
<a name="l00359"></a>00359 <span class="preprocessor"></span>
<a name="l00360"></a>00360 <span class="keywordtype">void</span>
<a name="l00361"></a><a class="code" href="classlibdap_1_1Constructor.html#ab7fb094be8da2a9f80f6d3b85e452934">00361</a> <a class="code" href="classlibdap_1_1Constructor.html#ab7fb094be8da2a9f80f6d3b85e452934" title="Print an ASCII representation of the variable structure.">Constructor::print_decl</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_semi,
<a name="l00362"></a>00362                         <span class="keywordtype">bool</span> constraint_info, <span class="keywordtype">bool</span> constrained)
<a name="l00363"></a>00363 {
<a name="l00364"></a>00364     <span class="keywordflow">if</span> (constrained &amp;&amp; !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>())
<a name="l00365"></a>00365         <span class="keywordflow">return</span>;
<a name="l00366"></a>00366 
<a name="l00367"></a>00367     out &lt;&lt; space &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() &lt;&lt; <span class="stringliteral">&quot; {\n&quot;</span> ;
<a name="l00368"></a>00368     <span class="keywordflow">for</span> (<a class="code" href="classlibdap_1_1Constructor.html#a5a585c58a099833c4ca26561963e0f83">Vars_citer</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="l00369"></a>00369         (*i)-&gt;print_decl(out, space + <span class="stringliteral">&quot;    &quot;</span>, <span class="keyword">true</span>,
<a name="l00370"></a>00370                          constraint_info, constrained);
<a name="l00371"></a>00371     }
<a name="l00372"></a>00372     out &lt;&lt; space &lt;&lt; <span class="stringliteral">&quot;} &quot;</span> &lt;&lt; <a class="code" href="namespacelibdap.html#afbd709ed83699c11234a213463d16b9c">id2www</a>(<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()) ;
<a name="l00373"></a>00373 
<a name="l00374"></a>00374     <span class="keywordflow">if</span> (constraint_info) { <span class="comment">// Used by test drivers only.</span>
<a name="l00375"></a>00375         <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>())
<a name="l00376"></a>00376             out &lt;&lt; <span class="stringliteral">&quot;: Send True&quot;</span>;
<a name="l00377"></a>00377         <span class="keywordflow">else</span>
<a name="l00378"></a>00378             out &lt;&lt; <span class="stringliteral">&quot;: Send False&quot;</span>;
<a name="l00379"></a>00379     }
<a name="l00380"></a>00380 
<a name="l00381"></a>00381     <span class="keywordflow">if</span> (print_semi)
<a name="l00382"></a>00382         out &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span> ;
<a name="l00383"></a>00383 }
<a name="l00384"></a>00384 
<a name="l00385"></a>00385 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l00386"></a>00386 <span class="preprocessor"></span><span class="keyword">class </span>PrintField : <span class="keyword">public</span> unary_function&lt;BaseType *, void&gt;
<a name="l00387"></a>00387 {
<a name="l00388"></a>00388     FILE *d_out;
<a name="l00389"></a>00389     <span class="keywordtype">string</span> d_space;
<a name="l00390"></a>00390     <span class="keywordtype">bool</span> d_constrained;
<a name="l00391"></a>00391 <span class="keyword">public</span>:
<a name="l00392"></a>00392     PrintField(FILE *o, <span class="keywordtype">string</span> s, <span class="keywordtype">bool</span> c)
<a name="l00393"></a>00393             : d_out(o), d_space(s), d_constrained(c)
<a name="l00394"></a>00394     {}
<a name="l00395"></a>00395 
<a name="l00396"></a>00396     <span class="keywordtype">void</span> operator()(BaseType *btp)
<a name="l00397"></a>00397     {
<a name="l00398"></a>00398         btp-&gt;print_xml(d_out, d_space, d_constrained);
<a name="l00399"></a>00399     }
<a name="l00400"></a>00400 };
<a name="l00401"></a>00401 
<a name="l00402"></a>00402 <span class="keywordtype">void</span>
<a name="l00403"></a>00403 <a class="code" href="classlibdap_1_1Constructor.html#a32de0413045173aa8803f540a6cea39b">Constructor::print_xml</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> constrained)
<a name="l00404"></a>00404 {
<a name="l00405"></a>00405     <span class="keywordflow">if</span> (constrained &amp;&amp; !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>())
<a name="l00406"></a>00406         <span class="keywordflow">return</span>;
<a name="l00407"></a>00407 
<a name="l00408"></a>00408     <span class="keywordtype">bool</span> has_attributes = <span class="keyword">false</span>; <span class="comment">// *** fix me</span>
<a name="l00409"></a>00409     <span class="keywordtype">bool</span> has_variables = (<a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>() != <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>());
<a name="l00410"></a>00410 
<a name="l00411"></a>00411     fprintf(out, <span class="stringliteral">&quot;%s&lt;%s&quot;</span>, space.c_str(), <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>().c_str());
<a name="l00412"></a>00412     <span class="keywordflow">if</span> (!<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>().empty())
<a name="l00413"></a>00413         fprintf(out, <span class="stringliteral">&quot; name=\&quot;%s\&quot;&quot;</span>, <a class="code" href="namespacelibdap.html#a62463a13bf510db3a14c0053fea14f4d">id2xml</a>(<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>()).c_str());
<a name="l00414"></a>00414 
<a name="l00415"></a>00415     <span class="keywordflow">if</span> (has_attributes || has_variables) {
<a name="l00416"></a>00416         fprintf(out, <span class="stringliteral">&quot;&gt;\n&quot;</span>);
<a name="l00417"></a>00417 
<a name="l00418"></a>00418         <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().print_xml(out, space + <span class="stringliteral">&quot;    &quot;</span>, constrained);
<a name="l00419"></a>00419 
<a name="l00420"></a>00420         for_each(<a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>(), <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>(),
<a name="l00421"></a>00421                  PrintField(out, space + <span class="stringliteral">&quot;    &quot;</span>, constrained));
<a name="l00422"></a>00422 
<a name="l00423"></a>00423         fprintf(out, <span class="stringliteral">&quot;%s&lt;/%s&gt;\n&quot;</span>, space.c_str(), <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>().c_str());
<a name="l00424"></a>00424     }
<a name="l00425"></a>00425     <span class="keywordflow">else</span> {
<a name="l00426"></a>00426         fprintf(out, <span class="stringliteral">&quot;/&gt;\n&quot;</span>);
<a name="l00427"></a>00427     }
<a name="l00428"></a>00428 }
<a name="l00429"></a>00429 <span class="preprocessor">#endif</span>
<a name="l00430"></a>00430 <span class="preprocessor"></span>
<a name="l00431"></a>00431 <span class="keyword">class </span>PrintFieldStrm : <span class="keyword">public</span> unary_function&lt;BaseType *, void&gt;
<a name="l00432"></a>00432 {
<a name="l00433"></a>00433     ostream &amp;d_out;
<a name="l00434"></a>00434     <span class="keywordtype">string</span> d_space;
<a name="l00435"></a>00435     <span class="keywordtype">bool</span> d_constrained;
<a name="l00436"></a>00436 <span class="keyword">public</span>:
<a name="l00437"></a>00437     PrintFieldStrm(ostream &amp;o, <span class="keywordtype">string</span> s, <span class="keywordtype">bool</span> c)
<a name="l00438"></a>00438             : d_out(o), d_space(s), d_constrained(c)
<a name="l00439"></a>00439     {}
<a name="l00440"></a>00440 
<a name="l00441"></a>00441     <span class="keywordtype">void</span> operator()(BaseType *btp)
<a name="l00442"></a>00442     {
<a name="l00443"></a>00443         btp-&gt;print_xml(d_out, d_space, d_constrained);
<a name="l00444"></a>00444     }
<a name="l00445"></a>00445 };
<a name="l00446"></a>00446 
<a name="l00447"></a>00447 <span class="keywordtype">void</span>
<a name="l00448"></a><a class="code" href="classlibdap_1_1Constructor.html#a32de0413045173aa8803f540a6cea39b">00448</a> <a class="code" href="classlibdap_1_1Constructor.html#a32de0413045173aa8803f540a6cea39b">Constructor::print_xml</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> constrained)
<a name="l00449"></a>00449 {
<a name="l00450"></a>00450     <span class="keywordflow">if</span> (constrained &amp;&amp; !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>())
<a name="l00451"></a>00451         <span class="keywordflow">return</span>;
<a name="l00452"></a>00452 
<a name="l00453"></a>00453     <span class="keywordtype">bool</span> has_attributes = <span class="keyword">false</span>; <span class="comment">// *** fix me</span>
<a name="l00454"></a>00454     <span class="keywordtype">bool</span> has_variables = (<a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>() != <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>());
<a name="l00455"></a>00455 
<a name="l00456"></a>00456     out &lt;&lt; space &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() ;
<a name="l00457"></a>00457     <span class="keywordflow">if</span> (!<a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>().empty())
<a name="l00458"></a>00458         out &lt;&lt; <span class="stringliteral">&quot; name=\&quot;&quot;</span> &lt;&lt; <a class="code" href="namespacelibdap.html#a62463a13bf510db3a14c0053fea14f4d">id2xml</a>(<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;&quot;</span> ;
<a name="l00459"></a>00459 
<a name="l00460"></a>00460     <span class="keywordflow">if</span> (has_attributes || has_variables) {
<a name="l00461"></a>00461         out &lt;&lt; <span class="stringliteral">&quot;&gt;\n&quot;</span> ;
<a name="l00462"></a>00462 
<a name="l00463"></a>00463         <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().<a class="code" href="classlibdap_1_1AttrTable.html#a5e27ea09f83831eded1b3d86de7f4534">print_xml</a>(out, space + <span class="stringliteral">&quot;    &quot;</span>, constrained);
<a name="l00464"></a>00464 
<a name="l00465"></a>00465         for_each(<a class="code" href="classlibdap_1_1Constructor.html#adeafe3d6c82d07b456a598a7b446c2c6">var_begin</a>(), <a class="code" href="classlibdap_1_1Constructor.html#a936b38c7c35ffb4fe17c5b8e85bdaaa2">var_end</a>(),
<a name="l00466"></a>00466                  PrintFieldStrm(out, space + <span class="stringliteral">&quot;    &quot;</span>, constrained));
<a name="l00467"></a>00467 
<a name="l00468"></a>00468         out &lt;&lt; space &lt;&lt; <span class="stringliteral">&quot;&lt;/&quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() &lt;&lt; <span class="stringliteral">&quot;&gt;\n&quot;</span> ;
<a name="l00469"></a>00469     }
<a name="l00470"></a>00470     <span class="keywordflow">else</span> {
<a name="l00471"></a>00471         out &lt;&lt; <span class="stringliteral">&quot;/&gt;\n&quot;</span> ;
<a name="l00472"></a>00472     }
<a name="l00473"></a>00473 }
<a name="l00474"></a>00474 
<a name="l00487"></a>00487 <span class="keywordtype">bool</span>
<a name="l00488"></a><a class="code" href="classlibdap_1_1Constructor.html#af26f89e9c0732a9c32bd5e15d716a7d7">00488</a> <a class="code" href="classlibdap_1_1Constructor.html#af26f89e9c0732a9c32bd5e15d716a7d7" title="Check to see whether this variable can be printed simply.">Constructor::is_linear</a>()
<a name="l00489"></a>00489 {
<a name="l00490"></a>00490     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00491"></a>00491 }
<a name="l00492"></a>00492 
<a name="l00501"></a>00501 <span class="keywordtype">void</span>
<a name="l00502"></a><a class="code" href="classlibdap_1_1Constructor.html#af411561f4f57c632b4d0a6f091f98ce4">00502</a> <a class="code" href="classlibdap_1_1Constructor.html#af411561f4f57c632b4d0a6f091f98ce4" title="dumps information about this object">Constructor::dump</a>(ostream &amp;strm)<span class="keyword"> const</span>
<a name="l00503"></a>00503 <span class="keyword"></span>{
<a name="l00504"></a>00504     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;Constructor::dump - (&quot;</span>
<a name="l00505"></a>00505     &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="l00506"></a>00506     <a class="code" href="classlibdap_1_1DapIndent.html#a4ed2cce66dbff9ad4320e89142103c6c">DapIndent::Indent</a>() ;
<a name="l00507"></a>00507     <a class="code" href="classlibdap_1_1Constructor.html#af411561f4f57c632b4d0a6f091f98ce4" title="dumps information about this object">BaseType::dump</a>(strm) ;
<a name="l00508"></a>00508     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;vars: &quot;</span> &lt;&lt; endl ;
<a name="l00509"></a>00509     DapIndent::Indent() ;
<a name="l00510"></a>00510     <a class="code" href="classlibdap_1_1Constructor.html#a5a585c58a099833c4ca26561963e0f83">Vars_citer</a> i = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.begin() ;
<a name="l00511"></a>00511     <a class="code" href="classlibdap_1_1Constructor.html#a5a585c58a099833c4ca26561963e0f83">Vars_citer</a> ie = <a class="code" href="classlibdap_1_1Constructor.html#ac9830d0abf882c915fe714e127b48b55">_vars</a>.end() ;
<a name="l00512"></a>00512     <span class="keywordflow">for</span> (; i != ie; i++) {
<a name="l00513"></a>00513         (*i)-&gt;dump(strm) ;
<a name="l00514"></a>00514     }
<a name="l00515"></a>00515     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ;
<a name="l00516"></a>00516     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ;
<a name="l00517"></a>00517 }
<a name="l00518"></a>00518 
<a name="l00519"></a>00519 } <span class="comment">// namespace libdap</span>
<a name="l00520"></a>00520 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="Constructor_8cc.html">Constructor.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>