2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 17:32:55 +00:00

- Fixed a inheritance bug, and added a test for it.

[SVN r18251]
This commit is contained in:
Bruno da Silva de Oliveira
2003-04-14 23:34:33 +00:00
parent ccd84c0be6
commit a15135f1c1
10 changed files with 86 additions and 11 deletions

View File

@@ -54,6 +54,10 @@ class ClassExporter(Exporter):
return makeid(self.class_.name)
def Name(self):
return self.class_.FullName()
def SetDeclarations(self, declarations):
Exporter.SetDeclarations(self, declarations)
decl = self.GetDeclaration(self.info.name)
@@ -269,9 +273,13 @@ class ClassExporter(Exporter):
def DeclareOverloads(m):
'Declares the macro for the generation of the overloads'
if not m.virtual:
func = m.name
code = 'BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(%s, %s, %i, %i)\n'
code = code % (OverloadName(m), func, m.minArgs, m.maxArgs)
if m.static:
func = m.FullName()
macro = 'BOOST_PYTHON_FUNCTION_OVERLOADS'
else:
func = m.name
macro = 'BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS'
code = '%s(%s, %s, %i, %i)\n' % (macro, OverloadName(m), func, m.minArgs, m.maxArgs)
if code not in declared:
declared[code] = True
self.Add('declaration', code)

View File

@@ -209,13 +209,18 @@ class Method(Function):
def PointerDeclaration(self):
'returns a declaration of a pointer to this function'
result = self.result.FullName()
params = ', '.join([x.FullName() for x in self.parameters])
const = ''
if self.const:
const = 'const'
return '(%s (%s::*)(%s) %s)&%s' %\
(result, self.class_, params, const, self.FullName())
if self.static:
# static methods are like normal functions
return Function.PointerDeclaration(self)
else:
# using syntax of methods
result = self.result.FullName()
params = ', '.join([x.FullName() for x in self.parameters])
const = ''
if self.const:
const = 'const'
return '(%s (%s::*)(%s) %s)&%s' %\
(result, self.class_, params, const, self.FullName())
class Constructor(Method):

View File

@@ -34,7 +34,7 @@ from policies import *
from CppParser import CppParser, CppParserError
import time
__VERSION__ = '0.7.2'
__VERSION__ = '0.7.3'
def RecursiveIncludes(include):
'Return a list containg the include dir and all its subdirectories'