Sophie

Sophie

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

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++: Float32.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('Float32_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>Float32.cc</h1>  </div>
</div>
<div class="contents">
<a href="Float32_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 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 <span class="comment">// Implementation for Float32.</span>
<a name="l00033"></a>00033 <span class="comment">//</span>
<a name="l00034"></a>00034 <span class="comment">// 3/22/99 jhrg</span>
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;iomanip&gt;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">char</span> rcsid[] <a class="code" href="config_8h.html#a05e109ec893d0b12023d5b0cf4f718c4">not_used</a> =
<a name="l00042"></a>00042     {<span class="stringliteral">&quot;$Id: Float32.cc 21699 2009-11-05 00:06:01Z jimg $&quot;</span>
<a name="l00043"></a>00043     };
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="Byte_8h.html">Byte.h</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="Int16_8h.html">Int16.h</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="UInt16_8h.html">UInt16.h</a>&quot;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &quot;<a class="code" href="Int32_8h.html">Int32.h</a>&quot;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &quot;<a class="code" href="UInt32_8h.html">UInt32.h</a>&quot;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &quot;<a class="code" href="Float32_8h.html">Float32.h</a>&quot;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &quot;<a class="code" href="Float64_8h.html">Float64.h</a>&quot;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &quot;<a class="code" href="Str_8h.html">Str.h</a>&quot;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &quot;<a class="code" href="Url_8h.html">Url.h</a>&quot;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &quot;<a class="code" href="Array_8h.html">Array.h</a>&quot;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include &quot;<a class="code" href="Structure_8h.html">Structure.h</a>&quot;</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include &quot;<a class="code" href="Sequence_8h.html">Sequence.h</a>&quot;</span>
<a name="l00057"></a>00057 <span class="preprocessor">#include &quot;<a class="code" href="Grid_8h.html">Grid.h</a>&quot;</span>
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 <span class="preprocessor">#include &quot;<a class="code" href="DDS_8h.html">DDS.h</a>&quot;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &quot;<a class="code" href="util_8h.html">util.h</a>&quot;</span>
<a name="l00061"></a>00061 <span class="preprocessor">#include &quot;<a class="code" href="parser_8h.html">parser.h</a>&quot;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#include &quot;<a class="code" href="Operators_8h.html">Operators.h</a>&quot;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &quot;<a class="code" href="dods-limits_8h.html">dods-limits.h</a>&quot;</span>
<a name="l00064"></a>00064 <span class="preprocessor">#include &quot;<a class="code" href="InternalErr_8h.html">InternalErr.h</a>&quot;</span>
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 
<a name="l00067"></a>00067 <span class="keyword">using</span> std::cerr;
<a name="l00068"></a>00068 <span class="keyword">using</span> std::endl;
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="keyword">namespace </span>libdap {
<a name="l00071"></a>00071 
<a name="l00079"></a><a class="code" href="classlibdap_1_1Float32.html#a440340df1382b7a5ddb0c5de7c690d39">00079</a> <a class="code" href="classlibdap_1_1Float32.html#a440340df1382b7a5ddb0c5de7c690d39">Float32::Float32</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n)
<a name="l00080"></a>00080         : <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a>(n, <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>)
<a name="l00081"></a>00081 {}
<a name="l00082"></a>00082 
<a name="l00090"></a><a class="code" href="classlibdap_1_1Float32.html#abb78eb0831332e4203c02d587bdc622c">00090</a> <a class="code" href="classlibdap_1_1Float32.html#a440340df1382b7a5ddb0c5de7c690d39">Float32::Float32</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;n, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;d)
<a name="l00091"></a>00091         : <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a>(n, d, <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>)
<a name="l00092"></a>00092 {}
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="classlibdap_1_1Float32.html#a5a2c3a95ef18f47d32643fff1a71435c">00094</a> <a class="code" href="classlibdap_1_1Float32.html#a440340df1382b7a5ddb0c5de7c690d39">Float32::Float32</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Float32.html" title="Holds a 32-bit floating point value.">Float32</a> &amp;copy_from) : <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a>(copy_from)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096     <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> = copy_from.<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>;
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00100"></a><a class="code" href="classlibdap_1_1Float32.html#a05e8f21ce016d9bea6b572a900e4d473">00100</a> <a class="code" href="classlibdap_1_1Float32.html#a05e8f21ce016d9bea6b572a900e4d473">Float32::ptr_duplicate</a>()
<a name="l00101"></a>00101 {
<a name="l00102"></a>00102     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classlibdap_1_1Float32.html#a440340df1382b7a5ddb0c5de7c690d39">Float32</a>(*<span class="keyword">this</span>);
<a name="l00103"></a>00103 }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105 <a class="code" href="classlibdap_1_1Float32.html" title="Holds a 32-bit floating point value.">Float32</a> &amp;
<a name="l00106"></a><a class="code" href="classlibdap_1_1Float32.html#a3a2a80201f53d63e874cf8ec80eba67a">00106</a> <a class="code" href="classlibdap_1_1Float32.html#a3a2a80201f53d63e874cf8ec80eba67a">Float32::operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Float32.html" title="Holds a 32-bit floating point value.">Float32</a> &amp;rhs)
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108     <span class="keywordflow">if</span> (<span class="keyword">this</span> == &amp;rhs)
<a name="l00109"></a>00109         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00110"></a>00110 
<a name="l00111"></a>00111     <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;
<a name="l00112"></a>00112 
<a name="l00113"></a>00113     <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> = rhs.<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>;
<a name="l00114"></a>00114 
<a name="l00115"></a>00115     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117 
<a name="l00118"></a>00118 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00119"></a><a class="code" href="classlibdap_1_1Float32.html#afb9f3bcf6d95c9fa752b41f5f1bd9eb1">00119</a> <a class="code" href="classlibdap_1_1Float32.html#afb9f3bcf6d95c9fa752b41f5f1bd9eb1" title="Returns the size of the class instance data.">Float32::width</a>()
<a name="l00120"></a>00120 {
<a name="l00121"></a>00121     <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(<a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a>);
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 <span class="keywordtype">bool</span>
<a name="l00125"></a><a class="code" href="classlibdap_1_1Float32.html#af2aa447cb5128232e6f7cd4d7b3cac53">00125</a> <a class="code" href="classlibdap_1_1Float32.html#af2aa447cb5128232e6f7cd4d7b3cac53" title="Move data to the net.">Float32::serialize</a>(<a class="code" href="classlibdap_1_1ConstraintEvaluator.html" title="Evaluate a constraint expression.">ConstraintEvaluator</a> &amp;eval, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> &amp;dds,
<a name="l00126"></a>00126                    <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshal/serialize dap data objects">Marshaller</a> &amp;m, <span class="keywordtype">bool</span> ce_eval)
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128     dds.<a class="code" href="classlibdap_1_1DDS.html#a8cd9b6a34f5e1a49665de3189e141de8">timeout_on</a>();
<a name="l00129"></a>00129 
<a name="l00130"></a>00130     <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="l00131"></a>00131         <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="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="preprocessor">#if EVAL</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>    <span class="keywordflow">if</span> (ce_eval &amp;&amp; !eval.<a class="code" href="classlibdap_1_1ConstraintEvaluator.html#aa0066a57cf00c975f6ccbc2e90c64742" title="Evaluate a boolean-valued constraint expression. This is main method for the evaluator ans is called ...">eval_selection</a>(dds, <a class="code" href="classlibdap_1_1BaseType.html#a9f102f5cc17ac7d2d80f9921e10d3baf" title="Returns the name of the dataset used to create this instance.">dataset</a>()))
<a name="l00135"></a>00135         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00136"></a>00136 <span class="preprocessor">#endif</span>
<a name="l00137"></a>00137 <span class="preprocessor"></span>
<a name="l00138"></a>00138     dds.<a class="code" href="classlibdap_1_1DDS.html#a6740f99a5fc64640505924c5603ace0a">timeout_off</a>();
<a name="l00139"></a>00139 
<a name="l00140"></a>00140     m.<a class="code" href="classlibdap_1_1Marshaller.html#ac251489a50acd9fa32990c2cb48c28f5">put_float32</a>( <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> ) ;
<a name="l00141"></a>00141 
<a name="l00142"></a>00142     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="keywordtype">bool</span>
<a name="l00146"></a><a class="code" href="classlibdap_1_1Float32.html#a8c274b30cfb8ebcb34ccecae15438da1">00146</a> <a class="code" href="classlibdap_1_1Float32.html#a8c274b30cfb8ebcb34ccecae15438da1" title="Receive data from the net.">Float32::deserialize</a>(<a class="code" href="classlibdap_1_1UnMarshaller.html" title="abstract base class used to unmarshall/deserialize dap data objects">UnMarshaller</a> &amp;um, <a class="code" href="classlibdap_1_1DDS.html">DDS</a> *, <span class="keywordtype">bool</span>)
<a name="l00147"></a>00147 {
<a name="l00148"></a>00148     um.<a class="code" href="classlibdap_1_1UnMarshaller.html#a9cc9a16495b80c7f29d1bc7b2f4b29dc">get_float32</a>( <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> ) ;
<a name="l00149"></a>00149 
<a name="l00150"></a>00150     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00151"></a>00151 }
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00154"></a><a class="code" href="classlibdap_1_1Float32.html#a3204d0d25e857aeefc00b36065e5bde8">00154</a> <a class="code" href="classlibdap_1_1Float32.html#a3204d0d25e857aeefc00b36065e5bde8" title="Loads class data.">Float32::val2buf</a>(<span class="keywordtype">void</span> *val, <span class="keywordtype">bool</span>)
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156     <span class="comment">// Jose Garcia This method is public I believe it has been</span>
<a name="l00157"></a>00157     <span class="comment">// designed to be used by read which must be implemented in a</span>
<a name="l00158"></a>00158     <span class="comment">// subclass, thus if the pointer val is NULL, is an Internal</span>
<a name="l00159"></a>00159     <span class="comment">// Error.</span>
<a name="l00160"></a>00160     <span class="comment">// Changed to InternalErr. jhrg</span>
<a name="l00161"></a>00161     <span class="keywordflow">if</span> (!val)
<a name="l00162"></a>00162         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__,
<a name="l00163"></a>00163                           <span class="stringliteral">&quot;The incoming pointer does not contain any data.&quot;</span>);
<a name="l00164"></a>00164 
<a name="l00165"></a>00165     <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> = *(<a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a> *)val;
<a name="l00166"></a>00166 
<a name="l00167"></a>00167     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Float32.html#afb9f3bcf6d95c9fa752b41f5f1bd9eb1" title="Returns the size of the class instance data.">width</a>();
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169 
<a name="l00170"></a>00170 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00171"></a><a class="code" href="classlibdap_1_1Float32.html#af6f943ec5481067249a6b56ec57c6ec5">00171</a> <a class="code" href="classlibdap_1_1Float32.html#af6f943ec5481067249a6b56ec57c6ec5" title="Reads the class data.">Float32::buf2val</a>(<span class="keywordtype">void</span> **val)
<a name="l00172"></a>00172 {
<a name="l00173"></a>00173     <span class="comment">// Jose Garcia</span>
<a name="l00174"></a>00174     <span class="comment">// The same comment justifying throwing an Error in val2buf applies here.</span>
<a name="l00175"></a>00175     <span class="keywordflow">if</span> (!val)
<a name="l00176"></a>00176         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__, <span class="stringliteral">&quot;NULL pointer.&quot;</span>);
<a name="l00177"></a>00177 
<a name="l00178"></a>00178     <span class="keywordflow">if</span> (!*val)
<a name="l00179"></a>00179         *val = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a>;
<a name="l00180"></a>00180 
<a name="l00181"></a>00181     *(<a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a> *)*val = <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>;
<a name="l00182"></a>00182 
<a name="l00183"></a>00183     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Float32.html#afb9f3bcf6d95c9fa752b41f5f1bd9eb1" title="Returns the size of the class instance data.">width</a>();
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185 
<a name="l00186"></a>00186 <span class="keywordtype">bool</span>
<a name="l00187"></a><a class="code" href="classlibdap_1_1Float32.html#a39f5adac2bd94e2fc0de1d483396afcb">00187</a> <a class="code" href="classlibdap_1_1Float32.html#a39f5adac2bd94e2fc0de1d483396afcb">Float32::set_value</a>(<a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a> f)
<a name="l00188"></a>00188 {
<a name="l00189"></a>00189     <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> = f;
<a name="l00190"></a>00190     <a class="code" href="classlibdap_1_1BaseType.html#a4533905a450d2a7af32e7d5acd557676" title="Sets the value of the read_p property.">set_read_p</a>(<span class="keyword">true</span>);
<a name="l00191"></a>00191 
<a name="l00192"></a>00192     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194 
<a name="l00200"></a>00200 <a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a>
<a name="l00201"></a><a class="code" href="classlibdap_1_1Float32.html#a7371bd4111884f04d2e93039312153a4">00201</a> <a class="code" href="classlibdap_1_1Float32.html#a7371bd4111884f04d2e93039312153a4">Float32::value</a>()<span class="keyword"> const</span>
<a name="l00202"></a>00202 <span class="keyword"></span>{
<a name="l00203"></a>00203     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>;
<a name="l00204"></a>00204 }
<a name="l00205"></a>00205 
<a name="l00206"></a>00206 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l00207"></a>00207 <span class="preprocessor"></span><span class="keywordtype">void</span>
<a name="l00208"></a>00208 <a class="code" href="classlibdap_1_1Float32.html#a16d3bc5792e80d6bf660416391f81dde" title="Prints the value of the variable.">Float32::print_val</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210     <span class="comment">// FIX: need to set precision in the printing somehow.</span>
<a name="l00211"></a>00211     <span class="comment">// os.precision(DODS_FLT_DIG);</span>
<a name="l00212"></a>00212 
<a name="l00213"></a>00213     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l00214"></a>00214         <a class="code" href="classlibdap_1_1BaseType.html#afd744b0ddeb04e7b173c9e83423ec572" title="Print an ASCII representation of the variable structure.">print_decl</a>(out, space, <span class="keyword">false</span>);
<a name="l00215"></a>00215         fprintf(out, <span class="stringliteral">&quot; = %.6g;\n&quot;</span>, <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>) ;
<a name="l00216"></a>00216     }
<a name="l00217"></a>00217     <span class="keywordflow">else</span>
<a name="l00218"></a>00218         fprintf(out, <span class="stringliteral">&quot;%.6g&quot;</span>, <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>) ;
<a name="l00219"></a>00219 }
<a name="l00220"></a>00220 <span class="preprocessor">#endif</span>
<a name="l00221"></a>00221 <span class="preprocessor"></span>
<a name="l00222"></a>00222 <span class="keywordtype">void</span>
<a name="l00223"></a><a class="code" href="classlibdap_1_1Float32.html#a16d3bc5792e80d6bf660416391f81dde">00223</a> <a class="code" href="classlibdap_1_1Float32.html#a16d3bc5792e80d6bf660416391f81dde" title="Prints the value of the variable.">Float32::print_val</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l00224"></a>00224 {
<a name="l00225"></a>00225     <span class="comment">// FIX: need to set precision in the printing somehow.</span>
<a name="l00226"></a>00226     <span class="comment">// os.precision(DODS_FLT_DIG);</span>
<a name="l00227"></a>00227 
<a name="l00228"></a>00228     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l00229"></a>00229         <a class="code" href="classlibdap_1_1BaseType.html#afd744b0ddeb04e7b173c9e83423ec572" title="Print an ASCII representation of the variable structure.">print_decl</a>(out, space, <span class="keyword">false</span>);
<a name="l00230"></a>00230         out &lt;&lt; <span class="stringliteral">&quot; = &quot;</span> &lt;&lt; std::setprecision( 6 ) &lt;&lt; <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span> ;
<a name="l00231"></a>00231     }
<a name="l00232"></a>00232     <span class="keywordflow">else</span>
<a name="l00233"></a>00233         out &lt;&lt; std::setprecision( 6 ) &lt;&lt; <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> ;
<a name="l00234"></a>00234 }
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 <span class="keywordtype">bool</span>
<a name="l00237"></a><a class="code" href="classlibdap_1_1Float32.html#accebf037e94f4e455cce505295c4cb0a">00237</a> <a class="code" href="classlibdap_1_1Float32.html#accebf037e94f4e455cce505295c4cb0a" title="Evaluate relational operators.">Float32::ops</a>(<a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *b, <span class="keywordtype">int</span> op)
<a name="l00238"></a>00238 {
<a name="l00239"></a>00239     <span class="comment">// Get this instance&#39;s value</span>
<a name="l00240"></a>00240     <span class="keywordflow">if</span> (!<a class="code" href="classlibdap_1_1BaseType.html#a38ff819a432217c55db2e9071928d20c" title="Has this variable been read?">read_p</a>() &amp;&amp; !<a class="code" href="classlibdap_1_1BaseType.html#a1da003c53f2e663223f603ab3fbd7c8e" title="Read data into a local buffer.">read</a>()) {
<a name="l00241"></a>00241         <span class="comment">// Jose Garcia Since the read method is virtual and</span>
<a name="l00242"></a>00242         <span class="comment">// implemented outside libdap++ if we cannot read the data</span>
<a name="l00243"></a>00243         <span class="comment">// that is the problem of whomever wrote the implementation of</span>
<a name="l00244"></a>00244         <span class="comment">// read and therefore it is an internal error.</span>
<a name="l00245"></a>00245         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__, <span class="stringliteral">&quot;This value not read!&quot;</span>);
<a name="l00246"></a>00246     }
<a name="l00247"></a>00247 
<a name="l00248"></a>00248     <span class="comment">// Extract the second arg&#39;s value.</span>
<a name="l00249"></a>00249     <span class="keywordflow">if</span> (!b || !(b-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a38ff819a432217c55db2e9071928d20c" title="Has this variable been read?">read_p</a>() || b-&gt;<a class="code" href="classlibdap_1_1BaseType.html#a1da003c53f2e663223f603ab3fbd7c8e" title="Read data into a local buffer.">read</a>())) {
<a name="l00250"></a>00250         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(__FILE__, __LINE__, <span class="stringliteral">&quot;This value not read!&quot;</span>);
<a name="l00251"></a>00251     }
<a name="l00252"></a>00252 
<a name="l00253"></a>00253     <span class="keywordflow">switch</span> (b-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>()) {
<a name="l00254"></a>00254     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>:
<a name="l00255"></a>00255         <span class="keywordflow">return</span> rops&lt;dods_float32, dods_byte, Cmp&lt;dods_float32, dods_byte&gt; &gt;
<a name="l00256"></a>00256                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Byte.html" title="Holds a single byte.">Byte</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<a name="l00257"></a>00257     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>:
<a name="l00258"></a>00258         <span class="keywordflow">return</span> rops&lt;dods_float32, dods_int16, Cmp&lt;dods_float32, dods_int16&gt; &gt;
<a name="l00259"></a>00259                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Int16.html" title="Holds a 16-bit signed integer value.">Int16</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<a name="l00260"></a>00260     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>:
<a name="l00261"></a>00261         <span class="keywordflow">return</span> rops&lt;dods_float32, dods_uint16, Cmp&lt;dods_float32, dods_uint16&gt; &gt;
<a name="l00262"></a>00262                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1UInt16.html" title="Holds an unsigned 16-bit integer.">UInt16</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<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> rops&lt;dods_float32, dods_int32, Cmp&lt;dods_float32, dods_int32&gt; &gt;
<a name="l00265"></a>00265                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Int32.html" title="Holds a 32-bit signed integer.">Int32</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<a name="l00266"></a>00266     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>:
<a name="l00267"></a>00267         <span class="keywordflow">return</span> rops&lt;dods_float32, dods_uint32, Cmp&lt;dods_float32, dods_uint32&gt; &gt;
<a name="l00268"></a>00268                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1UInt32.html" title="Holds a 32-bit unsigned integer.">UInt32</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<a name="l00269"></a>00269     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>:
<a name="l00270"></a>00270         <span class="keywordflow">return</span> rops&lt;dods_float32, dods_float32, Cmp&lt;dods_float32, dods_float32&gt; &gt;
<a name="l00271"></a>00271                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Float32.html" title="Holds a 32-bit floating point value.">Float32</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<a name="l00272"></a>00272     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>:
<a name="l00273"></a>00273         <span class="keywordflow">return</span> rops&lt;dods_float32, dods_float64, Cmp&lt;dods_float32, dods_float64&gt; &gt;
<a name="l00274"></a>00274                (<a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a>, <span class="keyword">dynamic_cast&lt;</span><a class="code" href="classlibdap_1_1Float64.html" title="Holds a 64-bit (double precision) floating point value.">Float64</a> *<span class="keyword">&gt;</span>(b)-&gt;_buf, op);
<a name="l00275"></a>00275     <span class="keywordflow">default</span>:
<a name="l00276"></a>00276         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00277"></a>00277     }
<a name="l00278"></a>00278 }
<a name="l00279"></a>00279 
<a name="l00288"></a>00288 <span class="keywordtype">void</span>
<a name="l00289"></a><a class="code" href="classlibdap_1_1Float32.html#a8244fea2d040cdf884648cebd9892d46">00289</a> <a class="code" href="classlibdap_1_1Float32.html#a8244fea2d040cdf884648cebd9892d46" title="dumps information about this object">Float32::dump</a>(ostream &amp;strm)<span class="keyword"> const</span>
<a name="l00290"></a>00290 <span class="keyword"></span>{
<a name="l00291"></a>00291     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;Float32::dump - (&quot;</span> &lt;&lt; (<span class="keywordtype">void</span> *)<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>
<a name="l00292"></a>00292          &lt;&lt; endl ;
<a name="l00293"></a>00293     <a class="code" href="classlibdap_1_1DapIndent.html#a4ed2cce66dbff9ad4320e89142103c6c">DapIndent::Indent</a>() ;
<a name="l00294"></a>00294     <a class="code" href="classlibdap_1_1Float32.html#a8244fea2d040cdf884648cebd9892d46" title="dumps information about this object">BaseType::dump</a>(strm) ;
<a name="l00295"></a>00295     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;value: &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1Float32.html#a834262cb760e896325c7597ca78ceedb">_buf</a> &lt;&lt; endl ;
<a name="l00296"></a>00296     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ;
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 } <span class="comment">// namespace libdap</span>
<a name="l00300"></a>00300 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="Float32_8cc.html">Float32.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>