From c5f847b188975119a8f06a274987564ac2cbbd48 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Thu, 20 Mar 2014 15:42:11 +0100 Subject: [PATCH] Fix usage of Boost smart pointers for compatibility with Boost >= 1.53 --- src/DF/DF_definitions.hxx | 35 ------------------- src/DF/testDF.cxx | 1 + .../SALOMEDSClient_definitions.hxx | 6 ++-- .../SALOMEDSImpl_AttributeLocalID.cxx | 1 + ...ALOMEDSImpl_AttributeSequenceOfInteger.cxx | 1 + .../SALOMEDSImpl_AttributeSequenceOfReal.cxx | 1 + .../SALOMEDSImpl_AttributeStudyProperties.cxx | 1 + .../SALOMEDSImpl_GenericVariable.cxx | 1 + 8 files changed, 9 insertions(+), 38 deletions(-) diff --git a/src/DF/DF_definitions.hxx b/src/DF/DF_definitions.hxx index 062775c09..e3f163f0e 100644 --- a/src/DF/DF_definitions.hxx +++ b/src/DF/DF_definitions.hxx @@ -32,41 +32,6 @@ #include #include -#include - -template class df_shared_ptr: public boost::shared_ptr -{ -public: - df_shared_ptr() {} - - template - explicit df_shared_ptr(Y * p) - { - boost::shared_ptr::reset(p); - } - - template - df_shared_ptr(df_shared_ptr const & r): - boost::shared_ptr(r,boost::detail::dynamic_cast_tag()) - {} - - template - df_shared_ptr & operator=(df_shared_ptr const & r) - { - df_shared_ptr(r).swap(*this); - return *this; - } - - template df_shared_ptr& operator()(Y * p) // Y must be complete - { - if(T* pt = dynamic_cast(p)) - boost::shared_ptr::reset(pt); - else - boost::throw_exception(std::bad_cast()); - return *this; - } - -}; # if defined(WIN32) && !defined(HAVE_NO_DLL) diff --git a/src/DF/testDF.cxx b/src/DF/testDF.cxx index e9a2f31ac..9c4ba6393 100644 --- a/src/DF/testDF.cxx +++ b/src/DF/testDF.cxx @@ -35,6 +35,7 @@ #include "DF_ChildIterator.hxx" #ifndef WIN32 +#include #include #include #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx index ba62dc855..3d67dfcd6 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx @@ -45,12 +45,12 @@ public: { boost::shared_ptr::reset(p); } - + template clt_shared_ptr(clt_shared_ptr const & r): - boost::shared_ptr(r,boost::detail::dynamic_cast_tag()) + boost::shared_ptr(boost::dynamic_pointer_cast(r)) {} - + template clt_shared_ptr & operator=(clt_shared_ptr const & r) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx index 1b4e2acf8..493d7024f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx @@ -25,6 +25,7 @@ // Module : SALOME // #include "SALOMEDSImpl_AttributeLocalID.hxx" +#include //======================================================================= //function : GetID diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx index caa77254e..0762725e1 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx @@ -26,6 +26,7 @@ // #include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx" #include +#include //======================================================================= //function : GetID diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx index 05052ad74..6c7bc5568 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx @@ -26,6 +26,7 @@ // #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx" #include +#include //======================================================================= //function : GetID diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx index feb5907ca..ead169e3b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx @@ -26,6 +26,7 @@ // #include "SALOMEDSImpl_AttributeStudyProperties.hxx" #include +#include const std::string& SALOMEDSImpl_AttributeStudyProperties::GetID() { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx index 80373654a..fe847ed61 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx @@ -26,6 +26,7 @@ #include "SALOMEDSImpl_Study.hxx" #include +#include //============================================================================ -- 2.39.2