@ -84,7 +84,12 @@ PyObject* NewContainer(CMessage* parent,
return NULL ;
return NULL ;
}
}
# if PY_MAJOR_VERSION >= 3
PyObject * obj = PyType_GenericAlloc (
reinterpret_cast < PyTypeObject * > ( MessageMapContainer_Type ) , 0 ) ;
# else
PyObject * obj = PyType_GenericAlloc ( & MessageMapContainer_Type , 0 ) ;
PyObject * obj = PyType_GenericAlloc ( & MessageMapContainer_Type , 0 ) ;
# endif
if ( obj = = NULL ) {
if ( obj = = NULL ) {
return PyErr_Format ( PyExc_RuntimeError ,
return PyErr_Format ( PyExc_RuntimeError ,
" Could not allocate new container. " ) ;
" Could not allocate new container. " ) ;
@ -458,44 +463,67 @@ PyObject* IterNext(PyObject* _self) {
} // namespace message_map_iterator
} // namespace message_map_iterator
PyTypeObject MessageMapContainer_Type = {
# if PY_MAJOR_VERSION >= 3
PyVarObject_HEAD_INIT ( & PyType_Type , 0 )
static PyType_Slot MessageMapContainer_Type_slots [ ] = {
FULL_MODULE_NAME " .MessageMapContainer " , // tp_name
{ Py_tp_dealloc , ( void * ) message_map_container : : Dealloc } ,
sizeof ( MessageMapContainer ) , // tp_basicsize
{ Py_mp_length , ( void * ) message_map_container : : Length } ,
0 , // tp_itemsize
{ Py_mp_subscript , ( void * ) message_map_container : : GetItem } ,
message_map_container : : Dealloc , // tp_dealloc
{ Py_mp_ass_subscript , ( void * ) message_map_container : : SetItem } ,
0 , // tp_print
{ Py_tp_methods , ( void * ) message_map_container : : Methods } ,
0 , // tp_getattr
{ Py_tp_iter , ( void * ) message_map_container : : GetIterator } ,
0 , // tp_setattr
{ 0 , 0 }
0 , // tp_compare
} ;
0 , // tp_repr
0 , // tp_as_number
PyType_Spec MessageMapContainer_Type_spec = {
0 , // tp_as_sequence
FULL_MODULE_NAME " .MessageMapContainer " ,
& message_map_container : : MpMethods , // tp_as_mapping
sizeof ( MessageMapContainer ) ,
0 , // tp_hash
0 ,
0 , // tp_call
Py_TPFLAGS_DEFAULT ,
0 , // tp_str
MessageMapContainer_Type_slots
0 , // tp_getattro
} ;
0 , // tp_setattro
0 , // tp_as_buffer
PyObject * MessageMapContainer_Type ;
Py_TPFLAGS_DEFAULT , // tp_flags
" A map container for message " , // tp_doc
# else
0 , // tp_traverse
PyTypeObject MessageMapContainer_Type = {
0 , // tp_clear
PyVarObject_HEAD_INIT ( & PyType_Type , 0 )
0 , // tp_richcompare
FULL_MODULE_NAME " .MessageMapContainer " , // tp_name
0 , // tp_weaklistoffset
sizeof ( MessageMapContainer ) , // tp_basicsize
message_map_container : : GetIterator , // tp_iter
0 , // tp_itemsize
0 , // tp_iternext
message_map_container : : Dealloc , // tp_dealloc
message_map_container : : Methods , // tp_methods
0 , // tp_print
0 , // tp_members
0 , // tp_getattr
0 , // tp_getset
0 , // tp_setattr
0 , // tp_base
0 , // tp_compare
0 , // tp_dict
0 , // tp_repr
0 , // tp_descr_get
0 , // tp_as_number
0 , // tp_descr_set
0 , // tp_as_sequence
0 , // tp_dictoffset
& message_map_container : : MpMethods , // tp_as_mapping
0 , // tp_init
0 , // tp_hash
} ;
0 , // tp_call
0 , // tp_str
0 , // tp_getattro
0 , // tp_setattro
0 , // tp_as_buffer
Py_TPFLAGS_DEFAULT , // tp_flags
" A map container for message " , // tp_doc
0 , // tp_traverse
0 , // tp_clear
0 , // tp_richcompare
0 , // tp_weaklistoffset
message_map_container : : GetIterator , // tp_iter
0 , // tp_iternext
message_map_container : : Methods , // tp_methods
0 , // tp_members
0 , // tp_getset
0 , // tp_base
0 , // tp_dict
0 , // tp_descr_get
0 , // tp_descr_set
0 , // tp_dictoffset
0 , // tp_init
} ;
# endif
PyTypeObject MessageMapIterator_Type = {
PyTypeObject MessageMapIterator_Type = {
PyVarObject_HEAD_INIT ( & PyType_Type , 0 )
PyVarObject_HEAD_INIT ( & PyType_Type , 0 )