Sophie

Sophie

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

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++: Byte.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('Byte_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>Byte.cc</h1>  </div>
</div>
<div class="contents">
<a href="Byte_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 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 &lt;jgallagher@gso.uri.edu&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="comment">// Implementation for Byte.</span>
<a name="l00033"></a>00033 <span class="comment">//</span>
<a name="l00034"></a>00034 <span class="comment">// jhrg 9/7/94</span>
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">char</span> rcsid[] <a class="code" href="config_8h.html#a05e109ec893d0b12023d5b0cf4f718c4">not_used</a> =
<a name="l00040"></a>00040     { <span class="stringliteral">&quot;$Id: Byte.cc 21699 2009-11-05 00:06:01Z jimg $&quot;</span>
<a name="l00041"></a>00041     };
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="preprocessor">#include &quot;<a class="code" href="Byte_8h.html">Byte.h</a>&quot;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &quot;<a class="code" href="Int16_8h.html">Int16.h</a>&quot;</span>
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="UInt16_8h.html">UInt16.h</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="Int32_8h.html">Int32.h</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="UInt32_8h.html">UInt32.h</a>&quot;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &quot;<a class="code" href="Float32_8h.html">Float32.h</a>&quot;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &quot;<a class="code" href="Float64_8h.html">Float64.h</a>&quot;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &quot;<a class="code" href="Str_8h.html">Str.h</a>&quot;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include &quot;<a class="code" href="Url_8h.html">Url.h</a>&quot;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include &quot;<a class="code" href="Array_8h.html">Array.h</a>&quot;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include &quot;<a class="code" href="Structure_8h.html">Structure.h</a>&quot;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include &quot;<a class="code" href="Sequence_8h.html">Sequence.h</a>&quot;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include &quot;<a class="code" href="Grid_8h.html">Grid.h</a>&quot;</span>
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="preprocessor">#include &quot;<a class="code" href="DDS_8h.html">DDS.h</a>&quot;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#include &quot;<a class="code" href="Operators_8h.html">Operators.h</a>&quot;</span>
<a name="l00059"></a>00059 
<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="dods-limits_8h.html">dods-limits.h</a>&quot;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &quot;<a class="code" href="InternalErr_8h.html">InternalErr.h</a>&quot;</span>
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="keyword">using</span> std::cerr;
<a name="l00066"></a>00066 <span class="keyword">using</span> std::endl;
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 <span class="keyword">namespace </span>libdap {
<a name="l00069"></a>00069 
<a name="l00079"></a><a class="code" href="classlibdap_1_1Byte.html#a6b22d844cd6418102466954f8e1e3106">00079</a> <a class="code" href="classlibdap_1_1Byte.html#a6b22d844cd6418102466954f8e1e3106" title="The Byte constructor.">Byte::Byte</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp; n): <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#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>)
<a name="l00080"></a>00080 {}
<a name="l00081"></a>00081 
<a name="l00092"></a><a class="code" href="classlibdap_1_1Byte.html#aa0470214af169a5e1c080baa8257fbba">00092</a> <a class="code" href="classlibdap_1_1Byte.html#a6b22d844cd6418102466954f8e1e3106" title="The Byte constructor.">Byte::Byte</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 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#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>)
<a name="l00093"></a>00093 {}
<a name="l00094"></a>00094 
<a name="l00095"></a><a class="code" href="classlibdap_1_1Byte.html#a5931c171a88042d65f65117fc237e5ac">00095</a> <a class="code" href="classlibdap_1_1Byte.html#a6b22d844cd6418102466954f8e1e3106" title="The Byte constructor.">Byte::Byte</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Byte.html" title="Holds a single byte.">Byte</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="l00096"></a>00096 {
<a name="l00097"></a>00097     <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> = copy_from.<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>;
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099 
<a name="l00100"></a><a class="code" href="classlibdap_1_1Byte.html#a599c7dec30fe35df45c9a66cbb7030be">00100</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="classlibdap_1_1Byte.html#a599c7dec30fe35df45c9a66cbb7030be">Byte::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_1Byte.html#a6b22d844cd6418102466954f8e1e3106" title="The Byte constructor.">Byte</a>(*<span class="keyword">this</span>);
<a name="l00103"></a>00103 }
<a name="l00104"></a>00104 
<a name="l00105"></a><a class="code" href="classlibdap_1_1Byte.html#a38a34e521485f8c9c436b9cf1d44c3b9">00105</a> <a class="code" href="classlibdap_1_1Byte.html" title="Holds a single byte.">Byte</a> &amp; <a class="code" href="classlibdap_1_1Byte.html#a38a34e521485f8c9c436b9cf1d44c3b9">Byte::operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Byte.html" title="Holds a single byte.">Byte</a> &amp; rhs)
<a name="l00106"></a>00106 {
<a name="l00107"></a>00107     <span class="keywordflow">if</span> (<span class="keyword">this</span> == &amp;rhs)
<a name="l00108"></a>00108         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00109"></a>00109 
<a name="l00110"></a>00110     dynamic_cast &lt; <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> &amp; &gt;(*this) = rhs;
<a name="l00111"></a>00111 
<a name="l00112"></a>00112     <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> = rhs.<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>;
<a name="l00113"></a>00113 
<a name="l00114"></a>00114     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="classlibdap_1_1Byte.html#aaf9de466bfe7fe19cf50b6ecf3bf0a86">00117</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1Byte.html#aaf9de466bfe7fe19cf50b6ecf3bf0a86" title="Returns the size of the class instance data.">Byte::width</a>()
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119     <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(<a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>);
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121 
<a name="l00132"></a><a class="code" href="classlibdap_1_1Byte.html#aa70aeb6aaddd570ed5bc32215b53c88e">00132</a> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1Byte.html#aa70aeb6aaddd570ed5bc32215b53c88e">Byte::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="l00133"></a>00133                      <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="l00134"></a>00134 {
<a name="l00135"></a>00135     dds.<a class="code" href="classlibdap_1_1DDS.html#a8cd9b6a34f5e1a49665de3189e141de8">timeout_on</a>();
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <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="l00138"></a>00138         <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="l00139"></a>00139 
<a name="l00140"></a>00140 <span class="preprocessor">#if EVAL</span>
<a name="l00141"></a>00141 <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="l00142"></a>00142         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00143"></a>00143 <span class="preprocessor">#endif</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span>
<a name="l00145"></a>00145     dds.<a class="code" href="classlibdap_1_1DDS.html#a6740f99a5fc64640505924c5603ace0a">timeout_off</a>();
<a name="l00146"></a>00146 
<a name="l00147"></a>00147     m.<a class="code" href="classlibdap_1_1Marshaller.html#a3dca09eaab7f05d389a86a0c962da1ac">put_byte</a>( <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> ) ;
<a name="l00148"></a>00148 
<a name="l00149"></a>00149     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 
<a name="l00155"></a><a class="code" href="classlibdap_1_1Byte.html#a11a4fa1e2e5c6477c38af9fa5c3118b4">00155</a> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1Byte.html#a11a4fa1e2e5c6477c38af9fa5c3118b4" title="Deserialize the char on stdin and put the result in _BUF.">Byte::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="l00156"></a>00156 {
<a name="l00157"></a>00157     um.<a class="code" href="classlibdap_1_1UnMarshaller.html#a3bd83db8260c855db81eaeaf0078342e">get_byte</a>( <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> ) ;
<a name="l00158"></a>00158 
<a name="l00159"></a>00159     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 
<a name="l00167"></a><a class="code" href="classlibdap_1_1Byte.html#a8b8afd3348f7d22e6ff02c0c605c7bfd">00167</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1Byte.html#a8b8afd3348f7d22e6ff02c0c605c7bfd">Byte::val2buf</a>(<span class="keywordtype">void</span> *val, <span class="keywordtype">bool</span>)
<a name="l00168"></a>00168 {
<a name="l00169"></a>00169     <span class="comment">// Jose Garcia</span>
<a name="l00170"></a>00170     <span class="comment">// This method is public therefore and I believe it has being designed</span>
<a name="l00171"></a>00171     <span class="comment">// to be use by read which must be implemented on the surrogate library,</span>
<a name="l00172"></a>00172     <span class="comment">// thus if the pointer val is NULL, is an Internal Error.</span>
<a name="l00173"></a>00173     <span class="keywordflow">if</span> (!val)
<a name="l00174"></a>00174         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(<span class="stringliteral">&quot;the incoming pointer does not contain any data.&quot;</span>);
<a name="l00175"></a>00175 
<a name="l00176"></a>00176     <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> = *(<a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a> *) val;
<a name="l00177"></a>00177 
<a name="l00178"></a>00178     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Byte.html#aaf9de466bfe7fe19cf50b6ecf3bf0a86" title="Returns the size of the class instance data.">width</a>();
<a name="l00179"></a>00179 }
<a name="l00180"></a>00180 
<a name="l00181"></a><a class="code" href="classlibdap_1_1Byte.html#a2de44757203d23419d59c8731ca0b96c">00181</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1Byte.html#a2de44757203d23419d59c8731ca0b96c" title="Reads the class data.">Byte::buf2val</a>(<span class="keywordtype">void</span> **val)
<a name="l00182"></a>00182 {
<a name="l00183"></a>00183     <span class="comment">// Jose Garcia</span>
<a name="l00184"></a>00184     <span class="comment">// The same comment justifying throwing an Error in val2buf applies here.</span>
<a name="l00185"></a>00185     <span class="keywordflow">if</span> (!val)
<a name="l00186"></a>00186         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(<span class="stringliteral">&quot;NULL pointer&quot;</span>);
<a name="l00187"></a>00187 
<a name="l00188"></a>00188     <span class="keywordflow">if</span> (!*val)
<a name="l00189"></a>00189         *val = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>;
<a name="l00190"></a>00190 
<a name="l00191"></a>00191     *(<a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a> *) * val = <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>;
<a name="l00192"></a>00192 
<a name="l00193"></a>00193     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Byte.html#aaf9de466bfe7fe19cf50b6ecf3bf0a86" title="Returns the size of the class instance data.">width</a>();
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195 
<a name="l00200"></a><a class="code" href="classlibdap_1_1Byte.html#ad79ed596e502d99c450a8a1e23b381b7">00200</a> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1Byte.html#ad79ed596e502d99c450a8a1e23b381b7">Byte::set_value</a>(<a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a> value)
<a name="l00201"></a>00201 {
<a name="l00202"></a>00202     <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> = <a class="code" href="classlibdap_1_1Byte.html#afcb7d879a5a0185d39518ff0fcc10afd">value</a>;
<a name="l00203"></a>00203     <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="l00204"></a>00204 
<a name="l00205"></a>00205     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00206"></a>00206 }
<a name="l00207"></a>00207 
<a name="l00210"></a><a class="code" href="classlibdap_1_1Byte.html#afcb7d879a5a0185d39518ff0fcc10afd">00210</a> <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a> <a class="code" href="classlibdap_1_1Byte.html#afcb7d879a5a0185d39518ff0fcc10afd">Byte::value</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> <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>;
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l00216"></a>00216 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Byte.html#adc3565bb42fd7454205e61a8f16119e4" title="Prints the value of the variable.">Byte::print_val</a>(FILE * out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l00219"></a>00219         <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="l00220"></a>00220         fprintf(out, <span class="stringliteral">&quot; = %d;\n&quot;</span>, (<span class="keywordtype">int</span>) <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>);
<a name="l00221"></a>00221     }
<a name="l00222"></a>00222     <span class="keywordflow">else</span>
<a name="l00223"></a>00223         fprintf(out, <span class="stringliteral">&quot;%d&quot;</span>, (<span class="keywordtype">int</span>) <a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>);
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225 <span class="preprocessor">#endif</span>
<a name="l00226"></a>00226 <span class="preprocessor"></span>
<a name="l00227"></a><a class="code" href="classlibdap_1_1Byte.html#adc3565bb42fd7454205e61a8f16119e4">00227</a> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Byte.html#adc3565bb42fd7454205e61a8f16119e4" title="Prints the value of the variable.">Byte::print_val</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l00228"></a>00228 {
<a name="l00229"></a>00229     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l00230"></a>00230         <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="l00231"></a>00231         out &lt;&lt; <span class="stringliteral">&quot; = &quot;</span> &lt;&lt; (int)<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span> ;
<a name="l00232"></a>00232     }
<a name="l00233"></a>00233     <span class="keywordflow">else</span>
<a name="l00234"></a>00234         out &lt;&lt; (int)<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> ;
<a name="l00235"></a>00235 }
<a name="l00236"></a>00236 
<a name="l00237"></a><a class="code" href="classlibdap_1_1Byte.html#ad97b380875f85f6e7c3d02488f209afa">00237</a> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1Byte.html#ad97b380875f85f6e7c3d02488f209afa" title="Evaluate relational operators.">Byte::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 
<a name="l00240"></a>00240     <span class="comment">// Extract the Byte arg&#39;s value.</span>
<a name="l00241"></a>00241     <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="l00242"></a>00242         <span class="comment">// Jose Garcia</span>
<a name="l00243"></a>00243         <span class="comment">// Since the read method is virtual and implemented outside</span>
<a name="l00244"></a>00244         <span class="comment">// libdap++ if we cannot read the data that is the problem</span>
<a name="l00245"></a>00245         <span class="comment">// of the user or of whoever wrote the surrogate library</span>
<a name="l00246"></a>00246         <span class="comment">// implementing read therefore it is an internal error.</span>
<a name="l00247"></a>00247         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(<span class="stringliteral">&quot;This value not read!&quot;</span>);
<a name="l00248"></a>00248     }
<a name="l00249"></a>00249     <span class="comment">// Extract the second arg&#39;s value.</span>
<a name="l00250"></a>00250     <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="l00251"></a>00251         <span class="comment">// Jose Garcia</span>
<a name="l00252"></a>00252         <span class="comment">// Since the read method is virtual and implemented outside</span>
<a name="l00253"></a>00253         <span class="comment">// libdap++ if we cannot read the data that is the problem</span>
<a name="l00254"></a>00254         <span class="comment">// of the user or of whoever wrote the surrogate library</span>
<a name="l00255"></a>00255         <span class="comment">// implementing read therefore it is an internal error.</span>
<a name="l00256"></a>00256         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1InternalErr.html" title="A class for software fault reporting.">InternalErr</a>(<span class="stringliteral">&quot;This value not read!&quot;</span>);
<a name="l00257"></a>00257     }
<a name="l00258"></a>00258 
<a name="l00259"></a>00259     <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="l00260"></a>00260     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>:
<a name="l00261"></a>00261         <span class="keywordflow">return</span> rops &lt; dods_byte, dods_byte, Cmp &lt; dods_byte, dods_byte &gt; &gt;
<a name="l00262"></a>00262                (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1Byte.html" title="Holds a single byte.">Byte</a> * &gt;(b)-&gt;_buf, op);
<a name="l00263"></a>00263     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>:
<a name="l00264"></a>00264         <span class="keywordflow">return</span> <a class="code" href="namespacelibdap.html#a79dd96d2f12a08a71d0aa3ecd42b9b47">rops</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>, <a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a>, <a class="code" href="classlibdap_1_1USCmp.html">USCmp</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>,
<a name="l00265"></a>00265                dods_int16 &gt; &gt; (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1Int16.html" title="Holds a 16-bit signed integer value.">Int16</a> * &gt;(b)-&gt;_buf, op);
<a name="l00266"></a>00266     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>:
<a name="l00267"></a>00267         <span class="keywordflow">return</span> <a class="code" href="namespacelibdap.html#a79dd96d2f12a08a71d0aa3ecd42b9b47">rops</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>, <a class="code" href="namespacelibdap.html#af0edc957e05ac3c9e085c2b4f30b2d18">dods_uint16</a>, <a class="code" href="classlibdap_1_1Cmp.html">Cmp</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>,
<a name="l00268"></a>00268                dods_uint16 &gt; &gt; (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1UInt16.html" title="Holds an unsigned 16-bit integer.">UInt16</a> * &gt;(b)-&gt;_buf, op);
<a name="l00269"></a>00269     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a524bfec434d0a8f82e06bfcc02c9a6b1">dods_int32_c</a>:
<a name="l00270"></a>00270         <span class="keywordflow">return</span> <a class="code" href="namespacelibdap.html#a79dd96d2f12a08a71d0aa3ecd42b9b47">rops</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>, <a class="code" href="namespacelibdap.html#ae759bb5209e20f49935f93743022b8bc">dods_int32</a>, <a class="code" href="classlibdap_1_1USCmp.html">USCmp</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>,
<a name="l00271"></a>00271                dods_int32 &gt; &gt; (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1Int32.html" title="Holds a 32-bit signed integer.">Int32</a> * &gt;(b)-&gt;_buf, op);
<a name="l00272"></a>00272     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>:
<a name="l00273"></a>00273         <span class="keywordflow">return</span> <a class="code" href="namespacelibdap.html#a79dd96d2f12a08a71d0aa3ecd42b9b47">rops</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>, <a class="code" href="namespacelibdap.html#acbbf2cafed9043c5e0cd44df0f75fc6d">dods_uint32</a>, <a class="code" href="classlibdap_1_1Cmp.html">Cmp</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>,
<a name="l00274"></a>00274                dods_uint32 &gt; &gt; (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1UInt32.html" title="Holds a 32-bit unsigned integer.">UInt32</a> * &gt;(b)-&gt;_buf, op);
<a name="l00275"></a>00275     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>:
<a name="l00276"></a>00276         <span class="keywordflow">return</span> <a class="code" href="namespacelibdap.html#a79dd96d2f12a08a71d0aa3ecd42b9b47">rops</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>, <a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a>, <a class="code" href="classlibdap_1_1Cmp.html">Cmp</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>,
<a name="l00277"></a>00277                dods_float32 &gt; &gt; (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1Float32.html" title="Holds a 32-bit floating point value.">Float32</a> * &gt;(b)-&gt;_buf,
<a name="l00278"></a>00278                                  op);
<a name="l00279"></a>00279     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>:
<a name="l00280"></a>00280         <span class="keywordflow">return</span> <a class="code" href="namespacelibdap.html#a79dd96d2f12a08a71d0aa3ecd42b9b47">rops</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>, <a class="code" href="namespacelibdap.html#af677a1bef7552bc36d52ecdcdd2c878f">dods_float64</a>, <a class="code" href="classlibdap_1_1Cmp.html">Cmp</a> &lt; <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a>,
<a name="l00281"></a>00281                dods_float64 &gt; &gt; (<a class="code" href="classlibdap_1_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a>, dynamic_cast &lt; <a class="code" href="classlibdap_1_1Float64.html" title="Holds a 64-bit (double precision) floating point value.">Float64</a> * &gt;(b)-&gt;_buf,
<a name="l00282"></a>00282                                  op);
<a name="l00283"></a>00283     <span class="keywordflow">default</span>:
<a name="l00284"></a>00284         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00285"></a>00285     }
<a name="l00286"></a>00286 }
<a name="l00287"></a>00287 
<a name="l00296"></a><a class="code" href="classlibdap_1_1Byte.html#a7a8dcba1239f9e3f3f40f622fc3ce859">00296</a> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Byte.html#a7a8dcba1239f9e3f3f40f622fc3ce859" title="dumps information about this object">Byte::dump</a>(ostream &amp; strm)<span class="keyword"> const</span>
<a name="l00297"></a>00297 <span class="keyword"></span>{
<a name="l00298"></a>00298     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;Byte::dump - (&quot;</span>
<a name="l00299"></a>00299     &lt;&lt; (<span class="keywordtype">void</span> *) <span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot;)&quot;</span> &lt;&lt; endl;
<a name="l00300"></a>00300     <a class="code" href="classlibdap_1_1DapIndent.html#a4ed2cce66dbff9ad4320e89142103c6c">DapIndent::Indent</a>();
<a name="l00301"></a>00301     <a class="code" href="classlibdap_1_1Byte.html#a7a8dcba1239f9e3f3f40f622fc3ce859" title="dumps information about this object">BaseType::dump</a>(strm);
<a name="l00302"></a>00302     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_1Byte.html#a7804c9e80fa9384292a4c47940c83ca4">_buf</a> &lt;&lt; endl;
<a name="l00303"></a>00303     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>();
<a name="l00304"></a>00304 }
<a name="l00305"></a>00305 
<a name="l00306"></a>00306 } <span class="comment">// namespace libdap</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="Byte_8cc.html">Byte.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>