Commit 8be4641d authored by Laurențiu Nicola's avatar Laurențiu Nicola

ENH: replace boost::shared_ptr with std::shared_ptr

parent 4842f48c
Pipeline #6787 passed with stages
in 84 minutes and 53 seconds
......@@ -21,15 +21,8 @@
#ifndef otbOGRFeatureWrapper_h
#define otbOGRFeatureWrapper_h
// #include <iosfwd> // std::ostream&
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#include <boost/shared_ptr.hpp>
#pragma GCC diagnostic pop
#else
#include <boost/shared_ptr.hpp>
#endif
#include <memory>
// #include "itkIndent.h", included from field
#include "otbOGRFieldWrapper.h"
#include "otbOGRGeometryWrapper.h"
......@@ -157,12 +150,12 @@ public:
* stored, without introducing a cyclic dependency, nor deporting the fields
* R/W to \c Feature interface.
*/
boost::shared_ptr<OGRFeature>& sptr()
std::shared_ptr<OGRFeature>& sptr()
{
return m_Feature;
}
/** \copydoc Feature::sptr() */
boost::shared_ptr<OGRFeature> const& sptr() const
std::shared_ptr<OGRFeature> const& sptr() const
{
return m_Feature;
}
......@@ -368,7 +361,7 @@ private:
void CheckInvariants() const;
/** Internal pointer to the shared \c OGRFeature.
*/
boost::shared_ptr<OGRFeature> m_Feature;
std::shared_ptr<OGRFeature> m_Feature;
};
......
......@@ -21,8 +21,9 @@
#ifndef otbOGRFieldWrapper_h
#define otbOGRFieldWrapper_h
#include <memory>
#include <string>
#include <boost/shared_ptr.hpp>
class OGRFieldDefn;
class OGRFeature;
#if defined(_MSC_VER)
......@@ -224,7 +225,7 @@ private:
/// Definition of the field.
FieldDefn m_Definition;
/// Link to the actual \c OGRFeature in charge of the fields.
boost::shared_ptr<OGRFeature>& m_Feature;
std::shared_ptr<OGRFeature>& m_Feature;
/** Index of the field according to the feature definition.
* \internal
* All the fields decoding is at the wrong place (\c OGRFeature instead of
......
......@@ -25,17 +25,16 @@
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#include <boost/shared_ptr.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/utility/enable_if.hpp>
#pragma GCC diagnostic pop
#else
#include <boost/shared_ptr.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/utility/enable_if.hpp>
#endif
// #include "itkIndent.h", included from field
#include "otbOGRFeatureWrapper.h"
#include <memory>
#include <string>
// #include "ogr_core.h" // OGRwkbGeometryType, included from feature -> field
......@@ -568,7 +567,7 @@ private:
* unless this is the result of \c ExecuteSQL(). In that case a deleter is set
* to correctly release the layer.
*/
boost::shared_ptr<OGRLayer> m_Layer;
std::shared_ptr<OGRLayer> m_Layer;
bool m_Modifiable;
......
......@@ -50,7 +50,7 @@
namespace
{ // Anonymous namespace
/**\ingroup GeometryInternals
* Deleter for \c boost::shared_ptr<> that doesn't delete.
* Deleter for \c std::shared_ptr<> that doesn't delete.
* This is required for \c OGRLayer s that belong to \c OGRDataSource.
* \internal Unlike OGR, works as a no-op on null geometries.
*/
......
......@@ -24,7 +24,7 @@
#include "itkNumericTraits.h"
#include "otbFunctorImageFilter.h"
#include "vnl/algo/vnl_svd.h"
#include <boost/shared_ptr.hpp>
#include <memory>
namespace otb
{
......@@ -80,7 +80,7 @@ private:
}
typedef vnl_svd<PrecisionType> SVDType;
typedef boost::shared_ptr<SVDType> SVDPointerType;
typedef std::shared_ptr<SVDType> SVDPointerType;
MatrixType m_U;
SVDPointerType m_Svd; // SVD of U
......
......@@ -24,7 +24,7 @@
#include "itkMacro.h"
#include "otbFunctorImageFilter.h"
#include "vnl/algo/vnl_svd.h"
#include <boost/shared_ptr.hpp>
#include <memory>
namespace otb
{
......@@ -62,7 +62,7 @@ public:
private:
typedef vnl_svd<PrecisionType> SVDType;
typedef boost::shared_ptr<SVDType> SVDPointerType;
typedef std::shared_ptr<SVDType> SVDPointerType;
unsigned int m_OutputSize;
SVDPointerType m_Svd;
......
......@@ -28,7 +28,7 @@
#include "itkImageIOBase.h"
#include "OTBImageIOExport.h"
#include <boost/shared_ptr.hpp>
#include <memory>
namespace otb
{
......@@ -234,7 +234,7 @@ private:
virtual void WriteImageInformation() = 0;
virtual void Write(const RegionType& streamRegion) = 0;
virtual bool CanStreamWrite() const = 0;
typedef boost::shared_ptr<SinkBase> Pointer;
typedef std::shared_ptr<SinkBase> Pointer;
virtual itk::ImageRegion<2> GetRegionToWrite() const = 0;
......@@ -266,7 +266,7 @@ private:
void WriteImageInformation() override;
void Write(const RegionType& streamRegion) override;
bool CanStreamWrite() const override;
typedef boost::shared_ptr<Sink> Pointer;
typedef std::shared_ptr<Sink> Pointer;
/** Get the region that should be written. By default this is the largest possible region
* of the input image, but this might be overridden by the box extended filename parameter of
......@@ -282,8 +282,8 @@ private:
};
/** The list of inputs and their associated parameters, built using AddInput */
typedef std::vector<boost::shared_ptr<SinkBase>> SinkListType;
SinkListType m_SinkList;
typedef std::vector<std::shared_ptr<SinkBase>> SinkListType;
SinkListType m_SinkList;
std::vector<RegionType> m_StreamRegionList;
};
......
......@@ -20,7 +20,8 @@
#ifndef otbSharkKMeansMachineLearningModel_h
#define otbSharkKMeansMachineLearningModel_h
#include "boost/shared_ptr.hpp"
#include <memory>
#include "itkLightObject.h"
#include "otbMachineLearningModel.h"
......@@ -163,7 +164,7 @@ private:
shark::Centroids m_Centroids;
/** shark Model could be SoftClusteringModel or HardClusteringModel */
boost::shared_ptr<ClusteringModelType> m_ClusteringModel;
std::shared_ptr<ClusteringModelType> m_ClusteringModel;
};
} // end namespace otb
......
......@@ -21,7 +21,8 @@
#define otbSharkKMeansMachineLearningModel_hxx
#include <fstream>
#include "boost/make_shared.hpp"
#include <utility>
#include "itkMacro.h"
#include "otbSharkKMeansMachineLearningModel.h"
......@@ -52,7 +53,7 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue>::SharkKMeansMachineLe
{
// Default set HardClusteringModel
this->m_ConfidenceIndex = true;
m_ClusteringModel = boost::make_shared<ClusteringModelType>(&m_Centroids);
m_ClusteringModel = std::make_shared<ClusteringModelType>(&m_Centroids);
}
......@@ -72,7 +73,7 @@ void SharkKMeansMachineLearningModel<TInputValue, TOutputValue>::Train()
// Use a Hard Clustering Model for classification
shark::kMeans(data, m_K, m_Centroids, m_MaximumNumberOfIterations);
m_ClusteringModel = boost::make_shared<ClusteringModelType>(&m_Centroids);
m_ClusteringModel = std::make_shared<ClusteringModelType>(&m_Centroids);
}
template <class TInputValue, class TOutputValue>
......
......@@ -32,8 +32,6 @@
#include "otbAtmosphericCorrectionParameters.h"
#include <boost/shared_ptr.hpp>
namespace otb
{
/** \class SpectralResponse
......@@ -68,7 +66,7 @@ public:
typedef TValuePrecision ValuePrecisionType;
typedef std::pair<TPrecision, TValuePrecision> PairType;
// typedef boost::shared_ptr<PairType> PairPointerType;
// typedef std::shared_ptr<PairType> PairPointerType;
typedef typename std::vector<PairType> VectorPairType;
/** Standard image typedef */
......
......@@ -23,7 +23,6 @@
#include "otbProspectModel.h"
#include "otb_boost_expint_header.h"
#include <boost/shared_ptr.hpp>
#include "otbMath.h"
// TODO check EPSILON matlab
......
......@@ -22,7 +22,6 @@
#include "otbSailModel.h"
#include "otb_boost_expint_header.h"
#include <boost/shared_ptr.hpp>
#include "otbMath.h"
// TODO check EPSILON matlab
......
......@@ -16,7 +16,6 @@
#define BOOST_ENABLE_ASSERT_HANDLER
#include <vector>
#include <boost/shared_ptr.hpp>
#define PY_ARRAY_UNIQUE_SYMBOL PyArrayHandle
#include <boost/python.hpp>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment