- /// Returns the pointer to the implementation
- void* implementation();
- /// Updates the implementation (deletes the old one)
- void setImplementation(void* theImpl);
+ /// Destructor
+ GEOMAPI_EXPORT virtual ~GeomAPI_Interface();
+
+ /// Returns the pointer to the impl
+ template<class T> inline T* implPtr()
+ {
+ return static_cast<T*>(myImpl.get());
+ }
+ /// Returns the pointer to the impl
+ template<class T> inline const T* implPtr() const
+ {
+ return static_cast<T*>(myImpl.get());
+ }
+ /// Returns the reference object of the impl
+ template<class T> inline const T& impl() const
+ {
+ return *(static_cast<T*>(myImpl.get()));
+ }
+ /// Updates the impl (deletes the old one)
+ template<class T> inline void setImpl(T* theImpl)
+ {
+ myImpl.reset(theImpl);
+ }
+
+ /// Returns true if the impl is empty
+ GEOMAPI_EXPORT bool empty() const;