40#include "GridFunction.h"
41#include "gse_parser.h"
42#include "grid_utils.h"
78function_grid(
int argc, BaseType *argv[], DDS &, BaseType **btpp)
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;
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);
167 vector<Grid *> grids;
168 get_grids(dds, &grids);
170 return !grids.empty();
bool canOperateOn(libdap::DDS &dds)
virtual bool read_p()
Has this variable been read?
bool read() override
Read the elements of Constructor marked for transmission.
virtual BaseType * ptr_duplicate()
BaseType * array_var()
Returns the Grid Array.
Map_iter map_begin()
Returns an iterator referencing the first Map vector.
Array * get_array()
Returns the Grid Array. This method returns the array using an Array*, so no cast is required.
virtual bool set_value(const string &value)
void set_send_p(bool state) override
Indicates that the data is ready to send.
top level DAP object to house generic methods