libdap++
Updated for version 3.8.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
DODSFilter.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
//
24
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25
26
// (c) COPYRIGHT URI/MIT 1997-1999
27
// Please first read the full copyright statement in the file COPYRIGHT_URI.
28
//
29
// Authors:
30
// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
31
32
#ifndef _dodsfilter_h
33
#define _dodsfilter_h
34
35
#include <string>
36
37
#ifndef _das_h
38
#include "
DAS.h
"
39
#endif
40
41
#ifndef _dds_h
42
#include "
DDS.h
"
43
#endif
44
45
#ifndef constraint_evaluator_h
46
#include "
ConstraintEvaluator.h
"
47
#endif
48
49
#define FILE_METHODS 1
50
51
namespace
libdap
52
{
53
80
class
DODSFilter
81
{
82
public
:
84
enum
Response
{
85
Unknown_Response
,
86
DAS_Response
,
87
DDS_Response
,
88
DataDDS_Response
,
89
DDX_Response
,
90
DataDDX_Response
,
91
BLOB_Response
,
92
Version_Response
93
};
94
95
protected
:
96
bool
d_comp
;
// True if the output should be compressed.
97
bool
d_bad_options
;
// True if the options (argc,argv) are bad.
98
bool
d_conditional_request
;
99
100
string
d_program_name
;
// Name of the filter program
101
string
d_dataset
;
// Name of the dataset/database
102
string
d_ce
;
// Constraint expression
103
string
d_cgi_ver
;
// Version of CGI script (caller)
104
string
d_anc_dir
;
// Look here for ancillary files
105
string
d_anc_file
;
// Use this for ancillary file name
106
string
d_cache_dir
;
// Use this for cache files
107
string
d_url
;
// URL minus CE.
108
109
Response
d_response
;
// enum name of the response to generate
110
string
d_action
;
// string name of the response to generate
111
112
int
d_timeout
;
// Server timeout after N seconds
113
114
time_t
d_anc_das_lmt
;
// Last modified time of the anc. DAS.
115
time_t
d_anc_dds_lmt
;
// Last modified time of the anc. DDS.
116
time_t
d_if_modified_since
;
// Time from a conditional request.
117
118
void
initialize
();
119
void
initialize
(
int
argc,
char
*argv[]);
120
121
virtual
int
process_options
(
int
argc,
char
*argv[]);
122
123
public
:
131
DODSFilter
()
132
{
133
initialize
();
134
}
135
DODSFilter
(
int
argc,
char
*argv[])
throw
(
Error
);
136
137
virtual
~DODSFilter
();
138
139
virtual
bool
is_conditional
()
const
;
140
141
virtual
string
get_cgi_version
()
const
;
142
virtual
void
set_cgi_version
(
string
version
);
143
144
virtual
string
get_ce
()
const
;
145
virtual
void
set_ce
(
string
_ce);
146
147
virtual
string
get_dataset_name
()
const
;
148
virtual
void
set_dataset_name
(
const
string
_dataset);
149
150
virtual
string
get_URL
()
const
;
151
virtual
void
set_URL
(
const
string
&url);
152
153
virtual
string
get_dataset_version
()
const
;
154
155
virtual
Response
get_response
()
const
;
156
virtual
string
get_action
()
const
;
157
virtual
void
set_response
(
const
string
&r);
158
159
virtual
time_t
get_dataset_last_modified_time
()
const
;
160
161
virtual
time_t
get_das_last_modified_time
(
const
string
&anc_location =
""
)
const
;
162
163
virtual
time_t
get_dds_last_modified_time
(
const
string
&anc_location =
""
)
const
;
164
165
virtual
time_t
get_data_last_modified_time
(
const
string
&anc_location =
""
)
const
;
166
167
virtual
time_t
get_request_if_modified_since
()
const
;
168
169
virtual
string
get_cache_dir
()
const
;
170
171
void
set_timeout
(
int
timeout = 0);
172
173
int
get_timeout
()
const
;
174
175
virtual
void
establish_timeout
(ostream &stream)
const
;
176
177
virtual
void
print_usage
()
const
;
178
179
virtual
void
send_version_info
()
const
;
180
181
virtual
void
send_das
(
DAS
&das,
const
string
&anc_location =
""
,
182
bool
with_mime_headers =
true
)
const
;
183
virtual
void
send_das
(ostream &out,
DAS
&das,
const
string
&anc_location =
""
,
184
bool
with_mime_headers =
true
)
const
;
185
186
virtual
void
send_dds
(
DDS
&dds,
ConstraintEvaluator
&eval,
187
bool
constrained =
false
,
188
const
string
&anc_location =
""
,
189
bool
with_mime_headers =
true
)
const
;
190
virtual
void
send_dds
(ostream &out,
DDS
&dds,
ConstraintEvaluator
&eval,
191
bool
constrained =
false
,
192
const
string
&anc_location =
""
,
193
bool
with_mime_headers =
true
)
const
;
194
// deprecated
195
virtual
void
functional_constraint
(
BaseType
&var,
DDS
&dds,
196
ConstraintEvaluator
&eval, ostream &out)
const
;
197
198
virtual
void
dataset_constraint
(
DDS
&dds,
ConstraintEvaluator
&eval,
199
ostream &out,
bool
ce_eval =
true
)
const
;
200
virtual
void
dataset_constraint_ddx
(
DDS
& dds,
ConstraintEvaluator
& eval,
201
ostream &out,
const
string
&boundary,
202
const
string
&start,
203
bool
ce_eval =
true
)
const
;
204
205
virtual
void
send_data
(
DDS
&dds,
ConstraintEvaluator
&eval,
206
ostream &data_stream,
207
const
string
&anc_location =
""
,
208
bool
with_mime_headers =
true
)
const
;
209
virtual
void
send_ddx
(
DDS
&dds,
ConstraintEvaluator
&eval, ostream &out,
210
bool
with_mime_headers =
true
)
const
;
211
virtual
void
send_data_ddx
(
DDS
&dds,
ConstraintEvaluator
&eval,
212
ostream &data_stream,
const
string
&start,
213
const
string
&boundary,
214
const
string
&anc_location =
""
,
215
bool
with_mime_headers =
true
)
const
;
216
217
#if FILE_METHODS
218
virtual
void
establish_timeout
(FILE *stream)
const
;
219
virtual
void
send_das
(FILE *out,
DAS
&das,
const
string
&anc_location =
""
,
220
bool
with_mime_headers =
true
)
const
;
221
virtual
void
send_dds
(FILE *out,
DDS
&dds,
ConstraintEvaluator
&eval,
222
bool
constrained =
false
,
223
const
string
&anc_location =
""
,
224
bool
with_mime_headers =
true
)
const
;
225
// deprecated
226
virtual
void
functional_constraint
(
BaseType
&var,
DDS
&dds,
227
ConstraintEvaluator
&eval, FILE *out)
const
;
228
229
virtual
void
dataset_constraint
(
DDS
&dds,
ConstraintEvaluator
&eval,
230
FILE *out,
bool
ce_eval =
true
)
const
;
231
virtual
void
send_data
(
DDS
&dds,
ConstraintEvaluator
&eval,
232
FILE *data_stream,
233
const
string
&anc_location =
""
,
234
bool
with_mime_headers =
true
)
const
;
235
virtual
void
send_ddx
(
DDS
&dds,
ConstraintEvaluator
&eval, FILE *out,
236
bool
with_mime_headers =
true
)
const
;
237
#endif
238
};
239
240
}
// namespace libdap
241
242
#endif // _dodsfilter_h
DODSFilter.h
Generated on Wed Jul 10 2013 17:26:30 for libdap++ by
1.8.4