Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
3f2d0cb8
Commit
3f2d0cb8
authored
Feb 15, 2021
by
Laurențiu Nicola
Browse files
Merge branch 'std-foreach' into 'develop'
ENH: Replace Boost.Foreach with standard C++ for See merge request
!791
parents
e76c2d50
44d9f7e8
Pipeline
#6862
passed with stages
in 19 minutes and 44 seconds
Changes
8
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Modules/Adapters/BoostAdapters/include/otb_boost_tokenizer_header.h
View file @
3f2d0cb8
...
...
@@ -24,11 +24,9 @@
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <boost/foreach.hpp>
#include <boost/tokenizer.hpp>
#pragma GCC diagnostic pop
#else
#include <boost/foreach.hpp>
#include <boost/tokenizer.hpp>
#endif
...
...
Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h
View file @
3f2d0cb8
...
...
@@ -567,16 +567,6 @@ private:
}
}
// end namespace otb::ogr
#if 0
// Either this, or inheriting from noncopyable is required for DataSource to be
// compatible with BOOST_FOREACH
namespace boost { namespace foreach {
template<typename T> struct is_noncopyable; // forward declaration
template <>
struct is_noncopyable<otb::ogr::DataSource> : mpl::true_ {};
}}
#endif
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbOGRDataSourceWrapper.hxx"
#endif
...
...
Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx
View file @
3f2d0cb8
...
...
@@ -25,10 +25,6 @@
#include <numeric>
#include <algorithm>
#include <clocale> // toupper
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
// ITK includes
#include "itkMacro.h" // itkExceptionMacro
#include "itkExceptionObject.h"
...
...
@@ -99,8 +95,8 @@ char const* DeduceDriverName(std::string filename)
}
const
std
::
string
extension
=
itksys
::
SystemTools
::
GetFilenameLastExtension
(
filename
);
ExtensionDriverAssociation
const
*
whichIt
=
std
::
find_if
(
boo
st
::
begin
(
k_ExtensionDriverMap
),
boo
st
::
end
(
k_ExtensionDriverMap
),
[
&
](
auto
const
&
x
)
{
return
x
.
Matches
(
extension
);
});
if
(
whichIt
==
boo
st
::
end
(
k_ExtensionDriverMap
))
std
::
find_if
(
st
d
::
begin
(
k_ExtensionDriverMap
),
st
d
::
end
(
k_ExtensionDriverMap
),
[
&
](
auto
const
&
x
)
{
return
x
.
Matches
(
extension
);
});
if
(
whichIt
==
st
d
::
end
(
k_ExtensionDriverMap
))
{
return
nullptr
;
// nothing found
}
...
...
@@ -692,7 +688,7 @@ std::string otb::ogr::DataSource::GetGlobalExtent(double& ulx, double& uly, doub
void
otb
::
ogr
::
DataSource
::
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
{
assert
(
m_DataSource
&&
"Datasource not initialized"
);
BOOST_FOREACH
(
Layer
const
&
l
,
*
this
)
for
(
const
Layer
&
l
:
*
this
)
{
l
.
PrintSelf
(
os
,
indent
);
}
...
...
Modules/Adapters/GdalAdapters/src/otbOGRFeatureWrapper.cxx
View file @
3f2d0cb8
...
...
@@ -23,8 +23,6 @@
/*===============================[ Includes ]================================*/
/*===========================================================================*/
#include "otbOGRFeatureWrapper.h"
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
...
...
Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx
View file @
3f2d0cb8
...
...
@@ -24,8 +24,6 @@
/*===========================================================================*/
#include <cassert>
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
...
...
@@ -223,7 +221,7 @@ void otb::ogr::Layer::PrintSelf(std::ostream& os, itk::Indent indent) const
{
os
<<
"Layer <"
<<
GetName
()
<<
"> of "
<<
OGRGeometryTypeToName
(
GetGeomType
())
<<
"
\n
"
;
indent
=
indent
.
GetNextIndent
();
BOOST_FOREACH
(
Feature
f
,
*
this
)
for
(
Feature
f
:
*
this
)
{
f
.
PrintSelf
(
os
,
indent
);
}
...
...
Modules/Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx
View file @
3f2d0cb8
...
...
@@ -33,7 +33,6 @@
#else
#include <boost/test/unit_test.hpp>
#endif
#include <boost/foreach.hpp>
#include "otb_boost_string_header.h"
#include "itksys/SystemTools.hxx"
#include "otbOGRDataSourceWrapper.h"
...
...
@@ -821,7 +820,7 @@ BOOST_AUTO_TEST_CASE(Add_n_Read_Geometries)
BOOST_CHECK_EQUAL
(
l
.
GetFeatureCount
(
false
),
20
);
int
u
=
-
10
;
BOOST_FOREACH
(
ogr
::
Feature
f
,
l
)
for
(
ogr
::
Feature
f
:
l
)
{
const
OGRPoint
ref
(
u
,
u
);
ogr
::
UniqueGeometryPtr
p
=
f
.
StealGeometry
();
...
...
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRDataFilter.hxx
View file @
3f2d0cb8
...
...
@@ -24,7 +24,6 @@
#include "otbPersistentImageToOGRDataFilter.h"
#include "otbStopwatch.h"
#include <boost/foreach.hpp>
#include <stdio.h>
#include "otbMacro.h"
#include "otbOGRHelpers.h"
...
...
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.hxx
View file @
3f2d0cb8
...
...
@@ -24,7 +24,6 @@
#include "otbPersistentImageToOGRLayerFilter.h"
#include "otbStopwatch.h"
#include <boost/foreach.hpp>
#include <stdio.h>
#include "otbMacro.h"
#include "otbOGRHelpers.h"
...
...
@@ -91,10 +90,10 @@ void PersistentImageToOGRLayerFilter<TImage>::Initialize()
oSRSESRI
.
morphFromESRI
();
#if GDAL_VERSION_NUM >= 3000000 // importFromWkt is const-correct in GDAL 3
// Use the same mapping strategy as the one in the datasource.
auto
mappingStrategy
=
m_OGRLayer
.
GetSpatialRef
()
->
GetAxisMappingStrategy
();
oSRS
.
SetAxisMappingStrategy
(
mappingStrategy
);
oSRSESRI
.
SetAxisMappingStrategy
(
mappingStrategy
);
// Use the same mapping strategy as the one in the datasource.
auto
mappingStrategy
=
m_OGRLayer
.
GetSpatialRef
()
->
GetAxisMappingStrategy
();
oSRS
.
SetAxisMappingStrategy
(
mappingStrategy
);
oSRSESRI
.
SetAxisMappingStrategy
(
mappingStrategy
);
#endif
if
(
m_OGRLayer
.
GetSpatialRef
()
&&
(
!
oSRS
.
IsSame
(
m_OGRLayer
.
GetSpatialRef
())
&&
!
oSRSESRI
.
IsSame
(
m_OGRLayer
.
GetSpatialRef
())))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment