In file DAS.h:

class DAS

Holds a DODS Data Attribute Structure.

Public Methods

DAS(AttrTable *dflt=(AttrTable *)NULL, unsigned int sz=0)
Create a DAS from a single attribute table
DAS(AttrTable *attr_table, string name)
Create a DAS object with one attribute table
Pix first_var()
Returns a pointer to the first attribute table
void next_var(Pix &p)
Increments an attribute table pointer to indicate the next table in the series
string get_name(Pix p)
Returns the name of the indicated attribute table
AttrTable* get_table(Pix p)
Returns the indicated attribute table
bool print(ostream &os = cout)
Creates an ASCII representation of a DAS on the given output stream

Public

get\_table()
Returns the attribute table with the given name
AttrTable* get_table(const string &name)
Returns the attribute table with the given name string
AttrTable* get_table(const char *name)
Returns the attribute table with the given name
add\_table()
Adds an attribute table to the DAS
AttrTable* add_table(const string &name, AttrTable *at)
Adds an attribute table to the DAS
AttrTable* add_table(const char *name, AttrTable *at)
Adds an attribute table to the DAS
parse()
Reads a DAS in from an external source
bool parse(string fname)
Reads a DAS from the named file
bool parse(int fd)
Reads a DAS from the given file descriptor
bool parse(FILE *in=stdin)
Reads a DAS from an open file descriptor

Documentation

The Data Attribute Structure is a set of name-value pairs used to describe the data in a particular dataset. The name-value pairs are called the ``attributes''. The values may be of any of the DODS simple data types (Byte, Int16, UInt16, Int32, UInt32, Float32, Float64, String and URL), and may be scalar or vector. Note that all values are actually stored as String data, making the easy to read/check using a web browser. \label{api:das} A value may also consist of a set of other name-value pairs. This makes it possible to nest collections of attributes, giving rise to a hierarchy of attributes. DODS uses this structure to provide information about variables in a dataset. For example, consider the dataset used in the DDS example earlier. In the following example of a DAS, several of the attribute collections have names corresponding to the names of variables in the DDS example. The attributes in that collection are said to belong to that variable. For example, the #lat# variable has an attribute ``units'' of ``degrees\_north''. \begin{verbatim} Attributes { GLOBAL { String title "Reynolds Optimum Interpolation (OI) SST"; } lat { String units "degrees_north"; String long_name "Latitude"; Float64 actual_range 89.5, -89.5; } lon { String units "degrees_east"; String long_name "Longitude"; Float64 actual_range 0.5, 359.5; } time { String units "days since 1-1-1 00:00:00"; String long_name "Time"; Float64 actual_range 726468., 729289.; String delta_t "0000-00-07 00:00:00"; } sst { String long_name "Weekly Means of Sea Surface Temperature"; Float64 actual_range -1.8, 35.09; String units "degC"; Float64 add_offset 0.; Float64 scale_factor 0.0099999998; Int32 missing_value 32767; } } \end{verbatim} Attributes may have arbitrary names, although in most datasets it is important to choose these names so a reader will know what they describe. In the above example, the ``GLOBAL'' attribute provides information about the entire dataset. Data attribute information is an important part of the the data provided to a DODS client by a server, and the DAS is how this data is packaged for sending (and how it is received). The DAS class is simply a sequence of attribute tables and names. It may be thought of as the top level of the attribute hierarchy.
DAS(AttrTable *dflt=(AttrTable *)NULL, unsigned int sz=0)
Create a DAS from a single attribute table. \note{In an older version of this class, #dflt# and #sz# initialized a hash table. That is no longer used and these params should no longer matter. Note that this constructor is effectively the empty constructor. 11/23/98 jhrg}
Parameters:
dflt - A pointer to a valid attribute table.
sz - The number of entries in the table.

DAS(AttrTable *attr_table, string name)
Create a DAS object with one attribute table. Use #append_attr()# to add additional attributes.
Parameters:
attr_table - The initial AttrTable.
See Also:
append_attr()

Pix first_var()
Returns a pointer to the first attribute table

void next_var(Pix &p)
Increments an attribute table pointer to indicate the next table in the series

string get_name(Pix p)
Returns the name of the indicated attribute table

AttrTable* get_table(Pix p)
Returns the indicated attribute table

get\_table()
Returns the attribute table with the given name.

AttrTable* get_table(const string &name)
Returns the attribute table with the given name string

AttrTable* get_table(const char *name)
Returns the attribute table with the given name

add\_table()
Adds an attribute table to the DAS

AttrTable* add_table(const string &name, AttrTable *at)
Adds an attribute table to the DAS

AttrTable* add_table(const char *name, AttrTable *at)
Adds an attribute table to the DAS

parse()
Reads a DAS in from an external source.

bool parse(string fname)
Reads a DAS from the named file

bool parse(int fd)
Reads a DAS from the given file descriptor

bool parse(FILE *in=stdin)
Reads a DAS from an open file descriptor

bool print(ostream &os = cout)
Creates an ASCII representation of a DAS on the given output stream


This class has no child classes.
See Also:
DDS
AttrTable

alphabetic index hierarchy of classes


generated by doc++