hdlConvertor/toPy.cpp
// [TODO] too similar with the code for HdlModuleDef
[TODO] too similar with the code for HdlModuleDef
[ TODO ] too similar with the code for HdlModuleDef
PyObject* ToPy::toPy(const HdlNamespace *o) {
	PyObject *py_inst = PyObject_CallObject(HdlNamespaceCls, NULL);
	if (py_inst == nullptr)
		return nullptr;
	if (toPy(static_cast<const WithNameAndDoc*>(o), py_inst))
		return nullptr;
	if (toPy_arr(py_inst, "objs", o->objs))
		return nullptr;
	auto dec_only = PyBool_FromLong(o->defs_only);
	if (!dec_only) {
		Py_DECREF(py_inst);
		return nullptr;
	}
	if (PyObject_SetAttrString(py_inst, "declaration_only", dec_only)) {
		Py_DECREF(py_inst);
		Py_DECREF(dec_only);
		return nullptr;
	}
	return py_inst;
}
PyObject * ToPy :: toPy ( const HdlNamespace * o ) { PyObject * py_inst = PyObject_CallObject ( HdlNamespaceCls , NULL ) ; if ( py_inst == nullptr ) return nullptr ; if ( toPy ( static_cast < const WithNameAndDoc * > ( o ) , py_inst ) ) return nullptr ; if ( toPy_arr ( py_inst , " " , o -> objs ) ) return nullptr ; auto dec_only = PyBool_FromLong ( o -> defs_only ) ; if ( ! dec_only ) { Py_DECREF ( py_inst ) ; return nullptr ; } if ( PyObject_SetAttrString ( py_inst , " " , dec_only ) ) { Py_DECREF ( py_inst ) ; Py_DECREF ( dec_only ) ; return nullptr ; } return py_inst ; }
[TODO] too similar with the code for HdlModuleDef
[ TODO ] too similar with the code for HdlModuleDef