Sophie

Sophie

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

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++: XDRFileMarshaller.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('XDRFileMarshaller_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>XDRFileMarshaller.cc</h1>  </div>
</div>
<div class="contents">
<a href="XDRFileMarshaller_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// XDRFileMarshaller.cc</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="comment">// -*- mode: c++; c-basic-offset:4 -*-</span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="comment">// This file is part of libdap, A C++ implementation of the OPeNDAP Data</span>
<a name="l00006"></a>00006 <span class="comment">// Access Protocol.</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="comment">// Copyright (c) 2002,2003 OPeNDAP, Inc.</span>
<a name="l00009"></a>00009 <span class="comment">// Author: Patrick West &lt;pwest@ucar.edu&gt;</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// This library is free software; you can redistribute it and/or</span>
<a name="l00012"></a>00012 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00013"></a>00013 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00014"></a>00014 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00015"></a>00015 <span class="comment">//</span>
<a name="l00016"></a>00016 <span class="comment">// This library is distributed in the hope that it will be useful,</span>
<a name="l00017"></a>00017 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00018"></a>00018 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00019"></a>00019 <span class="comment">// Lesser General Public License for more details.</span>
<a name="l00020"></a>00020 <span class="comment">//</span>
<a name="l00021"></a>00021 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>
<a name="l00022"></a>00022 <span class="comment">// License along with this library; if not, write to the Free Software</span>
<a name="l00023"></a>00023 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
<a name="l00024"></a>00024 <span class="comment">//</span>
<a name="l00025"></a>00025 <span class="comment">// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="comment">// (c) COPYRIGHT URI/MIT 1994-1999</span>
<a name="l00028"></a>00028 <span class="comment">// Please read the full copyright statement in the file COPYRIGHT_URI.</span>
<a name="l00029"></a>00029 <span class="comment">//</span>
<a name="l00030"></a>00030 <span class="comment">// Authors:</span>
<a name="l00031"></a>00031 <span class="comment">//      pwest       Patrick West &lt;pwest@ucar.edu&gt;</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="XDRFileMarshaller_8h.html">XDRFileMarshaller.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="Byte_8h.html">Byte.h</a>&quot;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="Int16_8h.html">Int16.h</a>&quot;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &quot;<a class="code" href="UInt16_8h.html">UInt16.h</a>&quot;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &quot;<a class="code" href="Int32_8h.html">Int32.h</a>&quot;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &quot;<a class="code" href="UInt32_8h.html">UInt32.h</a>&quot;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &quot;<a class="code" href="Float32_8h.html">Float32.h</a>&quot;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &quot;<a class="code" href="Float64_8h.html">Float64.h</a>&quot;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &quot;<a class="code" href="Str_8h.html">Str.h</a>&quot;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &quot;<a class="code" href="Url_8h.html">Url.h</a>&quot;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &quot;<a class="code" href="Array_8h.html">Array.h</a>&quot;</span>
<a name="l00045"></a>00045 <span class="preprocessor">#include &quot;<a class="code" href="Structure_8h.html">Structure.h</a>&quot;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &quot;<a class="code" href="Sequence_8h.html">Sequence.h</a>&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &quot;<a class="code" href="Grid_8h.html">Grid.h</a>&quot;</span>
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="preprocessor">#include &quot;<a class="code" href="util_8h.html">util.h</a>&quot;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &quot;<a class="code" href="InternalErr_8h.html">InternalErr.h</a>&quot;</span>
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="keyword">namespace </span>libdap {
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 XDRFileMarshaller::XDRFileMarshaller( FILE *out )
<a name="l00055"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae66cdd7798262b546842dcbdfb7c9d0b">00055</a>     : _sink( 0 )
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057     _sink = <a class="code" href="XDRUtils_8cc.html#a91ac75a1d242fbf5bbced463513f9942">new_xdrstdio</a>( out, XDR_ENCODE ) ;
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 XDRFileMarshaller::XDRFileMarshaller()
<a name="l00061"></a>00061     : <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshal/serialize dap data objects">Marshaller</a>(),
<a name="l00062"></a>00062       _sink( 0 )
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064     <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;Default constructor not implemented.&quot;</span> ) ;
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066 
<a name="l00067"></a>00067 XDRFileMarshaller::XDRFileMarshaller( <span class="keyword">const</span> XDRFileMarshaller &amp;m )
<a name="l00068"></a>00068     : Marshaller( m ),
<a name="l00069"></a>00069       _sink( 0 )
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071     <span class="keywordflow">throw</span> InternalErr( __FILE__, __LINE__, <span class="stringliteral">&quot;Copy constructor not implemented.&quot;</span> ) ;
<a name="l00072"></a>00072 }
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 XDRFileMarshaller &amp;
<a name="l00075"></a>00075 XDRFileMarshaller::operator=( <span class="keyword">const</span> XDRFileMarshaller &amp; )
<a name="l00076"></a>00076 {
<a name="l00077"></a>00077     <span class="keywordflow">throw</span> InternalErr( __FILE__, __LINE__, <span class="stringliteral">&quot;Copy operator not implemented.&quot;</span> ) ;
<a name="l00078"></a>00078 
<a name="l00079"></a>00079     <span class="keywordflow">return</span> *this ;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a0e9c48d5dac7c7e23ad73041250e42e5">XDRFileMarshaller::~XDRFileMarshaller</a>( )
<a name="l00083"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a0e9c48d5dac7c7e23ad73041250e42e5">00083</a> {
<a name="l00084"></a>00084     <a class="code" href="XDRUtils_8cc.html#acd1ce82fd29bbb21c05044ecbfc1c8a6">delete_xdrstdio</a>( _sink ) ;
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 <span class="keywordtype">void</span>
<a name="l00088"></a>00088 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae59b2ed13e57db21dfee45048647b5dc">XDRFileMarshaller::put_byte</a>( <a class="code" href="namespacelibdap.html#ad431f107665452c7fe52e360b38f2828">dods_byte</a> val )
<a name="l00089"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae59b2ed13e57db21dfee45048647b5dc">00089</a> {
<a name="l00090"></a>00090     <span class="keywordflow">if</span>( !xdr_char( _sink, (<span class="keywordtype">char</span> *)&amp;val ) )
<a name="l00091"></a>00091         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send byte data.\nThis may be due to a bug in DODS, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 <span class="keywordtype">void</span>
<a name="l00095"></a>00095 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a31b0b5e3a20a62fc78bc7b5de73b5432">XDRFileMarshaller::put_int16</a>( <a class="code" href="namespacelibdap.html#ae7f3429a8f8962d271e43ece6968d91d">dods_int16</a> val )
<a name="l00096"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a31b0b5e3a20a62fc78bc7b5de73b5432">00096</a> {
<a name="l00097"></a>00097     <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#a24654f59366e8cc041ba72d75f6308f9">XDR_INT16</a>( _sink, &amp;val ) )
<a name="l00098"></a>00098         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send int 16 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100 
<a name="l00101"></a>00101 <span class="keywordtype">void</span>
<a name="l00102"></a>00102 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a43ff6ab7c5899c6ed5d00fabfe7378d5">XDRFileMarshaller::put_int32</a>( <a class="code" href="namespacelibdap.html#ae759bb5209e20f49935f93743022b8bc">dods_int32</a> val )
<a name="l00103"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a43ff6ab7c5899c6ed5d00fabfe7378d5">00103</a> {
<a name="l00104"></a>00104     <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#a3e24e0d58a6330f2d3dcb3df5f66e59f">XDR_INT32</a>( _sink, &amp;val ) )
<a name="l00105"></a>00105         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not read int 32 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00108"></a>00108 <span class="keywordtype">void</span>
<a name="l00109"></a>00109 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#afef2b5f926f316108940ada99dcbbe52">XDRFileMarshaller::put_float32</a>( <a class="code" href="namespacelibdap.html#a40163a7391daa28f0e3063a2054a16a2">dods_float32</a> val )
<a name="l00110"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#afef2b5f926f316108940ada99dcbbe52">00110</a> {
<a name="l00111"></a>00111     <span class="keywordflow">if</span>( !xdr_float( _sink, &amp;val ) )
<a name="l00112"></a>00112         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send float 32 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="keywordtype">void</span>
<a name="l00116"></a>00116 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a30a90f2a1c1621a6aea60d7529195a17">XDRFileMarshaller::put_float64</a>( <a class="code" href="namespacelibdap.html#af677a1bef7552bc36d52ecdcdd2c878f">dods_float64</a> val )
<a name="l00117"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a30a90f2a1c1621a6aea60d7529195a17">00117</a> {
<a name="l00118"></a>00118     <span class="keywordflow">if</span>( !xdr_double( _sink, &amp;val ) )
<a name="l00119"></a>00119         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send float 64 data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121 
<a name="l00122"></a>00122 <span class="keywordtype">void</span>
<a name="l00123"></a>00123 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a8aa245cea6b01fe61abe430d42ed87d1">XDRFileMarshaller::put_uint16</a>( <a class="code" href="namespacelibdap.html#af0edc957e05ac3c9e085c2b4f30b2d18">dods_uint16</a> val )
<a name="l00124"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a8aa245cea6b01fe61abe430d42ed87d1">00124</a> {
<a name="l00125"></a>00125     <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#a0440bdd8dcee5f8ff49fd6c689278da8">XDR_UINT16</a>( _sink, &amp;val ) )
<a name="l00126"></a>00126         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send uint 16 data. This may be due to a\nbug in libdap or a problem with the network connection.&quot;</span>);
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 <span class="keywordtype">void</span>
<a name="l00130"></a>00130 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a77192c7e8103b7417c7327b2c768622d">XDRFileMarshaller::put_uint32</a>( <a class="code" href="namespacelibdap.html#acbbf2cafed9043c5e0cd44df0f75fc6d">dods_uint32</a> val )
<a name="l00131"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a77192c7e8103b7417c7327b2c768622d">00131</a> {
<a name="l00132"></a>00132     <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#a680769c94a1d529e0b8d81e0f1b7d4b4">XDR_UINT32</a>( _sink, &amp;val ) )
<a name="l00133"></a>00133         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send uint 32 data. This may be due to a\nbug in libdap or a problem with the network connection.&quot;</span>);
<a name="l00134"></a>00134 }
<a name="l00135"></a>00135 
<a name="l00136"></a>00136 <span class="keywordtype">void</span>
<a name="l00137"></a>00137 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a631ed426774e48c51c84c11ae0b19670">XDRFileMarshaller::put_str</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;val )
<a name="l00138"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a631ed426774e48c51c84c11ae0b19670">00138</a> {
<a name="l00139"></a>00139     <span class="keyword">const</span> <span class="keywordtype">char</span> *out_tmp = val.c_str() ;
<a name="l00140"></a>00140 
<a name="l00141"></a>00141     <span class="keywordflow">if</span>( !xdr_string( _sink, (<span class="keywordtype">char</span> **)&amp;out_tmp, <a class="code" href="namespacelibdap.html#aef2455580bf5deab23e48dd319ae059f">max_str_len</a>) )
<a name="l00142"></a>00142         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send string data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="keywordtype">void</span>
<a name="l00146"></a>00146 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a6c489d731cb385ab535c8be961a47551">XDRFileMarshaller::put_url</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;val )
<a name="l00147"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a6c489d731cb385ab535c8be961a47551">00147</a> {
<a name="l00148"></a>00148     <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a631ed426774e48c51c84c11ae0b19670">put_str</a>( val ) ;
<a name="l00149"></a>00149 }
<a name="l00150"></a>00150 
<a name="l00151"></a>00151 <span class="keywordtype">void</span>
<a name="l00152"></a>00152 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a3e982b1af7e682aa54b88143a2d94264">XDRFileMarshaller::put_opaque</a>( <span class="keywordtype">char</span> *val, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len )
<a name="l00153"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a3e982b1af7e682aa54b88143a2d94264">00153</a> {
<a name="l00154"></a>00154     <span class="keywordflow">if</span>( !xdr_opaque( _sink, val, len ) )
<a name="l00155"></a>00155         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error. Could not send opaque data.\nThis may be due to a bug in libdap, on the server or a\nproblem with the network connection.&quot;</span>);
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 <span class="keywordtype">void</span>
<a name="l00159"></a>00159 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae8471d29021141ff723ba00ebfed199b">XDRFileMarshaller::put_int</a>( <span class="keywordtype">int</span> val )
<a name="l00160"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae8471d29021141ff723ba00ebfed199b">00160</a> {
<a name="l00161"></a>00161     <span class="keywordflow">if</span>( !xdr_int( _sink, &amp;val) )
<a name="l00162"></a>00162         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error(1). This may be due to a bug in libdap or a\nproblem with the network connection.&quot;</span>);
<a name="l00163"></a>00163 }
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 <span class="keywordtype">void</span>
<a name="l00166"></a>00166 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a7bbe202d8e4942230a1c27615d23abbb">XDRFileMarshaller::put_vector</a>( <span class="keywordtype">char</span> *val, <span class="keywordtype">int</span> num, <a class="code" href="classlibdap_1_1Vector.html" title="Holds a one-dimensional collection of DAP2 data types.">Vector</a> &amp; )
<a name="l00167"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a7bbe202d8e4942230a1c27615d23abbb">00167</a> {
<a name="l00168"></a>00168     <span class="keywordflow">if</span> (!val)
<a name="l00169"></a>00169         <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="l00170"></a>00170                           <span class="stringliteral">&quot;Buffer pointer is not set.&quot;</span>);
<a name="l00171"></a>00171 
<a name="l00172"></a>00172     <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae8471d29021141ff723ba00ebfed199b">put_int</a>( num ) ;
<a name="l00173"></a>00173 
<a name="l00174"></a>00174     <span class="keywordflow">if</span>( !xdr_bytes( _sink, (<span class="keywordtype">char</span> **)&amp;val,
<a name="l00175"></a>00175                     (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *) &amp;num,
<a name="l00176"></a>00176                     <a class="code" href="namespacelibdap.html#a2b66c19fe22ad8616c2e33f94a0a9a49">DODS_MAX_ARRAY</a>) )
<a name="l00177"></a>00177     {
<a name="l00178"></a>00178         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error(2). This may be due to a bug in libdap or a\nproblem with the network connection.&quot;</span>);
<a name="l00179"></a>00179     }
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181 
<a name="l00182"></a>00182 <span class="keywordtype">void</span>
<a name="l00183"></a>00183 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a7bbe202d8e4942230a1c27615d23abbb">XDRFileMarshaller::put_vector</a>( <span class="keywordtype">char</span> *val, <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> width, <a class="code" href="classlibdap_1_1Vector.html" title="Holds a one-dimensional collection of DAP2 data types.">Vector</a> &amp;vec )
<a name="l00184"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#a34f2e689f1363a2ce4052c5a04a7619d">00184</a> {
<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>(__FILE__, __LINE__,
<a name="l00187"></a>00187                           <span class="stringliteral">&quot;Buffer pointer is not set.&quot;</span>);
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#ae8471d29021141ff723ba00ebfed199b">put_int</a>( num ) ;
<a name="l00190"></a>00190 
<a name="l00191"></a>00191     <a class="code" href="classlibdap_1_1BaseType.html" title="The basic data type for the DODS DAP types.">BaseType</a> *var = vec.<a class="code" href="classlibdap_1_1Vector.html#aa5ccb30d1f27ae587f35216b859feec7">var</a>() ;
<a name="l00192"></a>00192     <span class="keywordflow">if</span>( !xdr_array( _sink, (<span class="keywordtype">char</span> **)&amp;val,
<a name="l00193"></a>00193                     (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *) &amp; num,
<a name="l00194"></a>00194                     <a class="code" href="namespacelibdap.html#a2b66c19fe22ad8616c2e33f94a0a9a49">DODS_MAX_ARRAY</a>, width,
<a name="l00195"></a>00195                     <a class="code" href="classlibdap_1_1XDRUtils.html#aaf9f4be9a9e22a10416bfbad841751a3" title="Returns a function used to encode elements of an array.">XDRUtils::xdr_coder</a>( var-&gt;<a class="code" href="classlibdap_1_1BaseType.html#abc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() ) ) )
<a name="l00196"></a>00196     {
<a name="l00197"></a>00197         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">&quot;Network I/O Error(2). This may be due to a bug in libdap or a\nproblem with the network connection.&quot;</span>);
<a name="l00198"></a>00198     }
<a name="l00199"></a>00199 }
<a name="l00200"></a>00200 
<a name="l00201"></a>00201 <span class="keywordtype">void</span>
<a name="l00202"></a>00202 <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#adec06746eb6502d6166ad96069da0d94" title="dump the contents of this object to the specified ostream">XDRFileMarshaller::dump</a>(ostream &amp;strm)<span class="keyword"> const</span>
<a name="l00203"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#adec06746eb6502d6166ad96069da0d94">00203</a> <span class="keyword"></span>{
<a name="l00204"></a>00204     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#a45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">&quot;XDRFileMarshaller::dump - (&quot;</span>
<a name="l00205"></a>00205          &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="l00206"></a>00206 }
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 } <span class="comment">// namespace libdap</span>
<a name="l00209"></a>00209 
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="XDRFileMarshaller_8cc.html">XDRFileMarshaller.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>