SyFi  0.3
swig::SwigPySequence_Ref< T > Struct Template Reference

List of all members.

Public Member Functions

 SwigPySequence_Ref (PyObject *seq, int index)
 operator T () const
SwigPySequence_Refoperator= (const T &v)

Private Attributes

PyObject * _seq
int _index

Detailed Description

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

Definition at line 4591 of file SyFiPYTHON_wrap.cxx.


Constructor & Destructor Documentation

template<class T >
swig::SwigPySequence_Ref< T >::SwigPySequence_Ref ( PyObject *  seq,
int  index 
) [inline]

Definition at line 4593 of file SyFiPYTHON_wrap.cxx.

      : _seq(seq), _index(index)
    {
    }

Member Function Documentation

template<class T >
swig::SwigPySequence_Ref< T >::operator T ( ) const [inline]

Definition at line 4598 of file SyFiPYTHON_wrap.cxx.

References SWIG_Error, SWIG_Python_AddErrorMsg(), and SWIG_TypeError.

    {
      swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index);
      try {
        return swig::as<T>(item, true);
      } catch (std::exception& e) {
        char msg[1024];
        sprintf(msg, "in sequence element %d ", _index);
        if (!PyErr_Occurred()) {
          ::SWIG_Error(SWIG_TypeError,  swig::type_name<T>());
        }
        SWIG_Python_AddErrorMsg(msg);
        SWIG_Python_AddErrorMsg(e.what());
        throw;
      }
    }
template<class T >
SwigPySequence_Ref& swig::SwigPySequence_Ref< T >::operator= ( const T &  v) [inline]

Definition at line 4615 of file SyFiPYTHON_wrap.cxx.

    {
      PySequence_SetItem(_seq, _index, swig::from<T>(v));
      return *this;
    }

Member Data Documentation

template<class T >
int swig::SwigPySequence_Ref< T >::_index [private]

Definition at line 4623 of file SyFiPYTHON_wrap.cxx.

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

Definition at line 4622 of file SyFiPYTHON_wrap.cxx.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines