Salome HOME
Auto-formatting according to the defined code standard.
[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()
22   {
23     myImpl = 0;
24   }
25
26   /// Constructor by the implementation pointer (used for internal needs)
27   virtual ModelAPI_Interface(void* theImpl)
28   {
29     myImpl = theImpl;
30   }
31
32   /// Copy-constructor
33   virtual ModelAPI_Interface(ModelAPI_Interface& theOrig)
34   {
35     myImpl = theOrig.theImpl;
36     Duplicate();
37   }
38
39   virtual ModelAPI_Interface& operator=(ModelAPI_Interface& const theOrig)
40   { myImpl = theOrig.theImpl; Duplicate(); return *this;}
41
42   /// Duplicates the objet pointed by myImpl (loosing the old one)
43   virtual void Duplicate() = 0;
44
45 };
46
47 #endif