8#ifndef FUNCTIONS_RANGEFUNCTION_H_
9#define FUNCTIONS_RANGEFUNCTION_H_
13#include <libdap/ServerFunction.h>
14#include <libdap/dods-limits.h>
28 min_max_t() : max_val(-DODS_DBL_MAX), min_val(DODS_DBL_MAX), monotonic(
true) { }
30 friend std::ostream& operator<< (std::ostream& stream,
const min_max_t& v) {
31 stream <<
"min: " << v.min_val <<
32 ", max: " << v.max_val <<
33 ", monotonic: " << (v.monotonic?
"true":
"false") ;
40min_max_t find_min_max(
double* data,
int length,
bool use_missing,
double missing);
41libdap::BaseType *range_worker(libdap::BaseType *bt,
double missing,
bool use_missing);
53void function_dap2_range(
int argc, libdap::BaseType *argv[], libdap::DDS &dds, libdap::BaseType **btpp) ;
65libdap::BaseType *function_dap4_range(libdap::D4RValueList *args, libdap::DMR &dmr);
71class RangeFunction:
public libdap::ServerFunction {
76 setDescriptionString(
"The range() function evaluates the passed variable and returns an array of size 2 containing the min and max values of the variable.");
77 setUsageString(
"range(var)");
78 setRole(
"http://services.opendap.org/dap4/server-side-function/range");
79 setDocUrl(
"https://docs.opendap.org/index.php/Server_Side_Processing_Functions#range");
80 setFunction(function_dap2_range);
81 setFunction(function_dap4_range);
84 virtual ~RangeFunction()