<!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++: GSEClause.h 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++ <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 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 id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File 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('GSEClause_8h.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <h1>GSEClause.h</h1> </div> </div> <div class="contents"> <a href="GSEClause_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 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">// The Grid Selection Expression Clause class.</span> <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="preprocessor">#ifndef _gseclause_h</span> <a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define _gseclause_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 <sstream></span> <a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="preprocessor">#ifndef _basetype_h</span> <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="BaseType_8h.html">BaseType.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="preprocessor">#ifndef _array_h</span> <a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="Array_8h.html">Array.h</a>"</span> <a name="l00047"></a>00047 <span class="preprocessor">#endif</span> <a name="l00048"></a>00048 <span class="preprocessor"></span> <a name="l00049"></a>00049 <span class="preprocessor">#ifndef _grid_h</span> <a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="Grid_8h.html">Grid.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="l00056"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757">00056</a> <span class="keyword">enum</span> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757">relop</a> { <a name="l00057"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757aa8e5c4916f3c340f2bd4f22d272cb164">00057</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757aa8e5c4916f3c340f2bd4f22d272cb164">dods_nop_op</a>, <a name="l00058"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a8b4b62ef08f2e543f461ef4f519b4ff7">00058</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a8b4b62ef08f2e543f461ef4f519b4ff7">dods_greater_op</a>, <a name="l00059"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a78e7d0a03e0a6f15a5335fb85c08a327">00059</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a78e7d0a03e0a6f15a5335fb85c08a327">dods_greater_equal_op</a>, <a name="l00060"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a8028088cfd3ffa11f219a78c5155d263">00060</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a8028088cfd3ffa11f219a78c5155d263">dods_less_op</a>, <a name="l00061"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a6d8294078c5da7fd4aab6350b55f5dae">00061</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a6d8294078c5da7fd4aab6350b55f5dae">dods_less_equal_op</a>, <a name="l00062"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a6e5b83098bae549deb95a22af4ef3354">00062</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757a6e5b83098bae549deb95a22af4ef3354">dods_equal_op</a>, <a name="l00063"></a><a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757acb9f92535c4670fa5d97c4334b5764d2">00063</a> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757acb9f92535c4670fa5d97c4334b5764d2">dods_not_equal_op</a> <a name="l00064"></a>00064 }; <a name="l00065"></a>00065 <a name="l00074"></a><a class="code" href="classlibdap_1_1GSEClause.html">00074</a> <span class="keyword">class </span><a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a> <a name="l00075"></a>00075 { <a name="l00076"></a>00076 <span class="keyword">private</span>: <a name="l00077"></a>00077 <a class="code" href="classlibdap_1_1Array.html" title="A multidimensional array of identical data types.">Array</a> *d_map; <a name="l00078"></a>00078 <span class="comment">// _value1, 2 and _op1, 2 hold the first and second operators and</span> <a name="l00079"></a>00079 <span class="comment">// operands. For a clause like `var op value' only _op1 and _value1 have</span> <a name="l00080"></a>00080 <span class="comment">// valid information. For a clause like `value op var op value' the</span> <a name="l00081"></a>00081 <span class="comment">// second operator and operand are on _op2 and _value2. 1/19/99 jhrg</span> <a name="l00082"></a>00082 <span class="keywordtype">double</span> d_value1, d_value2; <a name="l00083"></a>00083 <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757">relop</a> d_op1, d_op2; <a name="l00084"></a>00084 <span class="keywordtype">int</span> d_start; <a name="l00085"></a>00085 <span class="keywordtype">int</span> d_stop; <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="keywordtype">string</span> d_map_min_value, d_map_max_value; <a name="l00088"></a>00088 <a name="l00089"></a>00089 <a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a>(); <span class="comment">// Hidden default constructor.</span> <a name="l00090"></a>00090 <a name="l00091"></a>00091 <a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a> &param); <span class="comment">// Hide</span> <a name="l00092"></a>00092 <a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a> &operator=(<a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a> &rhs); <span class="comment">// Hide</span> <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keywordtype">void</span> set_start_stop(); <a name="l00095"></a>00095 <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keywordtype">void</span> set_map_min_max_value(T min, T max); <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="keywordtype">void</span> compute_indices(); <a name="l00098"></a>00098 <a name="l00099"></a>00099 <span class="keyword">public</span>: <a name="l00102"></a>00102 <a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a>(<a class="code" href="classlibdap_1_1Grid.html" title="Holds the Grid data type.">Grid</a> *grid, <span class="keyword">const</span> <span class="keywordtype">string</span> &map, <span class="keyword">const</span> <span class="keywordtype">double</span> value, <a name="l00103"></a>00103 <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757">relop</a> op); <a name="l00104"></a>00104 <a name="l00105"></a>00105 <a class="code" href="classlibdap_1_1GSEClause.html">GSEClause</a>(<a class="code" href="classlibdap_1_1Grid.html" title="Holds the Grid data type.">Grid</a> *grid, <span class="keyword">const</span> <span class="keywordtype">string</span> &map, <span class="keyword">const</span> <span class="keywordtype">double</span> value1, <a name="l00106"></a>00106 <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757">relop</a> op1, <span class="keyword">const</span> <span class="keywordtype">double</span> value2, <span class="keyword">const</span> <a class="code" href="namespacelibdap.html#a43ed56cf2d346b9ca13adf3829fb6757">relop</a> op2); <a name="l00108"></a>00108 <a name="l00109"></a><a class="code" href="classlibdap_1_1GSEClause.html#a6358a3f64a63199158752fca673d7f67">00109</a> <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1GSEClause.html#a6358a3f64a63199158752fca673d7f67">~GSEClause</a>() { <a name="l00110"></a>00110 <span class="keyword">delete</span> d_map; d_map = 0; <a name="l00111"></a>00111 } <a name="l00112"></a>00112 <a name="l00113"></a>00113 <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1GSEClause.html#aa5dfaf92c387f6778b03868c98d5a9a8">OK</a>() <span class="keyword">const</span>; <a name="l00114"></a>00114 <a name="l00117"></a>00117 <a class="code" href="classlibdap_1_1Array.html" title="A multidimensional array of identical data types.">Array</a> *<a class="code" href="classlibdap_1_1GSEClause.html#ac51bc07a76af93ddc9d5fcac4e01f0e4" title="Get a pointer to the map variable constrained by this clause.">get_map</a>() <span class="keyword">const</span>; <a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1GSEClause.html#a70fec6657c42ebb5002188d12bd33301" title="Get the name of the map variable constrained by this clause.">get_map_name</a>() <span class="keyword">const</span>; <a name="l00120"></a>00120 <a name="l00121"></a>00121 <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1GSEClause.html#a306a6b0fbf600fa4b8844186a2d78452" title="Get the starting index of the clause&#39;s map variable as constrained by this clause.">get_start</a>() <span class="keyword">const</span>; <a name="l00122"></a>00122 <a name="l00123"></a>00123 <span class="keywordtype">int</span> <a class="code" href="classlibdap_1_1GSEClause.html#a0fb441e3d3ab032c94ac940ae64f5dbf" title="Get the stopping index of the clause&#39;s map variable as constrained by this clause.">get_stop</a>() <span class="keyword">const</span>; <a name="l00124"></a>00124 <a name="l00125"></a>00125 <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1GSEClause.html#a72c2807550fd5876d2d4d68d9c8842ad" title="Get the minimum map vector value.">get_map_min_value</a>() <span class="keyword">const</span>; <a name="l00126"></a>00126 <a name="l00127"></a>00127 <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1GSEClause.html#acff9c4b09e339a075a0f4ab57600ee0f" title="Get the maximum map vector value.">get_map_max_value</a>() <span class="keyword">const</span>; <a name="l00129"></a>00129 <a name="l00132"></a>00132 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1GSEClause.html#a71a7e297255ebbee794713fc7620379c" title="Set the pointer to the map vector contrained by this clause.">set_map</a>(<a class="code" href="classlibdap_1_1Array.html" title="A multidimensional array of identical data types.">Array</a> *map); <a name="l00133"></a>00133 <a name="l00134"></a>00134 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1GSEClause.html#a259e52b1a1754bca9a9a6758b4dadbf4" title="Set the starting index.">set_start</a>(<span class="keywordtype">int</span> start); <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1GSEClause.html#a9abbfd7a52404a933c15e1e342a14ae5" title="Set the stopping index.">set_stop</a>(<span class="keywordtype">int</span> stop); <a name="l00138"></a>00138 }; <a name="l00139"></a>00139 <a name="l00140"></a>00140 } <span class="comment">// namespace libdap</span> <a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="preprocessor">#endif // _gseclause_h</span> <a name="l00143"></a>00143 <span class="preprocessor"></span> </pre></div></div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="GSEClause_8h.html">GSEClause.h</a> </li> <li class="footer">Generated on Tue Feb 8 2011 for libdap++ by  <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>