]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_Interface.hxx
Salome HOME
377b7eab74d5c2aa6027e20f30cf7ab10448a1fe
[modules/shaper.git] / src / ModelAPI / ModelAPI_Interface.hxx
1 // File:        ModelAPI_Interface.hxx
2 // Created:     20 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_Interface_HeaderFile
6 #define ModelAPI_Interface_HeaderFile
7
8 #include <ModelAPI.hxx>
9
10 /**\class ModelAPI_Interface
11  * \ingroup DataModel
12  * \brief General base class for all interfaces in this package
13  */
14
15 class MODELAPI_EXPORT ModelAPI_Interface
16 {
17   void* myImpl; ///< pointer to the internal implementation object
18
19 public:
20   /// None - constructor
21   virtual ModelAPI_Interface() {myImpl = 0;}
22
23   /// Constructor by the implementation pointer (used for internal needs)
24   virtual ModelAPI_Interface(void* theImpl) {myImpl = theImpl;}
25
26   /// Copy-constructor
27   virtual ModelAPI_Interface(ModelAPI_Interface& theOrig) 
28   {myImpl = theOrig.theImpl; Duplicate();}
29
30   virtual ModelAPI_Interface& operator=(ModelAPI_Interface& const theOrig)
31   {myImpl = theOrig.theImpl; Duplicate(); return *this;}
32
33   /// Duplicates the objet pointed by myImpl (loosing the old one)
34   virtual void Duplicate() = 0;
35
36 };
37
38 #endif