Salome HOME
Fix compilation on Windows
[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 explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
27   /// Destructor
28   MODELHIGHAPI_EXPORT virtual ~ModelHighAPI_Interface();
29
30   /// Return ModelAPI_Feature
31   MODELHIGHAPI_EXPORT std::shared_ptr<ModelAPI_Feature> feature() const;
32
33   /// Shortcut for feature()->getKind()
34   MODELHIGHAPI_EXPORT const std::string& getKind();
35
36   /// Shortcut for feature()->execute()
37   MODELHIGHAPI_EXPORT void execute();
38
39   /// Throw exception to event loop
40   MODELHIGHAPI_EXPORT void throwException(const std::string & theDescription);
41
42 protected:
43   std::shared_ptr<ModelAPI_Feature> myFeature;
44 };
45
46 //--------------------------------------------------------------------------------------
47 //--------------------------------------------------------------------------------------
48 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */