<!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++: BaseType.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++ <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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File 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('BaseType_8cc.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <h1>BaseType.cc</h1> </div> </div> <div class="contents"> <a href="BaseType_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 <jgallagher@opendap.org></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 1994-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 <jgallagher@gso.uri.edu></span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="comment">// Implementation for BaseType.</span> <a name="l00033"></a>00033 <span class="comment">//</span> <a name="l00034"></a>00034 <span class="comment">// jhrg 9/6/94</span> <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="config_8h.html">config.h</a>"</span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="preprocessor">#include <cstdio></span> <span class="comment">// for stdin and stdout</span> <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="preprocessor">#include <sstream></span> <a name="l00041"></a>00041 <span class="preprocessor">#include <string></span> <a name="l00042"></a>00042 <a name="l00043"></a>00043 <span class="comment">//#define DODS_DEBUG</span> <a name="l00044"></a>00044 <a name="l00045"></a>00045 <span class="preprocessor">#include "<a class="code" href="BaseType_8h.html">BaseType.h</a>"</span> <a name="l00046"></a>00046 <span class="preprocessor">#include "<a class="code" href="Byte_8h.html">Byte.h</a>"</span> <a name="l00047"></a>00047 <span class="preprocessor">#include "<a class="code" href="Int16_8h.html">Int16.h</a>"</span> <a name="l00048"></a>00048 <span class="preprocessor">#include "<a class="code" href="UInt16_8h.html">UInt16.h</a>"</span> <a name="l00049"></a>00049 <span class="preprocessor">#include "<a class="code" href="Int32_8h.html">Int32.h</a>"</span> <a name="l00050"></a>00050 <span class="preprocessor">#include "<a class="code" href="UInt32_8h.html">UInt32.h</a>"</span> <a name="l00051"></a>00051 <span class="preprocessor">#include "<a class="code" href="Float32_8h.html">Float32.h</a>"</span> <a name="l00052"></a>00052 <span class="preprocessor">#include "<a class="code" href="Float64_8h.html">Float64.h</a>"</span> <a name="l00053"></a>00053 <span class="preprocessor">#include "<a class="code" href="Str_8h.html">Str.h</a>"</span> <a name="l00054"></a>00054 <span class="preprocessor">#include "<a class="code" href="Url_8h.html">Url.h</a>"</span> <a name="l00055"></a>00055 <span class="preprocessor">#include "<a class="code" href="Array_8h.html">Array.h</a>"</span> <a name="l00056"></a>00056 <span class="preprocessor">#include "<a class="code" href="Structure_8h.html">Structure.h</a>"</span> <a name="l00057"></a>00057 <span class="preprocessor">#include "<a class="code" href="Sequence_8h.html">Sequence.h</a>"</span> <a name="l00058"></a>00058 <span class="preprocessor">#include "<a class="code" href="Grid_8h.html">Grid.h</a>"</span> <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="preprocessor">#include "<a class="code" href="InternalErr_8h.html">InternalErr.h</a>"</span> <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="preprocessor">#include "<a class="code" href="util_8h.html">util.h</a>"</span> <a name="l00063"></a>00063 <span class="preprocessor">#include "<a class="code" href="escaping_8h.html">escaping.h</a>"</span> <a name="l00064"></a>00064 <a name="l00065"></a>00065 <span class="preprocessor">#include "<a class="code" href="debug_8h.html">debug.h</a>"</span> <a name="l00066"></a>00066 <a name="l00067"></a>00067 <span class="keyword">using namespace </span>std; <a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="keyword">namespace </span>libdap { <a name="l00070"></a>00070 <a name="l00071"></a>00071 <span class="comment">// Protected copy mfunc</span> <a name="l00072"></a>00072 <a name="l00079"></a>00079 <span class="keywordtype">void</span> <a name="l00080"></a><a class="code" href="classlibdap_1_1BaseType.html#a38d80d3b1e35aa40da1fd5c8ddb8ccd1">00080</a> BaseType::_duplicate(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> &bt) <a name="l00081"></a>00081 { <a name="l00082"></a>00082 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"BaseType::_duplicate: "</span> << bt._name << <span class="stringliteral">" send_p: "</span> <a name="l00083"></a>00083 << bt._send_p << endl); <a name="l00084"></a>00084 _name = bt._name; <a name="l00085"></a>00085 _type = bt._type; <a name="l00086"></a>00086 _dataset = bt._dataset; <a name="l00087"></a>00087 _read_p = bt._read_p; <span class="comment">// added, reza</span> <a name="l00088"></a>00088 _send_p = bt._send_p; <span class="comment">// added, reza</span> <a name="l00089"></a>00089 d_in_selection = bt.d_in_selection; <a name="l00090"></a>00090 _synthesized_p = bt._synthesized_p; <span class="comment">// 5/11/2001 jhrg</span> <a name="l00091"></a>00091 <a name="l00092"></a>00092 d_parent = bt.d_parent; <span class="comment">// copy pointers 6/4/2001 jhrg</span> <a name="l00093"></a>00093 <a name="l00094"></a>00094 d_attr = bt.d_attr; <span class="comment">// Deep copy.</span> <a name="l00095"></a>00095 } <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="comment">// Public mfuncs</span> <a name="l00098"></a>00098 <a name="l00110"></a><a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822">00110</a> BaseType::BaseType(<span class="keyword">const</span> <span class="keywordtype">string</span> &n, <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6" title="Identifies the data type.">Type</a> &t) <a name="l00111"></a>00111 : _name(n), _type(t), _dataset(<span class="stringliteral">""</span>), _read_p(false), _send_p(false), <a name="l00112"></a>00112 d_in_selection(false), _synthesized_p(false), d_parent(0) <a name="l00113"></a>00113 {} <a name="l00114"></a>00114 <a name="l00128"></a><a class="code" href="classlibdap_1_1BaseType.html#a558cf089820c9908d0c0ee693e803e41">00128</a> <a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822" title="The BaseType constructor.">BaseType::BaseType</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &n, <span class="keyword">const</span> <span class="keywordtype">string</span> &d, <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6" title="Identifies the data type.">Type</a> &t) <a name="l00129"></a>00129 : _name(n), _type(t), _dataset(d), _read_p(false), _send_p(false), <a name="l00130"></a>00130 d_in_selection(false), _synthesized_p(false), d_parent(0) <a name="l00131"></a>00131 {} <a name="l00132"></a>00132 <a name="l00134"></a><a class="code" href="classlibdap_1_1BaseType.html#ae11f0e6e4286438aad85bf01dba8ddfd">00134</a> <a class="code" href="classlibdap_1_1BaseType.html#a85729dec5e1c563a06bff3f3ec660822" title="The BaseType constructor.">BaseType::BaseType</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> &copy_from) : <a class="code" href="classlibdap_1_1DapObj.html" title="libdap base object for common functionality of libdap objects">DapObj</a>() <a name="l00135"></a>00135 { <a name="l00136"></a>00136 <a class="code" href="classlibdap_1_1BaseType.html#a38d80d3b1e35aa40da1fd5c8ddb8ccd1" title="Perform a deep copy.">_duplicate</a>(copy_from); <a name="l00137"></a>00137 } <a name="l00138"></a>00138 <a name="l00139"></a><a class="code" href="classlibdap_1_1BaseType.html#a78afe1ba971edce362b0f0360ad7a86f">00139</a> <a class="code" href="classlibdap_1_1BaseType.html#a78afe1ba971edce362b0f0360ad7a86f">BaseType::~BaseType</a>() <a name="l00140"></a>00140 { <a name="l00141"></a>00141 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"Entering ~BaseType ("</span> << <span class="keyword">this</span> << <span class="stringliteral">")"</span> << endl); <a name="l00142"></a>00142 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"Exiting ~BaseType"</span> << endl); <a name="l00143"></a>00143 } <a name="l00144"></a>00144 <a name="l00145"></a>00145 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> & <a name="l00146"></a><a class="code" href="classlibdap_1_1BaseType.html#a03e4440b91a651f16d17c3baf6812ebd">00146</a> <a class="code" href="classlibdap_1_1BaseType.html#a03e4440b91a651f16d17c3baf6812ebd">BaseType::operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> &rhs) <a name="l00147"></a>00147 { <a name="l00148"></a>00148 <span class="keywordflow">if</span> (<span class="keyword">this</span> == &rhs) <a name="l00149"></a>00149 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00150"></a>00150 <a name="l00151"></a>00151 <a class="code" href="classlibdap_1_1BaseType.html#a38d80d3b1e35aa40da1fd5c8ddb8ccd1" title="Perform a deep copy.">_duplicate</a>(rhs); <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00154"></a>00154 } <a name="l00155"></a>00155 <a name="l00160"></a>00160 <span class="keywordtype">string</span> <a name="l00161"></a><a class="code" href="classlibdap_1_1BaseType.html#a701eb3361f5b5628329ece019cd34519">00161</a> <a class="code" href="classlibdap_1_1BaseType.html#a701eb3361f5b5628329ece019cd34519">BaseType::toString</a>() <a name="l00162"></a>00162 { <a name="l00163"></a>00163 ostringstream oss; <a name="l00164"></a>00164 oss << <span class="stringliteral">"BaseType ("</span> << <span class="keyword">this</span> << <span class="stringliteral">"):"</span> << endl <a name="l00165"></a>00165 << <span class="stringliteral">" _name: "</span> << _name << endl <a name="l00166"></a>00166 << <span class="stringliteral">" _type: "</span> << <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() << endl <a name="l00167"></a>00167 << <span class="stringliteral">" _dataset: "</span> << _dataset << endl <a name="l00168"></a>00168 << <span class="stringliteral">" _read_p: "</span> << _read_p << endl <a name="l00169"></a>00169 << <span class="stringliteral">" _send_p: "</span> << _send_p << endl <a name="l00170"></a>00170 << <span class="stringliteral">" _synthesized_p: "</span> << _synthesized_p << endl <a name="l00171"></a>00171 << <span class="stringliteral">" d_parent: "</span> << d_parent << endl <a name="l00172"></a>00172 << <span class="stringliteral">" d_attr: "</span> << hex << &d_attr << dec << endl; <a name="l00173"></a>00173 <a name="l00174"></a>00174 <span class="keywordflow">return</span> oss.str(); <a name="l00175"></a>00175 } <a name="l00176"></a>00176 <a name="l00185"></a>00185 <span class="keywordtype">void</span> <a name="l00186"></a><a class="code" href="classlibdap_1_1BaseType.html#a1ecd80ca994b950bd19b5f525fa4c7a2">00186</a> <a class="code" href="classlibdap_1_1BaseType.html#a1ecd80ca994b950bd19b5f525fa4c7a2" title="dumps information about this object">BaseType::dump</a>(ostream &strm)<span class="keyword"> const</span> <a name="l00187"></a>00187 <span class="keyword"></span>{ <a name="l00188"></a>00188 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"BaseType::dump - ("</span> <a name="l00189"></a>00189 << (<span class="keywordtype">void</span> *)<span class="keyword">this</span> << <span class="stringliteral">")"</span> << endl ; <a name="l00190"></a>00190 <a class="code" href="classlibdap_1_1DapIndent.html#a4ed2cce66dbff9ad4320e89142103c6c">DapIndent::Indent</a>() ; <a name="l00191"></a>00191 <a name="l00192"></a>00192 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"name: "</span> << _name << endl ; <a name="l00193"></a>00193 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"type: "</span> << <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() << endl ; <a name="l00194"></a>00194 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"dataset: "</span> << _dataset << endl ; <a name="l00195"></a>00195 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"read_p: "</span> << _read_p << endl ; <a name="l00196"></a>00196 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"send_p: "</span> << _send_p << endl ; <a name="l00197"></a>00197 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"synthesized_p: "</span> << _synthesized_p << endl ; <a name="l00198"></a>00198 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"parent: "</span> << (<span class="keywordtype">void</span> *)d_parent << endl ; <a name="l00199"></a>00199 strm << <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> << <span class="stringliteral">"attributes: "</span> << endl ; <a name="l00200"></a>00200 DapIndent::Indent() ; <a name="l00201"></a>00201 d_attr.<a class="code" href="classlibdap_1_1AttrTable.html#aa83039e176ada59b990c68b6f3c2cdb7" title="dumps information about this object">dump</a>(strm) ; <a name="l00202"></a>00202 <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ; <a name="l00203"></a>00203 <a name="l00204"></a>00204 <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ; <a name="l00205"></a>00205 } <a name="l00206"></a>00206 <a name="l00209"></a>00209 <span class="keywordtype">string</span> <a name="l00210"></a><a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc">00210</a> <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">BaseType::name</a>()<span class="keyword"> const</span> <a name="l00211"></a>00211 <span class="keyword"></span>{ <a name="l00212"></a>00212 <span class="keywordflow">return</span> _name; <a name="l00213"></a>00213 } <a name="l00214"></a>00214 <a name="l00216"></a>00216 <span class="keywordtype">void</span> <a name="l00217"></a><a class="code" href="classlibdap_1_1BaseType.html#a86504564f45a3e6748c6f1cc0ff4e9fa">00217</a> <a class="code" href="classlibdap_1_1BaseType.html#a86504564f45a3e6748c6f1cc0ff4e9fa" title="Sets the name of the class instance.">BaseType::set_name</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &n) <a name="l00218"></a>00218 { <a name="l00219"></a>00219 <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a> = n; <a name="l00220"></a>00220 _name = <a class="code" href="namespacelibdap.html#a376f9593431111a80ef78c98b8f4a0e2">www2id</a>(name); <span class="comment">// www2id writes into its param.</span> <a name="l00221"></a>00221 } <a name="l00222"></a>00222 <a name="l00230"></a>00230 <span class="keywordtype">string</span> <a name="l00231"></a><a class="code" href="classlibdap_1_1BaseType.html#a9f102f5cc17ac7d2d80f9921e10d3baf">00231</a> <a class="code" href="classlibdap_1_1BaseType.html#a9f102f5cc17ac7d2d80f9921e10d3baf" title="Returns the name of the dataset used to create this instance.">BaseType::dataset</a>()<span class="keyword"> const</span> <a name="l00232"></a>00232 <span class="keyword"></span>{ <a name="l00233"></a>00233 <span class="keywordflow">return</span> _dataset; <a name="l00234"></a>00234 } <a name="l00235"></a>00235 <a name="l00237"></a>00237 <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6" title="Identifies the data type.">Type</a> <a name="l00238"></a><a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17">00238</a> <a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">BaseType::type</a>()<span class="keyword"> const</span> <a name="l00239"></a>00239 <span class="keyword"></span>{ <a name="l00240"></a>00240 <span class="keywordflow">return</span> _type; <a name="l00241"></a>00241 } <a name="l00242"></a>00242 <a name="l00244"></a>00244 <span class="keywordtype">void</span> <a name="l00245"></a><a class="code" href="classlibdap_1_1BaseType.html#af74f8d1ef57c9fcca46f620f75d175a3">00245</a> <a class="code" href="classlibdap_1_1BaseType.html#af74f8d1ef57c9fcca46f620f75d175a3" title="Sets the type of the class instance.">BaseType::set_type</a>(<span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6" title="Identifies the data type.">Type</a> &t) <a name="l00246"></a>00246 { <a name="l00247"></a>00247 _type = t; <a name="l00248"></a>00248 } <a name="l00249"></a>00249 <a name="l00251"></a>00251 <span class="keywordtype">string</span> <a name="l00252"></a><a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116">00252</a> <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">BaseType::type_name</a>()<span class="keyword"> const</span> <a name="l00253"></a>00253 <span class="keyword"></span>{ <a name="l00254"></a>00254 <span class="keywordflow">switch</span> (_type) { <a name="l00255"></a>00255 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6aa146d902a00eb7e9bb393f4e36bd07de">dods_null_c</a>: <a name="l00256"></a>00256 <span class="keywordflow">return</span> string(<span class="stringliteral">"Null"</span>); <a name="l00257"></a>00257 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>: <a name="l00258"></a>00258 <span class="keywordflow">return</span> string(<span class="stringliteral">"Byte"</span>); <a name="l00259"></a>00259 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>: <a name="l00260"></a>00260 <span class="keywordflow">return</span> string(<span class="stringliteral">"Int16"</span>); <a name="l00261"></a>00261 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>: <a name="l00262"></a>00262 <span class="keywordflow">return</span> string(<span class="stringliteral">"UInt16"</span>); <a name="l00263"></a>00263 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a524bfec434d0a8f82e06bfcc02c9a6b1">dods_int32_c</a>: <a name="l00264"></a>00264 <span class="keywordflow">return</span> string(<span class="stringliteral">"Int32"</span>); <a name="l00265"></a>00265 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>: <a name="l00266"></a>00266 <span class="keywordflow">return</span> string(<span class="stringliteral">"UInt32"</span>); <a name="l00267"></a>00267 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>: <a name="l00268"></a>00268 <span class="keywordflow">return</span> string(<span class="stringliteral">"Float32"</span>); <a name="l00269"></a>00269 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>: <a name="l00270"></a>00270 <span class="keywordflow">return</span> string(<span class="stringliteral">"Float64"</span>); <a name="l00271"></a>00271 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad620cef0bf41edebd4ee802071192a79">dods_str_c</a>: <a name="l00272"></a>00272 <span class="keywordflow">return</span> string(<span class="stringliteral">"String"</span>); <a name="l00273"></a>00273 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a64d653d09a50d6d17537c43ed217f665">dods_url_c</a>: <a name="l00274"></a>00274 <span class="keywordflow">return</span> string(<span class="stringliteral">"Url"</span>); <a name="l00275"></a>00275 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ada8f5df7bb2bc72327fcd16af811562f">dods_array_c</a>: <a name="l00276"></a>00276 <span class="keywordflow">return</span> string(<span class="stringliteral">"Array"</span>); <a name="l00277"></a>00277 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad93eb0a69e67742f061966ce594b9a6c">dods_structure_c</a>: <a name="l00278"></a>00278 <span class="keywordflow">return</span> string(<span class="stringliteral">"Structure"</span>); <a name="l00279"></a>00279 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>: <a name="l00280"></a>00280 <span class="keywordflow">return</span> string(<span class="stringliteral">"Sequence"</span>); <a name="l00281"></a>00281 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ac41525d2e860d3bcff641eb1fdba41d2">dods_grid_c</a>: <a name="l00282"></a>00282 <span class="keywordflow">return</span> string(<span class="stringliteral">"Grid"</span>); <a name="l00283"></a>00283 <span class="keywordflow">default</span>: <a name="l00284"></a>00284 cerr << <span class="stringliteral">"BaseType::type_name: Undefined type"</span> << endl; <a name="l00285"></a>00285 <span class="keywordflow">return</span> string(<span class="stringliteral">""</span>); <a name="l00286"></a>00286 } <a name="l00287"></a>00287 } <a name="l00288"></a>00288 <a name="l00294"></a>00294 <span class="keywordtype">bool</span> <a name="l00295"></a><a class="code" href="classlibdap_1_1BaseType.html#a614ce462dc6236791630f373bf75ad49">00295</a> <a class="code" href="classlibdap_1_1BaseType.html#a614ce462dc6236791630f373bf75ad49" title="Returns true if the instance is a numeric, string or URL type variable.">BaseType::is_simple_type</a>() <a name="l00296"></a>00296 { <a name="l00297"></a>00297 <span class="keywordflow">switch</span> (<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>()) { <a name="l00298"></a>00298 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6aa146d902a00eb7e9bb393f4e36bd07de">dods_null_c</a>: <a name="l00299"></a>00299 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>: <a name="l00300"></a>00300 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>: <a name="l00301"></a>00301 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>: <a name="l00302"></a>00302 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a524bfec434d0a8f82e06bfcc02c9a6b1">dods_int32_c</a>: <a name="l00303"></a>00303 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>: <a name="l00304"></a>00304 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>: <a name="l00305"></a>00305 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>: <a name="l00306"></a>00306 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad620cef0bf41edebd4ee802071192a79">dods_str_c</a>: <a name="l00307"></a>00307 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a64d653d09a50d6d17537c43ed217f665">dods_url_c</a>: <a name="l00308"></a>00308 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00309"></a>00309 <a name="l00310"></a>00310 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ada8f5df7bb2bc72327fcd16af811562f">dods_array_c</a>: <a name="l00311"></a>00311 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad93eb0a69e67742f061966ce594b9a6c">dods_structure_c</a>: <a name="l00312"></a>00312 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>: <a name="l00313"></a>00313 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ac41525d2e860d3bcff641eb1fdba41d2">dods_grid_c</a>: <a name="l00314"></a>00314 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00315"></a>00315 } <a name="l00316"></a>00316 <a name="l00317"></a>00317 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00318"></a>00318 } <a name="l00319"></a>00319 <a name="l00323"></a>00323 <span class="keywordtype">bool</span> <a name="l00324"></a><a class="code" href="classlibdap_1_1BaseType.html#ad1d57be80c8e89b8a9e59bed48779556">00324</a> <a class="code" href="classlibdap_1_1BaseType.html#ad1d57be80c8e89b8a9e59bed48779556" title="Returns true if the instance is a vector (i.e., array) type variable.">BaseType::is_vector_type</a>() <a name="l00325"></a>00325 { <a name="l00326"></a>00326 <span class="keywordflow">switch</span> (<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>()) { <a name="l00327"></a>00327 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6aa146d902a00eb7e9bb393f4e36bd07de">dods_null_c</a>: <a name="l00328"></a>00328 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>: <a name="l00329"></a>00329 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>: <a name="l00330"></a>00330 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>: <a name="l00331"></a>00331 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a524bfec434d0a8f82e06bfcc02c9a6b1">dods_int32_c</a>: <a name="l00332"></a>00332 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>: <a name="l00333"></a>00333 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>: <a name="l00334"></a>00334 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>: <a name="l00335"></a>00335 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad620cef0bf41edebd4ee802071192a79">dods_str_c</a>: <a name="l00336"></a>00336 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a64d653d09a50d6d17537c43ed217f665">dods_url_c</a>: <a name="l00337"></a>00337 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00338"></a>00338 <a name="l00339"></a>00339 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ada8f5df7bb2bc72327fcd16af811562f">dods_array_c</a>: <a name="l00340"></a>00340 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00341"></a>00341 <a name="l00342"></a>00342 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad93eb0a69e67742f061966ce594b9a6c">dods_structure_c</a>: <a name="l00343"></a>00343 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>: <a name="l00344"></a>00344 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ac41525d2e860d3bcff641eb1fdba41d2">dods_grid_c</a>: <a name="l00345"></a>00345 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00346"></a>00346 } <a name="l00347"></a>00347 <a name="l00348"></a>00348 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00349"></a>00349 } <a name="l00350"></a>00350 <a name="l00355"></a>00355 <span class="keywordtype">bool</span> <a name="l00356"></a><a class="code" href="classlibdap_1_1BaseType.html#a9eb6cae7f3490723180131345c85cfc7">00356</a> <a class="code" href="classlibdap_1_1BaseType.html#a9eb6cae7f3490723180131345c85cfc7" title="Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable...">BaseType::is_constructor_type</a>() <a name="l00357"></a>00357 { <a name="l00358"></a>00358 <span class="keywordflow">switch</span> (<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>()) { <a name="l00359"></a>00359 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6aa146d902a00eb7e9bb393f4e36bd07de">dods_null_c</a>: <a name="l00360"></a>00360 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>: <a name="l00361"></a>00361 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>: <a name="l00362"></a>00362 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>: <a name="l00363"></a>00363 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a524bfec434d0a8f82e06bfcc02c9a6b1">dods_int32_c</a>: <a name="l00364"></a>00364 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>: <a name="l00365"></a>00365 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>: <a name="l00366"></a>00366 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>: <a name="l00367"></a>00367 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad620cef0bf41edebd4ee802071192a79">dods_str_c</a>: <a name="l00368"></a>00368 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a64d653d09a50d6d17537c43ed217f665">dods_url_c</a>: <a name="l00369"></a>00369 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ada8f5df7bb2bc72327fcd16af811562f">dods_array_c</a>: <a name="l00370"></a>00370 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00371"></a>00371 <a name="l00372"></a>00372 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ad93eb0a69e67742f061966ce594b9a6c">dods_structure_c</a>: <a name="l00373"></a>00373 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a0b03707324b30e4a7c88876bbf8c7e3b">dods_sequence_c</a>: <a name="l00374"></a>00374 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6ac41525d2e860d3bcff641eb1fdba41d2">dods_grid_c</a>: <a name="l00375"></a>00375 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00376"></a>00376 } <a name="l00377"></a>00377 <a name="l00378"></a>00378 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00379"></a>00379 } <a name="l00380"></a>00380 <a name="l00406"></a>00406 <span class="keywordtype">int</span> <a name="l00407"></a><a class="code" href="classlibdap_1_1BaseType.html#a5c2235737737b482bfa7536b8aeab810">00407</a> <a class="code" href="classlibdap_1_1BaseType.html#a5c2235737737b482bfa7536b8aeab810" title="Count the members of constructor types.">BaseType::element_count</a>(<span class="keywordtype">bool</span>) <a name="l00408"></a>00408 { <a name="l00409"></a>00409 <span class="keywordflow">return</span> 1; <a name="l00410"></a>00410 } <a name="l00411"></a>00411 <a name="l00415"></a>00415 <span class="keywordtype">bool</span> <a name="l00416"></a><a class="code" href="classlibdap_1_1BaseType.html#ae64e677da27249473cdba0b60cdbb90a">00416</a> <a class="code" href="classlibdap_1_1BaseType.html#ae64e677da27249473cdba0b60cdbb90a">BaseType::synthesized_p</a>() <a name="l00417"></a>00417 { <a name="l00418"></a>00418 <span class="keywordflow">return</span> _synthesized_p; <a name="l00419"></a>00419 } <a name="l00420"></a>00420 <a name="l00426"></a>00426 <span class="keywordtype">void</span> <a name="l00427"></a><a class="code" href="classlibdap_1_1BaseType.html#a595cb4059cff24f801a1b6da79bd2f9e">00427</a> <a class="code" href="classlibdap_1_1BaseType.html#a595cb4059cff24f801a1b6da79bd2f9e">BaseType::set_synthesized_p</a>(<span class="keywordtype">bool</span> state) <a name="l00428"></a>00428 { <a name="l00429"></a>00429 _synthesized_p = state; <a name="l00430"></a>00430 } <a name="l00431"></a>00431 <a name="l00432"></a>00432 <span class="comment">// Return the state of _read_p (true if the value of the variable has been</span> <a name="l00433"></a>00433 <span class="comment">// read (and is in memory) false otherwise).</span> <a name="l00434"></a>00434 <a name="l00443"></a>00443 <span class="keywordtype">bool</span> <a name="l00444"></a><a class="code" href="classlibdap_1_1BaseType.html#a38ff819a432217c55db2e9071928d20c">00444</a> <a class="code" href="classlibdap_1_1BaseType.html#a38ff819a432217c55db2e9071928d20c" title="Has this variable been read?">BaseType::read_p</a>() <a name="l00445"></a>00445 { <a name="l00446"></a>00446 <span class="keywordflow">return</span> _read_p; <a name="l00447"></a>00447 } <a name="l00448"></a>00448 <a name="l00482"></a>00482 <span class="keywordtype">void</span> <a name="l00483"></a><a class="code" href="classlibdap_1_1BaseType.html#a4533905a450d2a7af32e7d5acd557676">00483</a> <a class="code" href="classlibdap_1_1BaseType.html#a4533905a450d2a7af32e7d5acd557676" title="Sets the value of the read_p property.">BaseType::set_read_p</a>(<span class="keywordtype">bool</span> state) <a name="l00484"></a>00484 { <a name="l00485"></a>00485 <span class="keywordflow">if</span> (! _synthesized_p) { <a name="l00486"></a>00486 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"Changing read_p state of "</span> << <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() << <span class="stringliteral">" to "</span> <a name="l00487"></a>00487 << state << endl); <a name="l00488"></a>00488 _read_p = state; <a name="l00489"></a>00489 } <a name="l00490"></a>00490 } <a name="l00491"></a>00491 <a name="l00502"></a>00502 <span class="keywordtype">bool</span> <a name="l00503"></a><a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192">00503</a> <a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">BaseType::send_p</a>() <a name="l00504"></a>00504 { <a name="l00505"></a>00505 <span class="keywordflow">return</span> _send_p; <a name="l00506"></a>00506 } <a name="l00507"></a>00507 <a name="l00516"></a>00516 <span class="keywordtype">void</span> <a name="l00517"></a><a class="code" href="classlibdap_1_1BaseType.html#aba7b27635c95b74536de18393133628e">00517</a> <a class="code" href="classlibdap_1_1BaseType.html#aba7b27635c95b74536de18393133628e">BaseType::set_send_p</a>(<span class="keywordtype">bool</span> state) <a name="l00518"></a>00518 { <a name="l00519"></a>00519 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"Calling BaseType::set_send_p() for: "</span> << this-><a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() <a name="l00520"></a>00520 << endl); <a name="l00521"></a>00521 _send_p = state; <a name="l00522"></a>00522 } <a name="l00523"></a>00523 <a name="l00524"></a>00524 <a name="l00530"></a>00530 <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> & <a name="l00531"></a><a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">00531</a> <a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">BaseType::get_attr_table</a>() <a name="l00532"></a>00532 { <a name="l00533"></a>00533 <span class="keywordflow">return</span> d_attr; <a name="l00534"></a>00534 } <a name="l00535"></a>00535 <a name="l00538"></a>00538 <span class="keywordtype">void</span> <a name="l00539"></a><a class="code" href="classlibdap_1_1BaseType.html#a572a1d76a75981abac83a4241e90c0fa">00539</a> <a class="code" href="classlibdap_1_1BaseType.html#a572a1d76a75981abac83a4241e90c0fa">BaseType::set_attr_table</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> &at) <a name="l00540"></a>00540 { <a name="l00541"></a>00541 d_attr = at; <a name="l00542"></a>00542 } <a name="l00543"></a>00543 <a name="l00570"></a>00570 <span class="keywordtype">void</span> <a name="l00571"></a><a class="code" href="classlibdap_1_1BaseType.html#add8e836c622042a339152a6c31e5bdfb">00571</a> <a class="code" href="classlibdap_1_1BaseType.html#add8e836c622042a339152a6c31e5bdfb">BaseType::transfer_attributes</a>(<a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at_container) <a name="l00572"></a>00572 { <a name="l00573"></a>00573 <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at = at_container-><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="l00574"></a>00574 <a name="l00575"></a>00575 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"In BaseType::transfer_attributes; processing "</span> << <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() << endl); <a name="l00576"></a>00576 <a name="l00577"></a>00577 <span class="keywordflow">if</span> (at) { <a name="l00578"></a>00578 at-><a class="code" href="classlibdap_1_1AttrTable.html#aadba23c830a02aa19c24c2a6f442dfd2">set_is_global_attribute</a>(<span class="keyword">false</span>); <a name="l00579"></a>00579 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"Processing AttrTable: "</span> << at-><a class="code" href="classlibdap_1_1AttrTable.html#a4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>() << endl); <a name="l00580"></a>00580 <a name="l00581"></a>00581 <a class="code" href="classlibdap_1_1AttrTable.html#a3647edf8906b672bad7a8c5ffc81d62a">AttrTable::Attr_iter</a> at_p = at-><a class="code" href="classlibdap_1_1AttrTable.html#a8881bb7044577dae3098f4a1d8bf4f2f">attr_begin</a>(); <a name="l00582"></a>00582 <span class="keywordflow">while</span> (at_p != at-><a class="code" href="classlibdap_1_1AttrTable.html#a543955729bad6b7a9d1d6b336596b1ba">attr_end</a>()) { <a name="l00583"></a>00583 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"About to append "</span> << endl); <a name="l00584"></a>00584 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"attr name,type:"</span> << at-><a class="code" href="classlibdap_1_1AttrTable.html#a4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>(at_p) << <span class="stringliteral">", "</span> << at-><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) << endl); <a name="l00585"></a>00585 <a name="l00586"></a>00586 <span class="keywordflow">if</span> (at-><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="l00587"></a>00587 <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>(*at-><a class="code" href="classlibdap_1_1AttrTable.html#a4010172de5c41cd88f2422d5e1975522" title="Get an attribute container.">get_attr_table</a>(at_p)), <a name="l00588"></a>00588 at-><a class="code" href="classlibdap_1_1AttrTable.html#a4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>(at_p)); <a name="l00589"></a>00589 <span class="keywordflow">else</span> <a name="l00590"></a>00590 <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-><a class="code" href="classlibdap_1_1AttrTable.html#a4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>(at_p), <a name="l00591"></a>00591 at-><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-><a class="code" href="classlibdap_1_1AttrTable.html#a7352d886789e9e38d530fc44c6cbef30" title="Get a vector-valued attribute.">get_attr_vector</a>(at_p)); <a name="l00592"></a>00592 <a name="l00593"></a>00593 at_p++; <a name="l00594"></a>00594 } <a name="l00595"></a>00595 } <a name="l00596"></a>00596 } <a name="l00597"></a>00597 <a name="l00609"></a>00609 <span class="keywordtype">bool</span> <a name="l00610"></a><a class="code" href="classlibdap_1_1BaseType.html#ae302ab2ec26e9fc5b575bf5d3d09aa5c">00610</a> <a class="code" href="classlibdap_1_1BaseType.html#ae302ab2ec26e9fc5b575bf5d3d09aa5c" title="Is this variable part of the current selection?">BaseType::is_in_selection</a>() <a name="l00611"></a>00611 { <a name="l00612"></a>00612 <span class="keywordflow">return</span> d_in_selection; <a name="l00613"></a>00613 } <a name="l00614"></a>00614 <a name="l00624"></a>00624 <span class="keywordtype">void</span> <a name="l00625"></a><a class="code" href="classlibdap_1_1BaseType.html#a2bc036248cdaf1affac464170f32ad30">00625</a> <a class="code" href="classlibdap_1_1BaseType.html#a2bc036248cdaf1affac464170f32ad30">BaseType::set_in_selection</a>(<span class="keywordtype">bool</span> state) <a name="l00626"></a>00626 { <a name="l00627"></a>00627 d_in_selection = state; <a name="l00628"></a>00628 } <a name="l00629"></a>00629 <a name="l00630"></a>00630 <span class="comment">// Protected method.</span> <a name="l00637"></a>00637 <span class="comment"></span><span class="keywordtype">void</span> <a name="l00638"></a><a class="code" href="classlibdap_1_1BaseType.html#a5b6a39f6ce6594fa74f3fc899ac9a966">00638</a> <a class="code" href="classlibdap_1_1BaseType.html#a5b6a39f6ce6594fa74f3fc899ac9a966">BaseType::set_parent</a>(<a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *parent) <a name="l00639"></a>00639 { <a name="l00640"></a>00640 <span class="keywordflow">if</span> (!dynamic_cast<Constructor *>(parent) <a name="l00641"></a>00641 && !dynamic_cast<Vector *>(parent)) <a name="l00642"></a>00642 <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">"Call to set_parent with incorrect variable type."</span>); <a name="l00643"></a>00643 <a name="l00644"></a>00644 d_parent = parent; <a name="l00645"></a>00645 } <a name="l00646"></a>00646 <a name="l00647"></a>00647 <span class="comment">// Public method.</span> <a name="l00648"></a>00648 <a name="l00654"></a>00654 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> * <a name="l00655"></a><a class="code" href="classlibdap_1_1BaseType.html#aeabb771d731dbcef92fff731fb429f85">00655</a> <a class="code" href="classlibdap_1_1BaseType.html#aeabb771d731dbcef92fff731fb429f85">BaseType::get_parent</a>() <a name="l00656"></a>00656 { <a name="l00657"></a>00657 <span class="keywordflow">return</span> d_parent; <a name="l00658"></a>00658 } <a name="l00659"></a>00659 <a name="l00660"></a>00660 <span class="comment">// Documented in the header file.</span> <a name="l00661"></a>00661 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> * <a name="l00662"></a><a class="code" href="classlibdap_1_1BaseType.html#a4dc4fac1bb6083f6db645f37bfd59b85">00662</a> <a class="code" href="classlibdap_1_1BaseType.html#a4dc4fac1bb6083f6db645f37bfd59b85" title="Returns a pointer to a member of a constructor class.">BaseType::var</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &<span class="comment">/*name*/</span>, <span class="keywordtype">bool</span> <span class="comment">/*exact_match*/</span>, <a class="code" href="classlibdap_1_1BaseType.html#ae9c6e71855b90a0e552713011c9ab81f">btp_stack</a> *<span class="comment">/*s*/</span>) <a name="l00663"></a>00663 { <a name="l00664"></a>00664 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *<span class="keyword">></span>(0); <a name="l00665"></a>00665 } <a name="l00666"></a>00666 <a name="l00683"></a>00683 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> * <a name="l00684"></a><a class="code" href="classlibdap_1_1BaseType.html#adecfc442b5927c79933c7f71cfe03fd2">00684</a> <a class="code" href="classlibdap_1_1BaseType.html#a4dc4fac1bb6083f6db645f37bfd59b85" title="Returns a pointer to a member of a constructor class.">BaseType::var</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &, <a class="code" href="classlibdap_1_1BaseType.html#ae9c6e71855b90a0e552713011c9ab81f">btp_stack</a> &) <a name="l00685"></a>00685 { <a name="l00686"></a>00686 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *<span class="keyword">></span>(0); <a name="l00687"></a>00687 } <a name="l00688"></a>00688 <a name="l00718"></a>00718 <span class="keywordtype">void</span> <a name="l00719"></a><a class="code" href="classlibdap_1_1BaseType.html#adca3c2621c4a509537c18362005d7f7f">00719</a> <a class="code" href="classlibdap_1_1BaseType.html#adca3c2621c4a509537c18362005d7f7f" title="Add a variable.">BaseType::add_var</a>(<a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *, <a class="code" href="namespacelibdap.html#addcb1d714cdecb877c65ff6d2fde0695" title="Names the parts of multi-section constructor data types.">Part</a>) <a name="l00720"></a>00720 { <a name="l00721"></a>00721 <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">"BaseType::add_var unimplemented"</span>); <a name="l00722"></a>00722 } <a name="l00723"></a>00723 <a name="l00789"></a>00789 <span class="keywordtype">bool</span> <a name="l00790"></a><a class="code" href="classlibdap_1_1BaseType.html#a1da003c53f2e663223f603ab3fbd7c8e">00790</a> <a class="code" href="classlibdap_1_1BaseType.html#a1da003c53f2e663223f603ab3fbd7c8e" title="Read data into a local buffer.">BaseType::read</a>() <a name="l00791"></a>00791 { <a name="l00792"></a>00792 <span class="keywordflow">if</span> (_read_p) <a name="l00793"></a>00793 <span class="keywordflow">return</span> <span class="keyword">false</span>; <a name="l00794"></a>00794 <a name="l00795"></a>00795 <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">"Unimplemented BaseType::read() method called."</span>); <a name="l00796"></a>00796 } <a name="l00797"></a>00797 <a name="l00798"></a>00798 <span class="keywordtype">void</span> <a name="l00799"></a><a class="code" href="classlibdap_1_1BaseType.html#a722d33783aa0272d339b0301a4f77e59">00799</a> <a class="code" href="classlibdap_1_1BaseType.html#a722d33783aa0272d339b0301a4f77e59">BaseType::intern_data</a>(<a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> &dds) <a name="l00800"></a>00800 { <a name="l00801"></a>00801 dds.<a class="code" href="classlibdap_1_1DDS.html#a8cd9b6a34f5e1a49665de3189e141de8">timeout_on</a>(); <a name="l00802"></a>00802 <a class="code" href="debug_8h.html#a32adf79142f0a426b5e782fb7cd4cad3">DBG</a>(cerr << <span class="stringliteral">"BaseType::intern_data: "</span> << <a class="code" href="classlibdap_1_1BaseType.html#a0a0c6b5d57813607dc06255b8e0b9bdc" title="Returns the name of the class instance.">name</a>() << endl); <a name="l00803"></a>00803 <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="l00804"></a>00804 <a class="code" href="classlibdap_1_1BaseType.html#a1da003c53f2e663223f603ab3fbd7c8e" title="Read data into a local buffer.">read</a>(); <span class="comment">// read() throws Error and InternalErr</span> <a name="l00805"></a>00805 <a name="l00806"></a>00806 dds.<a class="code" href="classlibdap_1_1DDS.html#a6740f99a5fc64640505924c5603ace0a">timeout_off</a>(); <a name="l00807"></a>00807 } <a name="l00808"></a>00808 <a name="l00809"></a>00809 <span class="preprocessor">#if FILE_METHODS</span> <a name="l00810"></a>00810 <span class="preprocessor"></span> <a name="l00852"></a>00852 <span class="keywordtype">void</span> <a name="l00853"></a>00853 <a class="code" href="classlibdap_1_1BaseType.html#afd744b0ddeb04e7b173c9e83423ec572" title="Print an ASCII representation of the variable structure.">BaseType::print_decl</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_semi, <a name="l00854"></a>00854 <span class="keywordtype">bool</span> constraint_info, <span class="keywordtype">bool</span> constrained) <a name="l00855"></a>00855 { <a name="l00856"></a>00856 <span class="comment">// if printing the constrained declaration, exit if this variable was not</span> <a name="l00857"></a>00857 <span class="comment">// selected.</span> <a name="l00858"></a>00858 <span class="keywordflow">if</span> (constrained && !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>()) <a name="l00859"></a>00859 <span class="keywordflow">return</span>; <a name="l00860"></a>00860 <a name="l00861"></a>00861 fprintf(out, <span class="stringliteral">"%s%s %s"</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="l00862"></a>00862 <a class="code" href="namespacelibdap.html#afbd709ed83699c11234a213463d16b9c">id2www</a>(_name).c_str()) ; <a name="l00863"></a>00863 <a name="l00864"></a>00864 <span class="keywordflow">if</span> (constraint_info) { <a name="l00865"></a>00865 <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="l00866"></a>00866 fprintf(out, <span class="stringliteral">": Send True"</span>) ; <a name="l00867"></a>00867 <span class="keywordflow">else</span> <a name="l00868"></a>00868 fprintf(out, <span class="stringliteral">": Send False"</span>) ; <a name="l00869"></a>00869 } <a name="l00870"></a>00870 <a name="l00871"></a>00871 <span class="keywordflow">if</span> (print_semi) <a name="l00872"></a>00872 fprintf(out, <span class="stringliteral">";\n"</span>) ; <a name="l00873"></a>00873 } <a name="l00874"></a>00874 <span class="preprocessor">#endif</span> <a name="l00875"></a>00875 <span class="preprocessor"></span> <a name="l00918"></a>00918 <span class="keywordtype">void</span> <a name="l00919"></a><a class="code" href="classlibdap_1_1BaseType.html#afd744b0ddeb04e7b173c9e83423ec572">00919</a> <a class="code" href="classlibdap_1_1BaseType.html#afd744b0ddeb04e7b173c9e83423ec572" title="Print an ASCII representation of the variable structure.">BaseType::print_decl</a>(ostream &out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_semi, <a name="l00920"></a>00920 <span class="keywordtype">bool</span> constraint_info, <span class="keywordtype">bool</span> constrained) <a name="l00921"></a>00921 { <a name="l00922"></a>00922 <span class="comment">// if printing the constrained declaration, exit if this variable was not</span> <a name="l00923"></a>00923 <span class="comment">// selected.</span> <a name="l00924"></a>00924 <span class="keywordflow">if</span> (constrained && !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>()) <a name="l00925"></a>00925 <span class="keywordflow">return</span>; <a name="l00926"></a>00926 <a name="l00927"></a>00927 out << space << <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() << <span class="stringliteral">" "</span> << <a class="code" href="namespacelibdap.html#afbd709ed83699c11234a213463d16b9c">id2www</a>(_name) ; <a name="l00928"></a>00928 <a name="l00929"></a>00929 <span class="keywordflow">if</span> (constraint_info) { <a name="l00930"></a>00930 <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="l00931"></a>00931 out << <span class="stringliteral">": Send True"</span> ; <a name="l00932"></a>00932 <span class="keywordflow">else</span> <a name="l00933"></a>00933 out << <span class="stringliteral">": Send False"</span> ; <a name="l00934"></a>00934 } <a name="l00935"></a>00935 <a name="l00936"></a>00936 <span class="keywordflow">if</span> (print_semi) <a name="l00937"></a>00937 out << <span class="stringliteral">";\n"</span> ; <a name="l00938"></a>00938 } <a name="l00939"></a>00939 <a name="l00940"></a>00940 <span class="preprocessor">#if FILE_METHODS</span> <a name="l00941"></a>00941 <span class="preprocessor"></span> <a name="l00947"></a>00947 <span class="keywordtype">void</span> <a name="l00948"></a>00948 <a class="code" href="classlibdap_1_1BaseType.html#a8bd2c7682edd48c64b210bdf247bdef7">BaseType::print_xml</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> constrained) <a name="l00949"></a>00949 { <a name="l00950"></a>00950 <span class="keywordflow">if</span> (constrained && !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>()) <a name="l00951"></a>00951 <span class="keywordflow">return</span>; <a name="l00952"></a>00952 <a name="l00953"></a>00953 fprintf(out, <span class="stringliteral">"%s<%s"</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="l00954"></a>00954 <span class="keywordflow">if</span> (!_name.empty()) <a name="l00955"></a>00955 fprintf(out, <span class="stringliteral">" name=\"%s\""</span>, <a class="code" href="namespacelibdap.html#a62463a13bf510db3a14c0053fea14f4d">id2xml</a>(_name).c_str()); <a name="l00956"></a>00956 <a name="l00957"></a>00957 <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().<a class="code" href="classlibdap_1_1AttrTable.html#a895e16236818e6b55790e4490cf6c2da" title="Get the number of entries in this attribute table.">get_size</a>() > 0) { <a name="l00958"></a>00958 fprintf(out, <span class="stringliteral">">\n"</span>); <span class="comment">// close the variable's tag</span> <a name="l00959"></a>00959 <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">" "</span>, constrained); <a name="l00960"></a>00960 <span class="comment">// After attributes, print closing tag</span> <a name="l00961"></a>00961 fprintf(out, <span class="stringliteral">"%s</%s>\n"</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="l00962"></a>00962 } <a name="l00963"></a>00963 <span class="keywordflow">else</span> { <a name="l00964"></a>00964 fprintf(out, <span class="stringliteral">"/>\n"</span>); <span class="comment">// no attributes; just close tag.</span> <a name="l00965"></a>00965 } <a name="l00966"></a>00966 } <a name="l00967"></a>00967 <span class="preprocessor">#endif</span> <a name="l00968"></a>00968 <span class="preprocessor"></span> <a name="l00975"></a>00975 <span class="keywordtype">void</span> <a name="l00976"></a><a class="code" href="classlibdap_1_1BaseType.html#a8bd2c7682edd48c64b210bdf247bdef7">00976</a> <a class="code" href="classlibdap_1_1BaseType.html#a8bd2c7682edd48c64b210bdf247bdef7">BaseType::print_xml</a>(ostream &out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> constrained) <a name="l00977"></a>00977 { <a name="l00978"></a>00978 <span class="keywordflow">if</span> (constrained && !<a class="code" href="classlibdap_1_1BaseType.html#a980c0013817836aa77ef74aeec7fb192" title="Should this variable be sent?">send_p</a>()) <a name="l00979"></a>00979 <span class="keywordflow">return</span>; <a name="l00980"></a>00980 <a name="l00981"></a>00981 out << space << <span class="stringliteral">"<"</span> << <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="l00982"></a>00982 <span class="keywordflow">if</span> (!_name.empty()) <a name="l00983"></a>00983 out << <span class="stringliteral">" name=\""</span> << <a class="code" href="namespacelibdap.html#a62463a13bf510db3a14c0053fea14f4d">id2xml</a>(_name) << <span class="stringliteral">"\""</span> ; <a name="l00984"></a>00984 <a name="l00985"></a>00985 <span class="keywordflow">if</span> (<a class="code" href="classlibdap_1_1BaseType.html#a1fcd9537c67e3bf88964b2656ff5bac1">get_attr_table</a>().<a class="code" href="classlibdap_1_1AttrTable.html#a895e16236818e6b55790e4490cf6c2da" title="Get the number of entries in this attribute table.">get_size</a>() > 0) { <a name="l00986"></a>00986 out << <span class="stringliteral">">\n"</span> ; <a name="l00987"></a>00987 <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">" "</span>, constrained); <a name="l00988"></a>00988 <span class="comment">// After attributes, print closing tag</span> <a name="l00989"></a>00989 out << space << <span class="stringliteral">"</"</span> << <a class="code" href="classlibdap_1_1BaseType.html#ac4461c9e287b167871acade5e5472116" title="Returns the type of the class instance as a string.">type_name</a>() << <span class="stringliteral">">\n"</span> ; <a name="l00990"></a>00990 } <a name="l00991"></a>00991 <span class="keywordflow">else</span> { <a name="l00992"></a>00992 out << <span class="stringliteral">"/>\n"</span> ; <a name="l00993"></a>00993 } <a name="l00994"></a>00994 } <a name="l00995"></a>00995 <a name="l00996"></a>00996 <span class="comment">// Compares the object's current state with the semantics of a particular</span> <a name="l00997"></a>00997 <span class="comment">// type. This will typically be defined in ctor classes (which have</span> <a name="l00998"></a>00998 <span class="comment">// complicated semantics). For BaseType, an object is semantically correct if</span> <a name="l00999"></a>00999 <span class="comment">// it has both a non-null name and type.</span> <a name="l01000"></a>01000 <span class="comment">//</span> <a name="l01001"></a>01001 <span class="comment">// NB: This is not the same as an invariant -- during the parse objects exist</span> <a name="l01002"></a>01002 <span class="comment">// but have no name. Also, the bool ALL defaults to false for BaseType. It is</span> <a name="l01003"></a>01003 <span class="comment">// used by children of CtorType.</span> <a name="l01004"></a>01004 <span class="comment">//</span> <a name="l01005"></a>01005 <span class="comment">// Returns: true if the object is semantically correct, false otherwise.</span> <a name="l01006"></a>01006 <a name="l01035"></a>01035 <span class="keywordtype">bool</span> <a name="l01036"></a><a class="code" href="classlibdap_1_1BaseType.html#aec503abec2fd3090e7738c0a575491f8">01036</a> <a class="code" href="classlibdap_1_1BaseType.html#aec503abec2fd3090e7738c0a575491f8" title="Compare an object&#39;s current state with the semantics of its type.">BaseType::check_semantics</a>(<span class="keywordtype">string</span> &msg, <span class="keywordtype">bool</span>) <a name="l01037"></a>01037 { <a name="l01038"></a>01038 <span class="keywordtype">bool</span> sem = (_type != <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6aa146d902a00eb7e9bb393f4e36bd07de">dods_null_c</a> && _name.length()); <a name="l01039"></a>01039 <a name="l01040"></a>01040 <span class="keywordflow">if</span> (!sem) <a name="l01041"></a>01041 msg = <span class="stringliteral">"Every variable must have both a name and a type\n"</span>; <a name="l01042"></a>01042 <a name="l01043"></a>01043 <span class="keywordflow">return</span> sem; <a name="l01044"></a>01044 } <a name="l01045"></a>01045 <a name="l01080"></a>01080 <span class="keywordtype">bool</span> <a name="l01081"></a><a class="code" href="classlibdap_1_1BaseType.html#a8a0000be2a244e3e07abda3020af8800">01081</a> <a class="code" href="classlibdap_1_1BaseType.html#a8a0000be2a244e3e07abda3020af8800" title="Evaluate relational operators.">BaseType::ops</a>(<a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *, <span class="keywordtype">int</span>) <a name="l01082"></a>01082 { <a name="l01083"></a>01083 <span class="comment">// Even though ops is a public method, it can never be called because</span> <a name="l01084"></a>01084 <span class="comment">// they will never have a BaseType object since this class is abstract,</span> <a name="l01085"></a>01085 <span class="comment">// however any of the child classes could by mistake call BaseType::ops</span> <a name="l01086"></a>01086 <span class="comment">// so this is an internal error. Jose Garcia</span> <a name="l01087"></a>01087 <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">"Unimplemented operator."</span>); <a name="l01088"></a>01088 } <a name="l01089"></a>01089 <a name="l01090"></a>01090 } <span class="comment">// namespace libdap</span> </pre></div></div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="BaseType_8cc.html">BaseType.cc</a> </li> <li class="footer">Generated on Tue Feb 8 2011 for libdap++ by  <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>