<!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++: AttrTable.h 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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>AttrTable.h</h1><a href="AttrTable_8h.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 <jgallagher@opendap.org></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 <jgallagher@gso.uri.edu></span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="comment">// An AttrTable is a table of attributes (type-name-value tuples).</span> <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="preprocessor">#ifndef _attrtable_h</span> <a name="l00035"></a><a class="code" href="AttrTable_8h.html#372d395d1d947510317195e5ad9bd284">00035</a> <span class="preprocessor"></span><span class="preprocessor">#define _attrtable_h 1</span> <a name="l00036"></a>00036 <span class="preprocessor"></span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="preprocessor">#include <string></span> <a name="l00039"></a>00039 <span class="preprocessor">#include <vector></span> <a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="preprocessor">#ifndef _error_h</span> <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="Error_8h.html">Error.h</a>"</span> <a name="l00043"></a>00043 <span class="preprocessor">#endif</span> <a name="l00044"></a>00044 <span class="preprocessor"></span> <a name="l00045"></a>00045 <span class="keyword">using</span> std::vector; <a name="l00046"></a>00046 <span class="keyword">using</span> std::string; <a name="l00047"></a>00047 <span class="keyword">using</span> std::vector; <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="preprocessor">#ifndef A_DapObj_h</span> <a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="DapObj_8h.html">DapObj.h</a>"</span> <a name="l00051"></a>00051 <span class="preprocessor">#endif</span> <a name="l00052"></a>00052 <span class="preprocessor"></span> <a name="l00053"></a>00053 <span class="keyword">namespace </span>libdap <a name="l00054"></a>00054 { <a name="l00055"></a>00055 <a name="l00076"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">00076</a> <span class="keyword">enum</span> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">AttrType</a> { <a name="l00077"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a9c48931629d48c70dcd9bc21ef708308">00077</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a9c48931629d48c70dcd9bc21ef708308">Attr_unknown</a>, <a name="l00078"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a0f1d4f1e70981b989c7753420cc2233d">00078</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>, <a name="l00079"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2ae86f70fa90ecd95f3e0ca3413d16f34a">00079</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2ae86f70fa90ecd95f3e0ca3413d16f34a">Attr_byte</a>, <a name="l00080"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2afbdbc322a10942f70f23cf5436b93c3f">00080</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2afbdbc322a10942f70f23cf5436b93c3f">Attr_int16</a>, <a name="l00081"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2ac5f8b06f3bb92555ca17c7ac3a2c9acc">00081</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2ac5f8b06f3bb92555ca17c7ac3a2c9acc">Attr_uint16</a>, <a name="l00082"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2aa9d080ef33455e44f820598bfba952ba">00082</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2aa9d080ef33455e44f820598bfba952ba">Attr_int32</a>, <a name="l00083"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2aab33c61e98b52f9fd90fca55cd074923">00083</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2aab33c61e98b52f9fd90fca55cd074923">Attr_uint32</a>, <a name="l00084"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a00ec5f70082c1c7c729d65d06340e708">00084</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a00ec5f70082c1c7c729d65d06340e708">Attr_float32</a>, <a name="l00085"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2ad0436c5332f3df3dde8f1d6bec998709">00085</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2ad0436c5332f3df3dde8f1d6bec998709">Attr_float64</a>, <a name="l00086"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a5ab5e05bc3d3cb5ff64c0379faccd4a3">00086</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a5ab5e05bc3d3cb5ff64c0379faccd4a3">Attr_string</a>, <a name="l00087"></a><a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2aab3f9f7548282b0ef0c588acef98caeb">00087</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2aab3f9f7548282b0ef0c588acef98caeb">Attr_url</a> <a name="l00088"></a>00088 }; <a name="l00089"></a>00089 <a name="l00090"></a>00090 <span class="keywordtype">string</span> <a class="code" href="namespacelibdap.html#84d1b6bca4eb21023f90f7b4ae6f382b">AttrType_to_String</a>(<span class="keyword">const</span> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">AttrType</a> at); <a name="l00091"></a>00091 <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">AttrType</a> <a class="code" href="namespacelibdap.html#6d4117c49771ce2665142ff0dd9c976b">String_to_AttrType</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &s); <a name="l00092"></a>00092 <a name="l00144"></a><a class="code" href="classlibdap_1_1AttrTable.html">00144</a> <span class="keyword">class </span><a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> : <span class="keyword">public</span> <a class="code" href="classlibdap_1_1DapObj.html" title="libdap base object for common functionality of libdap objects">DapObj</a> <a name="l00145"></a>00145 { <a name="l00146"></a>00146 <span class="comment">// entry needs to be made public to make up for issues with this class'</span> <a name="l00147"></a>00147 <span class="comment">// design. It should probably be moved to it's own class. 05/22/03 jhrg</span> <a name="l00148"></a>00148 <span class="keyword">public</span>: <a name="l00153"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">00153</a> <span class="keyword">struct </span><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">entry</a> <a name="l00154"></a>00154 { <a name="l00155"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#36ed731e3d0e620c41157ee8bd96bc42">00155</a> <span class="keywordtype">string</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#36ed731e3d0e620c41157ee8bd96bc42">name</a>; <a name="l00156"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">00156</a> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">AttrType</a> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">type</a>; <a name="l00157"></a>00157 <a name="l00158"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">00158</a> <span class="keywordtype">bool</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a>; <a name="l00159"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#46aca5e9ac178e67b78059a553d67b20">00159</a> <span class="keywordtype">string</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#46aca5e9ac178e67b78059a553d67b20">aliased_to</a>; <a name="l00160"></a>00160 <a name="l00161"></a>00161 <span class="comment">// If type == Attr_container, use attributes to read the contained</span> <a name="l00162"></a>00162 <span class="comment">// table, otherwise use attr to read the vector of values.</span> <a name="l00163"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">00163</a> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a>; <a name="l00164"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">00164</a> std::vector<string> *<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a>; <span class="comment">// a vector of values. jhrg 12/5/94</span> <a name="l00165"></a>00165 <a name="l00166"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#b320813490910bbbfd32f1e90c53be90">00166</a> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#b320813490910bbbfd32f1e90c53be90">entry</a>(): <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#36ed731e3d0e620c41157ee8bd96bc42">name</a>(<span class="stringliteral">""</span>), <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">type</a>(<a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a9c48931629d48c70dcd9bc21ef708308">Attr_unknown</a>), <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a>(false), <a name="l00167"></a>00167 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#46aca5e9ac178e67b78059a553d67b20">aliased_to</a>(<span class="stringliteral">""</span>) <a name="l00168"></a>00168 { <a name="l00169"></a>00169 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a> = 0; <a name="l00170"></a>00170 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a> = 0; <a name="l00171"></a>00171 } <a name="l00172"></a>00172 <a name="l00173"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6fdd679c67ba91156945a6754a84cb8a">00173</a> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#b320813490910bbbfd32f1e90c53be90">entry</a>(<span class="keyword">const</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">entry</a> &rhs) <a name="l00174"></a>00174 { <a name="l00175"></a>00175 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#1e27b2515a3a9ab782bdd0c4a7a3d25b">clone</a>(rhs); <a name="l00176"></a>00176 } <a name="l00177"></a>00177 <a name="l00178"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#2a3edc1474eaf5a443704fed6cbcfe01">00178</a> <span class="keywordtype">void</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#2a3edc1474eaf5a443704fed6cbcfe01">delete_entry</a>() <a name="l00179"></a>00179 { <a name="l00180"></a>00180 <span class="keywordflow">if</span> (<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a>) <span class="comment">// alias copies the pointers.</span> <a name="l00181"></a>00181 <span class="keywordflow">return</span>; <a name="l00182"></a>00182 <span class="keywordflow">if</span> (<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">type</a> == <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>) { <a name="l00183"></a>00183 <span class="keyword">delete</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a>; <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a> = 0; <a name="l00184"></a>00184 } <a name="l00185"></a>00185 <span class="keywordflow">else</span> { <a name="l00186"></a>00186 <span class="keyword">delete</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a>; <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a> = 0; <a name="l00187"></a>00187 } <a name="l00188"></a>00188 } <a name="l00189"></a>00189 <a name="l00190"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#ab237508e54dac117bd2e873253afe4b">00190</a> <span class="keyword">virtual</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#ab237508e54dac117bd2e873253afe4b">~entry</a>() <a name="l00191"></a>00191 { <a name="l00192"></a>00192 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#2a3edc1474eaf5a443704fed6cbcfe01">delete_entry</a>(); <a name="l00193"></a>00193 } <a name="l00194"></a>00194 <a name="l00195"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#1e27b2515a3a9ab782bdd0c4a7a3d25b">00195</a> <span class="keywordtype">void</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#1e27b2515a3a9ab782bdd0c4a7a3d25b">clone</a>(<span class="keyword">const</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">entry</a> &rhs) <a name="l00196"></a>00196 { <a name="l00197"></a>00197 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#36ed731e3d0e620c41157ee8bd96bc42">name</a> = rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#36ed731e3d0e620c41157ee8bd96bc42">name</a>; <a name="l00198"></a>00198 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">type</a> = rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">type</a>; <a name="l00199"></a>00199 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a> = rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a>; <a name="l00200"></a>00200 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#46aca5e9ac178e67b78059a553d67b20">aliased_to</a> = rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#46aca5e9ac178e67b78059a553d67b20">aliased_to</a>; <a name="l00201"></a>00201 <span class="keywordflow">switch</span> (rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#6491612f53754b89de9fc0168f800b04">type</a>) { <a name="l00202"></a>00202 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a9c48931629d48c70dcd9bc21ef708308">Attr_unknown</a>: <a name="l00203"></a>00203 <span class="keywordflow">break</span>; <a name="l00204"></a>00204 <span class="keywordflow">case</span> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a0f1d4f1e70981b989c7753420cc2233d">Attr_container</a>: { <a name="l00205"></a>00205 <span class="keywordflow">if</span> (rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a>) <a name="l00206"></a>00206 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a> = rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a>; <a name="l00207"></a>00207 <span class="keywordflow">else</span> <a name="l00208"></a>00208 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a> = <span class="keyword">new</span> <a class="code" href="classlibdap_1_1AttrTable.html#09533d67357ad866f5e499f9eff2253e">AttrTable</a>(*rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#491a2518fc391fbc1b892f75a7e90797">attributes</a>); <a name="l00209"></a>00209 <span class="keywordflow">break</span>; <a name="l00210"></a>00210 } <a name="l00211"></a>00211 <span class="keywordflow">default</span>: { <a name="l00212"></a>00212 <span class="keywordflow">if</span> (rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#9d1e4aef0aefa68788a2c06e3072b0db">is_alias</a>) <a name="l00213"></a>00213 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a> = rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a>; <a name="l00214"></a>00214 <span class="keywordflow">else</span> <a name="l00215"></a>00215 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a> = <span class="keyword">new</span> std::vector<string>(*rhs.<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#09b4c87f7859554ac6390ed632f64117">attr</a>); <a name="l00216"></a>00216 <span class="keywordflow">break</span>; <a name="l00217"></a>00217 } <a name="l00218"></a>00218 } <a name="l00219"></a>00219 } <a name="l00220"></a>00220 <a name="l00221"></a><a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#03884510f2a5b2e745a9398d11ed0919">00221</a> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">entry</a> &<a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#03884510f2a5b2e745a9398d11ed0919">operator=</a>(<span class="keyword">const</span> <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html">entry</a> &rhs) <a name="l00222"></a>00222 { <a name="l00223"></a>00223 <span class="keywordflow">if</span> (<span class="keyword">this</span> != &rhs) { <a name="l00224"></a>00224 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#2a3edc1474eaf5a443704fed6cbcfe01">delete_entry</a>(); <a name="l00225"></a>00225 <a class="code" href="structlibdap_1_1AttrTable_1_1entry.html#1e27b2515a3a9ab782bdd0c4a7a3d25b">clone</a>(rhs); <a name="l00226"></a>00226 } <a name="l00227"></a>00227 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00228"></a>00228 } <a name="l00229"></a>00229 }; <a name="l00230"></a>00230 <a name="l00231"></a><a class="code" href="classlibdap_1_1AttrTable.html#18087581e0377a852a029d4aa9d64a1e">00231</a> <span class="keyword">typedef</span> std::vector<entry *>::const_iterator <a class="code" href="classlibdap_1_1AttrTable.html#18087581e0377a852a029d4aa9d64a1e">Attr_citer</a> ; <a name="l00232"></a><a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">00232</a> <span class="keyword">typedef</span> std::vector<entry *>::iterator <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> ; <a name="l00233"></a>00233 <a name="l00234"></a>00234 <span class="keyword">private</span>: <a name="l00235"></a>00235 <span class="keywordtype">string</span> d_name; <a name="l00236"></a>00236 <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *d_parent; <a name="l00237"></a>00237 std::vector<entry *> attr_map; <a name="l00238"></a>00238 <a name="l00239"></a>00239 <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> simple_find(<span class="keyword">const</span> <span class="keywordtype">string</span> &target); <a name="l00240"></a>00240 <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *simple_find_container(<span class="keyword">const</span> <span class="keywordtype">string</span> &target); <a name="l00241"></a>00241 <a name="l00242"></a>00242 <span class="keywordtype">void</span> delete_attr_table(); <a name="l00243"></a>00243 <a name="l00244"></a><a class="code" href="classlibdap_1_1AttrTable.html#af41c5b6e5f9c13e92735511139b18b3">00244</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classlibdap_1_1AttrTable.html#af41c5b6e5f9c13e92735511139b18b3">AttrTableTest</a>; <a name="l00245"></a>00245 <a name="l00246"></a>00246 <span class="keyword">protected</span>: <a name="l00247"></a>00247 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#4fa4213ffc8bd5ab96ff6ba148fd9eb1">clone</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> &at); <a name="l00248"></a>00248 <a name="l00249"></a>00249 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#1abee354d7f609ed55b849b0431bc48f">simple_print</a>(FILE *out, <span class="keywordtype">string</span> pad, <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> i, <a name="l00250"></a>00250 <span class="keywordtype">bool</span> dereference); <a name="l00251"></a>00251 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#1abee354d7f609ed55b849b0431bc48f">simple_print</a>(ostream &out, <span class="keywordtype">string</span> pad, <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> i, <a name="l00252"></a>00252 <span class="keywordtype">bool</span> dereference); <a name="l00253"></a>00253 <a name="l00254"></a>00254 <span class="keyword">public</span>: <a name="l00255"></a>00255 <a class="code" href="classlibdap_1_1AttrTable.html#09533d67357ad866f5e499f9eff2253e">AttrTable</a>(); <a name="l00256"></a>00256 <a class="code" href="classlibdap_1_1AttrTable.html#09533d67357ad866f5e499f9eff2253e">AttrTable</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> &rhs); <a name="l00257"></a>00257 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html#c1a2ad7a01b70b53a0995f63649e23b7">~AttrTable</a>(); <a name="l00258"></a>00258 <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> & <a class="code" href="classlibdap_1_1AttrTable.html#5110c171d6fa7911f4022145f2ad9027">operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> &rhs); <a name="l00259"></a>00259 <a name="l00260"></a>00260 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#ad6a9557cc76cfb925e55077e0470859" title="Erase the attribute table.">erase</a>(); <a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1AttrTable.html#895e16236818e6b55790e4490cf6c2da" title="Get the number of entries in this attribute table.">get_size</a>() <span class="keyword">const</span>; <a name="l00263"></a>00263 <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1AttrTable.html#4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>() <span class="keyword">const</span>; <a name="l00264"></a>00264 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#3d09ff6bf5a12789308b20440dcaf302" title="Set the name of this attribute table.">set_name</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &n); <a name="l00265"></a>00265 <a name="l00269"></a><a class="code" href="classlibdap_1_1AttrTable.html#3cd9ea1f233c5d237c34c5a53c68a115">00269</a> <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#3cd9ea1f233c5d237c34c5a53c68a115">get_parent</a>()<span class="keyword"> const</span> <a name="l00270"></a>00270 <span class="keyword"> </span>{ <a name="l00271"></a>00271 <span class="keywordflow">return</span> d_parent; <a name="l00272"></a>00272 } <a name="l00273"></a>00273 <a name="l00274"></a>00274 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1AttrTable.html#7a526505d174c7a2f33e6b57761f8bc4" title="Add an attribute to the table.">append_attr</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name, <span class="keyword">const</span> <span class="keywordtype">string</span> &type, <a name="l00275"></a>00275 <span class="keyword">const</span> <span class="keywordtype">string</span> &value); <a name="l00276"></a>00276 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1AttrTable.html#7a526505d174c7a2f33e6b57761f8bc4" title="Add an attribute to the table.">append_attr</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name, <span class="keyword">const</span> <span class="keywordtype">string</span> &type, <a name="l00277"></a>00277 vector<string> *values); <a name="l00278"></a>00278 <a name="l00279"></a>00279 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#03f3a1197f9529d4c0328830c765cfe1" title="Add a container to the attribute table.">append_container</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00280"></a>00280 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#03f3a1197f9529d4c0328830c765cfe1" title="Add a container to the attribute table.">append_container</a>(<a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at, <span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00281"></a>00281 <a name="l00282"></a>00282 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#33653c34e856e2e5fc0578240eb7a959">find</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &target, <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> **at, <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> *iter); <a name="l00283"></a>00283 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#e403d070910c829f74a59fbf4648588f" title="Find an attribute with a given name.">find_container</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &target); <a name="l00284"></a>00284 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#efdc93c9514013ebd644488cd8365924">recurrsive_find</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &target, <a name="l00285"></a>00285 <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> *location); <a name="l00286"></a>00286 <a name="l00287"></a>00287 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#4010172de5c41cd88f2422d5e1975522" title="Get an attribute container.">get_attr_table</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00288"></a>00288 <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1AttrTable.html#689563c3beb8e6f571387c5105821f27" title="Get the type name of an attribute within this attribute table.">get_type</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00289"></a>00289 <span class="keyword">virtual</span> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">AttrType</a> <a class="code" href="classlibdap_1_1AttrTable.html#efcd82370930ba94a288f135d9417a93" title="Get the type of an attribute.">get_attr_type</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00290"></a>00290 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1AttrTable.html#1c86cb6c91dfdc37b9787828dd09483c" title="Get the number of attributes in this container.">get_attr_num</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00291"></a>00291 <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1AttrTable.html#615b618bb2333da0d7114eec2101defe">get_attr</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0); <a name="l00292"></a>00292 <span class="keyword">virtual</span> vector<string> *<a class="code" href="classlibdap_1_1AttrTable.html#7352d886789e9e38d530fc44c6cbef30" title="Get a vector-valued attribute.">get_attr_vector</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00293"></a>00293 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#9c8feb09ec38a783817bcd2fbd3421c8" title="Deletes an attribute.">del_attr</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name, <span class="keywordtype">int</span> i = -1); <a name="l00294"></a>00294 <a name="l00295"></a>00295 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> <a class="code" href="classlibdap_1_1AttrTable.html#8881bb7044577dae3098f4a1d8bf4f2f">attr_begin</a>(); <a name="l00296"></a>00296 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> <a class="code" href="classlibdap_1_1AttrTable.html#543955729bad6b7a9d1d6b336596b1ba">attr_end</a>(); <a name="l00297"></a>00297 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> <a class="code" href="classlibdap_1_1AttrTable.html#8b9dd1020a256e884747e8ecf57c10a3">get_attr_iter</a>(<span class="keywordtype">int</span> i); <a name="l00298"></a>00298 <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1AttrTable.html#4c79bee34f6d3fb0947776adaa52aeee" title="Get the name of this attribute table.">get_name</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00299"></a>00299 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1AttrTable.html#2ca5cf1e2aa163259b00affe49547a0d">is_container</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00300"></a>00300 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *<a class="code" href="classlibdap_1_1AttrTable.html#4010172de5c41cd88f2422d5e1975522" title="Get an attribute container.">get_attr_table</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00301"></a>00301 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> <a class="code" href="classlibdap_1_1AttrTable.html#bcdd3b10325085a3dd345343df159e48">del_attr_table</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00302"></a>00302 <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1AttrTable.html#689563c3beb8e6f571387c5105821f27" title="Get the type name of an attribute within this attribute table.">get_type</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00303"></a>00303 <span class="keyword">virtual</span> <a class="code" href="namespacelibdap.html#e4f907cc24469ce7b0fef9e3d7758d2a">AttrType</a> <a class="code" href="classlibdap_1_1AttrTable.html#efcd82370930ba94a288f135d9417a93" title="Get the type of an attribute.">get_attr_type</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00304"></a>00304 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1AttrTable.html#1c86cb6c91dfdc37b9787828dd09483c" title="Get the number of attributes in this container.">get_attr_num</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00305"></a>00305 <span class="keyword">virtual</span> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1AttrTable.html#615b618bb2333da0d7114eec2101defe">get_attr</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0); <a name="l00306"></a>00306 <span class="keyword">virtual</span> std::vector<string> *<a class="code" href="classlibdap_1_1AttrTable.html#7352d886789e9e38d530fc44c6cbef30" title="Get a vector-valued attribute.">get_attr_vector</a>(<a class="code" href="classlibdap_1_1AttrTable.html#3647edf8906b672bad7a8c5ffc81d62a">Attr_iter</a> iter); <a name="l00307"></a>00307 <a name="l00308"></a>00308 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#cd28a0951ff0764a6d740fbc30d3052f" title="Add an alias to a container held by this attribute table.">add_container_alias</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &name, <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *src); <a name="l00309"></a>00309 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#77971a429d7c23360fd41a4df177489c" title="Add an alias for an attribute.">add_value_alias</a>(<a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at, <span class="keyword">const</span> <span class="keywordtype">string</span> &name, <a name="l00310"></a>00310 <span class="keyword">const</span> <span class="keywordtype">string</span> &source); <a name="l00311"></a>00311 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1AttrTable.html#2b9a67d2cc96dee860e6fb2d713a8252" title="Adds an alias to the set of attributes.">attr_alias</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &alias, <a name="l00312"></a>00312 <a class="code" href="classlibdap_1_1AttrTable.html" title="Contains the attributes for a dataset.">AttrTable</a> *at, <a name="l00313"></a>00313 <span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00314"></a>00314 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1AttrTable.html#2b9a67d2cc96dee860e6fb2d713a8252" title="Adds an alias to the set of attributes.">attr_alias</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &alias, <span class="keyword">const</span> <span class="keywordtype">string</span> &name); <a name="l00315"></a>00315 <a name="l00316"></a>00316 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#cc2d83b4f1c8e704a6f83ff966a999c8" title="Prints the attribute table.">print</a>(FILE *out, <span class="keywordtype">string</span> pad = <span class="stringliteral">" "</span>, <a name="l00317"></a>00317 <span class="keywordtype">bool</span> dereference = <span class="keyword">false</span>); <a name="l00318"></a>00318 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#cc2d83b4f1c8e704a6f83ff966a999c8" title="Prints the attribute table.">print</a>(ostream &out, <span class="keywordtype">string</span> pad = <span class="stringliteral">" "</span>, <a name="l00319"></a>00319 <span class="keywordtype">bool</span> dereference = <span class="keyword">false</span>); <a name="l00320"></a>00320 <a name="l00321"></a>00321 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#5e27ea09f83831eded1b3d86de7f4534">print_xml</a>(FILE *out, <span class="keywordtype">string</span> pad = <span class="stringliteral">" "</span>, <a name="l00322"></a>00322 <span class="keywordtype">bool</span> constrained = <span class="keyword">false</span>); <a name="l00323"></a>00323 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#5e27ea09f83831eded1b3d86de7f4534">print_xml</a>(ostream &out, <span class="keywordtype">string</span> pad = <span class="stringliteral">" "</span>, <a name="l00324"></a>00324 <span class="keywordtype">bool</span> constrained = <span class="keyword">false</span>); <a name="l00325"></a>00325 <a name="l00326"></a>00326 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1AttrTable.html#a83039e176ada59b990c68b6f3c2cdb7" title="dumps information about this object">dump</a>(ostream &strm) <span class="keyword">const</span> ; <a name="l00327"></a>00327 }; <a name="l00328"></a>00328 <a name="l00329"></a>00329 } <span class="comment">// namespace libdap</span> <a name="l00330"></a>00330 <a name="l00331"></a>00331 <span class="preprocessor">#endif // _attrtable_h</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 19:57:06 2009 for libdap++ by <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>