12#ifndef _RD_PYSEQUENCEHOLDER_H_
13#define _RD_PYSEQUENCEHOLDER_H_
21namespace python = boost::python;
41 unsigned int size()
const {
44 res = boost::python::len(d_seq);
46 throw_value_error(
"sequence does not support length query");
64 throw_index_error(which);
68 T res = python::extract<T>(d_seq[which]);
71 throw_value_error(
"cannot extract desired type from sequence");
75 return static_cast<T
>(T());
#define POSTCONDITION(expr, mess)
unsigned int size() const
Returns the size of the contained sequence.
T operator[](unsigned int which) const
Returns an element of the sequence.
PySequenceHolder(python::object seq)