53#ifndef base_type_factory_h
182 string d_container_name;
188 string d_dap_version;
189 string d_request_xml_base;
194 vector<BaseType *> vars;
200 uint64_t d_max_response_size_kb;
212 typedef std::vector<BaseType *>::reverse_iterator
Vars_riter;
331 const vector<BaseType *> &
variables()
const {
return vars; }
370 void parse(
string fname);
372 void parse(FILE *in = stdin);
375 void print(FILE *out);
377 void print_xml(FILE *out,
bool constrained,
const string &blob =
"");
380 void print(ostream &out);
382 void print_xml(ostream &out,
bool constrained,
const string &blob =
"");
385 void print_xml_writer(ostream &out,
bool constrained,
const string &blob =
"");
388 void print_dmr(ostream &out,
bool constrained);
395 bool mark(
const string &name,
bool state);
402 virtual void dump(ostream &strm)
const;
Contains the attributes for a dataset.
The basic data type for the DODS DAP types.
stack< BaseType * > btp_stack
Hold attribute data for a DAP2 dataset.
void set_dataset_name(const string &n)
void set_dap_major(int p)
void mark_all(bool state)
void print_dmr(ostream &out, bool constrained)
Print the DAP4 DMR object using a 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.
void set_namespace(const string &ns)
Set the namespace for this DDS/DDX object/response.
virtual AttrTable & get_attr_table()
void set_request_xml_base(const string &xb)
std::vector< BaseType * >::const_iterator Vars_citer
void set_response_limit(long size)
string get_dap_version() const
uint64_t get_request_size_kb(bool constrained)
Get the estimated response size in kilobytes.
virtual void transfer_attributes(DAS *das)
BaseType * leaf_match(const string &name, BaseType::btp_stack *s=0)
void set_dap_minor(int p)
string get_namespace() const
Get the namespace associated with the DDS - likely set only by DDX responses.
int num_var()
Returns the number of variables in the DDS.
void print(FILE *out)
Print the entire DDS to the specified file.
BaseType * get_var_index(int i)
Get a variable.
int get_request_size(bool constrained)
Get the estimated response size in bytes.
bool is_dap4_projected(std::vector< string > &inventory)
Vars_riter var_rbegin()
Return a reverse iterator.
BaseTypeFactory * set_factory(BaseTypeFactory *factory)
string get_dataset_name() const
BaseType * exact_match(const string &name, BaseType::btp_stack *s=0)
void del_var(const string &n)
Removes a variable from the DDS.
void parse(string fname)
Parse a DDS from a file with the given d_name.
BaseType * var(const string &n, BaseType::btp_stack &s)
void print_xml(FILE *out, bool constrained, const string &blob="")
void insert_var(Vars_iter i, BaseType *ptr)
Insert a variable before the referenced element.
void duplicate(const DDS &dds)
bool mark(const string &name, bool state)
Mark the send_p flag of the named variable to state.
std::vector< BaseType * >::reverse_iterator Vars_riter
int get_dap_minor() const
Get the DAP minor version as sent by the client.
uint64_t get_response_limit_kb() const
The maximum allowed response size, in kilobytes. Zero indicates no limit (default).
DDS(BaseTypeFactory *factory, const string &name="")
void tag_nested_sequences()
Traverse DDS, set Sequence leaf nodes.
BaseTypeFactory * get_factory() const
DAS * get_das()
Get a DAS object.
void print_constrained(FILE *out)
Print a constrained DDS to the specified file.
Vars_riter var_rend()
Return a reverse iterator.
string get_dmr_version() const
void insert_var_nocopy(Vars_iter i, BaseType *ptr)
string get_request_xml_base() const
Get the URL that will return this DDS/DDX/DataThing.
void set_response_limit_kb(uint64_t size)
Set the maximum response size, in kilobytes. The size is given in kilobytes..
Vars_iter var_end()
Return an iterator.
int get_dap_major() const
Get the DAP major version as sent by the client.
const vector< BaseType * > & variables() const
void set_dap_version(const string &version_string="2.0")
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 ...
Vars_iter get_vars_iter(int i)
Get an iterator.
std::vector< BaseType * >::iterator Vars_iter
void print_xml_writer(ostream &out, bool constrained, const string &blob="")
long get_response_limit()
Get the maximum response size, in bytes. Zero indicates no limit.
DDS & operator=(const DDS &rhs)
void print_das(ostream &out)
write the DAS response given the attribute information in the DDS
virtual void dump(ostream &strm) const
dumps information about this object
libdap base object for common functionality of libdap objects
Holds a structure (aggregate) type.
top level DAP object to house generic methods
bool has_dap2_attributes(AttrTable &a)