casa
$Rev:20696$
|
00001 #ifndef _casac_conversions_python_h__ 00002 #define _casac_conversions_python_h__ 00003 #include <Python.h> 00004 #include <complexobject.h> 00005 #include <xmlcasa/record.h> 00006 #include <casac/BoolAry.h> 00007 #include <casac/IntAry.h> 00008 #include <casac/DoubleAry.h> 00009 #include <casac/ComplexAry.h> 00010 #include <casac/StringAry.h> 00011 #include <WX/Utils/value.h> 00012 #include <string> 00013 #include <casac/complex.h> 00014 00015 namespace casac { 00016 00017 int convert_idl_complex_from_python_complex(PyObject *obj, void *s); 00018 PyObject *convert_idl_complex_to_python_complex(const casac::complex &from); 00019 00020 00021 int python_BoolAry_check(PyObject *obj); 00022 int convert_idl_BoolAry_from_python_BoolAry(PyObject *obj, void *s); 00023 PyObject *convert_idl_BoolAry_to_python_BoolAry( const BoolAry &from); 00024 00025 int python_IntAry_check(PyObject *obj); 00026 int convert_idl_IntAry_from_python_IntAry(PyObject *obj, void *s); 00027 PyObject *convert_idl_IntAry_to_python_IntAry( const IntAry &from); 00028 00029 int python_DoubleAry_check(PyObject *obj); 00030 int convert_idl_DoubleAry_from_python_DoubleAry(PyObject *obj, void *s); 00031 PyObject *convert_idl_DoubleAry_to_python_DoubleAry( const DoubleAry &from); 00032 00033 int python_ComplexAry_check(PyObject *obj); 00034 int convert_idl_ComplexAry_from_python_ComplexAry(PyObject *obj, void *s); 00035 PyObject *convert_idl_ComplexAry_to_python_ComplexAry( const ComplexAry &from); 00036 00037 int python_StringAry_check(PyObject *obj); 00038 int convert_idl_StringAry_from_python_StringAry(PyObject *obj, void *s); 00039 PyObject *convert_idl_StringAry_to_python_StringAry( const StringAry &from); 00040 00041 00042 variant pyobj2variant(PyObject*,bool throw_error=false); 00043 PyObject *variant2pyobj(const variant &val); 00044 int convert_record_value_from_python_dict(PyObject *obj, void *s); 00045 PyObject *convert_record_value_to_python_dict( WX::Utils::SmartPtr<WX::Utils::Value> ptr ); 00046 int convert_variant_value_from_python_obj(PyObject *obj, void *s); 00047 PyObject *convert_variant_value_to_python_obj( WX::Utils::SmartPtr<WX::Utils::Value> ptr ); 00048 00049 WX::Utils::Value *initialize_python_record( ); 00050 WX::Utils::Value *initialize_python_record( const std::string & ); 00051 WX::Utils::Value *initialize_python_variant( ); 00052 WX::Utils::Value *initialize_python_variant( const std::string &a); 00053 00054 int is_intvec_compatible_numpy_array( PyObject *obj ); 00055 int convert_intvec_from_compatible_numpy_array( PyObject *obj, void *s ); 00056 00057 } 00058 00059 #endif