libdap++  Updated for version 3.11.7
libdap::DataDDS Class Reference

Holds a DAP2 DDS. More...

#include <DataDDS.h>

Inheritance diagram for libdap::DataDDS:
Inheritance graph
Collaboration diagram for libdap::DataDDS:
Collaboration graph

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. More...
 
void add_var_nocopy (BaseType *bt)
 Adds the variable to the DDS. More...
 
bool check_semantics (bool all=false)
 Check the semantics of each of the variables represented in the DDS. More...
 
 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. More...
 
void del_var (const string &n)
 Removes a variable from the DDS. More...
 
void del_var (Vars_iter i)
 Removes a variable from the DDS. More...
 
void del_var (Vars_iter i1, Vars_iter i2)
 Removes a range of variables from the DDS. More...
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual AttrTableget_attr_table ()
 
int get_dap_major () const
 Get the DAP major version as sent by the client. More...
 
int get_dap_minor () const
 Get the DAP minor version as sent by the client. More...
 
string get_dap_version () const
 
BaseTypeFactoryget_factory () const
 
Keywordsget_keywords ()
 
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. More...
 
string get_request_xml_base () const
 Get the URL that will return this DDS/DDX/DataThing. More...
 
long get_response_limit ()
 Get the maximum response size, in KB. Zero indicates no limit. More...
 
int get_timeout ()
 
BaseTypeget_var_index (int i)
 Get a variable. More...
 
Vars_iter get_vars_iter (int i)
 Get an iterator. More...
 
string get_version () const
 Get the server version string, unparsed. More...
 
int get_version_major () const
 Returns the major version number. More...
 
int get_version_minor () const
 Returns the minor version number. More...
 
void insert_var (Vars_iter i, BaseType *ptr)
 Insert a variable before the referenced element. More...
 
void insert_var_nocopy (Vars_iter i, BaseType *ptr)
 
bool mark (const string &name, bool state)
 Mark the send_p flag of the named variable to state. More...
 
void mark_all (bool state)
 
int num_var ()
 Returns the number of variables in the DDS. More...
 
void parse (string fname)
 Parse a DDS from a file with the given name. More...
 
void parse (int fd)
 Parse a DDS from a file indicated by the input file descriptor. More...
 
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. More...
 
void print (FILE *out)
 Print the entire DDS to the specified file. More...
 
void print (ostream &out)
 Print the entire DDS to the specified ostream. More...
 
void print_constrained (FILE *out)
 Print a constrained DDS to the specified file. More...
 
void print_constrained (ostream &out)
 Print a constrained DDS to the specified ostream. More...
 
void print_das (ostream &out)
 
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)
 Set the DAP major version (typically using info from the client) More...
 
void set_dap_minor (int p)
 Set the DAP minor version (typically using info from the client) More...
 
void set_dap_version (const string &version_string)
 
void set_dap_version (double d)
 
BaseTypeFactoryset_factory (BaseTypeFactory *factory)
 
void set_protocol (const string &p)
 
void set_request_xml_base (const string &xb)
 
void set_response_limit (long size)
 
void set_timeout (int t)
 
void set_version (const string &v)
 
void tag_nested_sequences ()
 Traverse DDS, set Sequence leaf nodes. More...
 
void timeout_off ()
 
void timeout_on ()
 
virtual void transfer_attributes (DAS *das)
 
BaseTypevar (const string &n, BaseType::btp_stack &s)
 
BaseTypevar (const string &n, BaseType::btp_stack *s=0)
 Find the variable with the given name. More...
 
Vars_iter var_begin ()
 Return an iterator to the first variable. More...
 
Vars_iter var_end ()
 Return an iterator. More...
 
Vars_riter var_rbegin ()
 Return a reverse iterator. More...
 
Vars_riter var_rend ()
 Return a reverse iterator. More...
 
virtual ~DataDDS ()
 
Dataset Name Accessors

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

string get_dataset_name () const
 
void set_dataset_name (const string &n)
 
File Name Accessor

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

See also
Dataset Name Accessors
string filename ()
 
void filename (const string &fn)
 
Container Name Accessor

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.

See also
Dataset Name Accessors
string container_name ()
 
void container_name (const string &cn)
 
Structurecontainer ()
 

Protected Member Functions

void duplicate (const DDS &dds)
 
BaseTypeexact_match (const string &name, BaseType::btp_stack *s=0)
 
BaseTypeleaf_match (const string &name, BaseType::btp_stack *s=0)
 

Detailed Description

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 77 of file DataDDS.h.

Member Typedef Documentation

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

Definition at line 219 of file DDS.h.

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

Definition at line 220 of file DDS.h.

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

Definition at line 221 of file DDS.h.

Constructor & Destructor Documentation

libdap::DataDDS::DataDDS ( BaseTypeFactory factory,
const string &  n = "",
const string &  v = "",
const string &  p = "" 
)
Parameters
factoryUse 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.
nThe name of the dataset. Can also be set using the set_dataset_name() method.
vThe server version.
pThe protocol version.

Definition at line 163 of file DataDDS.cc.

virtual libdap::DataDDS::~DataDDS ( )
inlinevirtual

Definition at line 97 of file DataDDS.h.

Member Function Documentation

void libdap::DDS::add_var ( BaseType bt)
inherited
Note
The copy will not copy data values.
Parameters
btSource variable.

Definition at line 470 of file DDS.cc.

References libdap::Structure::add_var(), DBG2, and libdap::BaseType::ptr_duplicate().

Referenced by libdap::DDS::container_name(), and libdap::DDXParser::ddx_end_document().

Here is the call graph for this function:

void libdap::DDS::add_var_nocopy ( BaseType bt)
inherited
Parameters
btSource variable.

Definition at line 493 of file DDS.cc.

References libdap::Structure::add_var_nocopy(), and DBG2.

Referenced by libdap::ConstraintEvaluator::eval_function_clauses().

Here is the call graph for this function:

bool libdap::DDS::check_semantics ( bool  all = false)
inherited

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
allIf true, recursively check the individual members of compound variables.
See also
BaseType::check_semantics

Definition at line 1279 of file DDS.cc.

References libdap::unique_names().

Here is the call graph for this function:

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

Get the current container structure.

Definition at line 431 of file DDS.cc.

string libdap::DDS::container_name ( )
inherited

Gets the dataset file name.

Definition at line 395 of file DDS.cc.

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

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

Definition at line 403 of file DDS.cc.

References libdap::DDS::add_var(), and libdap::DDS::var().

Here is the call graph for this function:

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

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 name given.

Note
Invalidates any iterators that reference the contents of the DDS.
Parameters
nThe name of the variable to remove.

Definition at line 515 of file DDS.cc.

References libdap::Structure::del_var().

Here is the call graph for this function:

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

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

Note
Invalidates any iterators that reference the contents of the DDS.
Parameters
iThe Vars_iter which refers to the variable.

Definition at line 538 of file DDS.cc.

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

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
i1The start of the range.
i2The end of the range.

Definition at line 554 of file DDS.cc.

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

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

Parameters
strmC++ i/o stream to dump the information to
Returns
void

Reimplemented from libdap::DDS.

Definition at line 128 of file DataDDS.cc.

void libdap::DDS::duplicate ( const DDS dds)
protectedinherited

Definition at line 114 of file DDS.cc.

References DBG, libdap::DDS::var_begin(), and libdap::DDS::var_end().

Referenced by libdap::DDS::DDS(), and libdap::DDS::operator=().

Here is the call graph for this function:

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

Definition at line 645 of file DDS.cc.

References DBG2, libdap::BaseType::name(), libdap::DDS::var(), and libdap::BaseType::var().

Referenced by libdap::DDS::var().

Here is the call graph for this function:

string libdap::DDS::filename ( )
inherited

Gets the dataset file name.

Definition at line 289 of file DDS.cc.

Referenced by libdap::ResponseBuilder::get_cached_data_ddx(), and libdap::ResponseBuilder::send_data().

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

Set the dataset's filename.

Definition at line 296 of file DDS.cc.

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

Get the attribute table for the global attributes.

Definition at line 274 of file DDS.cc.

Referenced by libdap::DDXParser::ddx_start_document().

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

Definition at line 263 of file DDS.h.

Referenced by libdap::DDS::print_xml(), and libdap::DDS::print_xml_writer().

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

Definition at line 265 of file DDS.h.

Referenced by libdap::DDS::print_xml(), and libdap::DDS::print_xml_writer().

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

Returns the dataset's name.

Definition at line 258 of file DDS.cc.

Referenced by libdap::ConstraintEvaluator::eval_function_clauses().

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

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 239 of file DDS.h.

Referenced by libdap::ConstraintEvaluator::eval_function_clauses(), libdap::ResponseBuilder::read_data_from_cache(), libdap::Connect::request_ddx(), and libdap::Connect::request_ddx_url().

Keywords& libdap::DDS::get_keywords ( )
inlineinherited

Definition at line 277 of file DDS.h.

string libdap::DataDDS::get_protocol ( ) const
inline
int libdap::DataDDS::get_protocol_major ( ) const
inline

Definition at line 133 of file DataDDS.h.

Referenced by libdap::Sequence::deserialize().

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

Definition at line 137 of file DataDDS.h.

Referenced by libdap::Sequence::deserialize().

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

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
constrainedShould the size of the whole DDS be used or should the current constraint be taken into account?

Definition at line 449 of file DDS.cc.

Referenced by libdap::ResponseBuilder::send_data(), and libdap::ResponseBuilder::send_data_ddx().

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

Definition at line 280 of file DDS.h.

Referenced by libdap::DDS::print_xml(), and libdap::DDS::print_xml_writer().

long libdap::DDS::get_response_limit ( )
inlineinherited
int libdap::DDS::get_timeout ( )
inherited

Definition at line 773 of file DDS.cc.

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

Return the ith variable.

Parameters
ithe index
Returns
The corresponding variable

Definition at line 714 of file DDS.cc.

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

Return the iterator for the ith variable.

Parameters
ithe index
Returns
The corresponding Vars_iter

Definition at line 705 of file DDS.cc.

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

Definition at line 109 of file DataDDS.h.

Referenced by libdap::ConstraintEvaluator::eval_function_clauses().

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

Definition at line 114 of file DataDDS.h.

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

Definition at line 119 of file DataDDS.h.

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

Insert a copy of the BaseType before the position given.

Parameters
iThe iterator that marks the position
ptrThe BaseType object to copy and insert

Definition at line 724 of file DDS.cc.

References libdap::BaseType::ptr_duplicate().

Here is the call graph for this function:

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
iThe iterator that marks the position
ptrThe BaseType object to insert

Definition at line 737 of file DDS.cc.

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

Definition at line 609 of file DDS.cc.

References DBG, libdap::BaseType::is_constructor_type(), libdap::BaseType::is_vector_type(), libdap::BaseType::name(), and libdap::BaseType::var().

Referenced by libdap::DDS::var().

Here is the call graph for this function:

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

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:
This should throw an exception on error!!!
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 1325 of file DDS.cc.

References DBG2, libdap::BaseType::name(), libdap::BaseType::set_send_p(), libdap::BaseType::type_name(), and libdap::DDS::var().

Here is the call graph for this function:

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

Mark the member variable send_p flags to state.

Returns
Void

Definition at line 1371 of file DDS.cc.

Referenced by libdap::ResponseBuilder::send_data(), and libdap::ResponseBuilder::send_dds().

int libdap::DDS::num_var ( )
inherited

Definition at line 744 of file DDS.cc.

void libdap::DDS::parse ( string  fname)
inherited
void libdap::DDS::parse ( int  fd)
inherited

Definition at line 814 of file DDS.cc.

References libdap::DDS::parse().

Here is the call graph for this function:

void libdap::DDS::parse ( FILE *  in = stdin)
inherited
Parameters
inRead the persistent DDS from this FILE*.
Exceptions
InternalErrThrown if in is null
ErrorThrown if the parse fails.

Definition at line 843 of file DDS.cc.

References DBG2, dds_buffer(), dds_delete_buffer(), dds_switch_to_buffer(), ddsparse(), libdap::parser_arg::error(), and libdap::parser_arg::status().

Here is the call graph for this function:

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

Definition at line 871 of file DDS.cc.

References libdap::id2www().

Referenced by main(), libdap::ResponseBuilder::send_dds(), and libdap::DODSFilter::send_dds().

Here is the call graph for this function:

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

Definition at line 894 of file DDS.cc.

References libdap::id2www().

Here is the call graph for this function:

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

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 941 of file DDS.cc.

References libdap::id2www().

Referenced by libdap::ResponseBuilder::dataset_constraint(), libdap::DODSFilter::dataset_constraint(), libdap::ResponseBuilder::send_data(), libdap::ResponseBuilder::send_dds(), and libdap::DODSFilter::send_dds().

Here is the call graph for this function:

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

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 969 of file DDS.cc.

References libdap::id2www().

Here is the call graph for this function:

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

Print the DAP2 DAS object using attribute information recorded this DDS object.

Note
Uses default indenting of four spaces and does not follow (now deprecated) attribute aliases.
Parameters
outWrite the DAS here.

Definition at line 917 of file DDS.cc.

References libdap::AttrTable::print().

Referenced by libdap::ResponseBuilder::send_das().

Here is the call graph for this function:

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
outDestination.
constrainedTrue if the output should be limited to just those variables that are in the projection of the current constraint expression.
blobThe dataBLOB href.
Deprecated:

Definition at line 1012 of file DDS.cc.

References c_dap20_namespace, c_dap32_namespace, c_default_dap20_schema_location, c_default_dap32_schema_location, libdap::DDS::get_dap_major(), libdap::DDS::get_dap_minor(), libdap::id2xml(), libdap::AttrTable::print_xml(), libdap::DDS::print_xml_writer(), libdap::DDS::var_begin(), and libdap::DDS::var_end().

Referenced by libdap::ResponseBuilder::dataset_constraint_ddx(), libdap::DODSFilter::dataset_constraint_ddx(), main(), and libdap::DODSFilter::send_ddx().

Here is the call graph for this function:

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 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
outDestination ostream.
constrainedTrue if the output should be limited to just those variables that are in the projection of the current constraint expression.
blobThe dataBLOB href.
Deprecated:

Definition at line 1097 of file DDS.cc.

References c_dap20_namespace, c_dap32_namespace, c_default_dap20_schema_location, c_default_dap32_schema_location, c_xml_namespace, libdap::DDS::get_dap_major(), libdap::DDS::get_dap_minor(), libdap::DDS::get_request_xml_base(), grddl_transformation_dap32, libdap::id2xml(), libdap::AttrTable::print_xml(), libdap::DDS::print_xml_writer(), libdap::DDS::var_begin(), and libdap::DDS::var_end().

Here is the call graph for this function:

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

Definition at line 303 of file DDS.cc.

Referenced by libdap::DDS::set_dap_version().

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

Definition at line 319 of file DDS.cc.

Referenced by libdap::DDS::set_dap_version().

void libdap::DDS::set_dap_version ( const string &  version_string)
inherited

Given the dap protocol version either from a MIME header or from within the DDX Dataset element, parse that string and set the DDS fields.

Parameters
version_stringThe version string from the MIME (request) or XML document.

Definition at line 337 of file DDS.cc.

References DBG, libdap::DDS::set_dap_major(), and libdap::DDS::set_dap_minor().

Referenced by libdap::ResponseBuilder::cache_data_ddx(), libdap::DDXParser::ddx_sax2_start_element(), and libdap::ResponseBuilder::send_data().

Here is the call graph for this function:

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

Given the dap protocol version, parse that string and set the DDS fields. This version of th method takes a double - a value that would be passed to a server-side function. This provides a way to set the protocol using stuff in the URL.

Parameters
dThe protocol version requested by the client, as a double.

Definition at line 370 of file DDS.cc.

References DBG, libdap::DDS::set_dap_major(), and libdap::DDS::set_dap_minor().

Here is the call graph for this function:

void libdap::DDS::set_dataset_name ( const string &  n)
inherited
BaseTypeFactory* libdap::DDS::set_factory ( BaseTypeFactory factory)
inlineinherited

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

Parameters
factoryThe factory this DDS should use. Caller must free factory when done with this DDS.
Returns
The old factory.
See also
BaseTypeFactory

Definition at line 250 of file DDS.h.

Referenced by libdap::ResponseBuilder::get_cached_data_ddx(), and libdap::ResponseBuilder::send_data().

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

Definition at line 124 of file DataDDS.h.

void libdap::DDS::set_request_xml_base ( const string &  xb)
inlineinherited
See also
get_request_xml_base

Definition at line 283 of file DDS.h.

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

Set the maximum response size. Zero is the default value. The size is given in kilobytes.

Parameters
sizeThe maximum size of the response in kilobytes.

Definition at line 291 of file DDS.h.

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, and15'' the minor number.

Definition at line 103 of file DataDDS.h.

void libdap::DDS::transfer_attributes ( DAS das)
virtualinherited

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
dasTransfer (copy) attributes from this DAS object.

Definition at line 201 of file DDS.cc.

References libdap::AttrTable::append_container(), libdap::AttrTable::attr_begin(), libdap::Attr_container, libdap::AttrTable::attr_end(), libdap::DAS::container_name(), DBG, libdap::Error::get_error_message(), libdap::AttrTable::get_name(), libdap::DAS::get_top_level_attributes(), libdap::DDS::var(), libdap::DDS::var_begin(), and libdap::DDS::var_end().

Referenced by libdap::ResponseBuilder::get_cached_data_ddx(), main(), and libdap::ResponseBuilder::send_data().

Here is the call graph for this function:

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 571 of file DDS.cc.

Referenced by libdap::DDS::container_name(), libdap::DDS::exact_match(), libdap::function_miic_ex2(), libdap::DDS::mark(), and libdap::DDS::transfer_attributes().

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

Returns a pointer to the named variable. If the name contains one or more field separators then the function looks for a variable whose name matches exactly. If the 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
nThe name of the variable to find.
sIf 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 595 of file DDS.cc.

References libdap::DDS::exact_match(), libdap::DDS::leaf_match(), libdap::Structure::var(), and libdap::www2id().

Here is the call graph for this function:

DDS::Vars_riter libdap::DDS::var_rbegin ( )
inherited

Definition at line 684 of file DDS.cc.

DDS::Vars_riter libdap::DDS::var_rend ( )
inherited

Definition at line 696 of file DDS.cc.


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