From: JINMEI Tatuya Date: Fri, 27 Jan 2012 22:27:42 +0000 (-0800) Subject: [1575] added some non-compilable note around meta-remarks that should be X-Git-Tag: trac2351_base~277^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80a2fbfd0db2b19beb0e18b3b3dc166ccdae76f6;p=thirdparty%2Fkea.git [1575] added some non-compilable note around meta-remarks that should be removed before releasing the wrapper code. Compiler will detect if any of them is forgotten to be cleaned up. --- diff --git a/src/lib/util/python/wrapper_template.cc b/src/lib/util/python/wrapper_template.cc index 1a67a8841a..780e69521c 100644 --- a/src/lib/util/python/wrapper_template.cc +++ b/src/lib/util/python/wrapper_template.cc @@ -32,14 +32,6 @@ using namespace isc::util::python; using namespace isc::@MODULE@; using namespace isc::@MODULE@::python; -// -// Definition of the classes -// - -// For each class, we need a struct, a helper functions (init, destroy, -// and static wrappers around the methods we export), a list of methods, -// and a type description - // // @CPPCLASS@ // @@ -52,6 +44,7 @@ namespace { // Shortcut type which would be convenient for adding class variables safely. typedef CPPPyObjectContainer @CPPCLASS@Container; +@REMOVE_THIS_ON_RELEASE@ // This is a template of typical code logic of python class initialization // with C++ backend. You'll need to adjust it according to details of the // actual C++ class. @@ -60,6 +53,7 @@ int s_@CPPCLASS@* self = static_cast(po_self); try { if (PyArg_ParseTuple(args, "REPLACE ME")) { + @REMOVE_THIS_ON_RELEASE@ // YOU'LL NEED SOME VALIDATION, PREPARATION, ETC, HERE. self->cppobj = new @CPPCLASS@(/*NECESSARY PARAMS*/); return (0); @@ -74,6 +68,7 @@ int return (-1); } + @REMOVE_THIS_ON_RELEASE@ // If we are here PyArg_ParseTuple() failed and TypeError should have // been set. If the constructor is more complicated and the control // could reach this point for other reasons, an appropriate Python @@ -82,6 +77,7 @@ int return (-1); } +@REMOVE_THIS_ON_RELEASE@ // This is a template of typical code logic of python object destructor. // In many cases you can use it without modification, but check that carefully. void @@ -92,6 +88,7 @@ void Py_TYPE(self)->tp_free(self); } +@REMOVE_THIS_ON_RELEASE@ // This should be able to be used without modification as long as the // underlying C++ class has toText(). PyObject* @@ -119,6 +116,7 @@ PyObject* const_cast(""))); } +@REMOVE_THIS_ON_RELEASE@ // This is quite specific isc.dns. For other wrappers this should probably // be removed. PyObject* @CPPCLASS@_toWire(PyObject* self, PyObject* args) { @@ -175,6 +173,8 @@ PyObject* PyMethodDef @CPPCLASS@_methods[] = { { "to_text", @CPPCLASS@_toText, METH_NOARGS, @CPPCLASS@_toText_doc }, + + @REMOVE_THIS_ON_RELEASE@ // This is quite specific isc.dns. For other wrappers this should probably // be removed: { "to_wire", @CPPCLASS@_toWire, METH_VARARGS, @@ -256,6 +256,7 @@ initModulePart_@CPPCLASS@(PyObject* mod) { } Py_INCREF(&@cppclass@_type); + @REMOVE_THIS_ON_RELEASE@ // The following template is the typical procedure for installing class // variables. If the class doesn't have a class variable, remove the // entire try-catch clauses.