1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name : ModelHighAPI_Integer.cpp
6 // 29/03/16 - Sergey POKHODENKO - Creation of the file
8 //--------------------------------------------------------------------------------------
9 #include "ModelHighAPI_Integer.h"
11 #include <ModelAPI_AttributeInteger.h>
12 //--------------------------------------------------------------------------------------
14 //--------------------------------------------------------------------------------------
15 ModelHighAPI_Integer::ModelHighAPI_Integer(int theValue)
16 : myVariantType(VT_INT)
21 ModelHighAPI_Integer::ModelHighAPI_Integer(const std::string & theValue)
22 : myVariantType(VT_STRING)
27 ModelHighAPI_Integer::ModelHighAPI_Integer(const char * theValue)
28 : myVariantType(VT_STRING)
33 ModelHighAPI_Integer::~ModelHighAPI_Integer()
37 //--------------------------------------------------------------------------------------
38 void ModelHighAPI_Integer::fillAttribute(
39 const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute) const
41 switch(myVariantType) {
42 case VT_INT: theAttribute->setValue(myInt); return;
43 case VT_STRING: theAttribute->setText(myString); return;
47 int ModelHighAPI_Integer::intValue() const
49 // needed for array of integer, which supports no text