Salome HOME
b7c4bbcdfc42a20d0875000532a232912bfb50a5
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeDocRef.h
1 // File:        ModelAPI_AttributeDocRef.h
2 // Created:     2 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_AttributeDocRef_H_
6 #define ModelAPI_AttributeDocRef_H_
7
8 #include "ModelAPI_Attribute.h"
9 #include "ModelAPI_Document.h"
10
11 /**\class ModelAPI_AttributeDocRef
12  * \ingroup DataModel
13  * \brief Attribute that contains reference to another document.
14  */
15
16 class ModelAPI_AttributeDocRef : public ModelAPI_Attribute
17 {
18  public:
19   /// Defines the document referenced from this attribute
20   MODELAPI_EXPORT virtual void setValue(std::shared_ptr<ModelAPI_Document> theDoc) = 0;
21
22   /// Returns document referenced from this attribute
23   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> value() = 0;
24
25   /// Returns the type of this class of attributes
26   MODELAPI_EXPORT static std::string type()
27   {
28     return "DocRef";
29   }
30
31   /// Returns the type of this class of attributes, not static method
32   MODELAPI_EXPORT virtual std::string attributeType()
33   {
34     return type();
35   }
36
37   /// To virtually destroy the fields of successors
38   MODELAPI_EXPORT virtual ~ModelAPI_AttributeDocRef()
39   {
40   }
41
42  protected:
43   /// Objects are created for features automatically
44   MODELAPI_EXPORT ModelAPI_AttributeDocRef()
45   {
46   }
47 };
48
49 typedef std::shared_ptr<ModelAPI_AttributeDocRef> AttributeDocRefPtr;
50
51 #endif