Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #2059 point in sketch is created not on selected line of external sketchPlane...
[modules/shaper.git]
/
src
/
GeomAPI
/
GeomAPI_Interface.h
diff --git
a/src/GeomAPI/GeomAPI_Interface.h
b/src/GeomAPI/GeomAPI_Interface.h
index fd5c83fce11ef200fe7d9faafa5a4e2dc534f143..27b8220129d590ed378e3f818b0f6c8932446c18 100644
(file)
--- a/
src/GeomAPI/GeomAPI_Interface.h
+++ b/
src/GeomAPI/GeomAPI_Interface.h
@@
-16,10
+16,15
@@
* \brief General base class for all interfaces in this package
*/
* \brief General base class for all interfaces in this package
*/
+template <typename T>
+void GeomAPI_deleter( void* p ) {
+ delete reinterpret_cast<T*>(p);
+}
+
class GeomAPI_Interface
{
private:
class GeomAPI_Interface
{
private:
- std::shared_ptr<
void
> myImpl; ///< pointer to the internal impl object
+ std::shared_ptr<
char
> myImpl; ///< pointer to the internal impl object
public:
/// None - constructor
public:
/// None - constructor
@@
-28,7
+33,7
@@
class GeomAPI_Interface
/// Constructor by the impl pointer (used for internal needs)
template<class T> explicit GeomAPI_Interface(T* theImpl)
{
/// Constructor by the impl pointer (used for internal needs)
template<class T> explicit GeomAPI_Interface(T* theImpl)
{
- myImpl
.reset(theImpl
);
+ myImpl
= std::shared_ptr<char>(reinterpret_cast<char*>(theImpl), GeomAPI_deleter<T>
);
}
/// Destructor
}
/// Destructor
@@
-37,22
+42,22
@@
class GeomAPI_Interface
/// Returns the pointer to the impl
template<class T> inline T* implPtr()
{
/// Returns the pointer to the impl
template<class T> inline T* implPtr()
{
- return
static
_cast<T*>(myImpl.get());
+ return
reinterpret
_cast<T*>(myImpl.get());
}
/// Returns the pointer to the impl
template<class T> inline const T* implPtr() const
{
}
/// Returns the pointer to the impl
template<class T> inline const T* implPtr() const
{
- return
static
_cast<T*>(myImpl.get());
+ return
reinterpret
_cast<T*>(myImpl.get());
}
/// Returns the reference object of the impl
template<class T> inline const T& impl() const
{
}
/// Returns the reference object of the impl
template<class T> inline const T& impl() const
{
- return *(
static
_cast<T*>(myImpl.get()));
+ return *(
reinterpret
_cast<T*>(myImpl.get()));
}
/// Updates the impl (deletes the old one)
template<class T> inline void setImpl(T* theImpl)
{
}
/// Updates the impl (deletes the old one)
template<class T> inline void setImpl(T* theImpl)
{
- myImpl
.reset(theImpl
);
+ myImpl
= std::shared_ptr<char>(reinterpret_cast<char*>(theImpl), GeomAPI_deleter<T>
);
}
/// Returns true if the impl is empty
}
/// Returns true if the impl is empty