Salome HOME
Define guards are corrected according to the code style
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeReference.h
1 // File:        ModelAPI_AttributeReference.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_AttributeReference_H_
6 #define ModelAPI_AttributeReference_H_
7
8 #include "ModelAPI_Attribute.h"
9 #include <ModelAPI_Feature.h>
10
11 /**\class ModelAPI_AttributeReference
12  * \ingroup DataModel
13  * \brief Attribute that contains reference to feature (located in the same document).
14  */
15
16 class ModelAPI_AttributeReference : public ModelAPI_Attribute
17 {
18 public:
19   /// Defines the object referenced from this attribute
20   MODELAPI_EXPORT virtual void setValue(ObjectPtr theObject) = 0;
21
22   /// Returns object referenced from this attribute
23   MODELAPI_EXPORT virtual ObjectPtr value() = 0;
24
25   /// Returns the type of this class of attributes
26   MODELAPI_EXPORT static std::string type() {return "Reference";}
27
28   /// Returns the type of this class of attributes, not static method
29   MODELAPI_EXPORT virtual std::string attributeType() {return type();}
30
31   /// To virtually destroy the fields of successors
32   MODELAPI_EXPORT virtual ~ModelAPI_AttributeReference() {}
33
34 protected:
35   /// Objects are created for features automatically
36   MODELAPI_EXPORT ModelAPI_AttributeReference()
37   {}
38 };
39
40 #endif