Salome HOME
Cleare Macros for easy atribute initialization in C++HighAPI interfaces
[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 <memory>
12 #include <string>
13 //--------------------------------------------------------------------------------------
14 class ModelAPI_Feature;
15 //--------------------------------------------------------------------------------------
16 /**\class ModelHighAPI_Interface
17  * \ingroup CPPHighAPI
18  * \brief Base class for feature interfaces
19  */
20 class ModelHighAPI_Interface
21 {
22 public:
23   /// Constructor
24   explicit ModelHighAPI_Interface(const std::shared_ptr<ModelAPI_Feature> & theFeature);
25   /// Destructor
26   virtual ~ModelHighAPI_Interface();
27
28   /// Return ModelAPI_Feature
29   std::shared_ptr<ModelAPI_Feature> feature() const;
30
31   /// Shortcut for feature()->getKind()
32   const std::string& getKind();
33
34   /// Shortcut for feature()->execute()
35   void execute();
36
37   /// Throw exception to event loop
38   void throwException(const std::string & theDescription);
39
40 protected:
41   std::shared_ptr<ModelAPI_Feature> myFeature;
42 };
43
44 //--------------------------------------------------------------------------------------
45 //--------------------------------------------------------------------------------------
46 #endif /* SRC_MODELHIGHAPI_MODELHIGHAPI_INTERFACE_H_ */