1 // Copyright (C) 2007-2016 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 #ifndef DFATTRIBUTE_HXX
21 #define DFATTRIBUTE_HXX
23 #include "DF_definitions.hxx"
29 //Class DF_Attribute is used to store some data defined by the DF_Attribute type
36 Standard_EXPORT DF_Attribute();
38 Standard_EXPORT virtual ~DF_Attribute();
40 //Returns a Label on which this Attribute is located.
41 Standard_EXPORT DF_Label Label() const;
43 //Searches an Attribute with given ID located on the same Label as this Attribute.
44 Standard_EXPORT DF_Attribute* FindAttribute(const std::string& theID) const;
47 Standard_EXPORT virtual std::string Save() { return ""; }
48 Standard_EXPORT virtual void Load(const std::string&) {}
50 //######## Virtual methods that must be redefined in descendants of the DF_Attribute
52 //This method must be redefined in all descendents of the DF_Attribute
53 //ID is a std::string that uniquely identify the given type of Attributes within the Application.
54 Standard_EXPORT virtual const std::string& ID() const = 0;
56 //Restores a content of this Attribute from another Attribute
57 Standard_EXPORT virtual void Restore(DF_Attribute* theAttribute) = 0;
59 //Creates a new empty copy oà this Attribute
60 Standard_EXPORT virtual DF_Attribute* NewEmpty() const = 0;
62 //Pastes a content of this Attribute into another Attribute
63 Standard_EXPORT virtual void Paste(DF_Attribute* theIntoAttribute) = 0;
68 Standard_EXPORT virtual void AfterAddition() {}
69 Standard_EXPORT virtual void BeforeForget() {}
75 friend class DF_Label;