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
David Youssefi
otb
Commits
923bdfa6
Commit
923bdfa6
authored
12 years ago
by
Luc Hermitte
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: OTB-134/OGR ...
parent
cf6d4087
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/otbOGRFieldWrapper.cxx
+3
-2
3 additions, 2 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.cxx
Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.h
+9
-23
9 additions, 23 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.h
with
12 additions
and
25 deletions
Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.cxx
+
3
−
2
View file @
923bdfa6
...
...
@@ -28,8 +28,8 @@
/*===========================================================================*/
/*===========================[ Static Assertions ]===========================*/
/*===========================================================================*/
namespace
types_
{
namespace
otb
{
namespace
ogr
{
namespace
metaprog
{
BOOST_STATIC_ASSERT
(
!
(
boost
::
is_same
<
MemberGetterPtr
<
int
,
&
OGRFeature
::
GetFieldAsInteger
>
,
MemberGetterPtr
<
double
,
&
OGRFeature
::
GetFieldAsDouble
>
...
...
@@ -67,6 +67,7 @@ BOOST_STATIC_ASSERT(!(boost::is_same<
>::
value
));
}
}
}
// end namespace otb::ogr
/*===========================================================================*/
/*===============================[ FieldDefn ]===============================*/
...
...
This diff is collapsed.
Click to expand it.
Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.h
+
9
−
23
View file @
923bdfa6
...
...
@@ -37,24 +37,9 @@ class OGRFieldDefn;
#include
"itkIndent.h"
#include
<cassert>
#if 0
#include <iomanip>
template <typename RT, typename CT> void print_adress(RT (CT::*p)(int))
{
unsigned char const * first = reinterpret_cast<unsigned char *>(&p);
unsigned char const * last = reinterpret_cast<unsigned char *>(&p + 1);
for (; first != last; ++first)
{
std::cout << std::hex << std::setw(2) << std::setfill('0')
<< (int)*first << ' ';
}
std::cout << "\n";
}
#endif
namespace
otb
{
namespace
ogr
{
namespace
types_
{
// namespace
types_
namespace
metaprog
{
// namespace
metaprog
using
namespace
boost
::
mpl
;
typedef
boost
::
mpl
::
map
<
pair
<
int
,
int_
<
OFTInteger
>
>
...
...
@@ -107,9 +92,8 @@ typedef map
// , pair<int_<OFTStringList>, MemberGetterPtr<char const*, &OGRFeature::GetFieldAsString, std::string> >
>
FieldGetters_Map
;
}
// namespace
types_
}
// namespace
metaprog
namespace
otb
{
namespace
ogr
{
class
FieldDefn
{
public:
...
...
@@ -185,11 +169,11 @@ public:
#endif
template
<
typename
T
>
T
GetValue
()
const
{
const
int
VALUE
=
boost
::
mpl
::
at
<
types_
::
FieldType_Map
,
T
>::
type
::
value
;
typedef
typename
boost
::
mpl
::
at
<
types_
::
FieldType_Map
,
T
>::
type
Kind
;
const
int
VALUE
=
boost
::
mpl
::
at
<
metaprog
::
FieldType_Map
,
T
>::
type
::
value
;
typedef
typename
boost
::
mpl
::
at
<
metaprog
::
FieldType_Map
,
T
>::
type
Kind
;
BOOST_STATIC_ASSERT
(
!
(
boost
::
is_same
<
Kind
,
boost
::
mpl
::
void_
>::
value
));
assert
(
m_Definition
.
GetType
()
==
Kind
::
value
);
typedef
typename
boost
::
mpl
::
at
<
types_
::
FieldGetters_Map
,
Kind
>::
type
GetterType
;
typedef
typename
boost
::
mpl
::
at
<
metaprog
::
FieldGetters_Map
,
Kind
>::
type
GetterType
;
BOOST_STATIC_ASSERT
(
!
(
boost
::
is_same
<
GetterType
,
boost
::
mpl
::
void_
>::
value
));
assert
(
m_index
>=
0
&&
m_index
<
m_Feature
->
GetFieldCount
());
return
GetterType
::
call
(
*
m_Feature
,
m_index
);
...
...
@@ -199,7 +183,9 @@ public:
private
:
FieldDefn
m_Definition
;
boost
::
shared_ptr
<
OGRFeature
>
&
m_Feature
;
size_t
m_index
;
// all the fields decoding is at the wrong place (OGRFeature instead of OGRField)
// all the fields decoding is at the wrong place (OGRFeature instead of
// OGRField) => need for an index
size_t
m_index
;
};
}
}
// end namespace otb::ogr
...
...
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