Salome HOME
Use full attribute type name in INTERFACE_N
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Interface.h
1 // Name   : ModelHighAPI_Interface.h
2 // Purpose: 
3 //
4 // History:
5 // 17/05/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
8 #define SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ModelHighAPI.h"
12
13 #include <memory>
14 #include <string>
15 //--------------------------------------------------------------------------------------
16 class ModelAPI_Feature;
17 //--------------------------------------------------------------------------------------
18 /**\class ModelHighAPI_Interface
19  * \ingroup CPPHighAPI
20  * \brief Base class for feature interfaces
21  */
22 class ModelHighAPI_Interface
23 {
24 public:
25   /// Constructor
26   MODELHIGHAPI_EXPORT
27   explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
28   /// Destructor
29   MODELHIGHAPI_EXPORT
30   virtual ~ModelHighAPI_Interface();
31
32   /// Return ModelAPI_Feature
33   MODELHIGHAPI_EXPORT
34   std::shared_ptr<ModelAPI_Feature> feature() const;
35
36   /// Shortcut for feature()->getKind()
37   MODELHIGHAPI_EXPORT
38   const std::string& getKind();
39
40   /// Shortcut for feature()->execute()
41   MODELHIGHAPI_EXPORT
42   void execute();
43
44   /// Throw exception to event loop
45   MODELHIGHAPI_EXPORT
46   void throwException(const std::string & theDescription);
47
48 protected:
49   std::shared_ptr<ModelAPI_Feature> myFeature;
50 };
51
52 //--------------------------------------------------------------------------------------
53 //--------------------------------------------------------------------------------------
54 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */