libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
GSEClause.h
Go to the documentation of this file.
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 <sstream>
38#include <string>
39
40#if 0
41#include <Array.h>
42#include <BaseType.h>
43#include <Grid.h>
44#endif
45
46namespace libdap {
47class BaseType;
48class Array;
49class Grid;
50} // namespace libdap
51
52namespace functions {
53
63
71
72class GSEClause {
73private:
74 libdap::Array *d_map;
75 // _value1, 2 and _op1, 2 hold the first and second operators and
76 // operands. For a clause like `var op value' only _op1 and _value1 have
77 // valid information. For a clause like `value op var op value' the
78 // second operator and operand are on _op2 and _value2. 1/19/99 jhrg
79 double d_value1, d_value2;
80 relop d_op1, d_op2;
81 int d_start;
82 int d_stop;
83
84 string d_map_min_value, d_map_max_value;
85
86 GSEClause(); // Hidden default constructor.
87
88 GSEClause(const GSEClause &param); // Hide
89 GSEClause &operator=(GSEClause &rhs); // Hide
90
91 template <class T> void set_start_stop();
92 template <class T> void set_map_min_max_value(T min, T max);
93
94 void compute_indices();
95
96public:
99 GSEClause(libdap::Grid *grid, const string &map, const double value, const relop op);
100
101 GSEClause(libdap::Grid *grid, const string &map, const double value1, const relop op1, const double value2,
102 const relop op2);
104
105 virtual ~GSEClause();
106
107 bool OK() const;
108
111 libdap::Array *get_map() const;
112
113 string get_map_name() const;
114
115 int get_start() const;
116
117 int get_stop() const;
118
119 string get_map_min_value() const;
120
121 string get_map_max_value() const;
123
126 void set_map(libdap::Array *map);
127
128 void set_start(int start);
129
130 void set_stop(int stop);
132};
133
134} // namespace functions
135
136#endif // _gseclause_h
string get_map_name() const
Get the name of the map variable constrained by this clause.
Definition GSEClause.cc:232
GSEClause(libdap::Grid *grid, const string &map, const double value1, const relop op1, const double value2, const relop op2)
libdap::Array * get_map() const
Get a pointer to the map variable constrained by this clause.
Definition GSEClause.cc:222
void set_stop(int stop)
Set the stopping index.
Definition GSEClause.cc:253
GSEClause(libdap::Grid *grid, const string &map, const double value, const relop op)
int get_stop() const
Get the stopping index of the clause's map variable as constrained by this clause.
Definition GSEClause.cc:246
void set_start(int start)
Set the starting index.
Definition GSEClause.cc:241
string get_map_max_value() const
Get the maximum map vector value.
Definition GSEClause.cc:265
int get_start() const
Get the starting index of the clause's map variable as constrained by this clause.
Definition GSEClause.cc:237
string get_map_min_value() const
Get the minimum map vector value.
Definition GSEClause.cc:259
void set_map(libdap::Array *map)
Set the pointer to the map vector contrained by this clause.
Definition GSEClause.cc:228
A multidimensional array of identical data types.
Definition Array.h:121
The basic data type for the DODS DAP types.
Definition BaseType.h:118
Holds the Grid data type.
Definition Grid.h:121
@ dods_greater_equal_op
Definition GSEClause.h:57
@ dods_greater_op
Definition GSEClause.h:56
@ dods_nop_op
Definition GSEClause.h:55
@ dods_not_equal_op
Definition GSEClause.h:61
@ dods_equal_op
Definition GSEClause.h:60
@ dods_less_op
Definition GSEClause.h:58
@ dods_less_equal_op
Definition GSEClause.h:59
top level DAP object to house generic methods
Definition AISConnect.cc:30