Commit 1e29d5ae authored by Kenneth Leiter's avatar Kenneth Leiter
Browse files

ENH: Add XdmfDataItem which stores array data to write to Xdmf.

parent 2be47fed
......@@ -23,6 +23,8 @@ set(XdmfSources
XdmfAttribute
XdmfAttributeCenter
XdmfAttributeType
XdmfDataItem
XdmfDataItemType
XdmfGeometry
XdmfGeometryType
XdmfGrid
......
......@@ -15,6 +15,7 @@ namespace boost {
}
%template(XdmfAttributePtr) boost::shared_ptr<XdmfAttribute>;
%template(XdmfDataItemPtr) boost::shared_ptr<XdmfDataItem>;
%template(XdmfGeometryPtr) boost::shared_ptr<XdmfGeometry>;
%template(XdmfGridPtr) boost::shared_ptr<XdmfGrid>;
%template(XdmfItemPtr) boost::shared_ptr<XdmfItem>;
......@@ -27,6 +28,8 @@ namespace boost {
#include <XdmfAttribute.hpp>
#include <XdmfAttributeCenter.hpp>
#include <XdmfAttributeType.hpp>
#include <XdmfDataItem.hpp>
#include <XdmfDataItemType.hpp>
#include <XdmfGeometry.hpp>
#include <XdmfGeometryType.hpp>
#include <XdmfGrid.hpp>
......@@ -45,6 +48,8 @@ namespace boost {
%include XdmfAttribute.hpp
%include XdmfAttributeCenter.hpp
%include XdmfAttributeType.hpp
%include XdmfDataItem.hpp
%include XdmfDataItemType.hpp
%include XdmfGeometry.hpp
%include XdmfGeometryType.hpp
%include XdmfGrid.hpp
......
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.37
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
......@@ -10,12 +10,18 @@ if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_Xdmf', [dirname(__file__)])
_mod = imp.load_module('_Xdmf', fp, pathname, description)
finally:
if fp is not None: fp.close()
return _mod
except ImportError:
import _Xdmf
return _Xdmf
if fp is not None:
try:
_mod = imp.load_module('_Xdmf', fp, pathname, description)
finally:
fp.close()
return _mod
_Xdmf = swig_import_helper()
del swig_import_helper
else:
......@@ -65,7 +71,7 @@ class SwigPyIterator(_object):
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _Xdmf.delete_SwigPyIterator
__del__ = lambda self : None;
......@@ -116,6 +122,25 @@ class XdmfAttributePtr(_object):
XdmfAttributePtr_swigregister = _Xdmf.XdmfAttributePtr_swigregister
XdmfAttributePtr_swigregister(XdmfAttributePtr)
class XdmfDataItemPtr(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XdmfDataItemPtr, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XdmfDataItemPtr, name)
__repr__ = _swig_repr
def __deref__(self): return _Xdmf.XdmfDataItemPtr___deref__(self)
def __init__(self):
this = _Xdmf.new_XdmfDataItemPtr()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _Xdmf.delete_XdmfDataItemPtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfDataItemPtr_New(self)
def printSelf(self): return _Xdmf.XdmfDataItemPtr_printSelf(self)
def write(self, *args): return _Xdmf.XdmfDataItemPtr_write(self, *args)
XdmfDataItemPtr_swigregister = _Xdmf.XdmfDataItemPtr_swigregister
XdmfDataItemPtr_swigregister(XdmfDataItemPtr)
class XdmfGeometryPtr(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XdmfGeometryPtr, name, value)
......@@ -251,7 +276,7 @@ class XdmfObject(_object):
__setattr__ = lambda self, name, value: _swig_setattr(self, XdmfObject, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XdmfObject, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
def printSelf(self): return _Xdmf.XdmfObject_printSelf(self)
XdmfObject_swigregister = _Xdmf.XdmfObject_swigregister
......@@ -264,7 +289,7 @@ class XdmfItem(XdmfObject):
__swig_getmethods__ = {}
for _s in [XdmfObject]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, XdmfItem, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
def write(self, *args): return _Xdmf.XdmfItem_write(self, *args)
XdmfItem_swigregister = _Xdmf.XdmfItem_swigregister
......@@ -426,6 +451,104 @@ def XdmfAttributeType_GlobalId():
return _Xdmf.XdmfAttributeType_GlobalId()
XdmfAttributeType_GlobalId = _Xdmf.XdmfAttributeType_GlobalId
class XdmfDataItem(XdmfItem):
__swig_setmethods__ = {}
for _s in [XdmfItem]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, XdmfDataItem, name, value)
__swig_getmethods__ = {}
for _s in [XdmfItem]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, XdmfDataItem, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfDataItem_New
if _newclass:New = staticmethod(_Xdmf.XdmfDataItem_New)
def printSelf(self): return _Xdmf.XdmfDataItem_printSelf(self)
def write(self, *args): return _Xdmf.XdmfDataItem_write(self, *args)
XdmfDataItem_swigregister = _Xdmf.XdmfDataItem_swigregister
XdmfDataItem_swigregister(XdmfDataItem)
def XdmfDataItem_New():
return _Xdmf.XdmfDataItem_New()
XdmfDataItem_New = _Xdmf.XdmfDataItem_New
class XdmfDataItemType(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XdmfDataItemType, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XdmfDataItemType, name)
__repr__ = _swig_repr
__swig_getmethods__["Unknown"] = lambda x: _Xdmf.XdmfDataItemType_Unknown
if _newclass:Unknown = staticmethod(_Xdmf.XdmfDataItemType_Unknown)
__swig_getmethods__["Int8"] = lambda x: _Xdmf.XdmfDataItemType_Int8
if _newclass:Int8 = staticmethod(_Xdmf.XdmfDataItemType_Int8)
__swig_getmethods__["Int16"] = lambda x: _Xdmf.XdmfDataItemType_Int16
if _newclass:Int16 = staticmethod(_Xdmf.XdmfDataItemType_Int16)
__swig_getmethods__["Int32"] = lambda x: _Xdmf.XdmfDataItemType_Int32
if _newclass:Int32 = staticmethod(_Xdmf.XdmfDataItemType_Int32)
__swig_getmethods__["Int64"] = lambda x: _Xdmf.XdmfDataItemType_Int64
if _newclass:Int64 = staticmethod(_Xdmf.XdmfDataItemType_Int64)
__swig_getmethods__["Float32"] = lambda x: _Xdmf.XdmfDataItemType_Float32
if _newclass:Float32 = staticmethod(_Xdmf.XdmfDataItemType_Float32)
__swig_getmethods__["Float64"] = lambda x: _Xdmf.XdmfDataItemType_Float64
if _newclass:Float64 = staticmethod(_Xdmf.XdmfDataItemType_Float64)
__swig_getmethods__["UInt8"] = lambda x: _Xdmf.XdmfDataItemType_UInt8
if _newclass:UInt8 = staticmethod(_Xdmf.XdmfDataItemType_UInt8)
__swig_getmethods__["UInt16"] = lambda x: _Xdmf.XdmfDataItemType_UInt16
if _newclass:UInt16 = staticmethod(_Xdmf.XdmfDataItemType_UInt16)
__swig_getmethods__["UInt32"] = lambda x: _Xdmf.XdmfDataItemType_UInt32
if _newclass:UInt32 = staticmethod(_Xdmf.XdmfDataItemType_UInt32)
def getName(self): return _Xdmf.XdmfDataItemType_getName(self)
def __eq__(self, *args): return _Xdmf.XdmfDataItemType___eq__(self, *args)
def __ne__(self, *args): return _Xdmf.XdmfDataItemType___ne__(self, *args)
def __init__(self, *args):
this = _Xdmf.new_XdmfDataItemType(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _Xdmf.delete_XdmfDataItemType
__del__ = lambda self : None;
XdmfDataItemType_swigregister = _Xdmf.XdmfDataItemType_swigregister
XdmfDataItemType_swigregister(XdmfDataItemType)
def XdmfDataItemType_Unknown():
return _Xdmf.XdmfDataItemType_Unknown()
XdmfDataItemType_Unknown = _Xdmf.XdmfDataItemType_Unknown
def XdmfDataItemType_Int8():
return _Xdmf.XdmfDataItemType_Int8()
XdmfDataItemType_Int8 = _Xdmf.XdmfDataItemType_Int8
def XdmfDataItemType_Int16():
return _Xdmf.XdmfDataItemType_Int16()
XdmfDataItemType_Int16 = _Xdmf.XdmfDataItemType_Int16
def XdmfDataItemType_Int32():
return _Xdmf.XdmfDataItemType_Int32()
XdmfDataItemType_Int32 = _Xdmf.XdmfDataItemType_Int32
def XdmfDataItemType_Int64():
return _Xdmf.XdmfDataItemType_Int64()
XdmfDataItemType_Int64 = _Xdmf.XdmfDataItemType_Int64
def XdmfDataItemType_Float32():
return _Xdmf.XdmfDataItemType_Float32()
XdmfDataItemType_Float32 = _Xdmf.XdmfDataItemType_Float32
def XdmfDataItemType_Float64():
return _Xdmf.XdmfDataItemType_Float64()
XdmfDataItemType_Float64 = _Xdmf.XdmfDataItemType_Float64
def XdmfDataItemType_UInt8():
return _Xdmf.XdmfDataItemType_UInt8()
XdmfDataItemType_UInt8 = _Xdmf.XdmfDataItemType_UInt8
def XdmfDataItemType_UInt16():
return _Xdmf.XdmfDataItemType_UInt16()
XdmfDataItemType_UInt16 = _Xdmf.XdmfDataItemType_UInt16
def XdmfDataItemType_UInt32():
return _Xdmf.XdmfDataItemType_UInt32()
XdmfDataItemType_UInt32 = _Xdmf.XdmfDataItemType_UInt32
class XdmfGeometry(XdmfItem):
__swig_setmethods__ = {}
for _s in [XdmfItem]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
......
/*
* XdmfDataItem.cpp
*
* Created on: Jan 29, 2010
* Author: kleiter
*/
#include "XdmfDataItem.hpp"
#include "XdmfVisitor.hpp"
XdmfDataItem::XdmfDataItem() :
mDataType(XdmfDataItemType::Unknown())
{
std::cout << "Created DataItem " << this << std::endl;
}
XdmfDataItem::~XdmfDataItem()
{
std::cout << "Deleted DataItem " << this << std::endl;
}
std::string XdmfDataItem::printSelf() const
{
return "XdmfDataItem";
}
template <>
void XdmfDataItem::setData<int>(int* dataPointer)
{
mDataPointer = dataPointer;
mDataType = XdmfDataItemType::Int32();
}
void XdmfDataItem::write(boost::shared_ptr<XdmfVisitor> visitor) const
{
visitor->visit(this);
}
/*
* XdmfDataItem.hpp
*
*
* Created on: Jan 25, 2010
* Author: kleiter
*/
#ifndef XDMFDATAITEM_HPP_
#define XDMFDATAITEM_HPP_
#include "XdmfDataItemType.hpp"
#include "XdmfItem.hpp"
class XdmfDataItem : public XdmfItem {
public:
XdmfNewMacro(XdmfDataItem);
template <typename T> void setData(T * dataPointer);
//int setData(int * dataPointer)
std::string printSelf() const;
void write(boost::shared_ptr<XdmfVisitor> visitor) const;
protected:
XdmfDataItem();
virtual ~XdmfDataItem();
private:
XdmfDataItem(const XdmfDataItem&); // Not implemented.
void operator=(const XdmfDataItem&); // Not implemented.
int* mDataPointer;
XdmfDataItemType mDataType;
};
#endif /* XDMFDATAITEM_HPP_ */
/*
* XdmfDataItemType.cpp
*
* Created on: Jan 29, 2010
* Author: kleiter
*/
#include "XdmfDataItemType.hpp"
// Supported XdmfDataItemTypes
XdmfDataItemType XdmfDataItemType::Unknown()
{
return XdmfDataItemType("Unknown");
}
XdmfDataItemType XdmfDataItemType::Int8()
{
return XdmfDataItemType("Int8");
}
XdmfDataItemType XdmfDataItemType::Int16()
{
return XdmfDataItemType("Int16");
}
XdmfDataItemType XdmfDataItemType::Int32()
{
return XdmfDataItemType("Int32");
}
XdmfDataItemType XdmfDataItemType::Int64()
{
return XdmfDataItemType("Int64");
}
XdmfDataItemType XdmfDataItemType::Float32()
{
return XdmfDataItemType("Float32");
}
XdmfDataItemType XdmfDataItemType::Float64()
{
return XdmfDataItemType("Float64");
}
XdmfDataItemType XdmfDataItemType::UInt8()
{
return XdmfDataItemType("UInt8");
}
XdmfDataItemType XdmfDataItemType::UInt16()
{
return XdmfDataItemType("UInt16");
}
XdmfDataItemType XdmfDataItemType::UInt32()
{
return XdmfDataItemType("UInt32");
}
XdmfDataItemType::XdmfDataItemType(const std::string& name) :
mName(name)
{};
XdmfDataItemType::XdmfDataItemType(const XdmfDataItemType& dataItemType):
mName(dataItemType.mName)
{
}
XdmfDataItemType& XdmfDataItemType::operator=(const XdmfDataItemType& dataItemType)
{
if(this != &dataItemType)
{
mName = dataItemType.mName;
}
return *this;
}
bool XdmfDataItemType::operator==(const XdmfDataItemType& dataItemType) const
{
return mName.compare(dataItemType.mName) == 0;
}
bool XdmfDataItemType::operator!=(const XdmfDataItemType& dataItemType) const
{
return !this->operator==(dataItemType);
}
std::string XdmfDataItemType::getName() const
{
return mName;
}
/*
* XdmfDataItemType.hpp
*
* Created on: Jan 25, 2010
* Author: kleiter
*/
#ifndef XDMFDATAITEMTYPE_HPP_
#define XDMFDATAITEMTYPE_HPP_
#include <string>
class XdmfDataItemType {
public:
// Supported Xdmf Data Item Types
static XdmfDataItemType Unknown();
static XdmfDataItemType Int8();
static XdmfDataItemType Int16();
static XdmfDataItemType Int32();
static XdmfDataItemType Int64();
static XdmfDataItemType Float32();
static XdmfDataItemType Float64();
static XdmfDataItemType UInt8();
static XdmfDataItemType UInt16();
static XdmfDataItemType UInt32();
/**
* Get the name of this data item type
*
* @return a string containing the name.
*/
std::string getName() const;
/*
* Compare two XdmfDataItemTypes for equality.
*
* @param an XdmfDataItemType to compare equality to.
* @return true iff the XdmfDataItemTypes are equal.
*/
bool operator==(const XdmfDataItemType& attributeType) const;
/**
* Compare two XdmfDataItemTypes for inequality.
*
* @param XdmfDataItemType to compare inequality to.
* @return true iff the XdmfDataItemTypes are not equal.
*/
bool operator!=(const XdmfDataItemType& top) const;
XdmfDataItemType(const XdmfDataItemType& attributeType);
XdmfDataItemType& operator=(const XdmfDataItemType& attributeType);
protected:
/**
* Protected constructor for XdmfDataItemType. The constructor is protected because all data item types supported
* by Xdmf should be accessed through more specific static methods that construct XdmfDataItemTypes - i.e. XdmfDataItemType::Int8().
*/
XdmfDataItemType(const std::string& name);
private:
std::string mName;
};
#endif /* XDMFDATAITEMTYPE_HPP_ */
/*
* XdmfGrid.cpp
* XdmfGeometry.cpp
*
* Created on: Jan 29, 2010
* Author: kleiter
......
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.37
* Version 1.3.40
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
......@@ -749,7 +749,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
/* Compatibility marcos for Python 3 */
/* Compatibility macros for Python 3 */
#if PY_VERSION_HEX >= 0x03000000
#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
......@@ -772,17 +772,35 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
# define SWIG_Python_str_FromFormat PyString_FromFormat
#endif
/* Warning: This function will allocate a new string in Python 3,
* so please call SWIG_Python_str_DelForPy3(x) to free the space.
*/
SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject *str)
{
#if PY_VERSION_HEX >= 0x03000000
char *cstr;
char *newstr;
Py_ssize_t len;
str = PyUnicode_AsUTF8String(str);
return PyBytes_AsString(str);
PyBytes_AsStringAndSize(str, &cstr, &len);
newstr = (char *) malloc(len+1);
memcpy(newstr, cstr, len+1);
Py_XDECREF(str);
return newstr;
#else
return PyString_AsString(str);
#endif
}
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
#else
# define SWIG_Python_str_DelForPy3(x)
#endif
SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char *c)
{
......@@ -937,11 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg)
if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
if (value) {
char *tmp;
PyObject *old_str = PyObject_Str(value);
PyErr_Clear();
Py_XINCREF(type);
PyErr_Format(type, "%s %s", SWIG_Python_str_AsChar(old_str), mesg);
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
SWIG_Python_str_DelForPy3(tmp);
Py_DECREF(old_str);
Py_DECREF(value);
} else {
......@@ -1452,9 +1472,7 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
#endif
{
const char *name = SWIG_TypePrettyName(v->ty);
PyObject *hex = SwigPyObject_hex(v);
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, hex);
Py_DECREF(hex);
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
if (v->next) {
#ifdef METH_NOARGS
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
......@@ -1476,13 +1494,16 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args)
SWIGRUNTIME int
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
{
char *str;
#ifdef METH_NOARGS
PyObject *repr = SwigPyObject_repr(v);
#else
PyObject *repr = SwigPyObject_repr(v, NULL);
#endif
if (repr) {
fputs(SWIG_Python_str_AsChar(repr), fp);
str = SWIG_Python_str_AsChar(repr);
fputs(str, fp);
SWIG_Python_str_DelForPy3(str);
Py_DECREF(repr);
return 0;
} else {
......@@ -1506,7 +1527,7 @@ SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
return (i < j) ? -1 : ((i > j) ? 1 : 0);
}
/* Added for Python 3.x, whould it also useful for Python 2.x? */
/* Added for Python 3.x, would it also be useful for Python 2.x? */
SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
{
......@@ -1554,7 +1575,7 @@ SwigPyObject_dealloc(PyObject *v)
/* destroy is always a VARARGS method */
PyObject *res;
if (data->delargs) {
/* we need to create a temporal object to carry the destroy operation */
/* we need to create a temporary object to carry the destroy operation */
PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
res = SWIG_Python_CallFunctor(destroy, tmp);
Py_DECREF(tmp);
......@@ -1729,7 +1750,11 @@ _PySwigObject_type(void) {
0, /*nb_coerce*/
#endif
(unaryfunc)SwigPyObject_long, /*nb_int*/
#if PY_VERSION_HEX < 0x03000000
(unaryfunc)SwigPyObject_long, /*nb_long*/
#else
0, /*nb_reserved*/
#endif
(unaryfunc)0, /*nb_float*/
#if PY_VERSION_HEX < 0x03000000
(unaryfunc)SwigPyObject_oct, /*nb_oct*/
......@@ -1751,7 +1776,7 @@ _PySwigObject_type(void) {
if (!type_init) {
const PyTypeObject tmp
= {
/* PyOjbect header changed in Python 3 */
/* PyObject header changed in Python 3 */
#if PY_VERSION_HEX >= 0x03000000
PyVarObject_HEAD_INIT(&PyType_Type, 0)
#else
......@@ -1769,7 +1794,11 @@ _PySwigObject_type(void) {
(getattrfunc)0, /* tp_getattr */
#endif
(setattrfunc)0, /* tp_setattr */
(cmpfunc)SwigPyObject_compare, /* tp_compare */
#if PY_VERSION_HEX >= 0x03000000
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
#else
(cmpfunc)SwigPyObject_compare, /* tp_compare */
#endif
(reprfunc)SwigPyObject_repr, /* tp_repr */
&SwigPyObject_as_number, /* tp_as_number */
0, /* tp_as_sequence */
......@@ -1816,7 +1845,7 @@ _PySwigObject_type(void) {
#endif
};
swigpyobject_type = tmp;
/* for Python 3 we already assigned the ob_type in PyVarObject_HEAD_INIT() */
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
#if PY_VERSION_HEX < 0x03000000
swigpyobject_type.ob_type = &PyType_Type;
#endif
......@@ -1940,14 +1969,18 @@ _PySwigPacked_type(void) {
(printfunc)SwigPyPacked_print, /* tp_print */
(getattrfunc)0, /* tp_getattr */
(setattrfunc)0, /* tp_setattr */
(cmpfunc