35 #define _attrtable_h 1
167 aliased_to(
""), is_global(true), attributes(0), attr(0) {}
182 delete attr; attr = 0;
212 attr =
new std::vector<string>(*rhs.
attr);
234 std::vector<entry *> attr_map;
242 bool d_is_global_attribute;
244 void delete_attr_table();
253 void simple_print(ostream &out,
string pad, Attr_iter i,
262 virtual void erase();
264 virtual unsigned int get_size()
const;
266 virtual void set_name(
const string &n);
279 virtual unsigned int append_attr(
const string &name,
const string &type,
280 const string &value);
281 virtual unsigned int append_attr(
const string &name,
const string &type,
282 vector<string> *values);
287 virtual void find(
const string &target,
AttrTable **at, Attr_iter *iter);
290 Attr_iter *location);
297 virtual string get_type(
const string &name);
300 virtual string get_attr(
const string &name,
unsigned int i = 0);
302 virtual void del_attr(
const string &name,
int i = -1);
307 virtual string get_name(Attr_iter iter);
311 virtual string get_type(Attr_iter iter);
314 virtual string get_attr(Attr_iter iter,
unsigned int i = 0);
321 const string &source);
325 virtual bool attr_alias(
const string &alias,
const string &name);
327 virtual void print(FILE *out,
string pad =
" ",
328 bool dereference =
false);
329 virtual void print(ostream &out,
string pad =
" ",
330 bool dereference =
false);
332 virtual void print_xml(FILE *out,
string pad =
" ",
333 bool constrained =
false);
334 virtual void print_xml(ostream &out,
string pad =
" ",
335 bool constrained =
false);
341 virtual void dump(ostream &strm)
const ;
346 #endif // _attrtable_h
std::vector< entry * >::iterator Attr_iter
virtual Attr_iter attr_end()
Contains the attributes for a dataset.
string AttrType_to_String(const AttrType at)
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
void clone(const AttrTable &at)
virtual void add_container_alias(const string &name, AttrTable *src)
Add an alias to a container held by this attribute table.
virtual void print_xml(FILE *out, string pad=" ", bool constrained=false)
virtual bool is_global_attribute() const
virtual string get_attr(const string &name, unsigned int i=0)
virtual void del_attr(const string &name, int i=-1)
Deletes an attribute.
virtual void set_is_global_attribute(bool ga)
virtual AttrTable * recurrsive_find(const string &target, Attr_iter *location)
void print_xml_writer(XMLWriter &xml)
virtual void print(FILE *out, string pad=" ", bool dereference=false)
Prints the attribute table.
virtual AttrTable * find_container(const string &target)
Find an attribute with a given name.
virtual string get_name() const
Get the name of this attribute table.
AttrTable & operator=(const AttrTable &rhs)
void print_dap4(XMLWriter &xml)
virtual Attr_iter get_attr_iter(int i)
virtual void add_value_alias(AttrTable *at, const string &name, const string &source)
Add an alias for an attribute.
virtual bool is_container(Attr_iter iter)
AttrType String_to_AttrType(const string &s)
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
AttrTable * simple_find_container(const string &target)
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
void clone(const entry &rhs)
friend class AttrTableTest
virtual void erase()
Erase the attribute table.
entry & operator=(const entry &rhs)
virtual bool attr_alias(const string &alias, AttrTable *at, const string &name)
Adds an alias to the set of attributes.
virtual Attr_iter attr_begin()
std::vector< entry * >::const_iterator Attr_citer
virtual unsigned int get_attr_num(const string &name)
Get the number of attributes in this container.
virtual AttrTable * get_parent() const
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
libdap base object for common functionality of libdap objects
void simple_print(FILE *out, string pad, Attr_iter i, bool dereference)
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
virtual void dump(ostream &strm) const
dumps information about this object
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
virtual void set_name(const string &n)
Set the name of this attribute table.
std::vector< string > * attr
virtual Attr_iter del_attr_table(Attr_iter iter)
virtual void find(const string &target, AttrTable **at, Attr_iter *iter)
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
Attr_iter simple_find(const string &target)