1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Interface.hxx
4 // Created: 23 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef GeomAPI_Interface_H_
8 #define GeomAPI_Interface_H_
12 /**\class GeomAPI_Interface
14 * \brief General base class for all interfaces in this package
17 class GEOMAPI_EXPORT GeomAPI_Interface
20 void* myImpl; ///< pointer to the internal impl object
23 /// None - constructor
26 /// Constructor by the impl pointer (used for internal needs)
27 GeomAPI_Interface(void* theImpl);
30 virtual ~GeomAPI_Interface();
32 /// Returns the pointer to the impl
33 template<class T> inline T* implPtr()
35 return static_cast<T*>(myImpl);
37 /// Returns the reference object of the impl
38 template<class T> inline const T& impl()
40 return *(static_cast<T*>(myImpl));
42 /// Updates the impl (deletes the old one)
43 void setImpl(void* theImpl);