1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "DF_definitions.hxx"
21 #include "DF_Label.hxx"
22 #include "DF_Attribute.hxx"
24 //Class DF_Attribute is used to store some data defined by the DF_Attribute type
27 DF_Attribute::DF_Attribute()
32 DF_Attribute::~DF_Attribute()
34 //Remove an attribute from a map of the node's attributes to
35 //avoid double deletion on the node destruction
37 std::map<std::string, DF_Attribute*>::iterator mi;
38 for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) {
39 if(mi->second == this) {
40 _node->_attributes.erase(mi);
47 //Returns a Label on which this Attribute is located.
48 DF_Label DF_Attribute::Label() const
50 return DF_Label(_node);
53 //Searches an Attribute with given ID located on the same Label as this Attribute.
54 DF_Attribute* DF_Attribute::FindAttribute(const std::string& theID) const
56 if(!_node) return NULL;
57 return Label().FindAttribute(theID);