1 #include "DF_definitions.hxx"
2 #include "DF_Label.hxx"
3 #include "DF_Attribute.hxx"
7 //Class DF_Attribute is used to store some data defined by the DF_Attribute type
10 DF_Attribute::DF_Attribute()
15 DF_Attribute::~DF_Attribute()
17 //Remove an attribute from a map of the node's attributes to
18 //avoid double deletion on the node destruction
20 map<string, DF_Attribute*>::iterator mi;
21 for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) {
22 if(mi->second == this) {
23 _node->_attributes.erase(mi);
29 //Returns a Label on which this Attribute is located.
30 DF_Label DF_Attribute::Label() const
32 return DF_Label(_node);
35 //Searches an Attribute with given ID located on the same Label as this Attribute.
36 DF_Attribute* DF_Attribute::FindAttribute(const string& theID) const
38 if(!_node) return NULL;
39 return Label().FindAttribute(theID);