Fix Iterators prefixes

This commit is contained in:
Simon Marchetto 2013-09-23 10:10:31 +02:00
commit 934fc9b37b
2 changed files with 20 additions and 20 deletions

View file

@ -41,7 +41,7 @@
%fragment("SciSequence_Cont", "header",
fragment="StdTraits",
fragment="SciSwigIterator_T")
fragment="SwigSciIterator_T")
{
%#include <stdio.h>
@ -99,9 +99,9 @@ namespace swig
};
template <class T, class Reference >
struct SciSequence_InputIterator
struct SwigSciSequence_InputIterator
{
typedef SciSequence_InputIterator<T, Reference > self;
typedef SwigSciSequence_InputIterator<T, Reference > self;
typedef std::random_access_iterator_tag iterator_category;
typedef Reference reference;
@ -109,11 +109,11 @@ namespace swig
typedef T* pointer;
typedef int difference_type;
SciSequence_InputIterator()
SwigSciSequence_InputIterator()
{
}
SciSequence_InputIterator(const SwigSciObject& seq, int index)
SwigSciSequence_InputIterator(const SwigSciObject& seq, int index)
: _seq(seq), _index(index)
{
}
@ -203,8 +203,8 @@ namespace swig
typedef int difference_type;
typedef int size_type;
typedef const pointer const_pointer;
typedef SciSequence_InputIterator<T, reference> iterator;
typedef SciSequence_InputIterator<T, const_reference> const_iterator;
typedef SwigSciSequence_InputIterator<T, reference> iterator;
typedef SwigSciSequence_InputIterator<T, const_reference> const_iterator;
SciSequence_Cont(const SwigSciObject& seq) : _seq(seq)
{
@ -301,7 +301,7 @@ namespace swig
if (!SWIG_IsOK(res) || !iter) {
%argument_fail(SWIG_TypeError, "$type", $symname, $argnum);
} else {
swig::SciSwigIterator_T<$type > *iter_t = dynamic_cast<swig::SciSwigIterator_T<$type > *>(iter);
swig::SwigSciIterator_T<$type > *iter_t = dynamic_cast<swig::SwigSciIterator_T<$type > *>(iter);
if (iter_t) {
$1 = iter_t->get_current();
} else {
@ -314,7 +314,7 @@ namespace swig
iterator, reverse_iterator, const_iterator, const_reverse_iterator {
swig::SciSwigIterator *iter = 0;
int res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 0);
$1 = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SciSwigIterator_T<$type > *>(iter) != 0));
$1 = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigSciIterator_T<$type > *>(iter) != 0));
}
%fragment("SciSequence_Cont");

View file

@ -3,7 +3,7 @@
*
* Users can derive form the SciSwigIterator to implemet their
* own iterators. As an example (real one since we use it for STL/STD
* containers), the template SciSwigIterator_T does the
* containers), the template SwigSciIterator_T does the
* implementation for generic C++ iterators.
* ----------------------------------------------------------------------------- */
@ -113,17 +113,17 @@ namespace swig {
}
}
%fragment("SciSwigIterator_T","header",fragment="<stddef.h>",fragment="SciSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") {
%fragment("SwigSciIterator_T","header",fragment="<stddef.h>",fragment="SciSwigIterator",fragment="StdTraits",fragment="StdIteratorTraits") {
namespace swig {
template<typename OutIterator>
class SciSwigIterator_T : public SciSwigIterator
class SwigSciIterator_T : public SciSwigIterator
{
public:
typedef OutIterator out_iterator;
typedef typename std::iterator_traits<out_iterator>::value_type value_type;
typedef SciSwigIterator_T<out_iterator> self_type;
typedef SwigSciIterator_T<out_iterator> self_type;
SciSwigIterator_T(out_iterator curr, SwigSciObject seq)
SwigSciIterator_T(out_iterator curr, SwigSciObject seq)
: SciSwigIterator(seq), current(curr)
{
}
@ -172,17 +172,17 @@ namespace swig {
template<typename OutIterator,
typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
typename FromOper = from_oper<ValueType> >
class SciSwigIteratorOpen_T : public SciSwigIterator_T<OutIterator>
class SciSwigIteratorOpen_T : public SwigSciIterator_T<OutIterator>
{
public:
FromOper from;
typedef OutIterator out_iterator;
typedef ValueType value_type;
typedef SciSwigIterator_T<out_iterator> base;
typedef SwigSciIterator_T<out_iterator> base;
typedef SciSwigIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
SciSwigIteratorOpen_T(out_iterator curr, SwigSciObject seq)
: SciSwigIterator_T<OutIterator>(curr, seq)
: SwigSciIterator_T<OutIterator>(curr, seq)
{
}
@ -215,17 +215,17 @@ namespace swig {
template<typename OutIterator,
typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
typename FromOper = from_oper<ValueType> >
class SciSwigIteratorClosed_T : public SciSwigIterator_T<OutIterator>
class SciSwigIteratorClosed_T : public SwigSciIterator_T<OutIterator>
{
public:
FromOper from;
typedef OutIterator out_iterator;
typedef ValueType value_type;
typedef SciSwigIterator_T<out_iterator> base;
typedef SwigSciIterator_T<out_iterator> base;
typedef SciSwigIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
SciSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, SwigSciObject seq)
: SciSwigIterator_T<OutIterator>(curr, seq), begin(first), end(last)
: SwigSciIterator_T<OutIterator>(curr, seq), begin(first), end(last)
{
}