35class TabularFunction:
public libdap::ServerFunction
38 friend class TabularFunctionTest;
39 friend class Dap4_TabularFunctionTest;
41 typedef std::vector< std::vector<libdap::BaseType*> *> SequenceValues;
42 typedef std::vector<unsigned long> Shape;
44 static void function_dap2_tabular(
int argc, libdap::BaseType *argv[], libdap::DDS &dds, libdap::BaseType **btpp);
47 static void function_dap2_tabular_2(
int argc, libdap::BaseType *argv[], libdap::DDS &, libdap::BaseType **btpp);
53 static Shape array_shape(libdap::Array *a);
54 static bool shape_matches(libdap::Array *a,
const Shape &shape);
55 static bool dep_indep_match(
const Shape &dep_shape,
const Shape &indep_shape);
57 static unsigned long number_of_values(
const Shape &shape);
59 static void build_columns(
unsigned long n, libdap::BaseType *btp, std::vector<libdap::Array*> &arrays, Shape &shape);
61 static void read_values(
const std::vector<libdap::Array*> &arrays);
63 static void build_sequence_values(
const std::vector<libdap::Array*> &arrays, SequenceValues &sv);
64 static void combine_sequence_values(SequenceValues &dep,
const SequenceValues &indep);
65 static void add_index_column(
const Shape &indep_shape,
const Shape &dep_shape,
66 std::vector<libdap::Array*> &dep_vars);
72 setDescriptionString(
"The tabular() function transforms one or more arrays into a sequence.");
73 setUsageString(
"tabular()");
74 setRole(
"http://services.opendap.org/dap4/server-side-function/tabular");
75 setDocUrl(
"https://docs.opendap.org/index.php/Server_Side_Processing_Functions#tabular");
76 setFunction(TabularFunction::function_dap2_tabular);
81 virtual ~TabularFunction()