]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/ModelHighAPI_RefAttr.h
Salome HOME
adc00b228faf09f1e56ffab61386d18d58f031eb
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_RefAttr.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name   : ModelHighAPI_RefAttr.h
3 // Purpose:
4 //
5 // History:
6 // 08/06/16 - Sergey POKHODENKO - Creation of the file
7
8 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_REFATTR_H_
9 #define SRC_MODELHIGHAPI_MODELHIGHAPI_REFATTR_H_
10
11 //--------------------------------------------------------------------------------------
12 #include "ModelHighAPI.h"
13
14 #include <memory>
15 #include <string>
16 //--------------------------------------------------------------------------------------
17 class ModelAPI_Attribute;
18 class ModelAPI_AttributeRefAttr;
19 class ModelAPI_AttributeRefAttrList;
20 class ModelAPI_Object;
21 class ModelAPI_ObjectMovedMessage;
22 class ModelHighAPI_Interface;
23 //--------------------------------------------------------------------------------------
24 /**\class ModelHighAPI_RefAttr
25  * \ingroup CPPHighAPI
26  * \brief Class for filling ModelAPI_AttributeRefAttr
27  */
28 class ModelHighAPI_RefAttr
29 {
30 public:
31   /// Default constructor
32   MODELHIGHAPI_EXPORT
33   ModelHighAPI_RefAttr();
34   /// Constructor for attribute
35   MODELHIGHAPI_EXPORT
36   ModelHighAPI_RefAttr(const std::shared_ptr<ModelAPI_Attribute> & theValue);
37   /// Constructor for object
38   MODELHIGHAPI_EXPORT
39   ModelHighAPI_RefAttr(const std::shared_ptr<ModelAPI_Object> & theValue);
40   /// Constructor for Interface (use result() for object)
41   MODELHIGHAPI_EXPORT
42   ModelHighAPI_RefAttr(const std::shared_ptr<ModelHighAPI_Interface> & theValue);
43   /// Destructor
44   MODELHIGHAPI_EXPORT
45   virtual ~ModelHighAPI_RefAttr();
46
47   /// Fill attribute values
48   MODELHIGHAPI_EXPORT virtual
49     void fillAttribute(const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute) const;
50
51   /// Append to list attribute
52   MODELHIGHAPI_EXPORT virtual
53     void appendToList(const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute) const;
54
55   /// Check the object is empty
56   MODELHIGHAPI_EXPORT
57   bool isEmpty() const;
58
59   /// Fill moved message by the attribute or object
60   MODELHIGHAPI_EXPORT
61   void fillMessage(const std::shared_ptr<ModelAPI_ObjectMovedMessage>& theMessage) const;
62
63 private:
64   enum VariantType { VT_ATTRIBUTE, VT_OBJECT } myVariantType;
65   std::shared_ptr<ModelAPI_Attribute> myAttribute;
66   std::shared_ptr<ModelAPI_Object> myObject;
67 };
68
69 //--------------------------------------------------------------------------------------
70 //--------------------------------------------------------------------------------------
71 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_REFATTR_H_ */