40#include "GridFunction.h"
41#include "gse_parser.h"
42#include "grid_utils.h"
80 DBG(cerr <<
"Entering function_grid..." << endl);
83 string(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") +
84 "<function name=\"grid\" version=\"1.0\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#grid\">\n" +
88 Str *response =
new Str(
"info");
89 response->set_value(info);
94 Grid *original_grid =
dynamic_cast < Grid *
>(argv[0]);
96 throw Error(malformed_expr,
"The first argument to grid() must be a Grid variable!");
101 Grid *l_grid =
dynamic_cast < Grid *
>(btp);
104 throw InternalErr(__FILE__, __LINE__,
"Expected a Grid.");
107 DBG(cerr <<
"grid: past initialization code" << endl);
113 BESDEBUG(
"functions",
"original_grid: read_p: " << original_grid->read_p() << endl);
114 BESDEBUG(
"functions",
"l_grid: read_p: " << l_grid->read_p() << endl);
116 BESDEBUG(
"functions",
"original_grid->array_(): read_p: " << original_grid->array_var()->read_p() << endl);
117 BESDEBUG(
"functions",
"l_grid->array+var(): read_p: " << l_grid->array_var()->read_p() << endl);
121 Grid::Map_iter i = l_grid->map_begin();
122 while (i != l_grid->map_end())
123 (*i++)->set_send_p(
true);
127 DBG(cerr <<
"grid: past map read" << endl);
133 vector < GSEClause * > clauses;
134 gse_arg *arg =
new gse_arg(l_grid);
135 for (
int i = 1; i < argc; ++i) {
136 parse_gse_expression(arg, argv[i]);
137 clauses.push_back(arg->get_gsec());
142 apply_grid_selection_expressions(l_grid, clauses);
144 DBG(cerr <<
"grid: past gse application" << endl);
146 l_grid->get_array()->set_send_p(
true);
167 vector<Grid *> grids;
168 get_grids(dds, &grids);
170 return !grids.empty();
bool canOperateOn(libdap::DDS &dds)
The basic data type for the DODS DAP types.
virtual BaseType * ptr_duplicate()=0
A class for error processing.
Holds the Grid data type.
A class for software fault reporting.
Holds character string data.
top level DAP object to house generic methods