Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > f149f58f4a75af135bdb24f5dfe94165 > files > 392

libdap-doc-3.9.3-3mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libdap++: XDRFileMarshaller.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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 class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>XDRFileMarshaller.cc</h1><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 "<a class="code" href="XDRFileMarshaller_8h.html">XDRFileMarshaller.h</a>"</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="Vector_8h.html">Vector.h</a>"</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="util_8h.html">util.h</a>"</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="InternalErr_8h.html">InternalErr.h</a>"</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>libdap {
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#c492a403b2021e54beb6117a16777a85">00041</a> XDRFileMarshaller::XDRFileMarshaller( FILE *out )
<a name="l00042"></a>00042     : _sink( 0 )
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044     _sink = <a class="code" href="XDRUtils_8cc.html#91ac75a1d242fbf5bbced463513f9942">new_xdrstdio</a>( out, XDR_ENCODE ) ;
<a name="l00045"></a>00045 }
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 XDRFileMarshaller::XDRFileMarshaller()
<a name="l00048"></a>00048     : <a class="code" href="classlibdap_1_1Marshaller.html" title="abstract base class used to marshall/serialize dap data objects">Marshaller</a>(),
<a name="l00049"></a>00049       _sink( 0 )
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051     <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">"Default constructor not implemented."</span> ) ;
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 XDRFileMarshaller::XDRFileMarshaller( <span class="keyword">const</span> XDRFileMarshaller &amp;m )
<a name="l00055"></a>00055     : Marshaller( m ),
<a name="l00056"></a>00056       _sink( 0 )
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058     <span class="keywordflow">throw</span> InternalErr( __FILE__, __LINE__, <span class="stringliteral">"Copy constructor not implemented."</span> ) ;
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 XDRFileMarshaller &amp;
<a name="l00062"></a>00062 XDRFileMarshaller::operator=( <span class="keyword">const</span> XDRFileMarshaller &amp; )
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064     <span class="keywordflow">throw</span> InternalErr( __FILE__, __LINE__, <span class="stringliteral">"Copy operator not implemented."</span> ) ;
<a name="l00065"></a>00065 
<a name="l00066"></a>00066     <span class="keywordflow">return</span> *this ;
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068 
<a name="l00069"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#0e9c48d5dac7c7e23ad73041250e42e5">00069</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#0e9c48d5dac7c7e23ad73041250e42e5">XDRFileMarshaller::~XDRFileMarshaller</a>( )
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071     <a class="code" href="XDRUtils_8cc.html#cd1ce82fd29bbb21c05044ecbfc1c8a6">delete_xdrstdio</a>( _sink ) ;
<a name="l00072"></a>00072 }
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 <span class="keywordtype">void</span>
<a name="l00075"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#e59b2ed13e57db21dfee45048647b5dc">00075</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#e59b2ed13e57db21dfee45048647b5dc">XDRFileMarshaller::put_byte</a>( <a class="code" href="namespacelibdap.html#d431f107665452c7fe52e360b38f2828">dods_byte</a> val )
<a name="l00076"></a>00076 {
<a name="l00077"></a>00077     <span class="keywordflow">if</span>( !xdr_char( _sink, (<span class="keywordtype">char</span> *)&amp;val ) )
<a name="l00078"></a>00078         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00079"></a>00079 }
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 <span class="keywordtype">void</span>
<a name="l00082"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#31b0b5e3a20a62fc78bc7b5de73b5432">00082</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#31b0b5e3a20a62fc78bc7b5de73b5432">XDRFileMarshaller::put_int16</a>( <a class="code" href="namespacelibdap.html#e7f3429a8f8962d271e43ece6968d91d">dods_int16</a> val )
<a name="l00083"></a>00083 {
<a name="l00084"></a>00084     <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#24654f59366e8cc041ba72d75f6308f9">XDR_INT16</a>( _sink, &amp;val ) )
<a name="l00085"></a>00085         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="keywordtype">void</span>
<a name="l00089"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#43ff6ab7c5899c6ed5d00fabfe7378d5">00089</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#43ff6ab7c5899c6ed5d00fabfe7378d5">XDRFileMarshaller::put_int32</a>( <a class="code" href="namespacelibdap.html#e759bb5209e20f49935f93743022b8bc">dods_int32</a> val )
<a name="l00090"></a>00090 {
<a name="l00091"></a>00091 <span class="preprocessor">#if 0</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span>    <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#3e24e0d58a6330f2d3dcb3df5f66e59f">XDR_INT32</a>( _sink, (<span class="keywordtype">int</span> *)&amp;val ) )
<a name="l00094"></a>00094 <span class="preprocessor">#else</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>    <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#3e24e0d58a6330f2d3dcb3df5f66e59f">XDR_INT32</a>( _sink, &amp;val ) )
<a name="l00096"></a>00096 <span class="preprocessor">#endif</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span>    <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#3e24e0d58a6330f2d3dcb3df5f66e59f">XDR_INT32</a>( _sink, &amp;val ) )
<a name="l00099"></a>00099         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 <span class="keywordtype">void</span>
<a name="l00103"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#fef2b5f926f316108940ada99dcbbe52">00103</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#fef2b5f926f316108940ada99dcbbe52">XDRFileMarshaller::put_float32</a>( <a class="code" href="namespacelibdap.html#40163a7391daa28f0e3063a2054a16a2">dods_float32</a> val )
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105     <span class="keywordflow">if</span>( !xdr_float( _sink, &amp;val ) )
<a name="l00106"></a>00106         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00107"></a>00107 }
<a name="l00108"></a>00108 
<a name="l00109"></a>00109 <span class="keywordtype">void</span>
<a name="l00110"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#30a90f2a1c1621a6aea60d7529195a17">00110</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#30a90f2a1c1621a6aea60d7529195a17">XDRFileMarshaller::put_float64</a>( <a class="code" href="namespacelibdap.html#f677a1bef7552bc36d52ecdcdd2c878f">dods_float64</a> val )
<a name="l00111"></a>00111 {
<a name="l00112"></a>00112     <span class="keywordflow">if</span>( !xdr_double( _sink, &amp;val ) )
<a name="l00113"></a>00113         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00114"></a>00114 }
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 <span class="keywordtype">void</span>
<a name="l00117"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#8aa245cea6b01fe61abe430d42ed87d1">00117</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#8aa245cea6b01fe61abe430d42ed87d1">XDRFileMarshaller::put_uint16</a>( <a class="code" href="namespacelibdap.html#f0edc957e05ac3c9e085c2b4f30b2d18">dods_uint16</a> val )
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119     <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#0440bdd8dcee5f8ff49fd6c689278da8">XDR_UINT16</a>( _sink, &amp;val ) )
<a name="l00120"></a>00120         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00121"></a>00121 }
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="keywordtype">void</span>
<a name="l00124"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#77192c7e8103b7417c7327b2c768622d">00124</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#77192c7e8103b7417c7327b2c768622d">XDRFileMarshaller::put_uint32</a>( <a class="code" href="namespacelibdap.html#cbbf2cafed9043c5e0cd44df0f75fc6d">dods_uint32</a> val )
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126 <span class="preprocessor">#if 0</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span>    <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#680769c94a1d529e0b8d81e0f1b7d4b4">XDR_UINT32</a>( _sink, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *)&amp;val ) )
<a name="l00129"></a>00129 <span class="preprocessor">#else</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span>        <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#680769c94a1d529e0b8d81e0f1b7d4b4">XDR_UINT32</a>( _sink, &amp;val ) )
<a name="l00131"></a>00131 <span class="preprocessor">#endif</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>    <span class="keywordflow">if</span>( !<a class="code" href="config_8h.html#680769c94a1d529e0b8d81e0f1b7d4b4">XDR_UINT32</a>( _sink, &amp;val ) )
<a name="l00134"></a>00134         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00135"></a>00135 }
<a name="l00136"></a>00136 
<a name="l00137"></a>00137 <span class="keywordtype">void</span>
<a name="l00138"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#631ed426774e48c51c84c11ae0b19670">00138</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#631ed426774e48c51c84c11ae0b19670">XDRFileMarshaller::put_str</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;val )
<a name="l00139"></a>00139 {
<a name="l00140"></a>00140     <span class="keyword">const</span> <span class="keywordtype">char</span> *out_tmp = val.c_str() ;
<a name="l00141"></a>00141 
<a name="l00142"></a>00142     <span class="keywordflow">if</span>( !xdr_string( _sink, (<span class="keywordtype">char</span> **)&amp;out_tmp, <a class="code" href="namespacelibdap.html#ef2455580bf5deab23e48dd319ae059f">max_str_len</a>) )
<a name="l00143"></a>00143         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146 <span class="keywordtype">void</span>
<a name="l00147"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#6c489d731cb385ab535c8be961a47551">00147</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#6c489d731cb385ab535c8be961a47551">XDRFileMarshaller::put_url</a>( <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;val )
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149     <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#631ed426774e48c51c84c11ae0b19670">put_str</a>( val ) ;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 
<a name="l00152"></a>00152 <span class="keywordtype">void</span>
<a name="l00153"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#3e982b1af7e682aa54b88143a2d94264">00153</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#3e982b1af7e682aa54b88143a2d94264">XDRFileMarshaller::put_opaque</a>( <span class="keywordtype">char</span> *val, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len )
<a name="l00154"></a>00154 {
<a name="l00155"></a>00155     <span class="keywordflow">if</span>( !xdr_opaque( _sink, val, len ) )
<a name="l00156"></a>00156         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"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."</span>);
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 
<a name="l00159"></a>00159 <span class="keywordtype">void</span>
<a name="l00160"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#e8471d29021141ff723ba00ebfed199b">00160</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#e8471d29021141ff723ba00ebfed199b">XDRFileMarshaller::put_int</a>( <span class="keywordtype">int</span> val )
<a name="l00161"></a>00161 {
<a name="l00162"></a>00162     <span class="keywordflow">if</span>( !xdr_int( _sink, &amp;val) )
<a name="l00163"></a>00163         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"Network I/O Error(1). This may be due to a bug in libdap or a\nproblem with the network connection."</span>);
<a name="l00164"></a>00164 }
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="keywordtype">void</span>
<a name="l00167"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#7bbe202d8e4942230a1c27615d23abbb">00167</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#7bbe202d8e4942230a1c27615d23abbb">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="l00168"></a>00168 {
<a name="l00169"></a>00169     <span class="keywordflow">if</span> (!val)
<a name="l00170"></a>00170         <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="l00171"></a>00171                           <span class="stringliteral">"Buffer pointer is not set."</span>);
<a name="l00172"></a>00172 
<a name="l00173"></a>00173     <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#e8471d29021141ff723ba00ebfed199b">put_int</a>( num ) ;
<a name="l00174"></a>00174 
<a name="l00175"></a>00175     <span class="keywordflow">if</span>( !xdr_bytes( _sink, (<span class="keywordtype">char</span> **)&amp;val,
<a name="l00176"></a>00176                     (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *) &amp;num,
<a name="l00177"></a>00177                     <a class="code" href="namespacelibdap.html#2b66c19fe22ad8616c2e33f94a0a9a49">DODS_MAX_ARRAY</a>) )
<a name="l00178"></a>00178     {
<a name="l00179"></a>00179         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"Network I/O Error(2). This may be due to a bug in libdap or a\nproblem with the network connection."</span>);
<a name="l00180"></a>00180     }
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 
<a name="l00183"></a>00183 <span class="keywordtype">void</span>
<a name="l00184"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#34f2e689f1363a2ce4052c5a04a7619d">00184</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#7bbe202d8e4942230a1c27615d23abbb">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="l00185"></a>00185 {
<a name="l00186"></a>00186     <span class="keywordflow">if</span> (!val)
<a name="l00187"></a>00187         <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="l00188"></a>00188                           <span class="stringliteral">"Buffer pointer is not set."</span>);
<a name="l00189"></a>00189 
<a name="l00190"></a>00190     <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#e8471d29021141ff723ba00ebfed199b">put_int</a>( num ) ;
<a name="l00191"></a>00191 
<a name="l00192"></a>00192     <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#a5ccb30d1f27ae587f35216b859feec7">var</a>() ;
<a name="l00193"></a>00193     <span class="keywordflow">if</span>( !xdr_array( _sink, (<span class="keywordtype">char</span> **)&amp;val,
<a name="l00194"></a>00194                     (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *) &amp; num,
<a name="l00195"></a>00195                     <a class="code" href="namespacelibdap.html#2b66c19fe22ad8616c2e33f94a0a9a49">DODS_MAX_ARRAY</a>, width,
<a name="l00196"></a>00196                     <a class="code" href="classlibdap_1_1XDRUtils.html#af9f4be9a9e22a10416bfbad841751a3" 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#bc6b2d7099f00bb5f324ec129bff2a17" title="Returns the type of the class instance.">type</a>() ) ) )
<a name="l00197"></a>00197     {
<a name="l00198"></a>00198         <span class="keywordflow">throw</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a>(<span class="stringliteral">"Network I/O Error(2). This may be due to a bug in libdap or a\nproblem with the network connection."</span>);
<a name="l00199"></a>00199     }
<a name="l00200"></a>00200 }
<a name="l00201"></a>00201 
<a name="l00202"></a>00202 <span class="keywordtype">void</span>
<a name="l00203"></a><a class="code" href="classlibdap_1_1XDRFileMarshaller.html#dec06746eb6502d6166ad96069da0d94">00203</a> <a class="code" href="classlibdap_1_1XDRFileMarshaller.html#dec06746eb6502d6166ad96069da0d94" title="dump the contents of this object to the specified ostream">XDRFileMarshaller::dump</a>(ostream &amp;strm)<span class="keyword"> const</span>
<a name="l00204"></a>00204 <span class="keyword"></span>{
<a name="l00205"></a>00205     strm &lt;&lt; <a class="code" href="classlibdap_1_1DapIndent.html#45ca36e552f70fbdbca0599da4320aab">DapIndent::LMarg</a> &lt;&lt; <span class="stringliteral">"XDRFileMarshaller::dump - ("</span>
<a name="l00206"></a>00206          &lt;&lt; (<span class="keywordtype">void</span> *)<span class="keyword">this</span> &lt;&lt; <span class="stringliteral">")"</span> &lt;&lt; endl ;
<a name="l00207"></a>00207 }
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 } <span class="comment">// namespace libdap</span>
<a name="l00210"></a>00210 
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 19:57:08 2009 for libdap++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>