1 // SWIG file Description.i
2 
3 %{
4 #include "openturns/Description.hxx"
5 %}
6 
7 %include Description_doc.i
8 
9 %template(StringCollection) OT::Collection<OT::String>;
10 %template(StringPersistentCollection) OT::PersistentCollection<OT::String>;
11 
12 %typemap(in) const OT::Description & ($1_basetype temp) {
13   if (! SWIG_IsOK(SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, SWIG_POINTER_NO_NULL))) {
14     try {
15       temp = OT::convert<OT::_PySequence_,OT::Description>( $input );
16       $1 = &temp;
catch(OT::InvalidArgumentException &)17     } catch (OT::InvalidArgumentException &) {
18       SWIG_exception(SWIG_TypeError, "Object passed as argument is not convertible to a Description");
19     }
20   }
21 }
22 
23 %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) const OT::Description & {
24   $1 = SWIG_IsOK(SWIG_ConvertPtr($input, NULL, $1_descriptor, SWIG_POINTER_NO_NULL)) ||
25        OT::isAPythonSequenceOf<OT::_PyString_>($input);
26 }
27 
28 %ignore OT::Description::Description(std::initializer_list<String> initList);
29 %include openturns/Description.hxx
30 
31 namespace OT {
32 
33 %extend Description {
34 
Description(const Description & other)35 Description(const Description & other) { return new OT::Description(other); }
36 
Description(PyObject * pyObj)37 Description(PyObject * pyObj)
38 {
39  OT::Pointer<OT::Collection<OT::String> > p_coll =  OT::buildCollectionFromPySequence<OT::String>( pyObj );
40  return new OT::Description( *p_coll );
41 }
42 
43 OTCollectionOperatorsHelper(OT::Description, OT::String)
44 
45 } // Description
46 } // OT
47