libdap::DataDDS Class Reference

Holds a DAP2 DDS. More...

`#include <DataDDS.h>`

Inheritance diagram for libdap::DataDDS:

## Public Types

typedef std::vector< BaseType * >::const_iterator | Vars_citer
typedef std::vector< BaseType * >::iterator | Vars_iter
typedef std::vector< BaseType * >::reverse_iterator | Vars_riter

## Public Member Functions

void | add_var (BaseType *bt)
| Adds a copy of the variable to the DDS. Using the ptr_duplicate() method, perform a deep copy on the variable bt and adds the result to this DDS.
void | add_var_nocopy (BaseType *bt)
| Adds the variable to the DDS.
bool | check_semantics (bool all=false)
| Check the semantics of each of the variables represented in the DDS.
Structure * | container ()
string | container_name ()
void | container_name (const string &cn)
| DataDDS (BaseTypeFactory *factory, const string &n="", const string &v="", const string &p="")
| Make an instance of DataDDS A DataDDS instance is a DDS with additional information about the version of the server from which the data came.
void | del_var (const string &n)
| Removes a variable from the DDS.
void | del_var (Vars_iter i)
| Removes a variable from the DDS.
void | del_var (Vars_iter i1, Vars_iter i2)
| Removes a range of variables from the DDS.
virtual void | dump (ostream &strm) const
| dumps information about this object
string | filename () const
void | filename (const string &fn)
virtual AttrTable & | get_attr_table ()
int | get_dap_major () const
| Get the DAP major version as sent by the client.
int | get_dap_minor () const
| Get the DAP minor version as sent by the client.
string | get_dap_version () const
DAS * | get_das ()
| Get a DAS object.
void | get_das (DAS *das)
string | get_dataset_name () const
string | get_dmr_version () const
BaseTypeFactory * | get_factory () const
string | get_namespace () const
| Get the namespace associated with the DDS - likely set only by DDX responses.
string | get_protocol () const
int | get_protocol_major () const
int | get_protocol_minor () const
int | get_request_size (bool constrained)
| Get the estimated response size in bytes.
uint64_t | get_request_size_kb (bool constrained)
| Get the estimated response size in kilobytes.
string | get_request_xml_base () const
| Get the URL that will return this DDS/DDX/DataThing.
long | get_response_limit ()
| Get the maximum response size, in bytes. Zero indicates no limit.
uint64_t | get_response_limit_kb () const
| The maximum allowed response size, in kilobytes. Zero indicates no limit (default).
BaseType * | get_var_index (int i)
| Get a variable.
Vars_iter | get_vars_iter (int i)
| Get an iterator.
string | get_version () const
| Get the server version string, unparsed.
int | get_version_major () const
| Returns the major version number.
int | get_version_minor () const
| Returns the minor version number.
void | insert_var (Vars_iter i, BaseType *ptr)
| Insert a variable before the referenced element.
void | insert_var_nocopy (Vars_iter i, BaseType *ptr)
bool | is_dap4_projected (std::vector< string > &inventory)
bool | mark (const string &name, bool state)
| Mark the `send_p` flag of the named variable to state.
void | mark_all (bool state)
int | num_var ()
| Returns the number of variables in the DDS.
void | parse (FILE *in=stdin)
| Parse a DDS from a file indicated by the input file descriptor. Read the persistent representation of a DDS from the FILE *in, parse it and create a matching binary object.
void | parse (int fd)
| Parse a DDS from a file indicated by the input file descriptor.
void | parse (string fname)
| Parse a DDS from a file with the given d_name.
void | print (FILE *out)
| Print the entire DDS to the specified file.
void | print (ostream &out)
| Print the entire DDS to the specified ostream.
void | print_constrained (FILE *out)
| Print a constrained DDS to the specified file.
void | print_constrained (ostream &out)
| Print a constrained DDS to the specified ostream.
void | print_das (ostream &out)
| write the DAS response given the attribute information in the DDS
void | print_dmr (ostream &out, bool constrained)
| Print the DAP4 DMR object using a DDS.
void | print_xml (FILE *out, bool constrained, const string &blob="")
void | print_xml (ostream &out, bool constrained, const string &blob="")
void | print_xml_writer (ostream &out, bool constrained, const string &blob="")
void | set_dap_major (int p)
void | set_dap_minor (int p)
void | set_dap_version (const string &version_string="2.0")
void | set_dap_version (double d)
void | set_dataset_name (const string &n)
BaseTypeFactory * | set_factory (BaseTypeFactory *factory)
void | set_namespace (const string &ns)
| Set the namespace for this DDS/DDX object/response.
void | set_protocol (const string &p)
void | set_request_xml_base (const string &xb)
void | set_response_limit (long size)
void | set_response_limit_kb (uint64_t size)
| Set the maximum response size, in kilobytes. The size is given in kilobytes..
void | set_version (const string &v)
void | tag_nested_sequences ()
| Traverse DDS, set Sequence leaf nodes.
bool | too_big ()
virtual void | transfer_attributes (DAS *das)
BaseType * | var (const string &n, BaseType::btp_stack &s)
BaseType * | var (const string &n, BaseType::btp_stack *s=0)
| Find the variable with the given d_name.
Vars_iter | var_begin ()
Vars_iter | var_end ()
| Return an iterator.
Vars_riter | var_rbegin ()
| Return a reverse iterator.
Vars_riter | var_rend ()
| Return a reverse iterator.
const vector< BaseType * > & | variables () const
DDS_timeout

Old deprecated DDS timeout code

Deprecated:

void | timeout_on ()
void | timeout_off ()
void | set_timeout (int t)
int | get_timeout ()

## Protected Member Functions

void | duplicate (const DDS &dds)
BaseType * | exact_match (const string &name, BaseType::btp_stack *s=0)
BaseType * | leaf_match (const string &name, BaseType::btp_stack *s=0)

## Detailed Description

Holds a DAP2 DDS.

This class adds some useful state information to the DDS structure. It is for use on the client side of the connection.

Note
  Make sure to pass a valid pointer to the DDS constructor or use the set_factory() method before actually using the DDS. Also make sure that the Factory's lifetime thereafter is the same as the DDS's. Never delete the factory until you're done using the DDS.
  Update: I removed the DEFAULT_BASETYPE_FACTORY switch because it caused more confusion than it avoided. See Trac #130.
  The compile-time symbol DEFAULT_BASETYPE_FACTORY controls whether the old (3.4 and earlier) DDS and DataDDS constructors are supported. These constructors now use a default factory class (BaseTypeFactory, implemented by this library) to instantiate Byte, ..., Grid variables. To use the default ctor in your code you must also define this symbol. If you do choose to define this and fail to provide a specialization of BaseTypeFactory when your software needs one, you code may not link or may fail at run time. In addition to the older ctors for DDS and DataDDS, defining the symbol also makes some of the older methods in Connect available (because those methods require the older DDS and DataDDS ctors.

See also
  Connect

Definition at line 76 of file DataDDS.h.

## Member Typedef Documentation

## Vars_citer

typedef std::vector<BaseType*>::const_iterator libdap::DDS::Vars_citer

inherited

Definition at line 210 of file DDS.h.

## Vars_iter

typedef std::vector<BaseType*>::iterator libdap::DDS::Vars_iter

inherited

Definition at line 211 of file DDS.h.

## Vars_riter

typedef std::vector<BaseType*>::reverse_iterator libdap::DDS::Vars_riter

inherited

Definition at line 212 of file DDS.h.

## Constructor & Destructor Documentation

## DataDDS()

libdap::DataDDS::DataDDS | ( | BaseTypeFactory * | factory,
|  | const string & | n = `""`,
|  | const string & | v = `""`,
|  | const string & | p = `""`
| ) |  |

Make an instance of DataDDS A DataDDS instance is a DDS with additional information about the version of the server from which the data came.

Parameters

  factory | Use this BaseTypeFactory to instantiate the variables. Caller must free; can also be set using the set_factory() method. Never delete until just before deleting the DDS itself unless you intend to replace the factory with a new instance.
  n | The name of the dataset. Can also be set using the set_dataset_name() method.
  v | The server version.
  p | The protocol version.

Definition at line 140 of file DataDDS.cc.

## ~DataDDS()

virtual libdap::DataDDS::~DataDDS | ( |  | ) |

inline virtual

Definition at line 94 of file DataDDS.h.

## Member Function Documentation

## add_var()

void libdap::DDS::add_var | ( | BaseType * | bt | ) |

inherited

Adds a copy of the variable to the DDS. Using the ptr_duplicate() method, perform a deep copy on the variable bt and adds the result to this DDS.

Note
  The copy will not copy data values.

Parameters

  bt | Source variable.

Definition at line 482 of file DDS.cc.

## add_var_nocopy()

void libdap::DDS::add_var_nocopy | ( | BaseType * | bt | ) |

inherited

Adds the variable to the DDS.

Parameters

  bt | Source variable.

Definition at line 504 of file DDS.cc.

## check_semantics()

bool libdap::DDS::check_semantics | ( | bool | all = `false` | ) |

inherited

Check the semantics of each of the variables represented in the DDS.

Check the semantics of the DDS describing a complete dataset. If ALL is true, check not only the semantics of THIS->TABLE, but also recursively all ctor types in the THIS->TABLE. By default, ALL is false since parsing a DDS input file runs semantic checks on all variables (but not the dataset itself.

Returns
  TRUE if the conventions for the DDS are not violated, FALSE otherwise.

Parameters

  all | If true, recursively check the individual members of compound variables.

See also
  BaseType::check_semantics

Definition at line 1305 of file DDS.cc.

## container()

Structure * libdap::DDS::container | ( |  | ) |

inherited

Get the current container structure.

Definition at line 422 of file DDS.cc.

## container_name() [1/2]

string libdap::DDS::container_name | ( |  | ) |

inherited

Get and set the current container. If there are multiple files being used to build this DDS, using a container will set a virtual structure for the current container.

@d_name Container Name Accessor

See also
  Dataset Name Accessors Gets the dataset file d_name.

Definition at line 395 of file DDS.cc.

## container_name() [2/2]

void libdap::DDS::container_name | ( | const string & | cn | ) |

inherited

Set the current container d_name and get or create a structure for that d_name.

Definition at line 399 of file DDS.cc.

## del_var() [1/3]

void libdap::DDS::del_var | ( | const string & | n | ) |

inherited

Removes a variable from the DDS.

Remove the named variable from the DDS. This method is not smart about looking up names. The variable must exist at the top level of the DDS and must match exactly the d_name given.

Note
  Invalidates any iterators that reference the contents of the DDS.

Parameters

  n | The d_name of the variable to remove.

Definition at line 523 of file DDS.cc.

## del_var() [2/3]

void libdap::DDS::del_var | ( | Vars_iter | i | ) |

inherited

Removes a variable from the DDS.

Remove the variable referenced by the iterator and free its storage.

Note
  Invalidates any iterators that reference the contents of the DDS.

Parameters

  i | The Vars_iter which refers to the variable.

Definition at line 544 of file DDS.cc.

## del_var() [3/3]

void libdap::DDS::del_var | ( | Vars_iter | i1,
|  | Vars_iter | i2
| ) |  |

inherited

Removes a range of variables from the DDS.

Remove the variables referenced by the range of iterators and free their storage.

Note
  Invalidates any iterators that reference the contents of the DDS.

Parameters

  i1 | The start of the range.
  i2 | The end of the range.

Definition at line 559 of file DDS.cc.

## dump()

void libdap::DataDDS::dump | ( | ostream & | strm | ) | const

virtual

dumps information about this object

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 libdap::DDS.

Definition at line 113 of file DataDDS.cc.

## duplicate()

void libdap::DDS::duplicate | ( | const DDS & | dds | ) |

protected inherited

Definition at line 117 of file DDS.cc.

## exact_match()

BaseType * libdap::DDS::exact_match | ( | const string & | name,
|  | BaseType::btp_stack * | s = `0`
| ) |  |

protected inherited

Definition at line 642 of file DDS.cc.

## filename() [1/2]

string libdap::DDS::filename | ( |  | ) | const

inherited

Get and set the dataset's filename. This is the physical location on a disk where the dataset exists. The dataset d_name is simply a title.

@d_name File Name Accessor

See also
  Dataset Name Accessors Gets the dataset file d_name.

Definition at line 287 of file DDS.cc.

## filename() [2/2]

void libdap::DDS::filename | ( | const string & | fn | ) |

inherited

Set the dataset's filename.

Definition at line 290 of file DDS.cc.

## get_attr_table()

AttrTable & libdap::DDS::get_attr_table | ( |  | ) |

virtual inherited

Get the attribute table for the global attributes.

Definition at line 276 of file DDS.cc.

## get_dap_major()

int libdap::DDS::get_dap_major | ( |  | ) | const

inline inherited

Get the DAP major version as sent by the client.

Definition at line 251 of file DDS.h.

## get_dap_minor()

int libdap::DDS::get_dap_minor | ( |  | ) | const

inline inherited

Get the DAP minor version as sent by the client.

Definition at line 253 of file DDS.h.

## get_dap_version()

string libdap::DDS::get_dap_version | ( |  | ) | const

inline inherited

Definition at line 256 of file DDS.h.

## get_das() [1/2]

DAS * libdap::DDS::get_das | ( |  | ) |

inherited

Get a DAS object.

Returns a new DAS that contains all of the Dataset attributes. This includes all Variable attributes as well as Global attributes. The caller is responsible for deleting the returned object.

Returns
  A newly allocated DAS object

Definition at line 957 of file DDS.cc.

## get_das() [2/2]

void libdap::DDS::get_das | ( | DAS * | das | ) |

inherited

Definition at line 1030 of file DDS.cc.

## get_dataset_name()

string libdap::DDS::get_dataset_name | ( |  | ) | const

inherited

Get and set the dataset's d_name. This is the d_name of the dataset itself, and is not to be confused with the d_name of the file or disk on which it is stored.

@d_name Dataset Name Accessors Returns the dataset's d_name.

Definition at line 268 of file DDS.cc.

## get_dmr_version()

string libdap::DDS::get_dmr_version | ( |  | ) | const

inline inherited

Definition at line 257 of file DDS.h.

## get_factory()

BaseTypeFactory * libdap::DDS::get_factory | ( |  | ) | const

inline inherited

Return the factory which makes instances of the Byte, ..., Grid type classes. Specialize BaseTypeFactory so that a DDS will be populated with your client or server's specialized types.

Returns
  An instance of BaseTypeFactory.

Definition at line 231 of file DDS.h.

## get_namespace()

string libdap::DDS::get_namespace | ( |  | ) | const

inline inherited

Get the namespace associated with the DDS - likely set only by DDX responses.

Definition at line 273 of file DDS.h.

## get_protocol()

string libdap::DataDDS::get_protocol | ( |  | ) | const

inline

Definition at line 114 of file DataDDS.h.

## get_protocol_major()

int libdap::DataDDS::get_protocol_major | ( |  | ) | const

inline

Definition at line 115 of file DataDDS.h.

## get_protocol_minor()

int libdap::DataDDS::get_protocol_minor | ( |  | ) | const

inline

Definition at line 116 of file DataDDS.h.

## get_request_size()

int libdap::DDS::get_request_size | ( | bool | constrained | ) |

inherited

Get the estimated response size in bytes.

Get the size of a response. This method looks at the variables in the DDS a computes the number of bytes in the response.

Note
  This version of the method does a poor job with Sequences. A better implementation would look at row-constraint-based limitations and use them for size computations. If a row-constraint is missing, return an error.

Parameters

  constrained | Should the size of the whole DDS be used or should the current constraint be taken into account?

Deprecated:
  "Use DDS::get_request_size_kb()"

Definition at line 438 of file DDS.cc.

## get_request_size_kb()

uint64_t libdap::DDS::get_request_size_kb | ( | bool | constrained | ) |

inherited

Get the estimated response size in kilobytes.

Get the estimated size of a response in kilobytes. This method looks at the variables in the DDS and computes the number of bytes in the response.

Note
  This version of the method does a poor job with Sequences. A better implementation would look at row-constraint-based limitations and use them for size computations. If a row-constraint is missing, return an error.

Parameters

  constrained | Should the size of the whole DDS be used or should the current constraint be taken into account?

Definition at line 463 of file DDS.cc.

## get_request_xml_base()

string libdap::DDS::get_request_xml_base | ( |  | ) | const

inline inherited

Get the URL that will return this DDS/DDX/DataThing.

Definition at line 267 of file DDS.h.

## get_response_limit()

long libdap::DDS::get_response_limit | ( |  | ) |

inline inherited

Get the maximum response size, in bytes. Zero indicates no limit.

Definition at line 279 of file DDS.h.

## get_response_limit_kb()

uint64_t libdap::DDS::get_response_limit_kb | ( |  | ) | const

inline inherited

The maximum allowed response size, in kilobytes. Zero indicates no limit (default).

Returns
  The maximum allowed response size, in kilobytes. Zero indicates no limit (default).

Definition at line 285 of file DDS.h.

## get_timeout()

int libdap::DDS::get_timeout | ( |  | ) |

inherited

Definition at line 721 of file DDS.cc.

## get_var_index()

BaseType * libdap::DDS::get_var_index | ( | int | i | ) |

inline inherited

Get a variable.

Definition at line 348 of file DDS.h.

## get_vars_iter()

Vars_iter libdap::DDS::get_vars_iter | ( | int | i | ) |

inline inherited

Get an iterator.

Definition at line 346 of file DDS.h.

## get_version()

string libdap::DataDDS::get_version | ( |  | ) | const

inline

Get the server version string, unparsed.

Definition at line 104 of file DataDDS.h.

## get_version_major()

int libdap::DataDDS::get_version_major | ( |  | ) | const

inline

Returns the major version number.

Definition at line 106 of file DataDDS.h.

## get_version_minor()

int libdap::DataDDS::get_version_minor | ( |  | ) | const

inline

Returns the minor version number.

Definition at line 108 of file DataDDS.h.

## insert_var()

void libdap::DDS::insert_var | ( | Vars_iter | i,
|  | BaseType * | ptr
| ) |  |

inherited

Insert a variable before the referenced element.

Insert a copy of the BaseType before the position given.

Parameters

  i | The iterator that marks the position
  ptr | The BaseType object to copy and insert

Definition at line 673 of file DDS.cc.

## insert_var_nocopy()

void libdap::DDS::insert_var_nocopy | ( | Vars_iter | i,
|  | BaseType * | ptr
| ) |  |

inherited

Insert the BaseType before the position given.

Note
  Does not copy the BaseType object - that caller must not free the inserted object's pointer. This object will, however, delete the pointer when it is deleted.

Parameters

  i | The iterator that marks the position
  ptr | The BaseType object to insert

Definition at line 682 of file DDS.cc.

## is_dap4_projected()

bool libdap::DDS::is_dap4_projected | ( | std::vector< string > & | inventory | ) |

inherited

Parameters

  inventory |

Returns

Definition at line 1396 of file DDS.cc.

## leaf_match()

BaseType * libdap::DDS::leaf_match | ( | const string & | name,
|  | BaseType::btp_stack * | s = `0`
| ) |  |

protected inherited

Definition at line 608 of file DDS.cc.

## mark()

bool libdap::DDS::mark | ( | const string & | n,
|  | bool | state
| ) |  |

inherited

Mark the `send_p` flag of the named variable to state.

Mark the named variable by setting its SEND_P flag to STATE (true indicates that it is to be sent). Names must be fully qualified.

Note
  For aggregate types this sets each part to STATE when STATE is True. Thus, if State is True and N is ‘exp1.test’, then both ‘exp1’ and ‘test’ have their SEND_P flag set to True. If STATE is False, then the SEND_P flag of the ‘test’ is set to False, but ‘exp1’ is left unchanged. This means that a single variable can be removed from the current projection without removing all the other children of its parent. See the mfunc set_send_p().

Returns
  True if the named variable was found, false otherwise.

Todo:
  These methods that use the btp_stack to keep track of the path from the top of a dataset to a particular variable can be rewritten to use the parent field instead.

Todo:
  All the methods that use names to identify variables should have counterparts that take BaseType pointers.

Definition at line 1347 of file DDS.cc.

## mark_all()

void libdap::DDS::mark_all | ( | bool | state | ) |

inherited

Mark the member variable `send_p` flags to state.

Returns
  Void

Definition at line 1386 of file DDS.cc.

## num_var()

int libdap::DDS::num_var | ( |  | ) |

inherited

Returns the number of variables in the DDS.

Definition at line 685 of file DDS.cc.

## parse() [1/3]

void libdap::DDS::parse | ( | FILE * | in = `stdin` | ) |

inherited

Parse a DDS from a file indicated by the input file descriptor. Read the persistent representation of a DDS from the FILE *in, parse it and create a matching binary object.

Parameters

  in | Read the persistent DDS from this FILE*.

Exceptions

  InternalErr | Thrown if `in` is null
  Error | Thrown if the parse fails.

Definition at line 787 of file DDS.cc.

## parse() [2/3]

void libdap::DDS::parse | ( | int | fd | ) |

inherited

Parse a DDS from a file indicated by the input file descriptor.

Definition at line 757 of file DDS.cc.

## parse() [3/3]

void libdap::DDS::parse | ( | string | fname | ) |

inherited

Parse a DDS from a file with the given d_name.

Definition at line 740 of file DDS.cc.

## print() [1/2]

void libdap::DDS::print | ( | FILE * | out | ) |

inherited

Print the entire DDS to the specified file.

Definition at line 812 of file DDS.cc.

## print() [2/2]

void libdap::DDS::print | ( | ostream & | out | ) |

inherited

Print the entire DDS to the specified ostream.

Definition at line 819 of file DDS.cc.

## print_constrained() [1/2]

void libdap::DDS::print_constrained | ( | FILE * | out | ) |

inherited

Print a constrained DDS to the specified file.

Print those parts (variables) of the DDS structure to OS that are marked to be sent after evaluating the constraint expression.

Note
  This function only works for scalars at the top level.

Returns
  true.

Definition at line 1071 of file DDS.cc.

## print_constrained() [2/2]

void libdap::DDS::print_constrained | ( | ostream & | out | ) |

inherited

Print a constrained DDS to the specified ostream.

Print those parts (variables) of the DDS structure to OS that are marked to be sent after evaluating the constraint expression.

Note
  This function only works for scalars at the top level.

Returns
  true.

Definition at line 1087 of file DDS.cc.

## print_das()

void libdap::DDS::print_das | ( | ostream & | out | ) |

inherited

write the DAS response given the attribute information in the DDS

This method provides the same DAS response as DAS::print(), but does so using the AttrTables bound to the variables in this DDS object.

Parameters

  out | Write the DAS response to this stream

Definition at line 942 of file DDS.cc.

## print_dmr()

void libdap::DDS::print_dmr | ( | ostream & | out,
|  | bool | constrained
| ) |  |

inherited

Print the DAP4 DMR object using a DDS.

This method prints the DMR from a DDS. If the dap version is not >= 4.0, it's an error to call this method.

Note
  Calling methods that print the DDS or DDX when get_dap_major() returns a value >= 4 is undefined. Use this method to get the DAP4 metadata response.

Parameters

  out | Write the XML to this stream
  constrained | Should the DMR be subject to a constraint?

Definition at line 1235 of file DDS.cc.

## print_xml() [1/2]

void libdap::DDS::print_xml | ( | FILE * | out,
|  | bool | constrained,
|  | const string & | blob = `""`
| ) |  |

inherited

Print an XML representation of this DDS. This method is used to generate the part of the DDX response. The `Dataset` tag is not written by this code. The caller of this method must handle writing that and including the `dataBLOB` tag.

Parameters

  out | Destination.
  constrained | True if the output should be limited to just those variables that are in the projection of the current constraint expression.
  blob | The dataBLOB href.

Deprecated:

Definition at line 1113 of file DDS.cc.

## print_xml() [2/2]

void libdap::DDS::print_xml | ( | ostream & | out,
|  | bool | constrained,
|  | const string & | blob = `""`
| ) |  |

inherited

Print an XML representation of this DDS. This method is used to generate the DDX response. The `Dataset` tag is not written by this code. The caller of this method must handle writing that and including the `dataBLOB` tag.

Parameters

  out | Destination ostream.
  constrained | True if the output should be limited to just those variables that are in the projection of the current constraint expression.
  blob | The dataBLOB href.

Deprecated:

Definition at line 1130 of file DDS.cc.

## print_xml_writer()

void libdap::DDS::print_xml_writer | ( | ostream & | out,
|  | bool | constrained,
|  | const string & | blob = `""`
| ) |  |

inherited

Print the DDX. This code uses the libxml2 'TextWriter' interface; something that seems to be a good compromise between doing it by hand (although more verbose it is also more reliable) and DOM.

Note
  This code handles several different versions of DAP in a fairly crude way. I've broken it up into three different responses: DAP2, DAP3.2 and DAP4.

Parameters

  out | Write the XML to this output sink
  constrained | True if the only variables to print are those in the current projection. If true, this will also suppress printing attributes.
  blob | This is an href (DAP2) or a cid (DAP3.4 and 4). The href points to the binary data; the cid is the M-MIME separator for the binary data.

Definition at line 1157 of file DDS.cc.

## set_dap_major()

void libdap::DDS::set_dap_major | ( | int | p | ) |

inherited

Deprecated:

Deprecated:

Definition at line 296 of file DDS.cc.

## set_dap_minor()

void libdap::DDS::set_dap_minor | ( | int | p | ) |

inherited

Deprecated:

Deprecated:

Definition at line 313 of file DDS.cc.

## set_dap_version() [1/2]

void libdap::DDS::set_dap_version | ( | const string & | v = `"2.0"` | ) |

inherited

Given the DAP protocol version, parse that string and set the DDS fields.

Parameters

  v | The version string.

Definition at line 328 of file DDS.cc.

## set_dap_version() [2/2]

void libdap::DDS::set_dap_version | ( | double | d | ) |

inherited

Deprecated:

Old way to set the DAP version.

Note
  Don't use this - two interfaces to set the version number is overkill

Parameters

  d | The protocol version requested by the client, as a double.

Deprecated:

Definition at line 374 of file DDS.cc.

## set_dataset_name()

void libdap::DDS::set_dataset_name | ( | const string & | n | ) |

inherited

Sets the dataset d_name.

Definition at line 271 of file DDS.cc.

## set_factory()

BaseTypeFactory * libdap::DDS::set_factory | ( | BaseTypeFactory * | factory | ) |

inline inherited

Set the factory class used to instantiate variables during the parse of a DDS.

Parameters

  factory | The factory this DDS should use. Caller must free factory when done with this DDS.

Returns
  The old factory.

See also
  BaseTypeFactory

Definition at line 239 of file DDS.h.

## set_namespace()

void libdap::DDS::set_namespace | ( | const string & | ns | ) |

inline inherited

Set the namespace for this DDS/DDX object/response.

Definition at line 276 of file DDS.h.

## set_protocol()

void libdap::DataDDS::set_protocol | ( | const string & | p | ) |

inline

Definition at line 110 of file DataDDS.h.

## set_request_xml_base()

void libdap::DDS::set_request_xml_base | ( | const string & | xb | ) |

inline inherited

See also
  get_request_xml_base

Definition at line 270 of file DDS.h.

## set_response_limit()

void libdap::DDS::set_response_limit | ( | long | size | ) |

inline inherited

Set the maximum response size. Zero is the default value. The size is given in kilobytes (but stored internally as the number of bytes).

Parameters

  size | The maximum size of the response in kilobytes.

Definition at line 292 of file DDS.h.

## set_response_limit_kb()

void libdap::DDS::set_response_limit_kb | ( | uint64_t | size | ) |

inline inherited

Set the maximum response size, in kilobytes. The size is given in kilobytes..

Parameters

  size | The maximum size of the response in kilobytes.

Definition at line 299 of file DDS.h.

## set_timeout()

void libdap::DDS::set_timeout | ( | int | t | ) |

inherited

Definition at line 714 of file DDS.cc.

## set_version()

void libdap::DataDDS::set_version | ( | const string & | v | ) |

inline

Sets the version string. This typically looks something like: `DODS/2.15`, where `2'' is the major version number, and`15'' the minor number.

Definition at line 99 of file DataDDS.h.

## tag_nested_sequences()

void libdap::DDS::tag_nested_sequences | ( |  | ) |

inherited

Traverse DDS, set Sequence leaf nodes.

Definition at line 730 of file DDS.cc.

## timeout_off()

void libdap::DDS::timeout_off | ( |  | ) |

inherited

Definition at line 695 of file DDS.cc.

## timeout_on()

void libdap::DDS::timeout_on | ( |  | ) |

inherited

Definition at line 687 of file DDS.cc.

## too_big()

bool libdap::DDS::too_big | ( |  | ) |

inline inherited

Returns
  Returns true if the total data bytes requested exceeds the set limit, false otherwise.

Definition at line 304 of file DDS.h.

## transfer_attributes()

void libdap::DDS::transfer_attributes | ( | DAS * | das | ) |

virtual inherited

This is the main method used to transfer attributes from a DAS object into a DDS. This uses the BaseType::transfer_attributes() method and the various implementations found here (in the constructors classes) and in handlers.

This method uses a deep copy to transfer the attributes, so it is safe to delete the source DAS object passed to this method once it is done.

Note
  To accommodate oddly built DAS objects produced by various handlers, specialize the methods there.

Parameters

  das | Transfer (copy) attributes from this DAS object.

Definition at line 231 of file DDS.cc.

## var() [1/2]

BaseType * libdap::DDS::var | ( | const string & | n,
|  | BaseType::btp_stack & | s
| ) |  |

inherited

Search for for variable n as above but record all compound type variables which ultimately contain n on s. This stack can then be used to mark the contained compound-type variables as part of the current projection.

Returns
  A BaseType pointer to the variable n or 0 if n could not be found.

Definition at line 575 of file DDS.cc.

## var() [2/2]

BaseType * libdap::DDS::var | ( | const string & | n,
|  | BaseType::btp_stack * | s = `0`
| ) |  |

inherited

Find the variable with the given d_name.

Returns a pointer to the named variable. If the d_name contains one or more field separators then the function looks for a variable whose name matches exactly. If the d_name contains no field separators then the function looks first in the top level and then in all subsequent levels and returns the first occurrence found. In general, this function searches constructor types in the order in which they appear in the DDS, but there is no requirement that it do so.

Note
  If a dataset contains two constructor types which have field names that are the same (say point.x and pair.x) you should use fully qualified names to get each of those variables.

Parameters

  n | The name of the variable to find.
  s | If given, this value-result parameter holds the path to the returned BaseType. Thus, this method can return the FQN for the variable n.

Returns
  A BaseType pointer to the variable or null if not found.

Definition at line 596 of file DDS.cc.

## var_begin()

Vars_iter libdap::DDS::var_begin | ( |  | ) |

inline inherited

Return an iterator to the first variable

See also
  vars()

Deprecated:

Definition at line 336 of file DDS.h.

## var_end()

Vars_iter libdap::DDS::var_end | ( |  | ) |

inline inherited

Return an iterator.

Definition at line 341 of file DDS.h.

## var_rbegin()

Vars_riter libdap::DDS::var_rbegin | ( |  | ) |

inline inherited

Return a reverse iterator.

Definition at line 338 of file DDS.h.

## var_rend()

Vars_riter libdap::DDS::var_rend | ( |  | ) |

inline inherited

Return a reverse iterator.

Definition at line 343 of file DDS.h.

## variables()

const vector< BaseType * > & libdap::DDS::variables | ( |  | ) | const

inline inherited

Get a const reference to the vector of BaseType pointers.

Note
  Use this in range-based for loops to iterate over the variables.

Returns
  A const reference to the vector of BaseType pointers.

Definition at line 331 of file DDS.h.

The documentation for this class was generated from the following files:

- DataDDS.h
- DataDDS.cc