Holds a DODS Data Descriptor Structure.
The DODS Data Descriptor Object (DDS) is a data structure used by the DODS software to describe datasets and subsets of those datasets. The DDS may be thought of as the declarations for the data structures that will hold data requested by some DODS client. Part of the job of a DODS server is to build a suitable DDS for a specific dataset and to send it to the client. Depending on the data access API in use, this may involve reading part of the dataset and inferring the DDS. Other APIs may require the server simply to read some ancillary data file with the DDS in it. \label{api:dds} On the server side, in addition to the data declarations, the DDS holds the clauses of any constraint expression that may have accompanied the data request from the DODS client. The DDS object includes methods for modifying the DDS according to the given constraint expression. It also has methods for directly modifying a DDS, and for transmitting it from a server to a client. For the client, the DDS object includes methods for reading the persistent form of the object sent from a server. This includes parsing the ASCII representation of the object and, possibly, reading data received from a server into a data object. Note that the class DDS is used to instantiate both DDS and DataDDS objects. A DDS that is empty (contains no actual data) is used by servers to send structural information to the client. The same DDS can becomes a DataDDS when data values are bound to the variables it defines. For a complete description of the DDS layout and protocol, please refer to {\it The DODS User Guide}. The DDS has an ASCII representation, which is what is transmitted from a DODS server to a client. Here is the DDS representation of an entire dataset containing a time series of worldwide grids of sea surface temperatures: \begin{verbatim} Dataset { Float64 lat[lat = 180]; Float64 lon[lon = 360]; Float64 time[time = 404]; Grid { ARRAY: Int32 sst[time = 404][lat = 180][lon = 360]; MAPS: Float64 time[time = 404]; Float64 lat[lat = 180]; Float64 lon[lon = 360]; } sst; } weekly; \end{verbatim} If the data request to this dataset includes a constraint expression, the corresponding DDS might be different. For example, if the request was only for northern hemisphere data at a specific time, the above DDS might be modified to appear like this: \begin{verbatim} Dataset { Grid { ARRAY: Int32 sst[time = 1][lat = 90][lon = 360]; MAPS: Float64 time[time = 1]; Float64 lat[lat = 90]; Float64 lon[lon = 360]; } sst; } weekly; \end{verbatim} Since the constraint has narrowed the area of interest, the range of latitude values has been halved, and there is only one time value in the returned array. Note that the simple arrays (#lat#, #lon#, and #time#) described in the dataset are also part of the #sst# Grid object. They can be requested by themselves or as part of that larger object. See the {\it The DODS User Guide}, or the documentation of the BaseType class for descriptions of the DODS data types.
DDS(const DDS &dds)
Dataset Name Accessors
string get_dataset_name()
void set_dataset_name(const string &n)
File Name Accessor
Variable Methods
void add_var(BaseType *bt)
void del_var(const string &n)
var()
BaseType* var(const string &n)
BaseType* var(const char *n)
BaseType* var(const string &n, btp_stack &s)
BaseType* var(Pix p)
Pix first_var()
void next_var(Pix &p)
External Function Accessors
template
void add_function(const string &name, bool_func f)
void add_function(const string &name, btp_func f)
void add_function(const string &name, proj_func f)
bool find_function(const string &name, bool_func *f) const
bool find_function(const string &name, btp_func *f) const
bool find_function(const string &name, proj_func *f) const
Constraint Expression
Pix first_clause()
void next_clause(Pix &p)
Clause& clause(Pix p)
bool clause_value(Pix p, const string &dataset)
append\_clause()
void append_clause(int op, rvalue *arg1, rvalue_list *arg2)
arg1 - A pointer to the argument on the left side of the
operator.
arg2 - A pointer to a list of the arguments on the right
side of the operator. void append_clause(bool_func func, rvalue_list *args)
args - A list of arguments to that function.
void append_clause(btp_func func, rvalue_list *args)
args - A list of arguments to that function.
bool functional_expression()
bool boolean_expression()
BaseType* eval_function(const string &dataset)
bool eval_selection(const string &dataset)
parse\_constraint
bool parse_constraint(const string &constraint, ostream &os = cout, bool server = true)
os - The output stream on which to write error objects and
messages.
server - If true, send errors back to client instead of
displaying errors on the default output stream. bool parse_constraint(const string &constraint, FILE *out, bool server = true)
void append_constant(BaseType *btp)
Read Methods
bool parse(string fname)
bool parse(int fd)
bool parse(FILE *in=stdin)
Print Methods
bool print(ostream &os = cout)
bool print(FILE *out)
bool print_constrained(ostream &os = cout)
bool print_constrained(FILE *out)
bool send(const string &dataset, const string &constraint, FILE *out, bool compressed = true, const string &cgi_ver = DVR)
constraint - A string containing the entire constraint
expression received in the original data request.
out - A pointer to the output buffer for the data.
compressed - If true, send compressed data.
cgi_ver - version information from the caller that identifies
the server sending data.
BaseType::read
BaseType::serialize void mark_all(bool state)
bool mark(const string &name, bool state)
bool check_semantics(bool all = false)
alphabetic index hierarchy of classes
generated by doc++