swig::SwigPySequence_Cont< T > Struct Template Reference

List of all members.

Public Types

typedef SwigPySequence_Ref< T > reference
typedef const
SwigPySequence_Ref< T > 
const_reference
typedef T value_type
typedef T * pointer
typedef int difference_type
typedef int size_type
typedef const pointer const_pointer
typedef
SwigPySequence_InputIterator
< T, reference
iterator
typedef
SwigPySequence_InputIterator
< T, const_reference
const_iterator

Public Member Functions

 SwigPySequence_Cont (PyObject *seq)
 ~SwigPySequence_Cont ()
size_type size () const
bool empty () const
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reference operator[] (difference_type n)
const_reference operator[] (difference_type n) const
bool check (bool set_err=true) const

Private Attributes

PyObject * _seq


Detailed Description

template<class T>
struct swig::SwigPySequence_Cont< T >

Definition at line 4305 of file SyFi_wrap.cc.


Member Typedef Documentation

Definition at line 4315 of file SyFi_wrap.cc.

template<class T>
typedef const pointer swig::SwigPySequence_Cont< T >::const_pointer

Definition at line 4313 of file SyFi_wrap.cc.

template<class T>
typedef const SwigPySequence_Ref<T> swig::SwigPySequence_Cont< T >::const_reference

Definition at line 4308 of file SyFi_wrap.cc.

template<class T>
typedef int swig::SwigPySequence_Cont< T >::difference_type

Definition at line 4311 of file SyFi_wrap.cc.

Definition at line 4314 of file SyFi_wrap.cc.

template<class T>
typedef T* swig::SwigPySequence_Cont< T >::pointer

Definition at line 4310 of file SyFi_wrap.cc.

template<class T>
typedef SwigPySequence_Ref<T> swig::SwigPySequence_Cont< T >::reference

Definition at line 4307 of file SyFi_wrap.cc.

template<class T>
typedef int swig::SwigPySequence_Cont< T >::size_type

Definition at line 4312 of file SyFi_wrap.cc.

template<class T>
typedef T swig::SwigPySequence_Cont< T >::value_type

Definition at line 4309 of file SyFi_wrap.cc.


Constructor & Destructor Documentation

template<class T>
swig::SwigPySequence_Cont< T >::SwigPySequence_Cont ( PyObject *  seq  )  [inline]

Definition at line 4317 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq.

04317                                        : _seq(0)
04318     {
04319       if (!PySequence_Check(seq)) {
04320         throw std::invalid_argument("a sequence is expected");
04321       }
04322       _seq = seq;
04323       Py_INCREF(_seq);
04324     }

template<class T>
swig::SwigPySequence_Cont< T >::~SwigPySequence_Cont (  )  [inline]

Definition at line 4326 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq.

04327     {
04328       Py_XDECREF(_seq);
04329     }


Member Function Documentation

template<class T>
const_iterator swig::SwigPySequence_Cont< T >::begin (  )  const [inline]

Definition at line 4346 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq.

04347     {
04348       return const_iterator(_seq, 0);
04349     }

template<class T>
iterator swig::SwigPySequence_Cont< T >::begin (  )  [inline]

Definition at line 4341 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq.

04342     {
04343       return iterator(_seq, 0);
04344     }

template<class T>
bool swig::SwigPySequence_Cont< T >::check ( bool  set_err = true  )  const [inline]

Definition at line 4371 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq, run::s, swig::SwigPySequence_Cont< T >::size(), SWIG_Error, and SWIG_RuntimeError.

Referenced by swig::traits_asptr_stdseq< Seq, T >::asptr().

04372     {
04373       int s = size();
04374       for (int i = 0; i < s; ++i) {
04375         swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
04376         if (!swig::check<value_type>(item)) {
04377           if (set_err) {
04378             char msg[1024];
04379             sprintf(msg, "in sequence element %d", i);
04380             SWIG_Error(SWIG_RuntimeError, msg);
04381           }
04382           return false;
04383         }
04384       }
04385       return true;
04386     }

template<class T>
bool swig::SwigPySequence_Cont< T >::empty (  )  const [inline]

Definition at line 4336 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::size().

04337     {
04338       return size() == 0;
04339     }

template<class T>
const_iterator swig::SwigPySequence_Cont< T >::end (  )  const [inline]

Definition at line 4356 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq, and swig::SwigPySequence_Cont< T >::size().

04357     {
04358       return const_iterator(_seq, size());
04359     }

template<class T>
iterator swig::SwigPySequence_Cont< T >::end (  )  [inline]

Definition at line 4351 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq, and swig::SwigPySequence_Cont< T >::size().

04352     {
04353       return iterator(_seq, size());
04354     }

template<class T>
const_reference swig::SwigPySequence_Cont< T >::operator[] ( difference_type  n  )  const [inline]

Definition at line 4366 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq.

04367     {
04368       return const_reference(_seq, n);
04369     }

template<class T>
reference swig::SwigPySequence_Cont< T >::operator[] ( difference_type  n  )  [inline]

Definition at line 4361 of file SyFi_wrap.cc.

References swig::SwigPySequence_Cont< T >::_seq.

04362     {
04363       return reference(_seq, n);
04364     }

template<class T>
size_type swig::SwigPySequence_Cont< T >::size (  )  const [inline]


Member Data Documentation

template<class T>
PyObject* swig::SwigPySequence_Cont< T >::_seq [private]


The documentation for this struct was generated from the following file:

Generated on Mon Aug 31 16:17:06 2009 for SyFi by  doxygen 1.5.9