Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
5539af24
Commit
5539af24
authored
12 years ago
by
Luc Hermitte
Browse files
Options
Downloads
Patches
Plain Diff
ENH: OTB-134/OGR first draft of layers iterator
parent
93f5e80a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+6
-6
6 additions, 6 deletions
...UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
+25
-3
25 additions, 3 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
with
31 additions
and
9 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx
+
6
−
6
View file @
5539af24
...
...
@@ -124,16 +124,16 @@ otb::ogr::DataSource::New(OGRDataSource * source)
/*===========================================================================*/
otb
::
ogr
::
DataSource
::
const_iterator
otb
::
ogr
::
DataSource
::
cbegin
()
const
{
//
return const_iterator(*this, 0);
assert
(
!
"not-ready"
);
return
const_iterator
();
return
const_iterator
(
*
this
,
0
);
//
assert(!"not-ready");
//
return const_iterator();
}
otb
::
ogr
::
DataSource
::
const_iterator
otb
::
ogr
::
DataSource
::
cend
()
const
{
//
return const_iterator(*this, GetLayersCount());
assert
(
!
"not-ready"
);
return
const_iterator
();
return
const_iterator
(
*
this
,
GetLayersCount
());
//
assert(!"not-ready");
//
return const_iterator();
}
otb
::
ogr
::
DataSource
::
iterator
otb
::
ogr
::
DataSource
::
begin
()
...
...
This diff is collapsed.
Click to expand it.
Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.h
+
25
−
3
View file @
5539af24
...
...
@@ -20,6 +20,10 @@
#include
<string>
// to implement copy_const
#include
<boost/mpl/if.hpp>
#include
<boost/type_traits/add_const.hpp>
#include
<boost/type_traits/is_const.hpp>
#include
"itkVector.h"
#include
"itkPoint.h"
...
...
@@ -247,8 +251,26 @@ public:
:
public
boost
::
iterator_facade
<
layer_iter
<
Value
>
,
Value
,
boost
::
random_access_traversal_tag
>
{
struct
enabler
{};
/** Const-synchronized type of the \c DataSource container.
* \internal
* The definition of a new series of functions \c boost::copy_const,
* \c boost::copy_cv, etc have been <a
* href="http://lists.boost.org/Archives/boost/2010/03/162526.php">discussed
* on boost mailing-list</a>. However nothing seems to have been undertaken
* in this way, even if a <a
* href="https://svn.boost.org/trac/boost/ticket/3970">ticket</a> has been
* opened.
*
* So here is the hard-coded result of what \c boost::copy_const would have
* given in order to avoid any licensing issue.
*/
typedef
typename
boost
::
mpl
::
if_
<
boost
::
is_const
<
Value
>
,
otb
::
ogr
::
DataSource
const
,
otb
::
ogr
::
DataSource
>::
type
container_type
;
public
:
layer_iter
(
otb
::
ogr
::
DataSourc
e
&
datasource
,
size_t
index
)
layer_iter
(
container_typ
e
&
datasource
,
size_t
index
)
:
m_DataSource
(
&
datasource
),
m_index
(
index
)
{}
layer_iter
()
:
m_DataSource
(
0
),
m_index
(
0
)
{}
...
...
@@ -279,8 +301,8 @@ public:
return
m_DataSource
->
GetLayerUnchecked
(
m_index
);
}
otb
::
ogr
::
DataSourc
e
*
m_DataSource
;
size_t
m_index
;
container_typ
e
*
m_DataSource
;
size_t
m_index
;
};
template
<
class
>
friend
class
layer_iter
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment