Salome HOME
Issue #1865: Create a field
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_RefAttr.h
index a2667cab244e7afea283c19f6d874b20e8f76082..d2ada9e9087b21e7d8836b7ed508a9768091310c 100644 (file)
@@ -1,5 +1,6 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 // Name   : ModelHighAPI_RefAttr.h
-// Purpose: 
+// Purpose:
 //
 // History:
 // 08/06/16 - Sergey POKHODENKO - Creation of the file
@@ -12,8 +13,6 @@
 
 #include <memory>
 #include <string>
-
-#include <boost/variant.hpp>
 //--------------------------------------------------------------------------------------
 class ModelAPI_Attribute;
 class ModelAPI_AttributeRefAttr;
@@ -45,18 +44,21 @@ public:
   virtual ~ModelHighAPI_RefAttr();
 
   /// Fill attribute values
-  MODELHIGHAPI_EXPORT
-  virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeRefAttr> & theAttribute) const;
+  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;
+
+  /// Check the object is empty
   MODELHIGHAPI_EXPORT
-  virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeRefAttrList> & theAttribute) const;
+  bool isEmpty() 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;
 };
 
 //--------------------------------------------------------------------------------------