DAS Class Reference

Hold attribute data for a DAP2 dataset. More...

#include <DAS.h>

Inheritance diagram for DAS:

Inheritance graph
[legend]
Collaboration diagram for DAS:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< entry
* >::const_iterator 
Attr_citer
typedef std::vector< entry
* >::iterator 
Attr_iter

Public Member Functions

void add_container_alias (const string &name, AttrTable *src)
 Add an alias to a container held by this attribute table.
void add_value_alias (AttrTable *das, const string &name, const string &source)
 Add an alias for an attribute.
unsigned int append_attr (const string &name, const string &type, vector< string > *values)
 Add an attribute to the table.
unsigned int append_attr (const string &name, const string &type, const string &value)
 Add an attribute to the table.
AttrTableappend_container (AttrTable *at, const string &name)
 Add a container to the attribute table.
AttrTableappend_container (const string &name)
 Add a container to the attribute table.
bool attr_alias (const string &alias, const string &name)
bool attr_alias (const string &alias, AttrTable *at, const string &name)
 Adds an alias to the set of attributes.
 DAS (AttrTable *attr_table, string name)
 DAS (AttrTable *dflt=(AttrTable *) NULL, unsigned int sz=0)
virtual void dump (ostream &strm) const
 dumps information about this object
void erase ()
 Erase the attribute table.
void find (const string &target, AttrTable **at, Attr_iter *iter)
AttrTablefind_container (const string &target)
 Find an attribute with a given name.
string get_name () const
 Get the name of this attribute table.
string get_name (Attr_iter &i)
AttrTableget_parent () const
unsigned int get_size () const
 Get the number of entries in this attribute table.
AttrTableget_table (const string &name)
 Returns the attribute table with the given name.
AttrTableget_table (Attr_iter &i)
 Returns the attribute table.
void print (FILE *out, string pad=" ", bool dereference=false)
 Prints the attribute table.
void print (FILE *out, bool dereference=false)
void print_xml (FILE *out, string pad=" ", bool constrained=false)
AttrTablerecurrsive_find (const string &target, Attr_iter *location)
void set_name (const string &n)
 Set the name of this attribute table.
AttrTable::Attr_iter var_begin ()
AttrTable::Attr_iter var_end ()
virtual ~DAS ()
get information using an iterator
Attr_iter attr_begin ()
Attr_iter attr_end ()
Attr_iter del_attr_table (Attr_iter iter)
string get_attr (Attr_iter iter, unsigned int i=0)
string get_attr (const string &name, unsigned int i=0)
Attr_iter get_attr_iter (int i)
unsigned int get_attr_num (Attr_iter iter)
AttrTableget_attr_table (Attr_iter iter)
AttrType get_attr_type (Attr_iter iter)
std::vector< string > * get_attr_vector (Attr_iter iter)
string get_name (Attr_iter iter)
string get_type (Attr_iter iter)
bool is_container (Attr_iter iter)
Accessors using an attribute name
Each of the following accessors get information using the name of an attribute. They perform a simple search for the name in this attribute table only; sub-tables are not searched and the dot notation is not recognized.

void del_attr (const string &name, int i=-1)
 Deletes an attribute.
unsigned int get_attr_num (const string &name)
 Get the number of attributes in this container.
AttrTableget_attr_table (const string &name)
 Get an attribute container.
AttrType get_attr_type (const string &name)
 Get the type of an attribute.
vector< string > * get_attr_vector (const string &name)
 Get a vector-valued attribute.
string get_type (const string &name)
 Get the type name of an attribute within this attribute table.
add_table()
Adds an attribute table to the DAS.

AttrTableadd_table (const string &name, AttrTable *at)
 Adds an attribute table to the DAS.
get information using an iterator
Attr_iter attr_begin ()
Attr_iter attr_end ()
Attr_iter del_attr_table (Attr_iter iter)
string get_attr (Attr_iter iter, unsigned int i=0)
string get_attr (const string &name, unsigned int i=0)
Attr_iter get_attr_iter (int i)
unsigned int get_attr_num (Attr_iter iter)
AttrTableget_attr_table (Attr_iter iter)
AttrType get_attr_type (Attr_iter iter)
std::vector< string > * get_attr_vector (Attr_iter iter)
string get_name (Attr_iter iter)
string get_type (Attr_iter iter)
bool is_container (Attr_iter iter)
Accessors using an attribute name
Each of the following accessors get information using the name of an attribute. They perform a simple search for the name in this attribute table only; sub-tables are not searched and the dot notation is not recognized.

void del_attr (const string &name, int i=-1)
 Deletes an attribute.
unsigned int get_attr_num (const string &name)
 Get the number of attributes in this container.
AttrTableget_attr_table (const string &name)
 Get an attribute container.
AttrType get_attr_type (const string &name)
 Get the type of an attribute.
vector< string > * get_attr_vector (const string &name)
 Get a vector-valued attribute.
string get_type (const string &name)
 Get the type name of an attribute within this attribute table.
parse()
Reads a DAS in from an external source.

void parse (FILE *in=stdin)
 Reads a DAS from an open file descriptor.
void parse (int fd)
 Read attributes from a file descriptor.
void parse (string fname)
 Reads a DAS from the named file.

Protected Member Functions

void clone (const AttrTable &at)
AttrTabledas_find (string name)
void simple_print (FILE *out, string pad, Attr_iter i, bool dereference)

Detailed Description

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 DAP2 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.

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. DAP2 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''.

    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;
        }
    }
    

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 DAP2 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.

See also:
DDS

AttrTable

Definition at line 121 of file DAS.h.


Member Typedef Documentation

typedef std::vector<entry *>::const_iterator AttrTable::Attr_citer [inherited]

Definition at line 226 of file AttrTable.h.

typedef std::vector<entry *>::iterator AttrTable::Attr_iter [inherited]

Definition at line 227 of file AttrTable.h.


Constructor & Destructor Documentation

DAS::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. This is unused. It was part of the ctor when DAS used the old GNU VHMap class. I switched from that to a SLList of struct toplevel_entry objects because the VHMap class had bugs I didn't want to fix. 11/23/98 jhrg

Definition at line 91 of file DAS.cc.

DAS::DAS ( AttrTable attr,
string  name 
)

Create a DAS object with one attribute table. Use append_attr() to add additional attributes.

See also:
append_attr()
Parameters:
attr The initial AttrTable.
name The name of the DAS parent structure.

Definition at line 102 of file DAS.cc.

References AttrTable::append_container(), and www2id().

Here is the call graph for this function:

DAS::~DAS (  )  [virtual]

Definition at line 114 of file DAS.cc.


Member Function Documentation

void AttrTable::add_container_alias ( const string &  name,
AttrTable src 
) [inherited]

Parameters:
name The name of the alias. May not use dot notation.
src The existing attribute container to alias.
Exceptions:
Error if an attribute, container or alias called name already exists in this attribute table.

Definition at line 789 of file AttrTable.cc.

References AttrTable::entry::aliased_to, Attr_container, AttrTable::attr_end(), AttrTable::entry::attributes, AttrTable::get_name(), AttrTable::entry::is_alias, AttrTable::entry::name, AttrTable::entry::type, and www2id().

Here is the call graph for this function:

AttrTable * DAS::add_table ( const string &  name,
AttrTable at 
)

Definition at line 160 of file DAS.cc.

References AttrTable::append_container(), and DBG.

Here is the call graph for this function:

void AttrTable::add_value_alias ( AttrTable das,
const string &  name,
const string &  source 
) [inherited]

Assume source names an attribute value in some container. Add an alias name for that value in this object.

Parameters:
das 
name The name of the alias. May not use dot notation.
source The name of the attribute to alias. May use dot notation.
Exceptions:
Error if the attribute table already contains an attribute, container or alias called name or if an attribute called source does not exist.

Definition at line 821 of file AttrTable.cc.

References AttrTable::entry::aliased_to, AttrTable::entry::attr, Attr_container, AttrTable::attr_end(), AttrTable::entry::attributes, AttrTable::find(), AttrTable::get_attr_table(), AttrTable::get_attr_type(), AttrTable::entry::is_alias, AttrTable::is_container(), AttrTable::entry::name, AttrTable::entry::type, and www2id().

Referenced by AttrTable::attr_alias().

Here is the call graph for this function:

unsigned int AttrTable::append_attr ( const string &  name,
const string &  type,
vector< string > *  values 
) [inherited]

This version of append_attr() takes a vector<string> of values. If the given name already refers to an attribute, and the attribute has values, append the new values to the existing ones.

The function throws an Error if the attribute is a container, or if the type of the input value does not match the existing attribute's type. Use append_container() to add container attributes.

This method performs a simple search for name in this attribute table only; sub-tables are not searched and the dot notation is not recognized.

Returns:
Returns the length of the added attribute value.
Parameters:
name The name of the attribute to add or modify.
type The type of the attribute to add or modify.
values A vector of values.

Definition at line 257 of file AttrTable.cc.

References AttrTable::entry::attr, AttrTable::get_type(), AttrTable::entry::is_alias, AttrTable::entry::name, String_to_AttrType(), AttrTable::entry::type, and www2id().

Here is the call graph for this function:

unsigned int AttrTable::append_attr ( const string &  name,
const string &  type,
const string &  attribute 
) [inherited]

If the given name already refers to an attribute, and the attribute has a value, the given value is appended to the attribute vector. Calling this function repeatedly is the way to append to an attribute vector.

The function throws an Error if the attribute is a container, or if the type of the input value does not match the existing attribute's type. Use append_container() to add container attributes.

This method performs a simple search for name in this attribute table only; sub-tables are not searched and the dot notation is not recognized.

Returns:
Returns the length of the added attribute value.
Parameters:
name The name of the attribute to add or modify.
type The type of the attribute to add or modify.
attribute The value to add to the attribute table.

Definition at line 204 of file AttrTable.cc.

References AttrTable::entry::attr, AttrTable::get_type(), AttrTable::entry::is_alias, AttrTable::entry::name, String_to_AttrType(), AttrTable::entry::type, and www2id().

Referenced by DDXParser::ddx_end_element(), DDS::transfer_attributes(), and Constructor::transfer_attributes().

Here is the call graph for this function:

AttrTable * AttrTable::append_container ( AttrTable at,
const string &  name 
) [inherited]

Append a new attribute container to this attribute table. The new container is at and its name is set to name. If this attribute table already contains an attribute container called name an exception is thrown.

Note:
The value of name will override the name of at set using the set_name() method.
Returns:
A pointer to the new AttrTable object.

Definition at line 331 of file AttrTable.cc.

References Attr_container, AttrTable::attr_end(), AttrTable::entry::attributes, AttrTable::d_parent, DBG, AttrTable::entry::is_alias, AttrTable::entry::name, AttrTable::set_name(), AttrTable::entry::type, and www2id().

Here is the call graph for this function:

AttrTable * AttrTable::append_container ( const string &  name  )  [inherited]

Create and append an attribute container to this AttrTable. If this attribute table already contains an attribute container called name an exception is thrown.

Returns:
A pointer to the new AttrTable object.

Definition at line 303 of file AttrTable.cc.

Referenced by add_table(), DAS(), DDS::find_matching_container(), Constructor::find_matching_container(), DDS::transfer_attributes(), and Constructor::transfer_attributes().

bool AttrTable::attr_alias ( const string &  alias,
const string &  name 
) [inherited]

Deprecated:
The current alias design is flawed. It is impossible to map this onto the XML implementation where the DAS and DDS information are combined in one object.
Parameters:
alias The alias to insert into the attribute table.
name The name of the already-existing attribute to which the alias will refer.

Definition at line 901 of file AttrTable.cc.

References AttrTable::attr_alias().

Here is the call graph for this function:

bool AttrTable::attr_alias ( const string &  alias,
AttrTable at,
const string &  name 
) [inherited]

Once an alias is inserted into an attribute table, reading the attributes for alias will return those stored for name.

Two forms for this function exist: one searches for name in the AttrTable referenced by at while the other uses this. You can use DAS::get_attr_table() to get the attribute table for an arbitrary name.

See also:
get_attr_table
Deprecated:
The current alias design is flawed. It is impossible to map this onto the XML implementation where the DAS and DDS information are combined in one object.
Parameters:
alias The alias to insert into the attribute table.
name The name of the already-existing attribute to which the alias will refer.
at An attribute table in which to insert the alias.

Definition at line 887 of file AttrTable.cc.

References AttrTable::add_value_alias().

Referenced by AttrTable::attr_alias().

Here is the call graph for this function:

AttrTable::Attr_iter AttrTable::attr_begin (  )  [inherited]

Get an iterator to the first entry in this attribute table.

Returns:
Attr_iter; references the end of the array if empty list.

Definition at line 609 of file AttrTable.cc.

Referenced by AttrTable::print_xml(), AttrTable::recurrsive_find(), DDS::transfer_attributes(), Constructor::transfer_attributes(), and var_begin().

AttrTable::Attr_iter AttrTable::attr_end (  )  [inherited]

Get an iterator to the end attribute table. Does not point to the last attribute in the table

Returns:
Attr_iter

Definition at line 618 of file AttrTable.cc.

Referenced by AttrTable::add_container_alias(), AttrTable::add_value_alias(), AttrTable::append_container(), AttrTable::print_xml(), AttrTable::recurrsive_find(), DDS::transfer_attributes(), Constructor::transfer_attributes(), and var_end().

void AttrTable::clone ( const AttrTable at  )  [protected, inherited]

Clone the given attribute table in this. Protected.

Definition at line 106 of file AttrTable.cc.

References AttrTable::attr_map, AttrTable::d_name, and AttrTable::d_parent.

Referenced by AttrTable::AttrTable(), and AttrTable::operator=().

AttrTable * DAS::das_find ( string  name  )  [protected]

Definition at line 73 of file DAS.cc.

References AttrTable::find_container().

Here is the call graph for this function:

void AttrTable::del_attr ( const string &  name,
int  i = -1 
) [inherited]

Delete the attribute named name. If i is given, and the attribute has a vector value, delete the i$^th$ element of the vector.

You can use this function to delete container attributes, although the i parameter has no meaning for that operation.

Parameters:
name The name of the attribute to delete. This can be an attribute of any type, including containers. However, this method looks only in this attribute table and does not recognize the dot notation.
i If the named attribute is a vector, and i is non-negative, the i-th entry in the vector is deleted, and the array is repacked. If i equals -1 (the default), the entire attribute is deleted.

Definition at line 577 of file AttrTable.cc.

References AttrTable::entry::attr, Attr_container, and www2id().

Here is the call graph for this function:

AttrTable::Attr_iter AttrTable::del_attr_table ( Attr_iter  iter  )  [inherited]

Delete the iterator. Since AttrTable stores pointers to AttrTable objects, the caller should be sure to delete the AttrTable itself. This method does not take care of that operation.

Note:
calling this method invalidates the iterator iter.
Parameters:
iter points to the entry to be deleted.
Returns:
The Attr_iter for the element following iter

Definition at line 673 of file AttrTable.cc.

References Attr_container.

void DAS::dump ( ostream &  strm  )  const [virtual]

Displays the pointer value of this instance and then calls parent dump

Parameters:
strm C++ i/o stream to dump the information to
Returns:
void

Reimplemented from AttrTable.

Definition at line 291 of file DAS.cc.

References AttrTable::dump(), DapIndent::Indent(), DapIndent::LMarg(), and DapIndent::UnIndent().

Here is the call graph for this function:

void AttrTable::erase (  )  [inherited]

Erase the entire attribute table. This returns an AttrTable to the empty state that's the same as the object generated by the null constructor.

Definition at line 910 of file AttrTable.cc.

Referenced by AISMerge::merge().

void AttrTable::find ( const string &  target,
AttrTable **  at,
Attr_iter iter 
) [inherited]

Look for an attribute or an attribute container. If used to search for an attribute container, this method returns the container's parent using the value-result parameter at and a reference to the container using the iterator value-result parameter iter. If used to search for an attribute, the attribute's container is returned using at; the attribute itself can be accessed using the iterator iter.

Parameters:
target The name (using dot notation) of the attribute or container to find.
at A value-result used to return the attribute container in which target was found. Null if target was not found.
iter The iterator which will reference the attribute found. Can be used to access target from within at. References dim_end() within at if the attribute or container does not exist.

Definition at line 370 of file AttrTable.cc.

References AttrTable::find_container(), and AttrTable::recurrsive_find().

Referenced by AttrTable::add_value_alias(), and AttrTable::find_container().

Here is the call graph for this function:

AttrTable * AttrTable::find_container ( const string &  target  )  [inherited]

Look in this attribute table for an attribute container named target. The search starts at this attribute table; target should use the dot notation to name containers held within children of this attribute table.

To search the entire DAS object, make sure to invoke this method from that object.

Parameters:
target The attribute container to find.
Returns:
A pointer to the attribute table or null if the container cannot be found.

Definition at line 464 of file AttrTable.cc.

References AttrTable::find(), and AttrTable::find_container().

Referenced by das_find(), AttrTable::find(), AttrTable::find_container(), DDS::find_matching_container(), Constructor::find_matching_container(), and AttrTable::get_attr_table().

Here is the call graph for this function:

string AttrTable::get_attr ( Attr_iter  iter,
unsigned int  i = 0 
) [inherited]

Returns the value of an attribute. If the attribute has a vector value, you can indicate which is the desired value with the index argument, i. If the argument is omitted, the first value is returned. If the attribute has only a single value, the index argument is ignored. If i is greater than the number of elements in the attribute, an error is produced.

All values in an attribute table are stored as string data. They may be converted to a more appropriate internal format by the calling program.

Parameters:
iter Reference to an attribute
i The attribute value index, zero-based. Default value: 0
Returns:
If the indicated attribute is a container, this function returns the string ``None''. If using a name to refer to the attribute and the named attribute does not exist, return the empty string.

Definition at line 733 of file AttrTable.cc.

References Attr_container.

string AttrTable::get_attr ( const string &  name,
unsigned int  i = 0 
) [inherited]

Definition at line 756 of file AttrTable.cc.

Referenced by AttrTable::print_xml().

AttrTable::Attr_iter AttrTable::get_attr_iter ( int  i  )  [inherited]

Given an index i, return the Attr_iter to the corresponding element. This method provides a way to use all the methods that take an Attr_iter using a simple integer index. Use the get_attr_num() or get_size() methods to determine how many items the AttrTable contains.

Parameters:
i The index
Returns:
The corresponding Attr_iter
See also:
get_attr_num, get_size

Definition at line 632 of file AttrTable.cc.

unsigned int AttrTable::get_attr_num ( Attr_iter  iter  )  [inherited]

If the attribute referenced by iter is a container attribute, this method returns the number of attributes in its attribute table. If the indicated attribute is not a container, the method returns the number of values for the attribute (1 for a scalar attribute, N for a vector attribute value).

Parameters:
iter Reference to an attribute
Returns:
The number of elements in the attribute.

Definition at line 708 of file AttrTable.cc.

References Attr_container.

unsigned int AttrTable::get_attr_num ( const string &  name  )  [inherited]

If the indicated attribute is a container attribute, this function returns the number of attributes in its attribute table. If the indicated attribute is not a container, the method returns the number of values for the attribute (1 for a scalar attribute, N for a vector attribute value).

Definition at line 535 of file AttrTable.cc.

Referenced by AttrTable::print_xml().

AttrTable * AttrTable::get_attr_table ( Attr_iter  iter  )  [inherited]

Get the attribute container referenced by iter. If no such container exists, then return a reference to the end of the table.

Parameters:
iter Reference to a table contained by this object.
Returns:
The child attribute table.

Definition at line 659 of file AttrTable.cc.

References Attr_container.

AttrTable * AttrTable::get_attr_table ( const string &  name  )  [inherited]

Definition at line 505 of file AttrTable.cc.

References AttrTable::find_container().

Referenced by AttrTable::add_value_alias(), get_table(), and AttrTable::print_xml().

Here is the call graph for this function:

AttrType AttrTable::get_attr_type ( Attr_iter  iter  )  [inherited]

Get the type of the attribute referenced by iter.

Parameters:
iter 
Returns:
The datatype of this attribute in an instance of AttrType.

Definition at line 695 of file AttrTable.cc.

AttrType AttrTable::get_attr_type ( const string &  name  )  [inherited]

Returns:
The AttrType value describing the attribute.

Definition at line 521 of file AttrTable.cc.

References Attr_unknown.

Referenced by AttrTable::add_value_alias().

vector< string > * AttrTable::get_attr_vector ( Attr_iter  iter  )  [inherited]

Returns a pointer to the vector of values associated with the attribute referenced by iterator iter.

Note that all values in an attribute table are stored as string data. They may be converted to a more appropriate internal format by the calling program.

Parameters:
iter Reference to the Attribute.
Returns:
If the indicated attribute is a container, this function returns the null pointer. Otherwise returns a pointer to the the attribute vector value.

Definition at line 774 of file AttrTable.cc.

References Attr_container.

vector< string > * AttrTable::get_attr_vector ( const string &  name  )  [inherited]

Get a pointer to the vector of values associated with the attribute referenced by Pix p or named name.

Note that all values in an attribute table are stored as string data. They may be converted to a more appropriate internal format by the calling program.

Returns:
If the indicated attribute is a container, this function returns the null pointer. Otherwise returns a pointer to the the attribute vector value.

Definition at line 554 of file AttrTable.cc.

Referenced by DDS::transfer_attributes(), and Constructor::transfer_attributes().

string AttrTable::get_name ( Attr_iter  iter  )  [inherited]

Returns the name of the attribute referenced by iter.

Definition at line 639 of file AttrTable.cc.

string AttrTable::get_name (  )  const [inherited]

Returns:
A string containing the name.

Definition at line 173 of file AttrTable.cc.

Referenced by AttrTable::add_container_alias(), get_name(), AttrTable::print(), AttrTable::print_xml(), AttrTable::simple_print(), DDS::transfer_attributes(), and Constructor::transfer_attributes().

string DAS::get_name ( Attr_iter i  ) 

Returns the name of the referenced attribute table.

Definition at line 131 of file DAS.cc.

References AttrTable::get_name().

Here is the call graph for this function:

AttrTable* AttrTable::get_parent (  )  const [inline, inherited]

Return a pointer to the AttrTable which holds this table (aka, its parent. If this AttrTable has no parent, this returns null.

Returns:
A pointer to the parent AttrTable.

Definition at line 261 of file AttrTable.h.

unsigned int AttrTable::get_size (  )  const [inherited]

Attributes that are containers count one attribute, as do attributes with both scalar and vector values.

Returns:
The number of entries.

Definition at line 165 of file AttrTable.cc.

Referenced by AISMerge::merge().

AttrTable * DAS::get_table ( const string &  name  ) 

Definition at line 146 of file DAS.cc.

References AttrTable::get_attr_table().

Here is the call graph for this function:

AttrTable * DAS::get_table ( Attr_iter i  ) 

Returns the referenced attribute table.

Definition at line 138 of file DAS.cc.

References AttrTable::get_attr_table().

Here is the call graph for this function:

string AttrTable::get_type ( Attr_iter  iter  )  [inherited]

Get the type name of an attribute referenced by iter.

Parameters:
iter Reference to the Attribute.
Returns:
A string with the name of this attribute datatype.

Definition at line 685 of file AttrTable.cc.

References AttrType_to_String().

Here is the call graph for this function:

string AttrTable::get_type ( const string &  name  )  [inherited]

Definition at line 512 of file AttrTable.cc.

Referenced by AttrTable::append_attr(), AttrTable::print_xml(), AttrTable::simple_print(), DDS::transfer_attributes(), and Constructor::transfer_attributes().

bool AttrTable::is_container ( Attr_iter  i  )  [inherited]

Returns true if the attribute referenced by i is a container.

Definition at line 648 of file AttrTable.cc.

References Attr_container.

Referenced by AttrTable::add_value_alias(), and AttrTable::print_xml().

void DAS::parse ( FILE *  in = stdin  ) 

Read attributes from in (which defaults to stdin). If dasrestart() fails, return false, otherwise return the status of dasparse().

Definition at line 236 of file DAS.cc.

References das_buffer(), das_delete_buffer(), das_switch_to_buffer(), and dasparse().

Here is the call graph for this function:

void DAS::parse ( int  fd  ) 

If the file descriptor cannot be fdopen'd, return false, otherwise return the status of the mfunc parse.

Note:
Added call to dup() within fdopen so that once the FILE * is closed the decriptor fd will not also be closed (instead the duplicate descriptor will be closed). Thus further information can be read from the descriptor fd.

Definition at line 207 of file DAS.cc.

References DBG, and parse().

Here is the call graph for this function:

void DAS::parse ( string  fname  ) 

Read attributes from a file. Returns false if unable to open the file, otherwise returns the result of the mfunc parse.

Definition at line 180 of file DAS.cc.

References can_not_read_file, and DBG.

Referenced by AISMerge::merge(), parse(), DODSFilter::read_ancillary_das(), Connect::request_das(), and Connect::request_das_url().

void AttrTable::print ( FILE *  out,
string  pad = "    ",
bool  dereference = false 
) [inherited]

Prints an ASCII representation of the attribute table to the indicated FILE pointer. The pad argument is prefixed to each line of the output to provide control of indentation.

Parameters:
out Print to the given output FILE.
pad Indent elements of a table using this string of spaces. By default this is a string of four spaces
dereference If true, follow aliases. Default is false.

Definition at line 964 of file AttrTable.cc.

References AttrTable::get_name(), id2www(), and AttrTable::simple_print().

Referenced by print().

Here is the call graph for this function:

void DAS::print ( FILE *  out,
bool  dereference = false 
)

Creates an ASCII representation of a DAS on the given output stream.

When an identifier contains a character that contains characters that cannot be present in a URL (e.g., a space) AttrTable::print replaces those characters with WWW escape codes. 7/13/2001 jhrg

Parameters:
out output FILE on which to print the DAS
dereference If true, follow aliases. Default is false.

Definition at line 274 of file DAS.cc.

References AttrTable::print().

Referenced by DODSFilter::send_das().

Here is the call graph for this function:

void AttrTable::print_xml ( FILE *  out,
string  pad = "    ",
bool  constrained = false 
) [inherited]

Print the attribute table in XML.

Parameters:
out Destination
pad Indent lines of text/xml this much. Default is four spaces.
constrained The DDX contains attribute information; is this DDX 'constrained?'

Definition at line 990 of file AttrTable.cc.

References AttrTable::attr_begin(), AttrTable::attr_end(), AttrTable::get_attr(), AttrTable::get_attr_num(), AttrTable::get_attr_table(), AttrTable::get_name(), AttrTable::get_type(), id2xml(), AttrTable::is_container(), and AttrTable::print_xml().

Referenced by Grid::print_xml(), DDS::print_xml(), Constructor::print_xml(), BaseType::print_xml(), AttrTable::print_xml(), and Array::print_xml_core().

Here is the call graph for this function:

AttrTable * AttrTable::recurrsive_find ( const string &  target,
Attr_iter location 
) [inherited]

This method scans for attributes using recursion to look inside containers even when the name of the attribute is not fully qualified. It starts looking in itself and descends into its children depth first. It will find attributes and attribute containers.

Parameters:
target Look for the attribute with this name.
location A value-result parameter. This returns an iterator to the attribute within the returned AttrTable object
Returns:
Returns a pointer to the AttrTable which holds target, or null if target is not found. In the latter case, the value of location is attr_end() for this AttrTable.

Definition at line 409 of file AttrTable.cc.

References AttrTable::attr_begin(), Attr_container, and AttrTable::attr_end().

Referenced by AttrTable::find().

Here is the call graph for this function:

void AttrTable::set_name ( const string &  n  )  [inherited]

Parameters:
n The new name of the attribute table.

Definition at line 181 of file AttrTable.cc.

References www2id().

Referenced by AttrTable::append_container().

Here is the call graph for this function:

void AttrTable::simple_print ( FILE *  out,
string  pad,
Attr_iter  i,
bool  dereference 
) [protected, inherited]

A simple printer that does nothing fancy with aliases. Protected.

Definition at line 925 of file AttrTable.cc.

References Attr_container, AttrTable::get_name(), AttrTable::get_type(), and id2www().

Referenced by AttrTable::print().

Here is the call graph for this function:

AttrTable::Attr_iter DAS::var_begin (  ) 

Returns a reference to the first attribute table.

Definition at line 118 of file DAS.cc.

References AttrTable::attr_begin().

Here is the call graph for this function:

AttrTable::Attr_iter DAS::var_end (  ) 

Returns a reference to the end of the attribute table. Does not point to an attribute.

Definition at line 124 of file DAS.cc.

References AttrTable::attr_end().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Jun 27 12:57:42 2007 for libdap++ by  doxygen 1.4.7