Adds the specified python-typed result and an optional Ftype pointer
        to use when cleaning up this object.

        :arg result: a python-typed representation of the result.
        :arg pointer: an instance of Ftype with pointer information for deallocating
          the c-pointer.

def add(self, varname, result, pointer=None):
        """Adds the specified python-typed result and an optional Ftype pointer
        to use when cleaning up this object.

        :arg result: a python-typed representation of the result.
        :arg pointer: an instance of Ftype with pointer information for deallocating
          the c-pointer.
        """
        self.result[varname] = result
        setattr(self, varname, result)
        if pointer is not None:
            self._finalizers[varname] = pointer