1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_AttributeRefAttr.h
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelAPI_AttributeRefAttr_H_
8 #define ModelAPI_AttributeRefAttr_H_
10 #include "ModelAPI_Attribute.h"
11 #include "ModelAPI_Feature.h"
13 /**\class ModelAPI_AttributeRefAttr
15 * \brief Attribute that contains reference to an attribute of a feature or reference to
16 * a feature (switchable)
19 class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute
22 /// Returns true if this attribute references to a object (not to the attribute)
23 MODELAPI_EXPORT virtual bool isObject() = 0;
25 /// Defines the reference to the attribute
26 MODELAPI_EXPORT virtual void setAttr(AttributePtr theAttr) = 0;
28 /// Returns attribute referenced from this attribute
29 MODELAPI_EXPORT virtual AttributePtr attr() = 0;
31 /// Defines the reference to the object
32 MODELAPI_EXPORT virtual void setObject(ObjectPtr theFeature) = 0;
34 /// Returns object referenced from this attribute
35 MODELAPI_EXPORT virtual ObjectPtr object() = 0;
37 /// Returns the type of this class of attributes
38 MODELAPI_EXPORT static std::string typeId()
43 /// Returns the type of this class of attributes, not static method
44 MODELAPI_EXPORT virtual std::string attributeType();
46 /// To virtually destroy the fields of successors
47 MODELAPI_EXPORT virtual ~ModelAPI_AttributeRefAttr();
50 /// Objects are created for features automatically
51 MODELAPI_EXPORT ModelAPI_AttributeRefAttr();
54 typedef std::shared_ptr<ModelAPI_AttributeRefAttr> AttributeRefAttrPtr;