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