Salome HOME
Remove dependency on boost
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_RefAttr.h
index 14fcc5563020ccd4e631d8235347018994938a2d..bc54e20789d32777a9d11b4a387ddd3a8235689b 100644 (file)
 
 #include <memory>
 #include <string>
-
-#include <boost/variant.hpp>
 //--------------------------------------------------------------------------------------
 class ModelAPI_Attribute;
 class ModelAPI_AttributeRefAttr;
+class ModelAPI_AttributeRefAttrList;
 class ModelAPI_Object;
+class ModelHighAPI_Interface;
 //--------------------------------------------------------------------------------------
 /**\class ModelHighAPI_RefAttr
  * \ingroup CPPHighAPI
@@ -31,10 +31,13 @@ public:
   ModelHighAPI_RefAttr();
   /// Constructor for attribute
   MODELHIGHAPI_EXPORT
-  explicit ModelHighAPI_RefAttr(const std::shared_ptr<ModelAPI_Attribute> & theValue);
+  ModelHighAPI_RefAttr(const std::shared_ptr<ModelAPI_Attribute> & theValue);
   /// Constructor for object
   MODELHIGHAPI_EXPORT
-  explicit ModelHighAPI_RefAttr(const std::shared_ptr<ModelAPI_Object> & theValue);
+  ModelHighAPI_RefAttr(const std::shared_ptr<ModelAPI_Object> & theValue);
+  /// Constructor for Interface (use result() for object)
+  MODELHIGHAPI_EXPORT
+  ModelHighAPI_RefAttr(const std::shared_ptr<ModelHighAPI_Interface> & theValue);
   /// Destructor
   MODELHIGHAPI_EXPORT
   virtual ~ModelHighAPI_RefAttr();
@@ -43,11 +46,14 @@ public:
   MODELHIGHAPI_EXPORT
   virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute) const;
 
+  /// Append to list attribute
+  MODELHIGHAPI_EXPORT
+  virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute) const;
+
 private:
-  boost::variant<
-    std::shared_ptr<ModelAPI_Attribute>,
-    std::shared_ptr<ModelAPI_Object>
-  > myValue;
+  enum VariantType { VT_ATTRIBUTE, VT_OBJECT } myVariantType;
+  std::shared_ptr<ModelAPI_Attribute> myAttribute;
+  std::shared_ptr<ModelAPI_Object> myObject;
 };
 
 //--------------------------------------------------------------------------------------