/usr/include/openturns/swig/Description.i is in libopenturns-dev 0.15-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | // SWIG file Description.i
// Author : $LastChangedBy: dutka $
// Date : $LastChangedDate: 2010-11-09 13:44:00 +0100 (Tue, 09 Nov 2010) $
// Id : $Id: Description.i 1649 2010-11-09 12:44:00Z dutka $
%{
#include "PythonWrappingFunctions.hxx"
#include "Description.hxx"
%}
%ignore OpenTURNS::Base::Common::TypedCollectionInterfaceObject<OpenTURNS::Base::Type::DescriptionImplementation>::getDimension() const;
%template(DescriptionImplementationTypedInterfaceObject) OpenTURNS::Base::Common::TypedInterfaceObject<OpenTURNS::Base::Type::DescriptionImplementation>;
%template(DescriptionImplementationTypedCollectionInterfaceObject) OpenTURNS::Base::Common::TypedCollectionInterfaceObject<OpenTURNS::Base::Type::DescriptionImplementation>;
%include Description.hxx
namespace OpenTURNS{ namespace Base { namespace Type { %extend Description { Description(const Description & other) { return new OpenTURNS::Base::Type::Description(other); } } }}}
namespace OpenTURNS { namespace Base { namespace Type {
%extend Description {
Description(PyObject * pyObj)
{
OpenTURNS::Pointer<OpenTURNS::Base::Type::Collection<OpenTURNS::String> > p_coll = OpenTURNS::buildCollectionFromPySequence<OpenTURNS::String>( pyObj );
return new OpenTURNS::Base::Type::Description( *p_coll );
}
/* Method __len__() is for Python */
OpenTURNS::UnsignedLong __len__() const
{
return self->getSize();
}
/* Method __contains__() is for Python */
OpenTURNS::Bool __contains__(const OpenTURNS::String & val) const
{
for (OpenTURNS::UnsignedLong i=0; i<self->getSize(); ++i) if ( (*self)[i] == val ) return true;
return false;
}
}
}}}
|