Commit fbe6bd80 authored by Luc Hermitte's avatar Luc Hermitte

REFAC: OTB-134/OGR -> extract is_contiguous

parent 7a4a64ac
......@@ -36,6 +36,7 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/OssimAdapters
${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/TinyXMLAdapters
${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/OGRAdapters
${OTB_SOURCE_DIR}/Code/UtilitiesAdapters
${OTB_SOURCE_DIR}/Code/Visu
${OTB_SOURCE_DIR}/Code/Visualization
${OTB_BINARY_DIR}/Code/Visualization
......
......@@ -2,3 +2,4 @@ ADD_SUBDIRECTORY(CurlAdapters)
ADD_SUBDIRECTORY(OssimAdapters)
ADD_SUBDIRECTORY(TinyXMLAdapters)
ADD_SUBDIRECTORY(OGRAdapters)
ADD_SUBDIRECTORY(boost)
......@@ -34,9 +34,9 @@ struct GeometryDeleter
/**\ingroup Geometry
* \defgroup OGRGeometryWrapper OGRGeometry Wrappers
* Helper definition to hangle \c OGRGeometry objects.
* %Helper definition to handle \c OGRGeometry objects.
*
* @note %OTB doesn't provide anything on top of \c OGRGeometryFactory to create
* \note %OTB doesn't provide anything on top of \c OGRGeometryFactory to create
* new factories. Please, never create new \c OGRGeometry by hand with
* <tt>new</tt> operator as there is no garanty they'll get destroyed within the
* proper memory context when released from an owning \c OGRFeature.
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __is_contiguous_h
#define __is_contiguous_h
/**\ingroup boost
* \file is_contiguous.h
* \since OTB v 3.14.0
*
* \note This type traits is likelly to appear in boost and in C++ TR2 at some
* point in time. It is used in order to (micro-)optimize the interfacing of OTB
* and OGR.
* \note The filename however does not follow boost naming policy yet.
*
* \sa http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3350.html about
* \c contiguous_iterator_tag.
*
* \todo What licence to use ?
*/
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_pointer.hpp>
namespace std {
// forward declarations
template <typename T, std::size_t N> class array;
template <typename T, typename Allocator> class vector;
} // std namespace
namespace boost {
/**\ingroup boost
* \brief Type-traits: are the elements contiguous in the range.
* \note This type traits is likelly to appear in boost and in C++ TR2 at some
* point in time. It is used in order to (micro-)optimize the interfacing of OTB
* and OGR.
* \note As a consequence, it follows C++ standard and boost naming policy.
*
* \sa http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3350.html about
* \c contiguous_iterator_tag.
*
*/
template <typename Range> struct is_contiguous
{ enum {value = is_array<Range>::value || is_pointer<Range>::value}; };
// forward declarations
template <typename T, std::size_t N> class array;
template <typename T, std::size_t N, typename CloneAllocator> class ptr_array;
template <typename T, typename CloneAllocator, typename Allocator> class ptr_vector;
template <typename T, typename Allocator> struct is_contiguous<std::vector<T, Allocator> >
{ enum {value = true}; };
template <typename T, std::size_t N> struct is_contiguous<boost::array<T, N> >
{ enum {value = true}; };
template <typename T, std::size_t N, typename CA> struct is_contiguous<boost::ptr_array<T, N, CA> >
{ enum {value = true}; };
template <typename T, typename CA, typename A> struct is_contiguous<boost::ptr_vector<T, CA, A> >
{ enum {value = true}; };
} // boost namespace
#endif // __is_contiguous_h
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