Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / Model / Model_AttributeRefAttr.h
1 // File:        Model_AttributeRefAttr.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeRefAttr_H_
6 #define Model_AttributeRefAttr_H_
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeRefAttr.h"
10 #include <TDF_Label.hxx>
11 #include <TDF_Reference.hxx>
12 #include <TDataStd_Comment.hxx>
13
14 /**\class Model_AttributeRefAttr
15  * \ingroup DataModel
16  * \brief Attribute that contains reference to an attribute of a feature 
17  * (located in the same document).
18  */
19
20 class Model_AttributeRefAttr : public ModelAPI_AttributeRefAttr
21 {
22   Handle_TDF_Reference myRef;  ///< reference to the feature label
23   ///< ID of the referenced attirbute (empty if this is a reference to a feature)
24   Handle_TDataStd_Comment myID;
25  public:
26   /// Returns true if this attribute references to a object (not to the attribute)
27   MODEL_EXPORT virtual bool isObject();
28
29   /// Defines the reference to the attribute
30   MODEL_EXPORT virtual void setAttr(std::shared_ptr<ModelAPI_Attribute> theAttr);
31
32   /// Returns attribute referenced from this attribute
33   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Attribute> attr();
34
35   /// Defines the reference to the object
36   MODEL_EXPORT virtual void setObject(ObjectPtr theFeature);
37
38   /// Returns object referenced from this attribute
39   MODEL_EXPORT virtual ObjectPtr object();
40
41  protected:
42   /// Objects are created for features automatically
43   MODEL_EXPORT Model_AttributeRefAttr(TDF_Label& theLabel);
44
45   friend class Model_Data;
46 };
47
48 #endif