Fix Iterators prefixes
This commit is contained in:
parent
b7064539d0
commit
934fc9b37b
2 changed files with 20 additions and 20 deletions
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
%fragment("SciSequence_Cont", "header",
|
%fragment("SciSequence_Cont", "header",
|
||||||
fragment="StdTraits",
|
fragment="StdTraits",
|
||||||
fragment="SciSwigIterator_T")
|
fragment="SwigSciIterator_T")
|
||||||
{
|
{
|
||||||
%#include <stdio.h>
|
%#include <stdio.h>
|
||||||
|
|
||||||
|
|
@ -99,9 +99,9 @@ namespace swig
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class Reference >
|
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 std::random_access_iterator_tag iterator_category;
|
||||||
typedef Reference reference;
|
typedef Reference reference;
|
||||||
|
|
@ -109,11 +109,11 @@ namespace swig
|
||||||
typedef T* pointer;
|
typedef T* pointer;
|
||||||
typedef int difference_type;
|
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)
|
: _seq(seq), _index(index)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -203,8 +203,8 @@ namespace swig
|
||||||
typedef int difference_type;
|
typedef int difference_type;
|
||||||
typedef int size_type;
|
typedef int size_type;
|
||||||
typedef const pointer const_pointer;
|
typedef const pointer const_pointer;
|
||||||
typedef SciSequence_InputIterator<T, reference> iterator;
|
typedef SwigSciSequence_InputIterator<T, reference> iterator;
|
||||||
typedef SciSequence_InputIterator<T, const_reference> const_iterator;
|
typedef SwigSciSequence_InputIterator<T, const_reference> const_iterator;
|
||||||
|
|
||||||
SciSequence_Cont(const SwigSciObject& seq) : _seq(seq)
|
SciSequence_Cont(const SwigSciObject& seq) : _seq(seq)
|
||||||
{
|
{
|
||||||
|
|
@ -301,7 +301,7 @@ namespace swig
|
||||||
if (!SWIG_IsOK(res) || !iter) {
|
if (!SWIG_IsOK(res) || !iter) {
|
||||||
%argument_fail(SWIG_TypeError, "$type", $symname, $argnum);
|
%argument_fail(SWIG_TypeError, "$type", $symname, $argnum);
|
||||||
} else {
|
} 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) {
|
if (iter_t) {
|
||||||
$1 = iter_t->get_current();
|
$1 = iter_t->get_current();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -314,7 +314,7 @@ namespace swig
|
||||||
iterator, reverse_iterator, const_iterator, const_reverse_iterator {
|
iterator, reverse_iterator, const_iterator, const_reverse_iterator {
|
||||||
swig::SciSwigIterator *iter = 0;
|
swig::SciSwigIterator *iter = 0;
|
||||||
int res = SWIG_ConvertPtr((SwigSciObject)$input, %as_voidptrptr(&iter), swig::SciSwigIterator::descriptor(), 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");
|
%fragment("SciSequence_Cont");
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Users can derive form the SciSwigIterator to implemet their
|
* Users can derive form the SciSwigIterator to implemet their
|
||||||
* own iterators. As an example (real one since we use it for STL/STD
|
* 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.
|
* 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 {
|
namespace swig {
|
||||||
template<typename OutIterator>
|
template<typename OutIterator>
|
||||||
class SciSwigIterator_T : public SciSwigIterator
|
class SwigSciIterator_T : public SciSwigIterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef OutIterator out_iterator;
|
typedef OutIterator out_iterator;
|
||||||
typedef typename std::iterator_traits<out_iterator>::value_type value_type;
|
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)
|
: SciSwigIterator(seq), current(curr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -172,17 +172,17 @@ namespace swig {
|
||||||
template<typename OutIterator,
|
template<typename OutIterator,
|
||||||
typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
|
typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
|
||||||
typename FromOper = from_oper<ValueType> >
|
typename FromOper = from_oper<ValueType> >
|
||||||
class SciSwigIteratorOpen_T : public SciSwigIterator_T<OutIterator>
|
class SciSwigIteratorOpen_T : public SwigSciIterator_T<OutIterator>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FromOper from;
|
FromOper from;
|
||||||
typedef OutIterator out_iterator;
|
typedef OutIterator out_iterator;
|
||||||
typedef ValueType value_type;
|
typedef ValueType value_type;
|
||||||
typedef SciSwigIterator_T<out_iterator> base;
|
typedef SwigSciIterator_T<out_iterator> base;
|
||||||
typedef SciSwigIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
|
typedef SciSwigIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
|
||||||
|
|
||||||
SciSwigIteratorOpen_T(out_iterator curr, SwigSciObject seq)
|
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,
|
template<typename OutIterator,
|
||||||
typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
|
typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
|
||||||
typename FromOper = from_oper<ValueType> >
|
typename FromOper = from_oper<ValueType> >
|
||||||
class SciSwigIteratorClosed_T : public SciSwigIterator_T<OutIterator>
|
class SciSwigIteratorClosed_T : public SwigSciIterator_T<OutIterator>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FromOper from;
|
FromOper from;
|
||||||
typedef OutIterator out_iterator;
|
typedef OutIterator out_iterator;
|
||||||
typedef ValueType value_type;
|
typedef ValueType value_type;
|
||||||
typedef SciSwigIterator_T<out_iterator> base;
|
typedef SwigSciIterator_T<out_iterator> base;
|
||||||
typedef SciSwigIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
|
typedef SciSwigIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
|
||||||
|
|
||||||
SciSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, SwigSciObject seq)
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue