bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
GSEClause.h
1
2// -*- mode: c++; c-basic-offset:4 -*-
3
4// This file is part of libdap, A C++ implementation of the OPeNDAP Data
5// Access Protocol.
6
7// Copyright (c) 2002,2003 OPeNDAP, Inc.
8// Author: James Gallagher <jgallagher@opendap.org>
9//
10// This library is free software; you can redistribute it and/or
11// modify it under the terms of the GNU Lesser General Public
12// License as published by the Free Software Foundation; either
13// version 2.1 of the License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23//
24// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25
26// (c) COPYRIGHT URI/MIT 1999
27// Please read the full copyright statement in the file COPYRIGHT_URI.
28//
29// Authors:
30// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
31
32// The Grid Selection Expression Clause class.
33
34#ifndef _gseclause_h
35#define _gseclause_h 1
36
37#include <string>
38#include <sstream>
39
40#if 0
41#include <libdap/BaseType.h>
42#include <libdap/Array.h>
43#include <libdap/Grid.h>
44#endif
45
46namespace libdap {
47class BaseType;
48class Array;
49class Grid;
50}
51
52namespace functions
53{
54
55enum relop {
56 dods_nop_op,
57 dods_greater_op,
58 dods_greater_equal_op,
59 dods_less_op,
60 dods_less_equal_op,
61 dods_equal_op,
62 dods_not_equal_op
63};
64
72
73class GSEClause
74{
75private:
76 libdap::Array *d_map;
77 // Process the Map Arrays.
78 // _value1, 2 and _op1, 2 hold the first and second operators and
79 // operands. For a clause like `var op value' only _op1 and _value1 have
80 // valid information. For a clause like `value op var op value' the
81 // second operator and operand are on _op2 and _value2. 1/19/99 jhrg
82 double d_value1, d_value2;
83 relop d_op1, d_op2;
84 int d_start;
85 int d_stop;
86
87 string d_map_min_value, d_map_max_value;
88
89 GSEClause(); // Hidden default constructor.
90
91 GSEClause(const GSEClause &param); // Hide
92 GSEClause &operator=(GSEClause &rhs); // Hide
93
94 template<class T> void set_start_stop();
95 template<class T> void set_map_min_max_value(T min, T max);
96
97 void compute_indices();
98
99public:
102 GSEClause(libdap::Grid *grid, const string &map, const double value,
103 const relop op);
104
105 GSEClause(libdap::Grid *grid, const string &map, const double value1,
106 const relop op1, const double value2, const relop op2);
107
108 GSEClause(libdap::Array *coverage, const string &map, const double value,
109 const relop op);
110
111 GSEClause(libdap::Array *coverage, const string &map, const double value1,
112 const relop op1, const double value2, const relop op2);
114
115 virtual ~GSEClause();
116
117 bool OK() const;
118
121 libdap::Array *get_map() const;
122
123 string get_map_name() const;
124
125 int get_start() const;
126
127 int get_stop() const;
128
129 string get_map_min_value() const;
130
131 string get_map_max_value() const;
133
136 void set_map(libdap::Array *map);
137
138 void set_start(int start);
139
140 void set_stop(int stop);
142};
143
144} // namespace functions
145
146#endif // _gseclause_h
147
string get_map_name() const
Get the name of the map variable constrained by this clause.
Definition GSEClause.cc:357
libdap::Array * get_map() const
Get a pointer to the map variable constrained by this clause.
Definition GSEClause.cc:339
void set_stop(int stop)
Set the stopping index.
Definition GSEClause.cc:392
int get_stop() const
Get the stopping index of the clause's map variable as constrained by this clause.
Definition GSEClause.cc:383
void set_start(int start)
Set the starting index.
Definition GSEClause.cc:374
string get_map_max_value() const
Get the maximum map vector value.
Definition GSEClause.cc:412
int get_start() const
Get the starting index of the clause's map variable as constrained by this clause.
Definition GSEClause.cc:366
string get_map_min_value() const
Get the minimum map vector value.
Definition GSEClause.cc:402
void set_map(libdap::Array *map)
Set the pointer to the map vector contrained by this clause.
Definition GSEClause.cc:349
STL class.