Functions | |
bool | double_eq (double lhs, double rhs, double epsilon=1.0e-5) |
double * | extract_double_array (Array *a) |
double | extract_double_value (BaseType *arg) |
string | extract_string_argument (BaseType *arg) |
BaseType * | func_one (int argc, BaseType *argv[], DDS &dds, const string &dataset) |
BaseType * | function_geoarray (int argc, BaseType *argv[], DDS &, const string &dataset) |
BaseType * | function_geogrid (int argc, BaseType *argv[], DDS &, const string &dataset) |
BaseType * | function_grid (int argc, BaseType *argv[], DDS &, const string &dataset) |
BaseType * | function_linear_scale (int argc, BaseType *argv[], DDS &, const string &dataset) |
BaseType * | function_version (int, BaseType *[], DDS &, const string &) |
void | register_functions (ConstraintEvaluator &ce) |
void | set_array_using_double (Array *dest, double *src, int src_len) |
bool libdap::double_eq | ( | double | lhs, | |
double | rhs, | |||
double | epsilon = 1.0e-5 | |||
) | [inline] |
Is lhs equal to rhs? Use epsilon to determine equality.
Definition at line 93 of file ce_functions.cc.
Referenced by function_linear_scale().
double * libdap::extract_double_array | ( | Array * | a | ) |
Given a pointer to an Array which holds a numeric type, extract the values and return in an array of doubles. This function allocates the array using 'new double[n]' so delete[] can be used when you are done the data.
Definition at line 235 of file ce_functions.cc.
References dods_array_c, dods_byte_c, dods_float32_c, dods_float64_c, dods_int16_c, dods_int32_c, dods_str_c, dods_uint16_c, dods_uint32_c, dods_url_c, BaseType::is_simple_type(), malformed_expr, BaseType::name(), BaseType::read_p(), BaseType::type(), and Vector::var().
Referenced by function_linear_scale().
Here is the call graph for this function:
double libdap::extract_double_value | ( | BaseType * | arg | ) |
Given a BaseType pointer, extract the numeric value it contains and return it in a C++ double.
arg | The BaseType pointer |
Definition at line 281 of file ce_functions.cc.
References BaseType::buf2val(), DBG, dods_byte_c, dods_float32_c, dods_float64_c, dods_int16_c, dods_int32_c, dods_str_c, dods_uint16_c, dods_uint32_c, dods_url_c, BaseType::is_simple_type(), malformed_expr, BaseType::read_p(), and BaseType::type().
Referenced by function_geoarray(), function_geogrid(), and function_linear_scale().
Here is the call graph for this function:
string libdap::extract_string_argument | ( | BaseType * | arg | ) |
Given a BaseType pointer, extract the string value it contains and return it.
arg | The BaseType pointer |
Definition at line 108 of file ce_functions.cc.
References BaseType::buf2val(), DBG, dods_str_c, malformed_expr, BaseType::read_p(), and BaseType::type().
Referenced by function_geoarray().
Here is the call graph for this function:
BaseType * libdap::function_geoarray | ( | int | argc, | |
BaseType * | argv[], | |||
DDS & | dds, | |||
const string & | dataset | |||
) |
Perform a selection on the array using geographical coordinates. This function takes several groups of arguments.
argc | ||
argv | ||
dds | ||
dataset |
Error | Thrown if thins go awry. |
Definition at line 996 of file ce_functions.cc.
References ArrayGeoConstraint::apply_constraint_to_data(), DBG, extract_double_value(), extract_string_argument(), ArrayGeoConstraint::get_constrained_array(), BaseType::ptr_duplicate(), GeoConstraint::set_bounding_box(), and Str::set_value().
Referenced by register_functions().
Here is the call graph for this function:
BaseType * libdap::function_geogrid | ( | int | argc, | |
BaseType * | argv[], | |||
DDS & | dds, | |||
const string & | dataset | |||
) |
The geogrid function returns the part of a Grid which includes a geographically specified rectangle. The arguments to the function are the name of a Grid, the left-top and right-bottom points of the rectangle and zero or more relational expressions of the sort that the grid function accepts. The constraints on the arguments are:
argc | The number of values in argv. | |
argv | An array of BaseType pointers which hold the arguments to be passed to geogrid. The arguments may be Strings, Integers, or Reals, subject to the above constraints. | |
dds | The DDS which holds the Grid. This DDS must include attributes. | |
dataset | Name of the dataset. |
Definition at line 616 of file ce_functions.cc.
References GridGeoConstraint::apply_constraint_to_data(), DBG, extract_double_value(), Grid::get_array(), GridGeoConstraint::get_constrained_grid(), gse_arg::get_gsec(), Grid::map_begin(), Grid::map_end(), BaseType::ptr_duplicate(), BaseType::read(), GeoConstraint::set_bounding_box(), Vector::set_read_p(), and Str::set_value().
Referenced by register_functions().
Here is the call graph for this function:
The grid function uses a set of relational expressions to form a selection within a Grid variable based on the values in the Grid's map vectors. Thus, if a Grid has a 'temperature' map which ranges from 0.0 to 32.0 degrees, it's possible to request the values of the Grid that fall between 10.5 and 12.5 degrees without knowing to which array indexes those values correspond. The function takes one or more arguments:
<map var> <relop> <constant>
<constant> <relop> <map var> <relop> <constant>
Each of the relation expressions is applied to the Grid and the result is returned.
argc | The number of values in argv. | |
argv | An array of BaseType pointers which hold the arguments to be passed to geogrid. The arguments may be Strings, Integers, or Reals, subject to the above constraints. | |
dds | The DDS which holds the Grid. | |
dataset | Name of the dataset. |
Definition at line 503 of file ce_functions.cc.
References DBG, Grid::get_array(), gse_arg::get_gsec(), Grid::map_begin(), Grid::map_end(), Grid::ptr_duplicate(), BaseType::read(), Vector::set_send_p(), and Str::set_value().
Referenced by register_functions().
Here is the call graph for this function:
BaseType * libdap::function_linear_scale | ( | int | argc, | |
BaseType * | argv[], | |||
DDS & | dds, | |||
const string & | dataset | |||
) |
Given a BaseType, scale it using 'y = mx + b'. Either provide the constants 'm' and 'b' or the function will look for the COARDS attributes 'scale_factor' and 'add_offset'.
argc | ||
argv | ||
dds | ||
dataset |
Error | Thrown if scale_factor is not given and the COARDS attributes cannot be found OR if the source variable is not a numeric scalar, Array or Grid. |
Definition at line 838 of file ce_functions.cc.
References Array::add_var(), DBG, DBG2, dods_grid_c, dods_str_c, dods_url_c, double_eq(), extract_double_array(), extract_double_value(), BaseType::get_parent(), Vector::length(), BaseType::name(), BaseType::read(), Vector::set_send_p(), Str::set_value(), BaseType::type(), BaseType::val2buf(), and Vector::val2buf().
Referenced by register_functions().
Here is the call graph for this function:
This server-side function returns version information for the server-side functions.
Definition at line 384 of file ce_functions.cc.
References Str::set_value().
Referenced by register_functions().
Here is the call graph for this function:
void libdap::register_functions | ( | ConstraintEvaluator & | ce | ) |
Definition at line 1085 of file ce_functions.cc.
References ConstraintEvaluator::add_function(), function_geoarray(), function_geogrid(), function_grid(), function_linear_scale(), and function_version().
Referenced by ConstraintEvaluator::ConstraintEvaluator().
Here is the call graph for this function:
void libdap::set_array_using_double | ( | Array * | dest, | |
double * | src, | |||
int | src_len | |||
) |
Given an array that holds some sort of numeric data, load it with values using an array of doubles. This function makes several assumptions. First, it assumes the caller really wants to put the doubles into whatever types the array holds! Caveat emptor. Second, it assumes that if the size of source (src) array is different than the destination (dest) the caller has made a mistake. In that case it will throw an Error object.
After setting that values, this method sets the read_p
property for dest.
dest | An Array. The values are written to this array, reusing its storage. Existing values are lost. | |
src | The source data. | |
src_len | The number of elements in the src array. |
Error | Thrown if dest is not a numeric-type array (Byte, ..., Float64) or if the number of elements in src does not match the number is dest. |
Definition at line 157 of file ce_functions.cc.
References dods_array_c, dods_byte_c, dods_float32_c, dods_float64_c, dods_int16_c, dods_int32_c, dods_str_c, dods_uint16_c, dods_uint32_c, dods_url_c, BaseType::is_simple_type(), Vector::length(), long_to_string(), Vector::set_read_p(), BaseType::type(), and Vector::var().
Referenced by GridGeoConstraint::apply_constraint_to_data().
Here is the call graph for this function: