20 #ifndef GeomAPI_Interface_H_
21 #define GeomAPI_Interface_H_
33 void GeomAPI_deleter(
void* p ) {
34 delete reinterpret_cast<T*
>(p);
40 std::shared_ptr<char> myImpl;
49 myImpl = std::shared_ptr<char>(
reinterpret_cast<char*
>(theImpl), GeomAPI_deleter<T>);
58 return reinterpret_cast<T*
>(myImpl.get());
61 template<
class T>
inline const T*
implPtr()
const
63 return reinterpret_cast<T*
>(myImpl.get());
66 template<
class T>
inline const T&
impl()
const
68 return *(
reinterpret_cast<T*
>(myImpl.get()));
71 template<
class T>
inline void setImpl(T* theImpl)
73 myImpl = std::shared_ptr<char>(
reinterpret_cast<char*
>(theImpl), GeomAPI_deleter<T>);
77 GEOMAPI_EXPORT
bool empty()
const;
General base class for all interfaces in this package.
Definition: GeomAPI_Interface.h:38
T * implPtr()
Returns the pointer to the impl.
Definition: GeomAPI_Interface.h:56
virtual GEOMAPI_EXPORT ~GeomAPI_Interface()
Destructor.
Definition: GeomAPI_Interface.cpp:27
GEOMAPI_EXPORT bool empty() const
Returns true if the impl is empty.
Definition: GeomAPI_Interface.cpp:32
GeomAPI_Interface(T *theImpl)
Constructor by the impl pointer (used for internal needs)
Definition: GeomAPI_Interface.h:47
void setImpl(T *theImpl)
Updates the impl (deletes the old one)
Definition: GeomAPI_Interface.h:71
const T * implPtr() const
Returns the pointer to the impl.
Definition: GeomAPI_Interface.h:61
const T & impl() const
Returns the reference object of the impl.
Definition: GeomAPI_Interface.h:66
GEOMAPI_EXPORT GeomAPI_Interface()
None - constructor.
Definition: GeomAPI_Interface.cpp:22