Salome HOME
Replace boost::shared_ptr<ModelAPI_Feature> on FeaturePtr
[modules/shaper.git] / src / Model / Model_AttributeReference.h
1 // File:        Model_AttributeReference.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeReference_HeaderFile
6 #define Model_AttributeReference_HeaderFile
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeReference.h"
10 #include <ModelAPI_Feature.h>
11 #include <TDF_Label.hxx>
12 #include <TDF_Reference.hxx>
13
14 /**\class Model_AttributeReference
15  * \ingroup DataModel
16  * \brief Attribute that contains reference to feature (located in the same document).
17  */
18
19 class Model_AttributeReference : public ModelAPI_AttributeReference
20 {
21   Handle_TDF_Reference myRef; ///< references to the feature label
22 public:
23   /// Defines the feature referenced from this attribute
24   MODEL_EXPORT virtual void setValue(FeaturePtr theFeature);
25
26   /// Returns feature referenced from this attribute
27   MODEL_EXPORT virtual FeaturePtr value();
28
29 protected:
30   /// Objects are created for features automatically
31   MODEL_EXPORT Model_AttributeReference(TDF_Label& theLabel);
32
33   friend class Model_Data;
34 };
35
36 #endif