1 // Name : ModelHighAPI_Double.cpp
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "ModelHighAPI_Double.h"
10 #include <ModelAPI_AttributeDouble.h>
11 //--------------------------------------------------------------------------------------
13 //--------------------------------------------------------------------------------------
14 ModelHighAPI_Double::ModelHighAPI_Double(double theValue)
19 ModelHighAPI_Double::ModelHighAPI_Double(const std::string & theValue)
24 ModelHighAPI_Double::ModelHighAPI_Double(const char * theValue)
29 ModelHighAPI_Double::~ModelHighAPI_Double()
33 //--------------------------------------------------------------------------------------
34 struct fill_visitor : boost::static_visitor<void>
36 mutable std::shared_ptr<ModelAPI_AttributeDouble> myAttribute;
38 fill_visitor(std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute)
39 : myAttribute(theAttribute) {}
41 void operator()(double theValue) const { myAttribute->setValue(theValue); }
42 void operator()(const std::string & theValue) const { myAttribute->setText(theValue); }
45 void ModelHighAPI_Double::fillAttribute(
46 std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const
48 boost::apply_visitor(fill_visitor(theAttribute), myValue);