Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Integer.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name   : ModelHighAPI_Integer.h
3 // Purpose:
4 //
5 // History:
6 // 29/03/16 - Sergey POKHODENKO - Creation of the file
7
8 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTEGER_H_
9 #define SRC_MODELHIGHAPI_MODELHIGHAPI_INTEGER_H_
10
11 //--------------------------------------------------------------------------------------
12 #include "ModelHighAPI.h"
13
14 #include <memory>
15 #include <string>
16 //--------------------------------------------------------------------------------------
17 class ModelAPI_AttributeInteger;
18 //--------------------------------------------------------------------------------------
19 /**\class ModelHighAPI_Integer
20  * \ingroup CPPHighAPI
21  * \brief Class for filling ModelAPI_AttributeInteger
22  */
23 class ModelHighAPI_Integer
24 {
25 public:
26   /// Constructor for int
27   MODELHIGHAPI_EXPORT
28   ModelHighAPI_Integer(int theValue = 0);
29   /// Constructor for std::string
30   MODELHIGHAPI_EXPORT
31   ModelHighAPI_Integer(const std::string & theValue);
32   /// Constructor for char *
33   MODELHIGHAPI_EXPORT
34   ModelHighAPI_Integer(const char * theValue);
35   /// Destructor
36   MODELHIGHAPI_EXPORT
37   virtual ~ModelHighAPI_Integer();
38
39   /// Fill attribute values
40   MODELHIGHAPI_EXPORT
41   virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeInteger> & theAttribute) const;
42
43   /// Returns a value (must be used only for attributes which support no text)
44   MODELHIGHAPI_EXPORT virtual int intValue() const;
45
46 private:
47   enum VariantType { VT_INT, VT_STRING } myVariantType;
48   int myInt;
49   std::string myString;
50 };
51
52 //--------------------------------------------------------------------------------------
53 //--------------------------------------------------------------------------------------
54 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTEGER_H_ */