26 #ifndef _d4attributes_h
27 #define _d4attributes_h 1
54 vector<string> d_values;
65 : d_name(name), d_type(type), d_attributes(0) {}
71 string name()
const {
return d_name; }
72 void set_name(
const string &name) { d_name = name; }
77 void add_value(
const string &value) { d_values.push_back(value); }
81 D4AttributeIter
value_end() {
return d_values.end(); }
83 unsigned int num_values()
const {
return d_values.size(); }
84 string value(
unsigned int i)
const {
return d_values[i]; }
97 vector<D4Attribute*> d_attrs;
100 D4AttributesCIter i = src.d_attrs.begin();
101 while (i != src.d_attrs.end()) {
106 D4Attribute *find_depth_first(
const string &name, D4AttributesIter i);
116 D4AttributesIter i = d_attrs.begin();
117 while(i != d_attrs.end()) {
123 if (
this == &rhs)
return *
this;
130 bool empty()
const {
return d_attrs.empty(); }
136 d_attrs.push_back(attr);
161 #endif // _d4attributes_h
D4AttributeType StringToD4AttributeType(string s)
D4Attribute(const string &name, D4AttributeType type)
D4Attributes & operator=(const D4Attributes &rhs)
string value(unsigned int i) const
D4AttributesIter attribute_begin()
Get an iterator to the start of the enumerations.
Contains the attributes for a dataset.
D4AttributeType type() const
void set_type(D4AttributeType type)
vector< D4Attribute * >::iterator D4AttributesIter
vector< D4Attribute * >::const_iterator D4AttributesCIter
D4AttributeIter value_end()
void set_name(const string &name)
vector< string >::const_iterator D4AttributeCIter
D4Attributes(const D4Attributes &rhs)
unsigned int num_values() const
void add_attribute_nocopy(D4Attribute *attr)
void add_value_vector(const vector< string > &values)
D4AttributesIter attribute_end()
Get an iterator to the end of the enumerations.
vector< string >::iterator D4AttributeIter
string D4AttributeTypeToString(D4AttributeType at)
void add_value(const string &value)
D4AttributeIter value_begin()
void add_attribute(D4Attribute *attr)