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");
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);
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);
165 bool GridFunction::canOperateOn(
DDS &dds)
167 vector<Grid *> grids;
168 get_grids(dds, &grids);
170 return !grids.empty();
virtual bool read_p()
Has this variable been read?
top level DAP object to house generic methods
A class for software fault reporting.
Holds character string data.
Map_iter map_begin()
Returns an iterator referencing the first Map vector.
virtual BaseType * ptr_duplicate()
virtual bool read()
simple implementation of read that iterates through vars and calls read on them
Holds the Grid data type.
virtual bool set_value(const string &value)
Array * get_array()
Returns the Grid Array. This method returns the array using an Array*, so no cast is required...
virtual void set_send_p(bool state)
Indicates that the data is ready to send.
The basic data type for the DODS DAP types.
BaseType * array_var()
Returns the Grid Array.
A class for error processing.