Sophie

Sophie

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

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++: Int16.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('Int16_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>Int16.cc</h1>  </div>
</div>
<div class="contents">
<a href="Int16_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 1996-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 Int32.</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: Int16.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="util_8h.html">util.h</a>&quot;</span>
<a name="l00059"></a>00059 <span class="preprocessor">#include &quot;<a class="code" href="parser_8h.html">parser.h</a>&quot;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include &quot;<a class="code" href="Operators_8h.html">Operators.h</a>&quot;</span>
<a name="l00061"></a>00061 <span class="preprocessor">#include &quot;<a class="code" href="dods-limits_8h.html">dods-limits.h</a>&quot;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#include &quot;<a class="code" href="debug_8h.html">debug.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="l00074"></a><a class="code" href="classlibdap_1_1Int16.html#a8221f1fa8aaf054c72059a48e5ec2753">00074</a> <a class="code" href="classlibdap_1_1Int16.html#a8221f1fa8aaf054c72059a48e5ec2753">Int16::Int16</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#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>)
<a name="l00075"></a>00075 {}
<a name="l00076"></a>00076 
<a name="l00084"></a><a class="code" href="classlibdap_1_1Int16.html#a40e5dd3ede0dce7a1b15320358519d6f">00084</a> <a class="code" href="classlibdap_1_1Int16.html#a8221f1fa8aaf054c72059a48e5ec2753">Int16::Int16</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#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>)
<a name="l00085"></a>00085 {}
<a name="l00086"></a>00086 
<a name="l00087"></a><a class="code" href="classlibdap_1_1Int16.html#a89761a72409722d72d5186d9aea825e0">00087</a> <a class="code" href="classlibdap_1_1Int16.html#a8221f1fa8aaf054c72059a48e5ec2753">Int16::Int16</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Int16.html" title="Holds a 16-bit signed integer value.">Int16</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="l00088"></a>00088 {
<a name="l00089"></a>00089     <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> = copy_from.<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a>;
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *
<a name="l00093"></a><a class="code" href="classlibdap_1_1Int16.html#a2deba43131c5ca63ae81f4f7449b6327">00093</a> <a class="code" href="classlibdap_1_1Int16.html#a2deba43131c5ca63ae81f4f7449b6327">Int16::ptr_duplicate</a>()
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classlibdap_1_1Int16.html#a8221f1fa8aaf054c72059a48e5ec2753">Int16</a>(*<span class="keyword">this</span>);
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 <a class="code" href="classlibdap_1_1Int16.html" title="Holds a 16-bit signed integer value.">Int16</a> &amp;
<a name="l00099"></a><a class="code" href="classlibdap_1_1Int16.html#a68375240267e7ab5324bd77cf86379d8">00099</a> <a class="code" href="classlibdap_1_1Int16.html#a68375240267e7ab5324bd77cf86379d8">Int16::operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Int16.html" title="Holds a 16-bit signed integer value.">Int16</a> &amp;rhs)
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101     <span class="keywordflow">if</span> (<span class="keyword">this</span> == &amp;rhs)
<a name="l00102"></a>00102         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00103"></a>00103 
<a name="l00104"></a>00104     <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="l00105"></a>00105 
<a name="l00106"></a>00106     <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> = rhs.<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a>;
<a name="l00107"></a>00107 
<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 
<a name="l00111"></a>00111 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00112"></a><a class="code" href="classlibdap_1_1Int16.html#a0f6b0d727089a08bf1979ee31039401c">00112</a> <a class="code" href="classlibdap_1_1Int16.html#a0f6b0d727089a08bf1979ee31039401c" title="Returns the size of the class instance data.">Int16::width</a>()
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114     <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(<a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a>);
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="keywordtype">bool</span>
<a name="l00118"></a><a class="code" href="classlibdap_1_1Int16.html#a3c6904ab6d9679c194c6519dde592892">00118</a> <a class="code" href="classlibdap_1_1Int16.html#a3c6904ab6d9679c194c6519dde592892" title="Move data to the net.">Int16::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="l00119"></a>00119                  <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="l00120"></a>00120 {
<a name="l00121"></a>00121     dds.<a class="code" href="classlibdap_1_1DDS.html#a8cd9b6a34f5e1a49665de3189e141de8">timeout_on</a>();
<a name="l00122"></a>00122 
<a name="l00123"></a>00123     <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="l00124"></a>00124         <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="l00125"></a>00125 
<a name="l00126"></a>00126 <span class="preprocessor">#if EVAL</span>
<a name="l00127"></a>00127 <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="l00128"></a>00128         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00129"></a>00129 <span class="preprocessor">#endif</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span>
<a name="l00131"></a>00131     dds.<a class="code" href="classlibdap_1_1DDS.html#a6740f99a5fc64640505924c5603ace0a">timeout_off</a>();
<a name="l00132"></a>00132 
<a name="l00133"></a>00133     m.<a class="code" href="classlibdap_1_1Marshaller.html#ad304d979a115c073bf8919ad426d4465">put_int16</a>( <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> ) ;
<a name="l00134"></a>00134 
<a name="l00135"></a>00135     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137 
<a name="l00138"></a>00138 <span class="keywordtype">bool</span>
<a name="l00139"></a><a class="code" href="classlibdap_1_1Int16.html#a2f5bf801ac701d4b886c22abd75794df">00139</a> <a class="code" href="classlibdap_1_1Int16.html#a2f5bf801ac701d4b886c22abd75794df" title="Receive data from the net.">Int16::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="l00140"></a>00140 {
<a name="l00141"></a>00141     um.<a class="code" href="classlibdap_1_1UnMarshaller.html#a399095f74628e9acb3c8aa7a65735fdd">get_int16</a>( <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> ) ;
<a name="l00142"></a>00142 
<a name="l00143"></a>00143     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00147"></a><a class="code" href="classlibdap_1_1Int16.html#ab2c9d7ed6f92e1dbdb08b179943bab4f">00147</a> <a class="code" href="classlibdap_1_1Int16.html#ab2c9d7ed6f92e1dbdb08b179943bab4f" title="Loads class data.">Int16::val2buf</a>(<span class="keywordtype">void</span> *val, <span class="keywordtype">bool</span>)
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149     <span class="comment">// Jose Garcia</span>
<a name="l00150"></a>00150     <span class="comment">// This method is public therefore and I believe it has being designed</span>
<a name="l00151"></a>00151     <span class="comment">// to be use by read which must be implemented on the surrogated library,</span>
<a name="l00152"></a>00152     <span class="comment">// thus if the pointer val is NULL, is  an Internal Error.</span>
<a name="l00153"></a>00153     <span class="keywordflow">if</span> (!val)
<a name="l00154"></a>00154         <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="l00155"></a>00155                           <span class="stringliteral">&quot;The incoming pointer does not contain any data.&quot;</span>);
<a name="l00156"></a>00156 
<a name="l00157"></a>00157     <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> = *(<a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a> *)val;
<a name="l00158"></a>00158 
<a name="l00159"></a>00159     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Int16.html#a0f6b0d727089a08bf1979ee31039401c" title="Returns the size of the class instance data.">width</a>();
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
<a name="l00163"></a><a class="code" href="classlibdap_1_1Int16.html#a7b1983c756a0c27942fc2a7563bb5d2e">00163</a> <a class="code" href="classlibdap_1_1Int16.html#a7b1983c756a0c27942fc2a7563bb5d2e" title="Reads the class data.">Int16::buf2val</a>(<span class="keywordtype">void</span> **val)
<a name="l00164"></a>00164 {
<a name="l00165"></a>00165     <span class="comment">// Jose Garcia</span>
<a name="l00166"></a>00166     <span class="comment">// The same comment justifying throwing an Error in val2buf applies here.</span>
<a name="l00167"></a>00167     <span class="keywordflow">if</span> (!val)
<a name="l00168"></a>00168         <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="l00169"></a>00169 
<a name="l00170"></a>00170     <span class="keywordflow">if</span> (!*val)
<a name="l00171"></a>00171         *val = <span class="keyword">new</span> <a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a>;
<a name="l00172"></a>00172 
<a name="l00173"></a>00173     *(<a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a> *)*val = <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a>;
<a name="l00174"></a>00174 
<a name="l00175"></a>00175     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Int16.html#a0f6b0d727089a08bf1979ee31039401c" title="Returns the size of the class instance data.">width</a>();
<a name="l00176"></a>00176 }
<a name="l00177"></a>00177 
<a name="l00178"></a>00178 <a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a>
<a name="l00179"></a><a class="code" href="classlibdap_1_1Int16.html#af9373c11c553ad22baafebb69f35ed37">00179</a> <a class="code" href="classlibdap_1_1Int16.html#af9373c11c553ad22baafebb69f35ed37">Int16::value</a>()<span class="keyword"> const</span>
<a name="l00180"></a>00180 <span class="keyword"></span>{
<a name="l00181"></a>00181     <span class="keywordflow">return</span> <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a>;
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 <span class="keywordtype">bool</span>
<a name="l00185"></a><a class="code" href="classlibdap_1_1Int16.html#acc13cb757d7ba3da5422935105f46cdd">00185</a> <a class="code" href="classlibdap_1_1Int16.html#acc13cb757d7ba3da5422935105f46cdd">Int16::set_value</a>(<a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a> i)
<a name="l00186"></a>00186 {
<a name="l00187"></a>00187     <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> = i;
<a name="l00188"></a>00188     <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="l00189"></a>00189 
<a name="l00190"></a>00190     <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192 
<a name="l00193"></a>00193 <span class="preprocessor">#if FILE_METHODS</span>
<a name="l00194"></a>00194 <span class="preprocessor"></span><span class="keywordtype">void</span>
<a name="l00195"></a>00195 <a class="code" href="classlibdap_1_1Int16.html#ac60b82349f40d252114773c7f6361aaf" title="Prints the value of the variable.">Int16::print_val</a>(FILE *out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l00196"></a>00196 {
<a name="l00197"></a>00197     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l00198"></a>00198         <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="l00199"></a>00199         fprintf(out, <span class="stringliteral">&quot; = %d;\n&quot;</span>, <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a>) ;
<a name="l00200"></a>00200     }
<a name="l00201"></a>00201     <span class="keywordflow">else</span>
<a name="l00202"></a>00202         fprintf(out, <span class="stringliteral">&quot;%d&quot;</span>, <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a>) ;
<a name="l00203"></a>00203 }
<a name="l00204"></a>00204 <span class="preprocessor">#endif</span>
<a name="l00205"></a>00205 <span class="preprocessor"></span>
<a name="l00206"></a>00206 <span class="keywordtype">void</span>
<a name="l00207"></a><a class="code" href="classlibdap_1_1Int16.html#ac60b82349f40d252114773c7f6361aaf">00207</a> <a class="code" href="classlibdap_1_1Int16.html#ac60b82349f40d252114773c7f6361aaf" title="Prints the value of the variable.">Int16::print_val</a>(ostream &amp;out, <span class="keywordtype">string</span> space, <span class="keywordtype">bool</span> print_decl_p)
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209     <span class="keywordflow">if</span> (print_decl_p) {
<a name="l00210"></a>00210         <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="l00211"></a>00211         out &lt;&lt; <span class="stringliteral">&quot; = &quot;</span> &lt;&lt; <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> &lt;&lt; <span class="stringliteral">&quot;;\n&quot;</span> ;
<a name="l00212"></a>00212     }
<a name="l00213"></a>00213     <span class="keywordflow">else</span>
<a name="l00214"></a>00214         out &lt;&lt; <a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> ;
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 <span class="keywordtype">bool</span>
<a name="l00218"></a><a class="code" href="classlibdap_1_1Int16.html#ad72c7db64b35bf1e8ad8aa7e27526cb9">00218</a> <a class="code" href="classlibdap_1_1Int16.html#ad72c7db64b35bf1e8ad8aa7e27526cb9" title="Evaluate relational operators.">Int16::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="l00219"></a>00219 {
<a name="l00220"></a>00220 
<a name="l00221"></a>00221     <span class="comment">// Extract the Byte arg&#39;s value.</span>
<a name="l00222"></a>00222     <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="l00223"></a>00223         <span class="comment">// Jose Garcia</span>
<a name="l00224"></a>00224         <span class="comment">// Since the read method is virtual and implemented outside</span>
<a name="l00225"></a>00225         <span class="comment">// libdap++ if we cannot read the data that is the problem</span>
<a name="l00226"></a>00226         <span class="comment">// of the user or of whoever wrote the surrogate library</span>
<a name="l00227"></a>00227         <span class="comment">// implemeting read therefore it is an internal error.</span>
<a name="l00228"></a>00228         <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="l00229"></a>00229     }
<a name="l00230"></a>00230 
<a name="l00231"></a>00231     <span class="comment">// Extract the second arg&#39;s value.</span>
<a name="l00232"></a>00232     <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="l00233"></a>00233         <span class="comment">// Jose Garcia</span>
<a name="l00234"></a>00234         <span class="comment">// Since the read method is virtual and implemented outside</span>
<a name="l00235"></a>00235         <span class="comment">// libdap++ if we cannot read the data that is the problem</span>
<a name="l00236"></a>00236         <span class="comment">// of the user or of whoever wrote the surrogate library</span>
<a name="l00237"></a>00237         <span class="comment">// implemeting read therefore it is an internal error.</span>
<a name="l00238"></a>00238         <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="l00239"></a>00239     }
<a name="l00240"></a>00240 
<a name="l00241"></a>00241     <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="l00242"></a>00242     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a4124790aeab42dbcd3d5303dea15b200">dods_byte_c</a>:
<a name="l00243"></a>00243         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_byte, SUCmp&lt;dods_int16, dods_byte&gt; &gt;
<a name="l00244"></a>00244                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00245"></a>00245     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a37d71c620b71be06fbe667e7cb0e80e4">dods_int16_c</a>:
<a name="l00246"></a>00246         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_int16, Cmp&lt;dods_int16, dods_int16&gt; &gt;
<a name="l00247"></a>00247                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00248"></a>00248     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a84188f64695716d84cefe910704ca094">dods_uint16_c</a>:
<a name="l00249"></a>00249         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_uint16, SUCmp&lt;dods_int16, dods_uint16&gt; &gt;
<a name="l00250"></a>00250                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00251"></a>00251     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a524bfec434d0a8f82e06bfcc02c9a6b1">dods_int32_c</a>:
<a name="l00252"></a>00252         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_int32, Cmp&lt;dods_int16, dods_int32&gt; &gt;
<a name="l00253"></a>00253                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00254"></a>00254     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a1bdeca4f415a3372b83448efd87bff83">dods_uint32_c</a>:
<a name="l00255"></a>00255         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_uint32, SUCmp&lt;dods_int16, dods_uint32&gt; &gt;
<a name="l00256"></a>00256                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00257"></a>00257     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a6aff4fd17f027d0f0c41423e2f74a68c">dods_float32_c</a>:
<a name="l00258"></a>00258         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_float32, Cmp&lt;dods_int16, dods_float32&gt; &gt;
<a name="l00259"></a>00259                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00260"></a>00260     <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#a05ca706d4539ae7b750c3bc7066ab6e6a8661c9f9c227fe59b7f5563f20e145d6">dods_float64_c</a>:
<a name="l00261"></a>00261         <span class="keywordflow">return</span> rops&lt;dods_int16, dods_float64, Cmp&lt;dods_int16, dods_float64&gt; &gt;
<a name="l00262"></a>00262                (<a class="code" href="classlibdap_1_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_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="l00263"></a>00263     <span class="keywordflow">default</span>:
<a name="l00264"></a>00264         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00265"></a>00265     }
<a name="l00266"></a>00266 }
<a name="l00267"></a>00267 
<a name="l00276"></a>00276 <span class="keywordtype">void</span>
<a name="l00277"></a><a class="code" href="classlibdap_1_1Int16.html#ab58ac36f1a81dbfe6dcb99a58ed1140e">00277</a> <a class="code" href="classlibdap_1_1Int16.html#ab58ac36f1a81dbfe6dcb99a58ed1140e" title="dumps information about this object">Int16::dump</a>(ostream &amp;strm)<span class="keyword"> const</span>
<a name="l00278"></a>00278 <span class="keyword"></span>{
<a name="l00279"></a>00279     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;Int16::dump - (&quot;</span>
<a name="l00280"></a>00280     &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="l00281"></a>00281     <a class="code" href="classlibdap_1_1DapIndent.html#a4ed2cce66dbff9ad4320e89142103c6c">DapIndent::Indent</a>() ;
<a name="l00282"></a>00282     <a class="code" href="classlibdap_1_1Int16.html#ab58ac36f1a81dbfe6dcb99a58ed1140e" title="dumps information about this object">BaseType::dump</a>(strm) ;
<a name="l00283"></a>00283     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_1Int16.html#a84c210306ebe9763cdab5a9b3ce4b376">_buf</a> &lt;&lt; endl ;
<a name="l00284"></a>00284     <a class="code" href="classlibdap_1_1DapIndent.html#a65c519d0916b031bcf60ca8d26fc82f8">DapIndent::UnIndent</a>() ;
<a name="l00285"></a>00285 }
<a name="l00286"></a>00286 
<a name="l00287"></a>00287 } <span class="comment">// namespace libdap</span>
<a name="l00288"></a>00288 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="Int16_8cc.html">Int16.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>