next up previous contents
Next: Functions that Write to Up: Client Library Functions Previous: Getting Information about Variables   Contents

Reading the Values of Variables from a Data Set

Reading variables from a data set is the last type of API function which requires serious attention. In order to accomplish this task, the API functions which read data must be identified and modified to use data gathered in the objects which are part of the DDS object. However, before any of the variable-type objects in the DDS can contain any information a request to read one or more variables must be issued to the remote data server.

In order to read the contents of a variable from the data set into the appropriate object within the DDS, the API read function(s) must be rewritten so that any information needed to build the correct URL is retrieved from the DDS. Once the URL has been built it is used to access a MIME document which contains, in binary form, the data in the variable. This information is then added to the correct object in the DDS. The read function then reads this information and returns it to the calling program.

All binary (i.e., variable value) information transferred by DODS is transfered as multipart Multipurpose Internet Mail Extensions documents. These documents contain a text description of the data type and the binary representation of the variable's value (the later is encoded using Sun's External Data Representation (XDR) standard). Once the binary data is received by the client library, it is transformed, using functions from the XDR library, from XDR's canonical network representation to the local machine's representation. This binary information is then stored in the object with the DDS. Thus, while binary information is transferred from server to client using XDR, the binary information stored in the DDS is in the client CPU's representation.

The DODS client and server toolkit provide C++ software which can be used to simplify reading variables and decoding the XDR-encoded binary data. However, each client library must provide code which extends the client and server tool kit class library to handle any special formatting/typecasting requirements of a particular API.

Figure: Structure Chart for the Data Read Functions in a DODS Client Library
\begin{figure}\centerline{\psfig{figure=client-read.ps,width=6in}}\end{figure}


next up previous contents
Next: Functions that Write to Up: Client Library Functions Previous: Getting Information about Variables   Contents
James Gallagher 2004-04-21