Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
44d9f7e8
Commit
44d9f7e8
authored
Feb 09, 2021
by
Laurențiu Nicola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Replace Boost.Foreach with C++ for
parent
e79bebec
Pipeline
#6797
passed with stages
in 155 minutes and 32 seconds
Changes
8
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
32 deletions
+9
-32
Modules/Adapters/BoostAdapters/include/otb_boost_tokenizer_header.h
...apters/BoostAdapters/include/otb_boost_tokenizer_header.h
+0
-2
Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h
...s/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h
+0
-10
Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx
...les/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx
+3
-7
Modules/Adapters/GdalAdapters/src/otbOGRFeatureWrapper.cxx
Modules/Adapters/GdalAdapters/src/otbOGRFeatureWrapper.cxx
+0
-2
Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx
Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx
+1
-3
Modules/Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx
...Adapters/GdalAdapters/test/otbOGRDataSourceWrapperNew.cxx
+1
-2
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRDataFilter.hxx
.../Conversion/include/otbPersistentImageToOGRDataFilter.hxx
+0
-1
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.hxx
...Conversion/include/otbPersistentImageToOGRLayerFilter.hxx
+4
-5
No files found.
Modules/Adapters/BoostAdapters/include/otb_boost_tokenizer_header.h
View file @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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 @
44d9f7e8
...
...
@@ -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
Markdown
is supported
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