Salome HOME
Resolve batch runtime errors on debian squeeze
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeRefAttr.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_AttributeRefAttr.h
4 // Created:     8 May 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_AttributeRefAttr_H_
8 #define ModelAPI_AttributeRefAttr_H_
9
10 #include "ModelAPI_Attribute.h"
11 #include "ModelAPI_Feature.h"
12
13 /**\class ModelAPI_AttributeRefAttr
14  * \ingroup DataModel
15  * \brief Attribute that contains reference to an attribute of a feature or reference to 
16  * a feature (switchable)
17  */
18
19 class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute
20 {
21  public:
22   /// Returns true if this attribute references to a object (not to the attribute)
23   MODELAPI_EXPORT virtual bool isObject() = 0;
24
25   /// Defines the reference to the attribute
26   MODELAPI_EXPORT virtual void setAttr(AttributePtr theAttr) = 0;
27
28   /// Returns attribute referenced from this attribute
29   MODELAPI_EXPORT virtual AttributePtr attr() = 0;
30
31   /// Defines the reference to the object
32   MODELAPI_EXPORT virtual void setObject(ObjectPtr theFeature) = 0;
33
34   /// Returns object referenced from this attribute
35   MODELAPI_EXPORT virtual ObjectPtr object() = 0;
36
37   /// Returns the type of this class of attributes
38   MODELAPI_EXPORT static std::string typeId()
39   {
40     return "RefAttr";
41   }
42
43   /// Returns the type of this class of attributes, not static method
44   MODELAPI_EXPORT virtual std::string attributeType();
45
46   /// To virtually destroy the fields of successors
47   MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefAttr();
48
49  protected:
50   /// Objects are created for features automatically
51   MODELAPI_EXPORT ModelAPI_AttributeRefAttr();
52 };
53
54 typedef std::shared_ptr<ModelAPI_AttributeRefAttr> AttributeRefAttrPtr;
55
56 #endif