82 DBG(cerr <<
"BaseType::_duplicate: " << bt._name <<
" send_p: " 83 << bt._send_p << endl);
86 _dataset = bt._dataset;
89 d_in_selection = bt.d_in_selection;
90 _synthesized_p = bt._synthesized_p;
92 d_parent = bt.d_parent;
110 BaseType::BaseType(
const string &n,
const Type &t)
111 : _name(n), _type(t), _dataset(
""), _read_p(false), _send_p(false),
112 d_in_selection(false), _synthesized_p(false), d_parent(0)
129 : _name(n), _type(t), _dataset(d), _read_p(false), _send_p(false),
130 d_in_selection(false), _synthesized_p(false), d_parent(0)
141 DBG(cerr <<
"Entering ~BaseType (" <<
this <<
")" << endl);
142 DBG(cerr <<
"Exiting ~BaseType" << endl);
164 oss <<
"BaseType (" <<
this <<
"):" << endl
165 <<
" _name: " << _name << endl
167 <<
" _dataset: " << _dataset << endl
168 <<
" _read_p: " << _read_p << endl
169 <<
" _send_p: " << _send_p << endl
170 <<
" _synthesized_p: " << _synthesized_p << endl
171 <<
" d_parent: " << d_parent << endl
172 <<
" d_attr: " << hex << &d_attr << dec << endl;
189 << (
void *)
this <<
")" << endl ;
256 return string(
"Null");
258 return string(
"Byte");
260 return string(
"Int16");
262 return string(
"UInt16");
264 return string(
"Int32");
266 return string(
"UInt32");
268 return string(
"Float32");
270 return string(
"Float64");
272 return string(
"String");
274 return string(
"Url");
276 return string(
"Array");
278 return string(
"Structure");
280 return string(
"Sequence");
282 return string(
"Grid");
284 cerr <<
"BaseType::type_name: Undefined type" << endl;
418 return _synthesized_p;
429 _synthesized_p = state;
485 if (! _synthesized_p) {
486 DBG(cerr <<
"Changing read_p state of " <<
name() <<
" to " 519 DBG(cerr <<
"Calling BaseType::set_send_p() for: " << this->
name()
575 DBG(cerr <<
"In BaseType::transfer_attributes; processing " <<
name() << endl);
579 DBG(cerr <<
"Processing AttrTable: " << at->
get_name() << endl);
583 DBG(cerr <<
"About to append " << endl);
584 DBG(cerr <<
"attr name,type:" << at->
get_name(at_p) <<
", " << at->
get_type(at_p) << endl);
612 return d_in_selection;
627 d_in_selection = state;
640 if (!dynamic_cast<Constructor *>(parent)
641 && !dynamic_cast<Vector *>(parent))
642 throw InternalErr(
"Call to set_parent with incorrect variable type.");
721 throw InternalErr(__FILE__, __LINE__,
"BaseType::add_var unimplemented");
795 throw InternalErr(
"Unimplemented BaseType::read() method called.");
802 DBG(cerr <<
"BaseType::intern_data: " <<
name() << endl);
854 bool constraint_info,
bool constrained)
858 if (constrained && !
send_p())
861 fprintf(out,
"%s%s %s", space.c_str(),
type_name().c_str(),
864 if (constraint_info) {
866 fprintf(out,
": Send True") ;
868 fprintf(out,
": Send False") ;
872 fprintf(out,
";\n") ;
920 bool constraint_info,
bool constrained)
924 if (constrained && !
send_p())
929 if (constraint_info) {
931 out <<
": Send True" ;
933 out <<
": Send False" ;
950 if (constrained && !
send_p())
953 fprintf(out,
"%s<%s", space.c_str(),
type_name().c_str());
955 fprintf(out,
" name=\"%s\"",
id2xml(_name).c_str());
961 fprintf(out,
"%s</%s>\n", space.c_str(),
type_name().c_str());
964 fprintf(out,
"/>\n");
978 if (constrained && !
send_p())
983 out <<
" name=\"" <<
id2xml(_name) <<
"\"" ;
989 out << space <<
"</" <<
type_name() <<
">\n" ;
1038 bool sem = (_type !=
dods_null_c && _name.length());
1041 msg =
"Every variable must have both a name and a type\n";
1087 throw InternalErr(__FILE__, __LINE__,
"Unimplemented operator.");
std::vector< entry * >::iterator Attr_iter
virtual bool read()
Read data into a local buffer.
virtual bool read_p()
Has this variable been read?
string name() const
Returns the name of the class instance.
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.
virtual void dump(ostream &strm) const
dumps information about this object
virtual Attr_iter attr_end()
virtual void print_xml(FILE *out, string space=" ", bool constrained=false)
Part
Names the parts of multi-section constructor data types.
BaseType & operator=(const BaseType &rhs)
Contains the attributes for a dataset.
virtual void set_name(const string &n)
Sets the name of the class instance.
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
virtual string get_name() const
Get the name of this attribute table.
virtual void print_xml(FILE *out, string pad=" ", bool constrained=false)
string id2xml(string in, const string ¬_allowed)
virtual BaseType * get_parent()
virtual void set_is_global_attribute(bool ga)
virtual void add_var(BaseType *bt, Part part=nil)
Add a variable.
Type
Identifies the data type.
virtual string toString()
virtual void set_in_selection(bool state)
virtual bool is_in_selection()
Is this variable part of the current selection?
stack< BaseType * > btp_stack
virtual void set_parent(BaseType *parent)
A class for software fault reporting.
virtual bool is_vector_type()
Returns true if the instance is a vector (i.e., array) type variable.
virtual bool is_constructor_type()
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable...
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
Returns a pointer to a member of a constructor class.
virtual int element_count(bool leaves=false)
Count the members of constructor types.
virtual void set_send_p(bool state)
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
Type type() const
Returns the type of the class instance.
void set_type(const Type &t)
Sets the type of the class instance.
virtual void set_read_p(bool state)
Sets the value of the read_p property.
virtual bool synthesized_p()
virtual Attr_iter attr_begin()
string www2id(const string &in, const string &escape, const string &except)
void _duplicate(const BaseType &bt)
Perform a deep copy.
BaseType(const string &n, const Type &t)
The BaseType constructor.
Evaluate a constraint expression.
static ostream & LMarg(ostream &strm)
virtual AttrTable & get_attr_table()
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
The basic data type for the DODS DAP types.
libdap base object for common functionality of libdap objects
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
string type_name() const
Returns the type of the class instance as a string.
virtual void set_attr_table(const AttrTable &at)
virtual bool ops(BaseType *b, int op)
Evaluate relational operators.
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
virtual bool is_simple_type()
Returns true if the instance is a numeric, string or URL type variable.
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
virtual void dump(ostream &strm) const
dumps information about this object
virtual void transfer_attributes(AttrTable *at)
virtual bool send_p()
Should this variable be sent?
string id2www(string in, const string &allowable)
string dataset() const
Returns the name of the dataset used to create this instance.
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
virtual void set_synthesized_p(bool state)