BaseType.cc
// -*- mode: c++; c-basic-offset:4 -*-
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
// Access Protocol.
// Copyright (c) 2002,2003 OPeNDAP, Inc.
// Author: James Gallagher <jgallagher@opendap.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
// (c) COPYRIGHT URI/MIT 1994-1999
// Please read the full copyright statement in the file COPYRIGHT_URI.
//
// Authors:
// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
// Implementation for BaseType.
//
// jhrg 9/6/94
#include "config.h"
#include <cstdio> // for stdin and stdout
#include <sstream>
#include <string>
//#define DODS_DEBUG
#include "BaseType.h"
#include "Byte.h"
#include "Int16.h"
#include "UInt16.h"
#include "Int32.h"
#include "UInt32.h"
#include "Float32.h"
#include "Float64.h"
#include "Str.h"
#include "Url.h"
#include "Array.h"
#include "Structure.h"
#include "Sequence.h"
#include "Grid.h"
#include "D4Attributes.h"
#include "DMR.h"
#include "XMLWriter.h"
#include "D4BaseTypeFactory.h"
#include "InternalErr.h"
#include "util.h"
#include "escaping.h"
#include "DapIndent.h"
#include "debug.h"
using namespace std;
namespace libdap {
// Protected copy mfunc
void
BaseType::m_duplicate(const BaseType &bt)
{
DBG(cerr << "In BaseType::m_duplicate for " << bt.name() << endl);
d_name = bt.d_name;
d_type = bt.d_type;
d_dataset = bt.d_dataset;
d_is_read = bt.d_is_read; // added, reza
d_is_send = bt.d_is_send; // added, reza
d_in_selection = bt.d_in_selection;
d_is_synthesized = bt.d_is_synthesized; // 5/11/2001 jhrg
d_parent = bt.d_parent; // copy pointers 6/4/2001 jhrg
d_attr = bt.d_attr; // Deep copy.
if (bt.d_attributes)
d_attributes = new D4Attributes(*bt.d_attributes); // deep copy
else
d_attributes = 0; // init to null if not used.
d_is_dap4 = bt.d_is_dap4;
DBG(cerr << "Exiting BaseType::m_duplicate for " << bt.name() << endl);
}
// Public mfuncs
BaseType::BaseType(const string &n, const Type &t, bool is_dap4)
: d_name(n), d_type(t), d_dataset(""), d_is_read(false), d_is_send(false),
d_parent(0), d_attributes(0), d_is_dap4(is_dap4),
d_in_selection(false), d_is_synthesized(false)
{}
BaseType::BaseType(const string &n, const string &d, const Type &t, bool is_dap4)
: d_name(n), d_type(t), d_dataset(d), d_is_read(false), d_is_send(false),
d_parent(0), d_attributes(0), d_is_dap4(is_dap4),
d_in_selection(false), d_is_synthesized(false)
{}
BaseType::BaseType(const BaseType &copy_from) : DapObj()
{
DBG(cerr << "In BaseTpe::copy_ctor for " << copy_from.name() << endl);
m_duplicate(copy_from);
}
BaseType::~BaseType()
{
DBG2(cerr << "Entering ~BaseType (" << this << ")" << endl);
if (d_attributes)
delete d_attributes;
DBG2(cerr << "Exiting ~BaseType" << endl);
}
BaseType &
BaseType::operator=(const BaseType &rhs)
{
if (this == &rhs)
return *this;
m_duplicate(rhs);
return *this;
}
string BaseType::toString()
{
ostringstream oss;
oss << "BaseType (" << this << "):" << endl
<< " _name: " << name() << endl
<< " _type: " << type_name() << endl
<< " _dataset: " << d_dataset << endl
<< " _read_p: " << d_is_read << endl
<< " _send_p: " << d_is_send << endl
<< " _synthesized_p: " << d_is_synthesized << endl
<< " d_parent: " << d_parent << endl
<< " d_attr: " << hex << &d_attr << dec << endl;
return oss.str();
}
void
BaseType::transform_to_dap4(D4Group */*root*/, Constructor *container)
{
BaseType *dest = ptr_duplicate();
// If it's already a DAP4 object then we can just return it!
if(!is_dap4()){
dest->attributes()->transform_to_dap4(get_attr_table());
dest->set_is_dap4(true);
}
container->add_var_nocopy(dest);
}
std::vector<BaseType *> *
BaseType::transform_to_dap2(AttrTable *)
{
BaseType *dest = this->ptr_duplicate();
// convert the d4 attributes to a dap2 attribute table.
// HK-403. jhrg 6/17/19
#if 0
AttrTable *attrs = this->attributes()->get_AttrTable(name());
dest->set_attr_table(*attrs);
#else
if (dest->get_attr_table().get_size() == 0) {
attributes()->transform_attrs_to_dap2(&dest->get_attr_table());
dest->get_attr_table().set_name(name());
}
#endif
dest->set_is_dap4(false);
vector<BaseType *> *result = new vector<BaseType *>();
result->push_back(dest);
return result;
}
void
BaseType::dump(ostream &strm) const
{
strm << DapIndent::LMarg << "BaseType::dump - ("
<< (void *)this << ")" << endl ;
DapIndent::Indent() ;
strm << DapIndent::LMarg << "name: " << name() << endl ;
strm << DapIndent::LMarg << "type: " << type_name() << endl ;
strm << DapIndent::LMarg << "dataset: " << d_dataset << endl ;
strm << DapIndent::LMarg << "read_p: " << d_is_read << endl ;
strm << DapIndent::LMarg << "send_p: " << d_is_send << endl ;
strm << DapIndent::LMarg << "synthesized_p: " << d_is_synthesized << endl ;
strm << DapIndent::LMarg << "d_is_dap4: " << d_is_dap4 << endl;
strm << DapIndent::LMarg << "parent: " << (void *)d_parent << endl ;
strm << DapIndent::LMarg << "attributes: " << endl ;
DapIndent::Indent() ;
if (d_attributes)
d_attributes->dump(strm);
else
d_attr.dump(strm) ;
DapIndent::UnIndent() ;
DapIndent::UnIndent() ;
}
string
BaseType::name() const
{
return d_name;
}
string
BaseType::FQN() const
{
if (get_parent() == 0)
return name();
else if (get_parent()->type() == dods_group_c)
return get_parent()->FQN() + name();
else
return get_parent()->FQN() + "." + name();
}
void
BaseType::set_name(const string &n)
{
string name = n;
d_name = www2id(name); // www2id writes into its param.
}
string
BaseType::dataset() const
{
return d_dataset;
}
Type
BaseType::type() const
{
return d_type;
}
void
BaseType::set_type(const Type &t)
{
d_type = t;
}
string
BaseType::type_name() const
{
if (is_dap4())
return libdap::D4type_name(d_type);
else
return libdap::D2type_name(d_type);
}
bool
BaseType::is_simple_type() const
{
return libdap::is_simple_type(type());
}
bool
BaseType::is_vector_type() const
{
return libdap::is_vector_type(type());
}
bool
BaseType::is_constructor_type() const
{
return libdap::is_constructor_type(type());
}
int
BaseType::element_count(bool)
{
return 1;
}
bool
BaseType::synthesized_p()
{
return d_is_synthesized;
}
void
BaseType::set_synthesized_p(bool state)
{
d_is_synthesized = state;
}
// Return the state of d_is_read (true if the value of the variable has been
// read (and is in memory) false otherwise).
bool
BaseType::read_p()
{
return d_is_read;
}
void
BaseType::set_read_p(bool state)
{
// The this comment is/was wrong!
// The is_synthesized property was not being used and the more I thought
// about how this was coded, the more this code below seemed like a bad idea.
// Once the property was set, the read_p property could not be changed.
// That seems a little silly. Also, I think I need to use this is_synthesized
// property for some of the server function code I'm working on for Raytheon,
// and I'd like to be able to control the read_p property! jhrg 3/9/15
// What's true: The is_synthesized property is used by
// 'projection functions' in the freeform handler. It might be better
// to modify the FFtypes to support this behavior, but for now I'm returning
// the library to its old behavior. That this change (setting is_read
// of the value of is_syn...) broke the FF handler was not detected
// because the FF tests were not being run due to an error in the FF
// bes-testsuite Makefile.am). jhrg 9/9/15
#if 1
if (!d_is_synthesized) {
d_is_read = state;
}
#else
d_is_read = state;
#endif
}
bool
BaseType::send_p()
{
return d_is_send;
}
void
BaseType::set_send_p(bool state)
{
DBG2(cerr << "Calling BaseType::set_send_p() for: " << this->name()
<< endl);
d_is_send = state;
}
AttrTable &
BaseType::get_attr_table()
{
return d_attr;
}
void
BaseType::set_attr_table(const AttrTable &at)
{
d_attr = at;
}
D4Attributes *
BaseType::attributes()
{
if (!d_attributes) d_attributes = new D4Attributes();
return d_attributes;
}
void
BaseType::set_attributes(D4Attributes *attrs)
{
d_attributes = new D4Attributes(*attrs);
}
void
BaseType::set_attributes_nocopy(D4Attributes *attrs)
{
d_attributes = attrs;
}
void BaseType::transfer_attributes(AttrTable *at_container) {
DBG(cerr << __func__ << "() - BEGIN name:'" << name() << "'" << endl);
AttrTable *at = at_container->get_attr_table(name());
DBG(cerr << __func__ << "() - at: "<< (void *) at << endl);
if (at) {
at->set_is_global_attribute(false);
DBG(cerr << __func__ << "() - Processing AttrTable: " << at->get_name() << endl);
AttrTable::Attr_iter at_p = at->attr_begin();
while (at_p != at->attr_end()) {
DBG(cerr << __func__ << "() - Attribute '" << at->get_name(at_p) << "' is type: " << at->get_type(at_p) << endl);
if (at->get_attr_type(at_p) == Attr_container){
// An attribute container may actually represent a child member variable. When
// that's the case we don't want to add the container to the parent type, but
// rather let any child of BaseType deal with those containers in the child's
// overridden transfer_attributes() method.
// We capitalize on the magic of the BaseType API and utilize the var() method
// to check for a child variable of the same name and, if one exists, we'll skip
// this AttrTable and let a child constructor class like Grid or Constructor
// deal with it.
BaseType *bt = var(at->get_name(at_p),true);
if(bt==0){
DBG(cerr << __func__ << "() - Adding container '" << at->get_name(at_p) << endl);
get_attr_table().append_container(new AttrTable(*at->get_attr_table(at_p)), at->get_name(at_p));
}
else {
DBG(cerr << __func__ << "() - Found child var: '"<< bt->type_name()<< " " << bt->name() << " (address:" << (void *) bt << ")" << endl);
DBG(cerr << __func__ << "() - Skipping container '" << at->get_name(at_p) << endl);
}
}
else {
DBG(cerr << __func__ << "() - Adding Attribute '" << at->get_name(at_p) << endl);
get_attr_table().append_attr(at->get_name(at_p), at->get_type(at_p), at->get_attr_vector(at_p),(*at_p)->is_utf8_str);
}
at_p++;
}
}
else {
DBG(cerr << __func__ << "() - Unable to locate AttrTable '" << name() << "' SKIPPING" << endl);
}
}
bool
BaseType::is_in_selection()
{
return d_in_selection;
}
void
BaseType::set_in_selection(bool state)
{
d_in_selection = state;
}
// Protected method.
void
BaseType::set_parent(BaseType *parent)
{
if (!dynamic_cast<Constructor *>(parent)
&& !dynamic_cast<Vector *>(parent)
&& parent != 0)
throw InternalErr("Call to set_parent with incorrect variable type.");
d_parent = parent;
}
// Public method.
BaseType *
BaseType::get_parent() const
{
return d_parent;
}
BaseType *
BaseType::get_ancestor()
{
if (d_parent)
return d_parent->get_ancestor();
else
return this;
}
// Documented in the header file.
BaseType *
BaseType::var(const string &/*name*/, bool /*exact_match*/, btp_stack */*s*/)
{
return static_cast<BaseType *>(0);
}
BaseType *
BaseType::var(const string &, btp_stack &)
{
return static_cast<BaseType *>(0);
}
void
BaseType::add_var(BaseType *, Part)
{
throw InternalErr(__FILE__, __LINE__, "BaseType::add_var unimplemented");
}
void
BaseType::add_var_nocopy(BaseType *, Part)
{
throw InternalErr(__FILE__, __LINE__, "BaseType::add_var_nocopy unimplemented");
}
bool
BaseType::read()
{
if (d_is_read)
return true;
throw InternalErr("Unimplemented BaseType::read() method called for the variable named: " + name());
}
void
BaseType::intern_data(ConstraintEvaluator &, DDS &/*dds*/)
{
#if USE_LOCAL_TIMEOUT_SCHEME
dds.timeout_on();
#endif
if (is_dap4())
throw Error(string("A method usable only with DAP2 variables was called on a DAP4 variable (").append(name()).append(")."), __FILE__, __LINE__);
DBG2(cerr << "BaseType::intern_data: " << name() << endl);
if (!read_p())
read(); // read() throws Error and InternalErr
#if USE_LOCAL_TIMEOUT_SCHEME
dds.timeout_off();
#endif
}
void
BaseType::intern_data()
{
if (!read_p())
read(); // read() throws Error and InternalErr
}
bool
BaseType::serialize(ConstraintEvaluator &, DDS &, Marshaller &, bool)
{
throw InternalErr(__FILE__, __LINE__, "The DAP2 serialize() method has not been implemented for " + type_name());
}
bool
BaseType::deserialize(UnMarshaller &, DDS *, bool)
{
throw InternalErr(__FILE__, __LINE__, "The DAP2 deserialize() method has not been implemented for " + type_name());
}
void
BaseType::serialize(D4StreamMarshaller &, DMR &, /*ConstraintEvaluator &,*/ bool)
{
throw InternalErr(__FILE__, __LINE__, "The DAP4 serialize() method has not been implemented for " + type_name());
}
void
BaseType::deserialize(D4StreamUnMarshaller &, DMR &)
{
throw InternalErr(__FILE__, __LINE__, "The DAP4 deserialize() method has not been implemented for " + type_name());
}
void
BaseType::print_decl(FILE *out, string space, bool print_semi,
bool constraint_info, bool constrained)
{
ostringstream oss;
print_decl(oss, space, print_semi, constraint_info, constrained);
fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
}
void
BaseType::print_decl(ostream &out, string space, bool print_semi,
bool constraint_info, bool constrained)
{
// if printing the constrained declaration, exit if this variable was not
// selected.
if (constrained && !send_p())
return;
out << space << type_name() << " " << id2www(name()) ;
if (constraint_info) {
if (send_p())
out << ": Send True" ;
else
out << ": Send False" ;
}
if (print_semi)
out << ";\n" ;
}
void
BaseType::print_val(FILE *out, string space, bool print_decl_p)
{
ostringstream oss;
print_val(oss, space, print_decl_p);
fwrite(oss.str().data(), sizeof(char), oss.str().length(), out);
}
void
BaseType::print_xml(FILE *out, string space, bool constrained)
{
XMLWriter xml(space);
print_xml_writer(xml, constrained);
fwrite(xml.get_doc(), sizeof(char), xml.get_doc_size(), out);
}
void
BaseType::print_xml(ostream &out, string space, bool constrained)
{
XMLWriter xml(space);
print_xml_writer(xml, constrained);
out << xml.get_doc();
}
void
BaseType::print_xml_writer(XMLWriter &xml, bool constrained)
{
if (constrained && !send_p())
return;
if (xmlTextWriterStartElement(xml.get_writer(), (const xmlChar*)type_name().c_str()) < 0)
throw InternalErr(__FILE__, __LINE__, "Could not write " + type_name() + " element");
if (!name().empty())
if (xmlTextWriterWriteAttribute(xml.get_writer(), (const xmlChar*) "name", (const xmlChar*)name().c_str()) < 0)
throw InternalErr(__FILE__, __LINE__, "Could not write attribute for name");
if (is_dap4())
attributes()->print_dap4(xml);
if (!is_dap4() && get_attr_table().get_size() > 0)
get_attr_table().print_xml_writer(xml);
if (xmlTextWriterEndElement(xml.get_writer()) < 0)
throw InternalErr(__FILE__, __LINE__, "Could not end " + type_name() + " element");
}
void
BaseType::print_dap4(XMLWriter &xml, bool constrained)
{
print_xml_writer(xml, constrained);
}
// Compares the object's current state with the semantics of a particular
// type. This will typically be defined in ctor classes (which have
// complicated semantics). For BaseType, an object is semantically correct if
// it has both a non-null name and type.
//
// NB: This is not the same as an invariant -- during the parse objects exist
// but have no name. Also, the bool ALL defaults to false for BaseType. It is
// used by children of CtorType.
//
// Returns: true if the object is semantically correct, false otherwise.
bool
BaseType::check_semantics(string &msg, bool)
{
bool sem = (d_type != dods_null_c && name().length());
if (!sem)
msg = "Every variable must have both a name and a type\n";
return sem;
}
bool
BaseType::ops(BaseType *, int)
{
// Even though ops is a public method, it can never be called because
// they will never have a BaseType object since this class is abstract,
// however any of the child classes could by mistake call BaseType::ops
// so this is an internal error. Jose Garcia
throw InternalErr(__FILE__, __LINE__, "Unimplemented operator.");
}
bool
BaseType::d4_ops(BaseType *, int)
{
throw InternalErr(__FILE__, __LINE__, "Unimplemented operator.");
}
unsigned int
BaseType::width(bool /* constrained */) const
{
throw InternalErr(__FILE__, __LINE__, "not implemented");
}
int64_t
BaseType::width_ll(bool /* constrained */) const
{
throw InternalErr(__FILE__, __LINE__, "not implemented");
}
bool BaseType::is_dap4_projected(std::vector<string> &inventory)
{
bool has_projected_dap4 = false;
if(send_p()) {
has_projected_dap4 = attributes()->has_dap4_types(FQN(), inventory);
}
return has_projected_dap4;
}
} // namespace libdap
libdap::AttrTable
Contains the attributes for a dataset.
Definition AttrTable.h:154
libdap::AttrTable::append_container
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
Definition AttrTable.cc:554
libdap::AttrTable::set_name
virtual void set_name(const string &n)
Set the name of this attribute table.
Definition AttrTable.cc:273
libdap::AttrTable::get_attr_table
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
Definition AttrTable.cc:751
libdap::AttrTable::attr_end
virtual Attr_iter attr_end()
Definition AttrTable.cc:863
libdap::AttrTable::get_type
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
Definition AttrTable.cc:757
libdap::AttrTable::get_attr_vector
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
Definition AttrTable.cc:797
libdap::AttrTable::append_attr
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
Definition AttrTable.cc:335
libdap::AttrTable::attr_begin
virtual Attr_iter attr_begin()
Definition AttrTable.cc:855
libdap::AttrTable::get_name
virtual string get_name() const
Get the name of this attribute table.
Definition AttrTable.cc:266
libdap::AttrTable::print_xml_writer
void print_xml_writer(XMLWriter &xml)
Definition AttrTable.cc:1614
libdap::AttrTable::get_size
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
Definition AttrTable.cc:259
libdap::AttrTable::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition AttrTable.cc:1715
libdap::AttrTable::get_attr_type
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
Definition AttrTable.cc:765
libdap::BaseType
The basic data type for the DODS DAP types.
Definition BaseType.h:120
libdap::BaseType::m_duplicate
void m_duplicate(const BaseType &bt)
Perform a deep copy.
Definition BaseType.cc:86
libdap::BaseType::is_dap4_projected
virtual bool is_dap4_projected(std::vector< string > &projected_dap4_inventory)
Definition BaseType.cc:1323
libdap::BaseType::print_xml_writer
virtual void print_xml_writer(XMLWriter &xml, bool constrained=false)
Definition BaseType.cc:1140
libdap::BaseType::type_name
virtual string type_name() const
Returns the type of the class instance as a string.
Definition BaseType.cc:376
libdap::BaseType::intern_data
virtual void intern_data()
Read data into this variable.
Definition BaseType.cc:936
libdap::BaseType::read
virtual bool read()
Read data into a local buffer.
Definition BaseType.cc:905
libdap::BaseType::deserialize
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
Definition BaseType.cc:949
libdap::BaseType::get_attr_table
virtual AttrTable & get_attr_table()
Definition BaseType.cc:579
libdap::BaseType::name
virtual string name() const
Returns the name of the class instance.
Definition BaseType.cc:317
libdap::BaseType::set_in_selection
virtual void set_in_selection(bool state)
Definition BaseType.cc:715
libdap::BaseType::print_decl
virtual void print_decl(FILE *out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
Print an ASCII representation of the variable structure.
Definition BaseType.cc:1009
libdap::BaseType::get_parent
virtual BaseType * get_parent() const
Definition BaseType.cc:748
libdap::BaseType::read_p
virtual bool read_p()
Has this variable been read?
Definition BaseType.cc:477
libdap::BaseType::width
virtual unsigned int width(bool constrained=false) const
How many bytes does this variable use Return the number of bytes of storage this variable uses....
Definition BaseType.cc:1305
libdap::BaseType::set_read_p
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Definition BaseType.cc:513
libdap::BaseType::dataset
virtual string dataset() const
Returns the name of the dataset used to create this instance.
Definition BaseType.cc:355
libdap::BaseType::d4_ops
virtual bool d4_ops(BaseType *b, int op)
Evaluator a relop for DAP4.
Definition BaseType.cc:1288
libdap::BaseType::set_attr_table
virtual void set_attr_table(const AttrTable &at)
Definition BaseType.cc:587
libdap::BaseType::set_synthesized_p
virtual void set_synthesized_p(bool state)
Definition BaseType.cc:460
libdap::BaseType::set_parent
virtual void set_parent(BaseType *parent)
Definition BaseType.cc:730
libdap::BaseType::element_count
virtual int element_count(bool leaves=false)
Count the members of constructor types.
Definition BaseType.cc:440
libdap::BaseType::dump
void dump(ostream &strm) const override
dumps information about this object
Definition BaseType.cc:287
libdap::BaseType::toString
virtual string toString()
Definition BaseType.cc:180
libdap::BaseType::is_vector_type
virtual bool is_vector_type() const
Returns true if the instance is a vector (i.e., array) type variable.
Definition BaseType.cc:399
libdap::BaseType::print_xml
virtual void print_xml(FILE *out, string space=" ", bool constrained=false)
Definition BaseType.cc:1111
libdap::BaseType::set_name
virtual void set_name(const string &n)
Sets the name of the class instance.
Definition BaseType.cc:341
libdap::BaseType::ops
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
Definition BaseType.cc:1262
libdap::BaseType::is_constructor_type
virtual bool is_constructor_type() const
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
Definition BaseType.cc:409
libdap::BaseType::attributes
virtual D4Attributes * attributes()
Definition BaseType.cc:596
libdap::BaseType::FQN
virtual std::string FQN() const
Definition BaseType.cc:329
libdap::BaseType::send_p
virtual bool send_p()
Should this variable be sent?
Definition BaseType.cc:551
libdap::BaseType::is_simple_type
virtual bool is_simple_type() const
Returns true if the instance is a numeric, string or URL type variable.
Definition BaseType.cc:390
libdap::BaseType::set_send_p
virtual void set_send_p(bool state)
Definition BaseType.cc:565
libdap::BaseType::ptr_duplicate
virtual BaseType * ptr_duplicate()=0
libdap::BaseType::transform_to_dap4
virtual void transform_to_dap4(D4Group *root, Constructor *container)
DAP2 to DAP4 transform.
Definition BaseType.cc:212
libdap::BaseType::serialize
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Move data to the net, then remove them from the object.
Definition BaseType.cc:943
libdap::BaseType::add_var
virtual void add_var(BaseType *bt, Part part=nil)
Add a variable.
Definition BaseType.cc:821
libdap::BaseType::transfer_attributes
virtual void transfer_attributes(AttrTable *at)
Definition BaseType.cc:641
libdap::BaseType::is_in_selection
virtual bool is_in_selection()
Is this variable part of the current selection?
Definition BaseType.cc:700
libdap::BaseType::synthesized_p
virtual bool synthesized_p()
Definition BaseType.cc:449
libdap::BaseType::check_semantics
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
Definition BaseType.cc:1215
libdap::BaseType::BaseType
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
Definition BaseType.cc:126
libdap::BaseType::var
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=nullptr)
Returns a pointer to a member of a constructor class.
Definition BaseType.cc:764
libdap::BaseType::set_type
virtual void set_type(const Type &t)
Sets the type of the class instance.
Definition BaseType.cc:369
libdap::BaseType::type
virtual Type type() const
Returns the type of the class instance.
Definition BaseType.cc:362
libdap::BaseType::print_val
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
Definition BaseType.cc:1096
libdap::BaseType::print_dap4
virtual void print_dap4(XMLWriter &xml, bool constrained=false)
Definition BaseType.cc:1170
libdap::BaseType::transform_to_dap2
virtual std::vector< BaseType * > * transform_to_dap2(AttrTable *parent_attr_table)
DAP4 to DAP2 transform.
Definition BaseType.cc:255
libdap::ConstraintEvaluator
Evaluate a constraint expression.
Definition ConstraintEvaluator.h:43
libdap::Constructor
Definition Constructor.h:44
libdap::Constructor::add_var_nocopy
void add_var_nocopy(BaseType *bt, Part part=nil) override
Definition Constructor.cc:395
libdap::D4Attributes
Definition D4Attributes.h:100
libdap::D4Attributes::transform_to_dap4
void transform_to_dap4(AttrTable &at)
copy attributes from DAP2 to DAP4
Definition D4Attributes.cc:197
libdap::D4Attributes::transform_attrs_to_dap2
void transform_attrs_to_dap2(AttrTable *d2_attr_table)
Copy the attributes from this D4Attributes object to a DAP2 AttrTable.
Definition D4Attributes.cc:312
libdap::D4Attributes::has_dap4_types
bool has_dap4_types(const std::string &path, std::vector< std::string > &inventory) const
Definition D4Attributes.cc:661
libdap::D4Attributes::dump
virtual void dump(ostream &strm) const
dumps information about this object
Definition D4Attributes.cc:684
libdap::D4Group
Definition D4Group.h:44
libdap::D4StreamMarshaller
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
Definition D4StreamMarshaller.h:71
libdap::D4StreamUnMarshaller
Read data from the stream made by D4StreamMarshaller.
Definition D4StreamUnMarshaller.h:65
libdap::DDS
Definition DDS.h:178
libdap::DMR
Definition DMR.h:58
libdap::DapObj
libdap base object for common functionality of libdap objects
Definition DapObj.h:51
libdap::Error
A class for error processing.
Definition Error.h:94
libdap::InternalErr
A class for software fault reporting.
Definition InternalErr.h:65
libdap::Marshaller
abstract base class used to marshal/serialize dap data objects
Definition Marshaller.h:50
libdap::UnMarshaller
abstract base class used to unmarshall/deserialize dap data objects
Definition UnMarshaller.h:55
libdap::Vector
Holds a one-dimensional collection of DAP2 data types.
Definition Vector.h:83
libdap::XMLWriter
Definition XMLWriter.h:39
libdap
top level DAP object to house generic methods
Definition AlarmHandler.h:36
libdap::Type
Type
Identifies the data type.
Definition Type.h:94
libdap::www2id
string www2id(const string &in, const string &escape, const string &except)
Definition escaping.cc:220
libdap::is_simple_type
bool is_simple_type(Type t)
Returns true if the instance is a numeric, string or URL type variable.
Definition util.cc:778
libdap::D2type_name
string D2type_name(Type t)
Returns the type of the class instance as a string. Supports all DAP2 types and not the DAP4-only typ...
Definition util.cc:652
libdap::D4type_name
string D4type_name(Type t)
Returns the type of the class instance as a string. Supports all DAP4 types and not the DAP2-only typ...
Definition util.cc:697
libdap::is_constructor_type
bool is_constructor_type(Type t)
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
Definition util.cc:862
libdap::is_vector_type
bool is_vector_type(Type t)
Returns true if the instance is a vector (i.e., array) type variable.
Definition util.cc:818
libdap::Part
Part
Names the parts of multi-section constructor data types.
Definition Type.h:48
libdap::id2www
string id2www(string in, const string &allowable)
Definition escaping.cc:153