Salome HOME
Renaming feature() of ModelAPI_Attribute to owner()
[modules/shaper.git] / src / ModelAPI / ModelAPI_Attribute.h
1 // File:        ModelAPI_Attribute.h
2 // Created:     2 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_Attribute_HeaderFile
6 #define ModelAPI_Attribute_HeaderFile
7
8 #include "ModelAPI.h"
9 #include <string>
10 #include <boost/shared_ptr.hpp>
11
12 class ModelAPI_Feature;
13
14 /**\class ModelAPI_Attribute
15  * \ingroup DataModel
16  * \brief Generic attribute of the Object.
17  */
18 class ModelAPI_Attribute
19 {
20   ///< needed here to emit signal that feature changed on change of the attribute
21   boost::shared_ptr<ModelAPI_Feature> myFeature;
22 public:
23   
24   /// Returns the type of this class of attributes, not static method
25   MODELAPI_EXPORT virtual std::string attributeType() = 0;
26
27   /// To virtually destroy the fields of successors
28   MODELAPI_EXPORT virtual ~ModelAPI_Attribute() {}
29
30   /// Sets the owner of this attribute
31   MODELAPI_EXPORT void setFeature(const boost::shared_ptr<ModelAPI_Feature>& theFeature)
32     {myFeature = theFeature;}
33
34   /// Returns the owner of this attribute
35   MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Feature>& owner()
36   {return myFeature;}
37 protected:
38   /// Objects are created for features automatically
39   ModelAPI_Attribute(){}
40
41 };
42
43 #endif