Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/kernel.git] / src / DF / DF_Attribute.hxx
1 #ifndef DFATTRIBUTE_HXX
2 #define DFATTRIBUTE_HXX
3
4 #include "DF_definitions.hxx"
5 #include <string>
6
7 class DF_Label;
8 class DF_LabelNode;
9
10 //Class DF_Attribute is used to store some data defined by the DF_Attribute type
11 class DF_Attribute {
12 protected:
13   DF_LabelNode* _node;
14
15 public:
16   //Constructor
17   Standard_EXPORT DF_Attribute();
18
19   Standard_EXPORT virtual ~DF_Attribute();
20
21   //Returns a Label on which this Attribute is located.
22   Standard_EXPORT DF_Label Label() const;
23
24   //Searches an Attribute with given ID located on the same Label as this Attribute.
25   Standard_EXPORT DF_Attribute* FindAttribute(const std::string& theID) const;
26
27
28   Standard_EXPORT virtual std::string Save() { return ""; } 
29   Standard_EXPORT virtual void Load(const std::string&) {}
30
31   //######## Virtual methods that must be redefined in descendants of the DF_Attribute 
32
33   //This method must be redefined in all descendents of the DF_Attribute
34   //ID is a std::string that uniquely identify the given type of Attributes within the Application.
35   Standard_EXPORT virtual const std::string& ID() const = 0;
36
37   //Restores a content of this Attribute from another Attribute
38   Standard_EXPORT virtual  void Restore(DF_Attribute* theAttribute) = 0;
39
40   //Creates a new empty copy oà this Attribute
41   Standard_EXPORT virtual DF_Attribute* NewEmpty() const = 0;
42
43   //Pastes a content of this Attribute into another Attribute 
44   Standard_EXPORT virtual  void Paste(DF_Attribute* theIntoAttribute) = 0;
45
46  
47   //######## Callbacks
48
49   Standard_EXPORT virtual void AfterAddition() {}
50   Standard_EXPORT virtual void BeforeForget() {}
51
52 protected:
53   void Backup() {}
54
55   
56 friend class DF_Label;
57   
58 };
59
60 #endif