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

Compare commits

..

1 Commits

Author SHA1 Message Date
nobody
debba1c7c6 This commit was manufactured by cvs2svn to create branch
'compiler_supported_error_messages'.

[SVN r13249]
2002-03-22 12:16:42 +00:00
159 changed files with 5321 additions and 14377 deletions

View File

@@ -61,13 +61,6 @@ subproject libs/python/build ;
SEARCH on <module@>python.jam = $(BOOST_BUILD_PATH) ;
include <module@>python.jam ;
# This nasty hack works with versions of Python 1.5.2 -> 2.2 to avoid
# building any Python stuff if there's no installation.
SEARCH on <find-python-install>__init__.py = $(PYTHON_STDLIB_PATH)/test $(SUBDIR) ;
include <find-python-install>__init__.py ;
if ! $(gNO_PYTHON_INSTALL)
{
local PYTHON_PROPERTIES = $(PYTHON_PROPERTIES) <define>BOOST_PYTHON_DYNAMIC_LIB ;
#######################
@@ -89,13 +82,11 @@ local CPP_SOURCES =
;
lib boost_python_static : ../src/$(CPP_SOURCES).cpp
# requirements
: $(BOOST_PYTHON_INCLUDES)
# requirements
: $(BOOST_PYTHON_INCLUDES)
<shared-linkable>true
<define>BOOST_PYTHON_STATIC_LIB=1
[ difference $(PYTHON_PROPERTIES) : <define>BOOST_PYTHON_DYNAMIC_LIB ]
: <suppress>true # don't build this unless the user asks for it by name
;
<define>BOOST_PYTHON_STATIC_LIB=1
$(PYTHON_PROPERTIES) ;
dll boost_python
# $(SUFDLL[1])
@@ -104,17 +95,10 @@ dll boost_python
: $(BOOST_PYTHON_INCLUDES)
<shared-linkable>true
<runtime-link>dynamic
<define>BOOST_PYTHON_HAS_DLL_RUNTIME=1
$(PYTHON_PROPERTIES)
;
stage bin-stage : <dll>boost_python
:
<tag><debug>"_debug"
<tag><debug-python>"_pydebug"
:
debug release
;
############# comprehensive module and test ###########
bpl-test boost_python_test
: ../test/comprehensive.cpp ;
@@ -130,7 +114,7 @@ rule boost-python-example-runtest ( name )
: ../example/$(name).cpp ;
boost-python-runtest $(name)
: ../example/test_$(name).py <pyd>$(name) <dll>boost_python ;
: ../example/test_$(name).py <pyd>$(name) ;
}
@@ -170,4 +154,3 @@ boost-python-multi-example-runtest ivect2 : ivect dvect ;
boost-python-multi-example-runtest
noncopyable : noncopyable_import noncopyable_export ;
}

View File

@@ -1,22 +0,0 @@
# Dummy file actually to be included by Jam when the python headers
# can't be found
if ! $(gNO_PYTHON_INSTALL)
{
ECHO "---------------------------------------------------------------------" ;
ECHO skipping Boost.Python library build ;
ECHO You can configure the location of your python installation, by setting: ;
ECHO "PYTHON_ROOT - currently" \"$(PYTHON_ROOT:J=" ")\" ;
ECHO "PYTHON_VERSION - The 2-part python Major.Minor version number (e.g." ;
ECHO " \"2.2\", NOT \"2.2.1\") - currently" \"$(PYTHON_VERSION)\" ;
ECHO ;
ECHO "The following are automatically configured from PYTHON_ROOT if not" ;
ECHO "otherwise set:" ;
ECHO " PYTHON_INCLUDES - path to Python #include directories; currently" \"$(PYTHON_INCLUDES:J=" ")\" ;
ECHO " PYTHON_LIB_PATH - path to Python library; currently" ;
ECHO " " \"$(PYTHON_LIB_PATH:J=" ")\" ;
ECHO " PYTHON_STDLIB_PATH - path to Python standard library modules; currently" ;
ECHO " " \"$(PYTHON_STDLIB_PATH:J=" ")\" ;
ECHO "---------------------------------------------------------------------" ;
}
gNO_PYTHON_INSTALL ?= true ;

241
build/bpl_static.dsp Normal file
View File

@@ -0,0 +1,241 @@
# Microsoft Developer Studio Project File - Name="bpl_static" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=bpl_static - Win32 DebugPython
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "bpl_static.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "bpl_static.mak" CFG="bpl_static - Win32 DebugPython"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "bpl_static - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "bpl_static - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "bpl_static - Win32 DebugPython" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "bpl_static - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W4 /WX /GR /GX /O2 /I "..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "bpl_static - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /WX /Gm- /GR /GX /Zi /Od /I "..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "bpl_static - Win32 DebugPython"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "bpl_static___Win32_DebugPython"
# PROP BASE Intermediate_Dir "bpl_static___Win32_DebugPython"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugPython"
# PROP Intermediate_Dir "DebugPython"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W4 /WX /Gm /GR /GX /Zi /Od /I "..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W4 /WX /Gm- /GR /GX /Zi /Od /I "..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BOOST_DEBUG_PYTHON" /FR /YX /FD /GZ /EHs /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "bpl_static - Win32 Release"
# Name "bpl_static - Win32 Debug"
# Name "bpl_static - Win32 DebugPython"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\src\classes.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\conversions.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\extension_class.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\functions.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\init_function.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\module_builder.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\objects.cpp
# ADD CPP /W3
# End Source File
# Begin Source File
SOURCE=..\src\types.cpp
# ADD CPP /W3
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\..\boost\python\detail\base_object.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\callback.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\caller.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\cast.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\class_builder.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\classes.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\config.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\conversions.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\errors.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\extension_class.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\functions.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\init_function.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\module_builder.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\none.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\objects.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\operators.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\reference.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\signatures.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\singleton.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\types.hpp
# End Source File
# Begin Source File
SOURCE=..\..\..\boost\python\detail\wrap_python.hpp
# End Source File
# End Group
# End Target
# End Project

108
build/build.dsw Normal file
View File

@@ -0,0 +1,108 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "bpl_static"=.\bpl_static.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "example1"=.\example1\example1.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name bpl_static
End Project Dependency
}}}
###############################################################################
Project: "getting_started1"=.\getting_started1\getting_started1.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name bpl_static
End Project Dependency
}}}
###############################################################################
Project: "getting_started2"=.\getting_started2\getting_started2.dsp - Package Owner=<4>
Package=<5>
{{{
begin source code control
getting_started2
.\getting_started2
end source code control
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name bpl_static
End Project Dependency
}}}
###############################################################################
Project: "rwgk1"=.\rwgk1\rwgk1.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name bpl_static
End Project Dependency
}}}
###############################################################################
Project: "test"=.\test\test.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name bpl_static
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

BIN
build/build.opt Normal file

Binary file not shown.

136
build/example1/example1.dsp Normal file
View File

@@ -0,0 +1,136 @@
# Microsoft Developer Studio Project File - Name="example1" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=example1 - Win32 DebugPython
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "example1.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "example1.mak" CFG="example1 - Win32 DebugPython"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "example1 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "example1 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "example1 - Win32 DebugPython" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "example1 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXAMPLE1_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXAMPLE1_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/hello.dll" /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "example1 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXAMPLE1_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXAMPLE1_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"Debug/hello.dll" /pdbtype:sept /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "example1 - Win32 DebugPython"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "example1___Win32_DebugPython"
# PROP BASE Intermediate_Dir "example1___Win32_DebugPython"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugPython"
# PROP Intermediate_Dir "DebugPython"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXAMPLE1_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXAMPLE1_EXPORTS" /D "BOOST_DEBUG_PYTHON" /YX /FD /GZ /EHs /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"Debug/hello.dll" /pdbtype:sept /libpath:"c:\tools\python\libs"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"DebugPython/hello_d.dll" /pdbtype:sept /libpath:"c:\tools\python\src\PCbuild"
!ENDIF
# Begin Target
# Name "example1 - Win32 Release"
# Name "example1 - Win32 Debug"
# Name "example1 - Win32 DebugPython"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\example\example1.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,136 @@
# Microsoft Developer Studio Project File - Name="getting_started1" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=getting_started1 - Win32 DebugPython
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "getting_started1.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "getting_started1.mak" CFG="getting_started1 - Win32 DebugPython"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "getting_started1 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "getting_started1 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "getting_started1 - Win32 DebugPython" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "getting_started1 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "getting_started1 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GR /GX /ZI /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "getting_started1 - Win32 DebugPython"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "DebugPython"
# PROP BASE Intermediate_Dir "DebugPython"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugPython"
# PROP Intermediate_Dir "DebugPython"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /D "BOOST_DEBUG_PYTHON" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"DebugPython/boost_python_test_d.pdb" /debug /machine:I386 /out:"DebugPython/getting_started1_d.dll" /pdbtype:sept /libpath:"c:\tools\python\src\PCbuild"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "getting_started1 - Win32 Release"
# Name "getting_started1 - Win32 Debug"
# Name "getting_started1 - Win32 DebugPython"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\example\getting_started1.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,135 @@
# Microsoft Developer Studio Project File - Name="getting_started2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=getting_started2 - Win32 DebugPython
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "getting_started2.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "getting_started2.mak" CFG="getting_started2 - Win32 DebugPython"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "getting_started2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "getting_started2 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "getting_started2 - Win32 DebugPython" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "getting_started2"
# PROP Scc_LocalPath "."
CPP=xicl6.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "getting_started2 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "getting_started2 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "getting_started2 - Win32 DebugPython"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "getting_started2___Win32_DebugPython"
# PROP BASE Intermediate_Dir "getting_started2___Win32_DebugPython"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "getting_started2___Win32_DebugPython"
# PROP Intermediate_Dir "getting_started2___Win32_DebugPython"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /D "BOOST_DEBUG_PYTHON" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"DebugPython/getting_started2_d.dll" /pdbtype:sept /libpath:"c:\tools\python\src\pcbuild"
!ENDIF
# Begin Target
# Name "getting_started2 - Win32 Release"
# Name "getting_started2 - Win32 Debug"
# Name "getting_started2 - Win32 DebugPython"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\example\getting_started2.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

135
build/rwgk1/rwgk1.dsp Normal file
View File

@@ -0,0 +1,135 @@
# Microsoft Developer Studio Project File - Name="rwgk1" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=rwgk1 - Win32 DebugPython
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "rwgk1.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "rwgk1.mak" CFG="rwgk1 - Win32 DebugPython"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "rwgk1 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "rwgk1 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "rwgk1 - Win32 DebugPython" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "rwgk1 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RWGK1_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RWGK1_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "rwgk1 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RWGK1_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RWGK1_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "rwgk1 - Win32 DebugPython"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "rwgk1___Win32_DebugPython"
# PROP BASE Intermediate_Dir "rwgk1___Win32_DebugPython"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugPython"
# PROP Intermediate_Dir "DebugPython"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RWGK1_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RWGK1_EXPORTS" /D "BOOST_DEBUG_PYTHON" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"c:\tools\python\libs"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"DebugPython/rwgk1_d.dll" /pdbtype:sept /libpath:"C:\tools\python\src\PCbuild"
!ENDIF
# Begin Target
# Name "rwgk1 - Win32 Release"
# Name "rwgk1 - Win32 Debug"
# Name "rwgk1 - Win32 DebugPython"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\example\rwgk1.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

145
build/test/test.dsp Normal file
View File

@@ -0,0 +1,145 @@
# Microsoft Developer Studio Project File - Name="test" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=test - Win32 DebugPython
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "test.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "test.mak" CFG="test - Win32 DebugPython"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "test - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "test - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "test - Win32 DebugPython" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "test - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /YX /FD /Zm200 /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/boost_python_test.dll" /libpath:"c:\tools\python\libs"
!ELSEIF "$(CFG)" == "test - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm- /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /YX /FD /GZ /Zm200 /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"Debug/boost_python_test.dll" /pdbtype:sept /libpath:"c:\tools\python\libs"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "test - Win32 DebugPython"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "test___Win32_DebugPython"
# PROP BASE Intermediate_Dir "test___Win32_DebugPython"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugPython"
# PROP Intermediate_Dir "DebugPython"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /YX /FD /GZ /Zm200 /c
# ADD CPP /nologo /MDd /W3 /Gm- /GR /GX /Zi /Od /I "..\..\..\.." /I "c:\tools\python\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TEST_EXPORTS" /D "BOOST_DEBUG_PYTHON" /YX /FD /GZ /Zm200 /EHs /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"c:\tools\python\libs"
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"DebugPython/boost_python_test_d.dll" /pdbtype:sept /libpath:"c:\tools\python\src\PCbuild"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "test - Win32 Release"
# Name "test - Win32 Debug"
# Name "test - Win32 DebugPython"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\test\comprehensive.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\test\comprehensive.hpp
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,9 +1,5 @@
# Usage:
#
# Create a new empty directory anywhere (preferably not in the boost tree).
# Copy this Makefile to that new directory and rename it to "Makefile"
# Adjust the pathnames below.
#
# make copy Copy the sources and tests
# make Compile all sources
# make test Run doctest tests

View File

@@ -9,214 +9,172 @@
"../../../c++boost.gif" alt="c++boost.gif (8819 bytes)">Building an
Extension Module</h1>
<h2>Building Boost.Python</h2>
<p>The build process for Boost is currently undergoing some evolution,
and, it is to be hoped, improvement. The following facts may help:
<p>Every Boost.Python extension module must be linked with the
<code>boost_python</code> shared library. To build
<code>boost_python</code>, use <a
href="../../../tools/build/index.html">Boost.Build</a> in the
usual way from the <code>libs/python/build</code> subdirectory
of your boost installation (if you have already built boost from
the top level this may have no effect, since the work is already
done).
<h3>Configuration</h3>
You may need to configure the following variables to point Boost.Build at your Python installation:
<table border="1">
<tr><th>Variable Name <th>Semantics <th>Default <th>Notes
<tr>
<td><code>PYTHON_ROOT</code>
<td>The root directory of your Python installation
<td>Windows:&nbsp;<code>c:/tools/python</code>
Unix:&nbsp;<code>/usr/local</code>
<td>On Unix, this is the <code>--with-prefix=</code> directory
used to configure Python
<tr>
<td><code>PYTHON_VERSION</code>
<td>The The 2-part python Major.Minor version number
<td>Windows:&nbsp;<code>2.1</code>
Unix:&nbsp;<code>1.5</code>
<td>Be sure not to include a third number, e.g. <b>not</b>
&quot;<code>2.2.1</code>&quot;, even if that's the version you
have.
<tr>
<td><code>PYTHON_INCLUDES</code>
<td>path to Python <code>#include</code> directories
<td>Autoconfigured from <code>PYTHON_ROOT</code>
<tr>
<td><code>PYTHON_LIB_PATH</code>
<td>path to Python library object.
<td>Autoconfigured from <code>PYTHON_ROOT</code>
<tr>
<td><code>PYTHON_STDLIB_PATH</code>
<td>path to Python standard library modules
<td>Autoconfigured from <code>PYTHON_ROOT</code>
<tr>
<td><code>CYGWIN_ROOT</code>
<td>path to the user's Cygwin installation
<td>
<td><a href="http://www.cygwin.com">Cygwin</a> only. This and the following two settings are
useful when building with multiple toolsets on Windows, since
Cygwin requires a different build of Python.
<tr>
<td><code>GCC_PYTHON_ROOT</code>
<td>path to the user's Cygwin Python installation
<td><code>$(CYGWIN_ROOT)/usr/local</code>
<td><a href="http://www.cygwin.com">Cygwin</a> only
<tr>
<td><code>GCC_DEBUG_PYTHON_ROOT</code>
<td>path to the user's Cygwin <code><a
href="#variants">pydebug</a></code> build
<td><code>$(CYGWIN_ROOT)/usr/local/pydebug</code>
<td><a href="http://www.cygwin.com">Cygwin</a> only
</table>
<h3>Results</h3>
<p>The build process will create a
<code>libs/python/build/bin-stage</code> subdirectory of the
boost root (or of <code>$(ALL_LOCATE_TARGET)</code>,
if you have set that variable), containing the built
libraries. The libraries are actually built to unique
directories for each toolset and variant elsewhere in the
filesystem, and copied to the
<code>bin-stage</code> directory as a convenience, so if you
build with multiple toolsets at once, the product of later
toolsets will overwrite that of earlier toolsets in
<code>bin-stage</code>.
<h3>Testing</h3>
<p>To build and test Boost.Python from within the
<code>libs/python/build</code> directory, invoke
<blockquote>
<pre>
bjam -sTOOLS=<i><a href="../../../tools/build/index.html#Tools">toolset</a></i> test
</pre>
</blockquote>
This will
update all of the Boost.Python v1 test and example targets. The tests
are relatively quiet by default. To get more-verbose output, you might try
<blockquote>
<pre>
bjam -sTOOLS=<i><a href="../../../tools/build/index.html#Tools">toolset</a></i> -sPYTHON_TEST_ARGS=-v test
</pre>
</blockquote>
which will print each test's Python code with the expected output as
it passes.
<h2>Building your Extension Module</h2>
Though there are other approaches, the easiest way to build an
extension module using Boost.Python is with Boost.Build. Until
Boost.Build v2 is released, cross-project build dependencies are
not supported, so it works most smoothly if you add a new
subproject to your boost installation. The
<code>libs/python/example</code> subdirectory of your boost
installation contains a minimal example (along with many extra
sources). To copy the example subproject:
<ol>
<li>Create a new subdirectory in, <code>libs/python</code>, say
<code>libs/python/my_project</code>.
<li>Copy <code><a
href="../example/Jamfile">libs/python/example/Jamfile</a></code>
to your new directory.
<li>Edit the Jamfile as appropriate for your project. You'll
want to change the &quot;<code>subproject</code>&quot; rule
invocation at the top, and the names of some of the source files
and/or targets.
</ol>
If you can't modify or copy your boost installation, the
alternative is to create your own Boost.Build project. A similar
example you can use as a starting point is available in <code><a
href="../example/project.zip">this archive</a></code>. You'll
need to edit the Jamfile and Jamrules files, depending on the
relative location of your Boost installation and the new
project. Note that automatic testing of extension modules is not
available in this configuration.
<h2><a name="variants">Build Variants</a></h2>
Three <a
href="../../../tools/build/build_system.htm#variants">variant</a>
configurations of all python-related targets are supported, and
can be selected by setting the <code><a
href="../../../tools/build/build_system.htm#user_globals">BUILD</a></code>
variable:
<hr>
Makefiles for various platforms and a Visual Studio project
reside in the Boost subdirectory <tt>libs/python/build</tt>.
Build targets include:
<ul>
<li><code>release</code> (optimization, <tt>-DNDEBUG</tt>)
<li>The <tt>boost_python</tt> library for static linking with your
extension module. On the various Unices, this library will be
called <tt>libboost_python.a</tt>. When using Visual C++, the
library will be called <tt>boost_python.lib</tt>.
<li><code>debug</code> (no optimization <tt>-D_DEBUG</tt>)
<p>
<li>A comprehensive test of Boost.Python features. This test builds
a Boost.Python extension module, then runs Python to import the
module, and runs a series of tests on it using <tt><a href=
"../test/doctest.py">doctest</a></tt>. Source code for the module
and tests is available in the Boost subdirectory
<tt>libs/python/test</tt>.
<li><code>debug-python</code> (no optimization, <tt>-D_DEBUG
<p>
<li>Various examples from the Boost subdirectory
<tt>libs/python/example</tt>.
All these examples include a doctest modeled
on the comprehensive test above.
</ul>
<hr>
There is a group of makefiles with support for simultaneous
compilation on multiple platforms and a consistent set of
features that build the <tt>boost_python</tt> library for static
linking, the comprehensive test, and all examples in
<tt>libs/python/example</tt>:
<ul>
<li><a href="../build/vc60.mak">vc60.mak</a>:
Visual C++ 6.0 Service Pack 4
<li><a href="../build/mingw32.mak">mingw32.mak</a>:
mingw32 (Win32-targeted) gcc 2.95.2
<li><a href="../build/linux_gcc.mak">linux_gcc.mak</a>:
gcc 2.95.2 on Linux/Unix
<li><a href="../build/tru64_cxx.mak">tru64_cxx.mak</a>:
Compaq Alpha using the Compaq cxx compiler
<li><a href="../build/irix_CC.mak">irix_CC.mak</a>:
Silicon Graphics IRIX 6.5 CC compiler
</ul>
<a href="http://cctbx.sourceforge.net/page_installation_adv.html#installation_boost_python"
>Usage of these makefiles is described here.</a>
<hr>
There is another group of makefiles for GNU make.
These makefiles are less redundant than the makefiles
in the group above,
but the list of compilation targets is not as complete
and there is no support for simultaneous compilation
on multiple platforms.
<ul>
<li><a href="../build/como.mak">como.mak</a>:
Comeau C++ on Linux
<li><a href="../build/gcc.mak">gcc.mak</a>:
GCC on Linux/Unix.
</ul>
<hr>
A project workspace for Microsoft Visual Studio is provided at <tt><a
href="../build/build.dsw">libs/python/build/build.dsw</a></tt>. The
include paths for this project may need to be changed for your
installation. They currently assume that python has been installed at
<tt>c:\tools\python</tt>. Three configurations of all targets are
supported:
<ul>
<li>Release (optimization, <tt>-DNDEBUG</tt>)
<li>Debug (no optimization <tt>-D_DEBUG</tt>)
<li>DebugPython (no optimization, <tt>-D_DEBUG
-DBOOST_DEBUG_PYTHON</tt>)
</ul>
<p>The first two variants of the <code>boost_python</code>
library are built by default, and are compatible with the
default Python distribution. The <code>debug-python</code>
variant corresponds to a specially-built debugging version of
Python. On Unix platforms, this python is built by adding
<code>--with-pydebug</code> when configuring the Python
build. On Windows, the debugging version of Python is generated
by the &quot;Win32 Debug&quot; target of the
<code>PCBuild.dsw</code> Visual C++ 6.0 project in the
<code>PCBuild</code> subdirectory of your Python distribution.
Extension modules built with Python debugging enabled are <b>not
link-compatible</b> with a non-debug build of Python. Since few
people actually have a debug build of Python (it doesn't come
with the standard distribution), the normal
<code>debug</code> variant builds modules which are compatible
with ordinary Python.
<p>On many windows compilers, when extension modules are built
with
<p>When extension modules are built with Visual C++ using
<tt>-D_DEBUG</tt>, Python defaults to <i>force</i> linking with a
special debugging version of the Python DLL. Since this debug DLL
isn't supplied with the default Python installation for Windows,
Boost.Python uses <tt><a href=
"../../../boost/python/detail/wrap_python.hpp">boost/python/detail/wrap_python.hpp</a></tt>
to temporarily undefine <tt>_DEBUG</tt> when <tt>Python.h</tt> is
<tt>#include</tt>d - unless <code>BOOST_DEBUG_PYTHON</code> is defined.
<tt>#include</tt>d.
<p>If you want the extra runtime checks available with the
debugging version of the library, <tt>#define
BOOST_DEBUG_PYTHON</tt> to re-enable python debuggin, and link
with the <code>debug-python</code> variant of
<tt>boost_python</tt>.
<p>If you want the extra runtime checks available with the debugging
version of the library, <tt>#define BOOST_DEBUG_PYTHON</tt> to
re-enable library forcing, and link with the DebugPython version of
<tt>boost_python.lib</tt>. You'll need to get the debugging version
of the Python executable (<tt>python_d.exe</tt>) and DLL
(<tt>python20_d.dll</tt> or <tt>python15_d.dll</tt>). The Python
sources include project files for building these. If you <a href=
"http://www.python.org">download</a> them, change the name of the
top-level directory to <tt>src</tt>, and install it under
<tt>c:\tools\python</tt>, the workspace supplied by Boost.Python will
be able to use it without modification. Just open
<tt>c:\tools\python\src\pcbuild\pcbuild.dsw</tt> and invoke "build
all" to generate all the debugging targets.
<p>If you do not <tt>#define BOOST_DEBUG_PYTHON</tt>, be sure that
any source files in your extension module <tt>#include &lt;<a href=
any source files <tt>#include &lt;<a href=
"../../../boost/python/detail/wrap_python.hpp">boost/python/detail/wrap_python.hpp</a>&gt;</tt>
instead of the usual <tt>Python.h</tt>, or you will have link
incompatibilities.<br>
<hr>
If your platform isn't directly supported, you can build a static
library from the following source files (in the Boost subdirectory
<tt>libs/python/src</tt>), or compile them directly and link the
resulting objects into your extension module:
<ul>
<li><a href=
"../../../libs/python/src/classes.cpp">classes.cpp</a>
<li><a href=
"../../../libs/python/src/conversions.cpp">conversions.cpp</a>
<li><a href=
"../../../libs/python/src/cross_module.cpp">cross_module.cpp</a>
<li><a href=
"../../../libs/python/src/extension_class.cpp">extension_class.cpp</a>
<li><a href=
"../../../libs/python/src/functions.cpp">functions.cpp</a>
<li><a href=
"../../../libs/python/src/init_function.cpp">init_function.cpp</a>
<li><a href=
"../../../libs/python/src/module_builder.cpp">module_builder.cpp</a>
<li><a href=
"../../../libs/python/src/objects.cpp">objects.cpp</a>
<li><a href=
"../../../libs/python/src/types.cpp">types.cpp</a>
</ul>
<hr>
Next: <a href="enums.html">Wrapping Enums</a> Previous: <a href=
"under-the-hood.html">A Peek Under the Hood</a> Up: <a href=
"index.html">Top</a>
<hr>
<p>&copy; Copyright David Abrahams 2002. Permission to copy, use, modify,
<p>&copy; Copyright David Abrahams 2000. Permission to copy, use, modify,
sell and distribute this document is granted provided this copyright
notice appears in all copies. This document is provided ``as is'' without
express or implied warranty, and with no claim as to its suitability for
any purpose.
<p>Updated: May 15, 2002 (David Abrahams)
<p>Updated: Apr 17, 2001 (R.W. Grosse-Kunstleve)
</div>

View File

@@ -16,101 +16,62 @@
intrusive on your C++ design. In most cases, you should not have to alter
your C++ classes in any way in order to use them with Boost.Python. The system
<em>should</em> simply ``reflect'' your C++ classes and functions into
Python.
Python. The major features of Boost.Python include support for:
<ul>
<li><a href="inheritance.html">Subclassing extension types in Python</a>
<li><a href="overriding.html">Overriding virtual functions in Python</a>
<li><a href="overloading.html">[Member] function Overloading</a>
<li><a href="special.html#numeric_auto">Automatic wrapping of numeric operators</a>
</ul>
among others.
<p>
<table border="1">
<tr><td> <b>Note:</b> this is the last official release of
Boost.Python v1. Development of this version of the library has
stopped; it will be retired soon in favor of the redesigned and
improved version 2. A summary of the development goals is available on
the Python <a href="http://www.python.org/sigs/c++-sig/">C++-sig</a>
page, which also serves as a mailing list for users of both versions
of the library. A preview of the v2 documentation is available <a
href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/boost/boost/libs/python/doc/v2/index.html?rev=HEAD&content-type=text/html">here</a>,
and instructions for getting started with a prerelease are available
upon request.
</table>
<h2>Supported Platforms</h2>
<p>Boost.Python is known to have been tested
against <a href="http://www.python/org/2.2.1">Python 2.2.1</a> using
the following compilers:
<p>Boost.Python is known to have been tested in the following configurations:
<ul>
<li>Against Python 2.0 using the following compiler/library combinations:
<ul>
<li><a
href="http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp">MSVC++6sp5</a>.
All tests pass.
href="http://msdn.microsoft.com/vstudio/sp/vs6sp4/dnldoverview.asp">MSVC++6sp4</a>
with the native library.
<li><a
href="http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp">MSVC++6sp5</a>
with <a href="http://www.stlport.org">STLPort</a>-4.5.3. A compiler bug interferes with
<a
href="../example/simple_vector.cpp">libs/python/example/simple_vector.cpp</a>. All
other tests pass.
<li>An upcoming release of <a
href="http://www.metrowerks.com/products/windows/">Metrowerks
CodeWarrior Pro6 for Windows</a> with the native library (the first
release has a bug that's fatal to Boost.Python)
<p>
<li><a href="http://msdn.microsoft.com/visualc/">MSVC++7 (Visual
Studio .NET)</a>. All tests pass.
<p>
<li><a href="http://www.metrowerks.com/products/windows/">Metrowerks
CodeWarrior Pro7.2 and Pro7.0 for Windows</a>. All tests pass.
<p>
<li><a href="http://gcc.gnu.org">GCC 3.0.4</a> under <a
href="http://www.cygwin.com">Cygwin</a> and
<a href="http://www.redhat.com/">RedHat Linux 7.1</a>.
All tests pass.
<p>
<li>Compaq C++ V6.2-024 for Digital UNIX (an <a
href="http://www.edg.com/">EDG</a>-based compiler).
All tests pass.<br>
Note that the Boost.Compatibility
library must be included (see e.g. tru64_cxx.mak in the build
directory).
<p>
<li>Silicon Graphics MIPSpro Version 7.3.1.2m (an <a
href="http://www.edg.com/">EDG</a>-based compiler).
All tests pass.<br>
Note that the Boost.Compatibility
library must be included (see e.g. irix_CC.mak in the build
directory).
<p>
<li><a href="http://gcc.gnu.org">GCC 2.95.2</a> under <a
href="http://www.mingw.org">MinGW</a> and <a
href="http://www.redhat.com/">RedHat Linux 7.1</a>.
Compilation succeeds, but some tests fail at runtime due to
exception handling bugs. It is therefore highly recommended
to use GCC 3.0.4 instead.
<p>
<li><a
<li><a
href="http://developer.intel.com/software/products/compilers/c50/">Intel
C++ 6.0</a> beta: Comprehensive test fails to link due to a
linker bug. Other tests seem to work.
<p>
<li><a
href="http://developer.intel.com/software/products/compilers/c50/">Intel
C++ 5.0</a> Comprehensive test fails at runtime due to an
exception-handling bug. Other tests seem to work.
C++ 5.0</a>. Compilation succeeds, but tests <font
color="#FF0000"><b>FAILED at runtime</b></font> due to a bug in its
exception-handling implementation.
</ul>
<p>
Note that pickling doesn't work with Python 2.2
due to a core language bug. This is fixed in
<a href="http://www.python/org/2.2.1">2.2.1</a>.
<li>Against Python 1.5.2 using the following compiler/library:
<p>
Boost.Python has also been used with other versions of Python back to
Python 1.5.2. It is expected that the older Python releases still work,
but we are not regularly testing for backward compatibility.
<ul>
<li><a
href="http://msdn.microsoft.com/vstudio/sp/vs6sp4/dnldoverview.asp">MSVC++6sp4</a>
<li><a
href="http://msdn.microsoft.com/vstudio/sp/vs6sp4/dnldoverview.asp">MSVC++6sp4</a>/<a
href="http://www.stlport.org">STLport 4.0</a>
<li><a href="http://gcc.gnu.org/">GCC 2.95.2</a> [by <a href="mailto:koethe@informatik.uni-hamburg.de">Ullrich
Koethe</a>]
<li><a href="http://gcc.gnu.org/">GCC 2.95.2</a>/<a href="http://www.stlport.org">STLport 4.0</a>
<li>Compaq C++ V6.2-024 for Digital UNIX V5.0 Rev. 910 (an <a
href="http://www.edg.com/">EDG</a>-based compiler) with <a
href="http://www.stlport.org/beta.html">STLport-4.1b3</a> [by <a
href="mailto:rwgk@cci.lbl.gov">Ralf W. Grosse-Kunstleve</a>]
<li>An upcoming release of <a href="http://www.metrowerks.com/products/windows/">Metrowerks CodeWarrior
Pro6 for Windows</a> (the first release has a bug that's fatal to Boost.Python)
</ul>
</ul>
<h2>Credits</h2>
<ul>
@@ -191,8 +152,8 @@ but we are not regularly testing for backward compatibility.
href="../test/comprehensive.cpp">cpp</a>]</code>
<p>
Questions should be directed to the <a href=
"http://www.python.org/sigs/c++-sig/">Python C++ SIG</a>.
Questions should be directed to <a href=
"http://www.yahoogroups.com/list/boost">the boost mailing list</a>.
<p>
&copy; Copyright David Abrahams 2001. Permission to copy, use, modify,
@@ -201,5 +162,5 @@ but we are not regularly testing for backward compatibility.
express or implied warranty, and with no claim as to its suitability for
any purpose.
<p>
Updated: Apr 2002
Updated: Mar 6, 2001

View File

@@ -768,7 +768,7 @@ void throw_key_error_if_end(
if (p == m.end())
{
PyErr_SetObject(PyExc_KeyError, boost::python::converters::to_python(key));
boost::python::throw_error_already_set();
throw boost::python::error_already_set();
}
}

View File

@@ -1,162 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - April 2002 Progress Report</title>
</head>
<body link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="http://www.boost.org"><img height="86" width="277" alt="C++ Boost" src="../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">April 2002 Progress Report</h2>
</td>
</tr>
</table>
<hr>
<h2>Contents</h2>
<dl class="index">
<dt><a href="#accomplishments">Accomplishments</a></dt>
<dl class="index">
<dt><a href="#arity">Arbitrary Arity Support</a></dt>
<dt><a href="#callbacks">New Callback Interface</a></dt>
<dt><a href="#policies">Call Policies for Construtors</a></dt>
<dt><a href="#bugs">Real Users, Real Bugs</a></dt>
<dt><a href="#insights">New Insights</a></dt>
<dt><a href="#v1">Boost.Python V1 Maintenance</a></dt>
</dl>
<dt><a href="#missing">What's Missing</a></dt>
</dl>
<h2><a name="accomplishments">Accomplishments</a></h2>
April was a short month as far as Boost.Python was concerned, since
the spring ISO C++ Committee Meeting (and associated vacation)
occupied me for the 2nd half of the month. However, a suprising amount
of work got done...
<h3><a name="arity">Arbitrary Arity Support</a></h3>
I began using the <a
href="../../../preprocessor/doc/index.htm">Boost.Preprocessor</a>
metaprogramming library to generate support for functions and member
functions of arbitrary arity, which was, to say the least, quite an
adventure. The feedback cycle resulting from my foray into
Boost.Preprocessor resulted in several improvements to the library,
most notably in its documentation.
<p>
Boost.Python now supports calls of up to 17 arguments on most
compilers. Because most EDG-based compilers have dismal preprocessor
performance, I had to &quot;manually&quot; expand the metaprograms for
arities from zero to fifteen arguments, and EDG-based compilers with
<code>__EDG_VERSION__&nbsp;&lt;=&nbsp;245</code> only support 15
arguments by default. If some crazy program finds a need for more than
the default arity support, users can increase the base support by
setting the <code>BOOST_PYTHON_MAX_ARITY</code> preprocessor symbol.
<h3><a name="callbacks">New Callback Interface</a></h3>
I mentioned in <a href="Mar2002.html">last month's report</a> that I
wasn't pleased with the interface for the interface for calling into
Python, so now it has been redesigned. The new interface is outlined
in <a
href="http://mail.python.org/pipermail/c++-sig/2002-April/000953.html">this
message</a> (though the GCC 2.95.3 bugs have been fixed).
<h3><a name="policies">Call Policies for Constructors</a></h3>
On April 2nd, I <a
href="http://mail.python.org/pipermail/c++-sig/2002-April/000916.html">announced</a>
support for the use of call policies with constructors.
<h3><a name="bugs">Real Users, Real Bugs</a></h3>
At least two people outside of Kull began actually using Boost.Python
v2 in earnest this month. Peter Bienstman and Pearu Pearson both
provided valuable real-world bug reports that helped me to improve the
library's robustness.
<h3><a name="insights">New Insights</a></h3>
<a
href="http://mail.python.org/pipermail/c++-sig/2002-May/001010.html"
>Answering some of Pearu's questions</a> about explicitly converting
objects between Python and C++ actually led me to a new understanding
of the role of the current conversion facilities. In Boost.Python v1,
all conversions between Python and C++ were handled by a single family
of functions, called <code>to_python()</code> and
<code>from_python()</code>. Since the primary role of Boost.Python is
to wrap C++ functions in Python, I used these names for the first kind
of converters I needed: those that extract C++ objects to be used as
function arguments and which C++ function return values to
Python. The better-considered approach in Boost.Python v2 uses a
completely different mechanism for conversions used when calling
Python from C++, as in wrapped virtual function implementations. I
usually think of this as a &quot;callback&quot;, as in &quot;calling
back into Python&quot;, and I named the converters used in callbacks
accordingly: <code>to_python_callback</code> and
<code>from_python_callback</code>. However, as it turns out, the
behavior of the &quot;callback&quot; converters is the appropriate one
for users who want to explicitly extract a C++ value from a Python
object, or create a Python object from a C++ value. The upshot is that
it probably makes sense to change the name of the existing <code>to_python</code> and
<code>from_python</code> so those names are available for the
user-friendly explicit converters.
<p>
<a
href="http://mail.python.org/pipermail/c++-sig/2002-May/001013.html">Another
of Pearu's questions</a> pushes momentum further in the direction of a
more-sophisticated overloading mechanism than the current
simple-minded &quot;first match&quot; approach, as I suggested <a
href="Mar2002.html#implicit_conversions">last month</a>.
<h3><a name="v1">Boost.Python V1 Mainenance</a></h3>
As much as I'm looking forward to retiring Boost.Python v1, a
significant amount of effort has been being spent dealing with support
problems; the saying that code rots when left alone is true, and
Boost.Python is no exception. Eventually it became obvious to me that
we were going to have to invest some effort in keeping V1 healthy
while working on V2. Ralf and I have expanded support for various
compilers and stabilized the V1 codebase considerably. We discarded
the obsolete Visual Studio projects which were causing so much
confusion. Still to do before the next Boost release:
<ol>
<li>Update the build/test documentation with detailed instructions for
configuring various toolsets.
<li>Provide some links to Boost.Python v2 to let people know what's
coming.
</ol>
<h2><a name="missing">What's Missing</a></h2>
Last month I announced that I would implement the following which are
not yet complete:
<ol>
<li>Document all implemented features
<li>Implement conversions for <code>char</code> types. This is
implemented but not tested, so we have to assume it doesn't work.
</ol>
These are my first priority for this month (especially the
documentation).
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
3 May, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave Abrahams</a>
2002. All Rights Reserved.</i></p>
</body>
</html>

View File

@@ -1,233 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - March 2002 Progress Report</title>
</head>
<body link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="http://www.boost.org"><img height="86" width="277" alt="C++ Boost" src="../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">March 2002 Progress Report</h2>
</td>
</tr>
</table>
<hr>
<h2>Contents</h2>
<dl class="index">
<dt><a href="#accomplishments">Accomplishments</a></dt>
<dl class="index">
<dt><a href="#calling_python">Calling Python from C++</a></dt>
<dt><a href="#virtual_functions">Virtual Functions</a></dt>
<dt><a href="#abstract_classes">Abstract Classes</a></dt>
<dt><a href="#implicit_conversions">C++ Implicit Conversions</a></dt>
<dt><a href="#data_members">C++ Data Members</a></dt>
<dt><a href="#miscellaneous">Miscellaneous</a></dt>
</dl>
<dt><a href="#future">The Near future</a></dt>
<dt><a href="#notes">Notes</a></dt>
</dl>
<h2><a name="accomplishments">Accomplishments</a></h2>
March was mostly devoted to the reimplementation of features from
Boost.Python v1, and some new features. Re-examination of the features
from Boost.Python v1 allowed me to make significant improvements.
<h3><a name="calling_python">Calling Python from C++</a></h3>
The ability to call Python from C++ is crucial for virtual function
support. Implementing this feature well for V2 proved to be more
interesting than I expected. You can review most of the relevant
design decisions
<a href="callbacks.txt">here</a>.
<p>
One point which <i>isn't</i> emphasized in that document is that there
are subtle differences in the way <code>from_python</code> conversions
work when used for C++ function arguments and Python function return
values. In particular, while <code>T const&amp;</code> arguments may
invoke rvalue converters, a reference-to-const return value requires
an lvalue converter, since a temporary conversion result would leave
the returned reference dangling.
<p>I'm not particularly pleased with the current callback interface,
since it usually results in constructs like:
<pre>
<u>return returning</u>&lt;X&amp;&gt;::call(f, obj);
</pre>
However, I think the following may be possible and I plan to investigate:
<pre>
return apply&lt;X&amp;&gt;(f, obj);
</pre>
I'm open to suggestion for better names (and syntaxes)!
<h3><a name="virtual_functions">Virtual Functions</a></h3>
Once Python callbacks were implemented, it was just a short step to
implementing virtual functions. Python extension class exposing a C++
class whose virtual functions are overridable in Python must actually
hold a C++ instance of a class <i>derived</i> from the one exposed to
Python. Needing some way for users to specify that class, I added an
optional template argument to <code>value_holder_generator</code> and
<code>pointer_holder_generator&lt;&gt;</code> to specify the class
actually held. This move began to put pressure on the
<code>class_&lt;&gt;</code> interface, since the need for the user to
produce complicated instantations of
<code>class_&lt;&gt;</code> was increased:
<pre>
class&lt;Foo, bases&lt;&gt;, value_holder_generator&lt;Foo_callback&gt; &gt;(&quot;Foo&quot;)
.def(&quot;hello&quot;, &amp;Foo::hello)
...
</pre>
<h3><a name="abstract_classes">Abstract Classes</a></h3>
Normally when a C++ class is exposed to Python, the library registers
a conversion function which allows users to wrap functions returning
values of that type. Naturally, these return values are temporaries,
so the conversion function must make a copy in some
dynamically-allocated storage (a &quot;holder&quot;) which is managed
by the corresponding Python object.
<p>Unfortunately, in the case of abstract classes (and other types
without a publicly-accessible copy constructor), instantiating this
conversion function causes a compilation error. In order to support
non-copyable classes, there had to be some way to prevent the library
from trying to instantiate the conversion function. The only practical
approach I could think of was to add an additional template parameter
to the <code>class_&lt;&gt;</code> interface. When the number of
template parameters with useful defaults begins to grow, it is often
hard to choose an order which allows users to take advantage of the
defaults.
<p>
This was the straw that broke the
<code>class_&lt;&gt;</code> interface's back and caused the redesign
whose outcome is detailed <a
href="http://mail.python.org/pipermail/c++-sig/2002-March/000892.html">here</a>.
The approach allows the user to supply the optional parameters in an
arbitrary order. It was inspired by the use of <a
href="../../../utility/iterator_adaptors.htm#named_tempalte_parameters">named
template parameters</a> in the <a
href="../../../utility/iterator_adaptors.htm">Boost Iterator Adaptor
Library</a>, though in this case it is possible to deduce the meaning
of the template parameters entirely from their type properties,
resulting in a simpler interface. Although the move from a
policy-based design to what resembles a configuration DSL usually
implies a loss of flexibility, in this case I think any costs are far
outweighed by the advantages.
<p>Note: working around the limitations of the various compilers I'm
supporting was non-trivial, and resulted in a few messy implementation
details. It might be a good idea to switch to a more-straightforward
approach once Metrowerks CodeWarrior Pro8 is released.
<h3><a name="implicit_conversions">C++ Implicit Conversions</a></h3>
Support for C++ implicit conversion involves creating
<code>from_python</code> converters for a type <code>U</code> which in
turn use <code>from_python</code> converters registered for a type
<code>T</code> where there exists a implicit conversion from
<code>T</code> to <code>U</code>. The current implementation is
subject to two inefficiencies:
<ol>
<li>Because an rvalue <code>from_python</code> converter produces two
pieces of data (a function and a <code>void*</code>) from its
<code>convertible()</code> function, we end up calling the function
for <code>T</code> twice: once when the converter is looked up in the
registry, and again when the conversion is actually performed.
<li>A vector is used to mark the "visited" converters, preventing
infinite recursion as <code>T</code> to
<code>U</code> and <code>U</code> to <code>T</code> converters
continually search through one-another.
</ol>
I consider the former to be a minor issue. The second may or may not
prove to be computationally significant, but I believe that
architecturally, it points toward a need for more sophisticated
overload resolution. It may be that we want CLOS-style multimethod
dispatching along with C++ style rules that prevent more than one
implicit conversion per argument.
<h3><a name="data_members">C++ Data Members</a></h3>
To supply the ability to directly access data members, I was able to
hijack the new Python <a
href="http://www.python.org/2.2/descrintro.html#property">property</a>
type. I had hoped that I would also be able to re-use the work of <a
href="make_function.html">make_function</a> to create callable python
objects from C++ functions which access a data member of a given
class. C++ facilities for specifying data member pointer non-type
template arguments require the user to explicitly specify the type of
the data member and this under-utilized feature is also not
well-implemented on all compilers, so passing the member pointer as a
runtime value is the only practical approach. The upshot is that any
such entity would actually have to be a function <i>object</i>, and I
haven't implemented automatic wrapping of C++ callable function
objects yet, so there is less re-use in the implementation than I'd
like. I hope to implement callable object wrapping and refactor this
code one day. I also hope to implement static data member support,
for which Python's property will not be an appropriate descriptor.
<h3><a name="miscellaneous">Miscellaneous</a></h3>
<ul>
<li>Moved <code>args&lt;&gt;</code> and <code>bases&lt;&gt;</code> from unnamed namespace to <code>boost::python</code> in their own header files.
<li>Convert <code>NULL</code> pointers returned from wrapped C++ functions to <code>None</code>.
<li>Improved some compile-time error checks.
<li>Eliminated <code>boost/python/detail/eval.hpp</code> in favor of
more-general <code>boost/mpl/apply.hpp</code>.
<li>General code cleanup and refactoring.
<li>Works with Microsoft Visual C++ 7.0
<li>Warning suppression for many compilers
<li>Elegant interface design for exporting <code>enum</code> types.
</ul>
<hr>
<h2><a name="future">The Near Future</a></h2>
Before April 15th I plan to
<ol>
<li>Document all implemented features
<li>Implement a <code>CallPolicy</code> interface for constructors of wrapped
classes
<li>Implement conversions for <code>char</code> types.
<li>Implement automated code generation for all headers containing
families of overloaded functions to handle arbitrary arity.
</ol>
I also hope to implement a mechanism for generating conversions
between arbitrary Python sequences and C++ containers, if time permits
(and others haven't already done it)!
<h2><a name="notes">Notes</a></h2>
The older version of KCC used by Kull is generating lots of warnings
about a construct I use to instantiate static members of various class
templates. I'm thinking of moving to an idiom which uses a function
template to suppress it, but worry about bloating the size of debug
builds. Since KCC users may be moving to GCC, I'm not sure that it's
worth doing anything about it.
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
1 April, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave Abrahams</a>
2002. All Rights Reserved.</i></p>
</body>
</html>

View File

@@ -21,6 +21,7 @@
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a></dt>
<dt><a href="#functions">Functions</a></dt>
<dl class="page-index">
<dt><a href="#call-spec">call</a></dt>
@@ -31,48 +32,28 @@
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<p>
<code>&lt;boost/python/call.hpp&gt;</code> defines the <a
href="#call-spec"><code>call</code></a> family of overloaded function
templates, used to invoke Python callable objects from C++.
<p>{{Introductory text}}</p>
<h2><a name="functions"></a>Functions</h2>
<pre>
<a name="call-spec">template &lt;class R, class A1, class A2, ... class A<i>n</i>&gt;</a>
R call(PyObject* callable, A1 const&amp;, A2 const&amp;, ... A<i>n</i> const&amp;)
<a name="call-spec"></a>call
</pre>
<dl class="function-semantics">
<dt><b>Requires:</b> <code>R</code> is a pointer type, reference
type, or a complete type with an accessible copy constructor</dt>
<dt><b>Effects:</b> Invokes <code>callable(a1,&nbsp;a2,&nbsp;...a<i>n</i>)</code> in
Python, where <code>a1</code>...<code>a<i>n</i></code> are the arguments to
<code>call()</code>, converted to Python objects.
<dt><b>Returns:</b> The result of the Python call, converted to the C++ type <code>R</code>.</dt>
</dt>
<dt><b>Rationale:</b> For a complete semantic description and
rationale, see <a href="callbacks.html">this page</a>.
</dt>
<dt><b>Requires:</b> {{text}}</dt>
<dt><b>Effects:</b> {{text}}</dt>
<dt><b>Postconditions:</b> {{text}}</dt>
<dt><b>Returns:</b> {{text}}</dt>
<dt><b>Throws:</b> {{text}}</dt>
<dt><b>Complexity:</b> {{text}}</dt>
<dt><b>Rationale:</b> {{text}}</dt>
</dl>
<h2><a name="examples"></a>Example(s)</h2>
The following C++ function applies a Python callable object to its two
arguments and returns the result. If a Python exception is raised or
the result can't be converted to a <code>double</code>, an exception
is thrown.
<pre>
double apply2(PyObject* func, double x, double y)
{
return boost::python::call&lt;double&gt;(func, x, y);
}
</pre>
<p>{{Example(s)}}</p>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
9 May, 2002 <!-- Luann's birthday! -->
05 November, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave Abrahams</a>

View File

@@ -1,140 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - &lt;call_method.hpp&gt;</title>
</head>
<body link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="http://www.boost.org"><img height="86" width="277" alt="C++ Boost" src="../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">Header &lt;call_method.hpp&gt;</h2>
</td>
</tr>
</table>
<hr>
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a></dt>
<dt><a href="#functions">Functions</a></dt>
<dl class="page-index">
<dt><a href="#call_method-spec">call_method</a></dt>
</dl>
<dt><a href="#examples">Example(s)</a></dt>
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<p>
<code>&lt;boost/python/call_method.hpp&gt;</code> defines the <a
href="#call_method-spec"><code>call_method</code></a> family of overloaded function
templates, used to invoke Python callable objects from C++.
<h2><a name="functions"></a>Functions</h2>
<pre>
<a name="call_method-spec">template &lt;class R, class A1, class A2, ... class A<i>n</i>&gt;</a>
R call_method(PyObject* self, char const* method, A1 const&amp;, A2 const&amp;, ... A<i>n</i> const&amp;)
</pre>
<dl class="function-semantics">
<dt><b>Requires:</b> <code>R</code> is a pointer type, reference
type, or a complete type with an accessible copy constructor</dt>
<dt><b>Effects:</b> Invokes <code>self.<i>method</i>(a1,&nbsp;a2,&nbsp;...a<i>n</i>)</code> in
Python, where <code>a1</code>...<code>a<i>n</i></code> are the arguments to
<code>call_method()</code>, converted to Python objects. For a
complete semantic description, see <a href="callbacks.html">this
page</a>.
<dt><b>Returns:</b> The result of the Python call, converted to the
C++ type <code>R</code>.</dt>
</dt>
<dt><b>Rationale:</b> <code>call_method</code> is critical to
implementing C++ virtual functions which are overridable in Python,
as shown by the example below.
</dt>
</dl>
<h2><a name="examples"></a>Example(s)</h2>
The following C++ illustrates the use of <code>call_method</code> in
wrapping a class with a virtual function that can be overridden in
Python:
<h3>C++ Module Definition</h3>
<pre>
#include &lt;boost/python/module.hpp&gt;
#include &lt;boost/python/class.hpp&gt;
#include &lt;boost/utility.hpp&gt;
#include &lt;cstring&gt;
// class to be wrapped
class Base
{
public:
virtual char const* class_name() const { return &quot;Base&quot;; }
virtual ~Base();
};
bool is_base(Base* b)
{
return !std::strcmp(b-&gt;class_name(), &quot;Base&quot;);
}
// Wrapper code begins here
using namespace boost::python;
// Callback class
class Base_callback : public Base
{
public:
Base_callback(PyObject* self) : m_self(self) {}
char const* class_name() const { return <b>call_method</b>(m_self, &quot;class_name&quot;); }
char const* Base_name() const { return Base::class_name(); }
private:
PyObject* m_self;
};
using namespace boost::python;
BOOST_PYTHON_MODULE_INIT(my_module)
{
module("my_module")
.def(&quot;is_base&quot;, is_base)
.add(
class_&lt;Base,Base_callback, noncopyable&gt;(&quot;Base&quot;)
.def(&quot;class_name&quot;, &#24;Base_callback::Base_name);
)
;
}
</pre>
<h3>Python Code</h3>
<pre>
&gt;&gt;&gt; from my_module import *
&gt;&gt;&gt; class Derived(Base):
... def __init__(self):
... Base.__init__(self)
... def class_name(self):
... return self.__class__.__name__
...
&gt;&gt;&gt; is_base(Base()) # calls the class_name() method from C++
1
&gt;&gt;&gt; is_base(Derived())
0
</pre>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
9 May, 2002 <!-- Luann's birthday! -->
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave Abrahams</a>
2002. All Rights Reserved.</i></p>
</body>
</html>

View File

@@ -1,245 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - Calling Python Functions and Methods</title>
</head>
<body link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="http://www.boost.org"><img height="86" width="277" alt="C++ Boost" src="../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">Calling Python Functions and Methods</h2>
</td>
</tr>
</table>
<hr>
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a></dt>
<dt><a href="#argument_handling">Argument Handling</a></dt>
<dt><a href="#result_handling">Result Handling</a></dt>
<dt><a href="#result_handling">Rationale</a></dt>
</dl>
<hr>
<h2><a name="introduction">Introduction</a></h2>
<p>
Boost.Python provides two families of function templates,
<code><a href="call.html#call-spec">call</a></code> and <code><a
href="call_method.html#call_method-spec">call_method</a></code>, for
invoking Python functions and methods respectively. The interface for
calling a Python function object (or any Python callable object) looks
like:
<pre>
call&lt;ResultType&gt;(callable_object, a1, a2... a<i>N</i>);
</pre>
Calling a method of a Python object is similarly easy:
<pre>
call_method&lt;ResultType&gt;(self_object, &quot;<i>method-name</i>&quot;, a1, a2... a<i>N</i>);
</pre>
<h2><a name="argument_handling">Argument Handling</a></h2>
<p>
Arguments are converted to Python according to their type. By default,
the arguments <code>a1</code>...<code>a<i>N</i></code> are copied into
new Python objects, but this behavior can be overridden by the use of
<code><a href="ptr.html#ptr-spec">ptr()</a></code> and <a
href="../../../bind/ref.html#reference_wrapper">ref()</a>:
<pre>
class X : boost::noncopyable
{
...
};
void apply(PyObject* callable, X&amp; x)
{
// Invoke callable, passing a Python object which holds a reference to x
boost::python::call&lt;void&gt;(callable, boost::ref(x));
}
</pre>
In the table below, <code><b>x</b></code> denotes the actual argument
object and <code><b>cv</b></code> denotes an optional
<i>cv-qualification</i>: &quot;<code>const</code>&quot;,
&quot;<code>volatile</code>&quot;, or &quot;<code>const
volatile</code>&quot;.
<table border="1" summary="class_ template parameters">
<tr>
<th>Argument Type
<th>Behavior
<tr>
<td><code>T cv&amp;</code><br>
<code>T cv</code>
<td>The Python argument is created by the same means used
for the return value of a wrapped C++ function returning
<code>T</code>. When
<code>T</code> is a class type, that normally means
<code>*x</code> is copy-constructed into the new Python
object.
<tr>
<td><code>T*</code>
<td>If <code>x&nbsp;==&nbsp;0</code>, the Python argument will
be <code><a
href="http://www.python.org/doc/current/lib/bltin-null-object.html">None</a></code>. Otherwise,
the Python argument is created by the same means used for the
return value of a wrapped C++ function returning
<code>T</code>. When
<code>T</code> is a class type, that normally means
<code>*x</code> is copy-constructed into the new Python
object.
<tr>
<td><code><a
href="../../../bind/ref.html#reference_wrapper">boost::reference_wrapper</a>&lt;T&gt; </code>
<td>The Python argument contains a pointer to, rather than a
copy of, <code>x.get()</code>. Note: failure to ensure that no
Python code holds a reference to the resulting object beyond
the lifetime of <code>*x.get()</code> <b>may result in a
crash!</b>
<tr>
<td><code><a
href="ptr.html#pointer_wrapper-spec">pointer_wrapper</a>&lt;T&gt;</code>
<td>If <code>x.get()&nbsp;==&nbsp;0</code>, the Python
argument will be <code><a
href="http://www.python.org/doc/current/lib/bltin-null-object.html">None</a></code>.
Otherwise, the Python argument contains a pointer to, rather
than a copy of, <code>*x.get()</code>. Note: failure to ensure
that no Python code holds a reference to the resulting object
beyond the lifetime of <code>*x.get()</code> <b>may result in
a crash!</b>
</table>
<h2><a name="result_handling">Result Handling</a></h2>
In general, <code>call&lt;ResultType&gt;()</code> and
<code>call_method&lt;ResultType&gt;()</code> return
<code>ResultType</code> by exploiting all lvalue and rvalue
<code>from_python</code> converters registered for ResultType and
returning a copy of the result. However, when
<code>ResultType</code> is a pointer or reference type, Boost.Python
searches only for lvalue converters. To prevent dangling pointers and
references, an exception will be thrown if the Python result object
has only a single reference count.
<h2><a name="rationale">Rationale</a></h2>
In general, to get Python arguments corresponding to
<code>a1</code>...<code>a<i>N</i></code>, a new Python object must be
created for each one; should the C++ object be copied into that Python
object, or should the Python object simply hold a reference/pointer to
the C++ object? In general, the latter approach is unsafe, since the
called function may store a reference to the Python object
somewhere. If the Python object is used after the C++ object is
destroyed, we'll crash Python.
<p>In keeping with the philosophy that users on the Python side
shouldn't have to worry about crashing the interpreter, the default
behavior is to copy the C++ object, and to allow a non-copying
behavior only if the user writes <code><a
href="../../../bind/ref.html">boost::ref</a>(a1)</code> instead of a1
directly. At least this way, the user doesn't get dangerous behavior
&quot;by accident&quot;. It's also worth noting that the non-copying
(&quot;by-reference&quot;) behavior is in general only available for
class types, and will fail at runtime with a Python exception if used
otherwise[<a href="#1">1</a>].
<p>
However, pointer types present a problem: one approach is to refuse
to compile if any aN has pointer type: after all, a user can always pass
<code>*aN</code> to pass &quot;by-value&quot; or <code>ref(*aN)</code>
to indicate a pass-by-reference behavior. However, this creates a
problem for the expected null pointer to
<code>None</code> conversion: it's illegal to dereference a null
pointer value.
<p>
The compromise I've settled on is this:
<ol>
<li>The default behavior is pass-by-value. If you pass a non-null
pointer, the pointee is copied into a new Python object; otherwise
the corresponding Python argument will be None.
<li>if you want by-reference behavior, use <code>ptr(aN)</code> if
<code>aN</code> is a pointer and <code>ref(aN)</code> otherwise. If
a null pointer is passed to <code>ptr(aN)</code>, the corresponding
Python argument will be <code>None</code>.
</ol>
<p>
As for results, we have a similar problem: if <code>ResultType</code>
is allowed to be a pointer or reference type, the lifetime of the
object it refers to is probably being managed by a Python object. When
that Python object is destroyed, our pointer dangles. The problem is
particularly bad when the <code>ResultType</code> is char const* - the
corresponding Python String object is typically uniquely-referenced,
meaning that the pointer dangles as soon as <code>call&lt;char
const*&gt;(...)</code> returns.
<p>
The old Boost.Python v1 deals with this issue by refusing to compile
any uses of <code>call&lt;char const*&gt;()</code>, but this goes both
too far and not far enough. It goes too far because there are cases
where the owning Python string object survives beyond the call (just
for instance, when it's the name of a Python class), and it goes not
far enough because we might just as well have the same problem with a
returned pointer or reference of any other type.
<p>
In Boost.Python v2 this is dealt with by:
<ol>
<li> lifting the compile-time restriction on const
char* callback returns
<li> detecting the case when the reference count on the result
Python object is 1 and throwing an exception inside of
<code>call&lt;U&gt;(...)</code> when <code>U</code> is a pointer
or reference type.
</ol>
This should be acceptably safe because users have to explicitly
specify a pointer/reference for <code>U</code> in
<code>call&lt;U&gt;</code>, and they will be protected against dangles
at runtime, at least long enough to get out of the
<code>call&lt;U&gt;(...)</code> invocation.
<hr>
<a name="1">[1]</a> It would be possible to make it fail at compile-time for non-class
types such as int and char, but I'm not sure it's a good idea to impose
this restriction yet.
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 April, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave Abrahams</a>
2002. All Rights Reserved.</i></p>
</body>
</html>

View File

@@ -1,88 +0,0 @@
Here's the plan:
I aim to provide an interface similar to that of Boost.Python v1's
callback<>::call(...) for dealing with callbacks. The interface will
look like:
returning<ResultType>::call("method_name", self_object, a1, a2...);
or
returning<ResultType>::call(callable_object, a1, a2...);
ARGUMENT HANDLING
There is an issue concerning how to make Python objects from the
arguments a1...aN. A new Python object must be created; should the C++
object be copied into that Python object, or should the Python object
simply hold a reference/pointer to the C++ object? In general, the
latter approach is unsafe, since the called function may store a
reference to the Python object somewhere. If the Python object is used
after the C++ object is destroyed, we'll crash Python.
I plan to make the copying behavior the default, and to allow a
non-copying behavior if the user writes boost::ref(a1) instead of a1
directly. At least this way, the user doesn't get dangerous behavior "by
accident". It's also worth noting that the non-copying ("by-reference")
behavior is in general only available for class types, and will fail at
runtime with a Python exception if used otherwise**
However, pointer types present a problem: My first thought is to refuse
to compile if any aN has pointer type: after all, a user can always pass
*aN to pass "by-value" or ref(*aN) to indicate a pass-by-reference
behavior. However, this creates a problem for the expected NULL pointer
=> None conversion: it's illegal to dereference a null pointer value.
We could use another construct, say "ptr(aN)", to deal with null
pointers, but then what does it mean? We know what it does when aN is
NULL, but it might either have by-value or by-reference behavior when aN
is non-null.
The compromise I've settled on is this:
1. The default behavior is pass-by-value. If you pass a non-null
pointer, the pointee is copied into a new Python object; otherwise
the corresponding Python argument will be None.
2. if you want by-reference behavior, use ptr(aN) if aN is a pointer
and ref(aN) otherwise. If a null pointer is passed to ptr(aN), the
corresponding Python argument will be None.
RESULT HANDLING
As for results, we have a similar problem: if ResultType is allowed to
be a pointer or reference type, the lifetime of the object it refers to
is probably being managed by a Python object. When that Python object is
destroyed, our pointer dangles. The problem is particularly bad when the
ResultType is char const* - the corresponding Python String object is
typically uniquely-referenced, meaning that the pointer dangles as soon
as returning<char const*>::call() returns.
Boost.Python v1 deals with this issue by refusing to compile any uses of
callback<char const*>::call(), but IMO this goes both too far and not
far enough. It goes too far because there are cases where the owning
String object survives beyond the call (just for instance when it's the
name of a Python class), and it goes not far enough because we might
just as well have the same problem with any returned pointer or
reference.
I propose to address this in Boost.Python v2 by
1. lifting the compile-time restriction on const
char* callback returns
2. detecting the case when the reference count on the
result Python object is 1 and throwing an exception
inside of returning<U>::call() when U is a pointer or
reference type.
I think this is acceptably safe because users have to explicitly specify
a pointer/reference for U in returning<U>, and they will be protected
against dangles at runtime, at least long enough to get out of the
returning<U>::call() invocation.
-Dave
**It would be possible to make it fail at compile-time for non-class
types such as int and char, but I'm not sure it's a good idea to impose
this restriction yet.

View File

@@ -105,7 +105,7 @@ struct Foo {
using namespace boost::python;
BOOST_PYTHON_MODULE_INIT(my_module)
{
module("my_module")
module m("my_module")
.add(
class_&lt;Bar&gt;()
)

View File

@@ -1,150 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - &lt;boost/python/data_members.hpp&gt;</title>
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt=
"C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">Header &lt;boost/python/data_members.hpp&gt;</h2>
</table>
<hr>
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a>
<dt><a href="#functions">Functions</a>
<dd>
<dl class="page-index">
<dt><a href="#make_getter-spec">make_getter</a>
<dt><a href="#make_setter-spec">make_setter</a>
</dl>
<dt><a href="#examples">Example</a>
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<p><code><a href="#make_getter-spec">make_getter</a>()</code> and
<code><a href="#make_setter-spec">make_setter</a>()</code> are
the functions used internally by <code>class_&lt;&gt;::<a href=
"class.html#class_-spec-modifiers">def_readonly</a></code> and
<code>class_&lt;&gt;::<a href=
"class.html#class_-spec-modifiers">def_readwrite</a></code> to
produce Python callable objects which wrap C++ data members.
<h2><a name="functions"></a>Functions</h2>
<pre>
<a name="make_getter-spec">template &lt;class C, class D&gt;</a>
objects::function* make_getter(D C::*pm);
template &lt;class C, class D, class Policies&gt;
objects::function* make_getter(D C::*pm, Policies const&amp; policies);
</pre>
<dl class="function-semantics">
<dt><b>Requires:</b> <code>Policies</code> is a model of <a
href="CallPolicies.html">CallPolicies</a>.
<dt><b>Effects:</b> Creates a Python callable object which
accepts a single argument that can be converted
<code>from_python</code> to <code>C*</code>, and returns the
corresponding member <code>D</code> member of the <code>C</code>
object, converted <code>to_python</code>. If
<code>policies</code> is supplied, it will be applied to the
function as described <a href=
"CallPolicies.html">here</a>.
<dt><b>Returns:</b> A pointer convertible to <code>PyObject*</code> which
refers to the new Python callable object.
</dl>
<pre>
<a name="make_setter-spec">template &lt;class C, class D&gt;</a>
objects::function* make_setter(D C::*pm);
template &lt;class C, class D, class Policies&gt;
objects::function* make_setter(D C::*pm, Policies const&amp; policies);
</pre>
<dl class="function*-semantics">
<dt><b>Requires:</b> <code>Policies</code> is a model of <a
href="CallPolicies.html">CallPolicies</a>.
<dt><b>Effects:</b> Creates a Python callable object which, when
called from Python, expects two arguments which can be converted
<code>from_python</code> to <code>C*</code> and
<code>D&nbsp;const&amp;</code>, respectively, and sets the
corresponding <code>D</code> member of the <code>C</code>
object. If <code>policies</code> is supplied, it will be applied
to the function as described <a
href="CallPolicies.html">here</a>.
<dt><b>Returns:</b> A pointer convertible to
<code>PyObject*</code> which refers to the new Python callable
object.
</dl>
<h2><a name="examples"></a>Example</h2>
<p>The code below uses make_getter and make_setter to expose a
data member as functions:
<pre>
#include &lt;boost/python/data_members.hpp&gt;
#include &lt;boost/python/module.hpp&gt;
#include &lt;boost/python/class.hpp&gt;
struct X
{
X(int x) : y(x) {}
int y;
};
using namespace boost::python;
BOOST_PYTHON_MODULE_INIT(data_members_example)
{
module("data_members_example")
.add(
class_&lt;X&gt;(&quot;X&quot;)
.def_init(args&lt;int&gt;())
.def(&quot;get&quot;, make_getter(&amp;X::y))
.def(&quot;set&quot;, make_setter(&amp;X::y))
)
;
}
</pre>
It can be used this way in Python:
<pre>
&gt;&gt;&gt; from data_members_example import *
&gt;&gt;&gt; x = X(1)
&gt;&gt;&gt; x.get()
1
&gt;&gt;&gt; x.set(2)
&gt;&gt;&gt; x.get()
2
</pre>
<p>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
8 May 2002 <!--webbot bot="Timestamp" endspan i-checksum="39359" -->
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave
Abrahams</a> 2002. All Rights Reserved.</i>

View File

@@ -1,367 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content=
"text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - February 2002 Progress Report</title>
<style type="text/css">
:link { color: #0000ff }
:visited { color: #800080 }
p.c3 {font-style: italic}
h2.c2 {text-align: center}
h1.c1 {text-align: center}
</style>
<table border="0" cellpadding="7" cellspacing="0" width=
"100%" summary="header">
<tr>
<td valign="top" width="300">
<h3><a href="http://www.boost.org"><img height="86"
width="277" alt="C++ Boost" src="../c++boost.gif"
border="0"></a></h3>
<td valign="top">
<h1 class="c1">Boost.Python</h1>
<h2 class="c2">February 2002 Progress Report</h2>
</table>
<hr>
<h2>Contents</h2>
<dl class="index">
<dt><a href="#Python10">Python10 Conference Report</a>
<dt><a href="#progress">Boost.Python v2 Progress</a>
<dd>
<dl class="index">
<dt><a href="#documentation">Documentation</a>
<dt><a href="#conversion">Overhaul of
<code>to_python</code>/<code>from_python</code>
conversion mechanism</a>
<dt><a href="#miscellaneous">Miscellaneous</a>
</dl>
</dl>
<h2><a name="Python10">Python10 Conference Report</a></h2>
I spent the first week of February at the Python10 conference
in Alexandria, VA. I&#39;m including this experience report
for two reasons: firstly, it documents where my time was
used. Secondly, a public presence for Boost.Python and
interaction between the Python and C++ communities is
important to the future of Boost.Python, which in turn is
important to the Kull Project.
<p>Andy Koenig, of all people, was the keynote speaker of
this year&#39;s opening plenary session. He presented his
&quot;impressions of a polyglot outsider&quot;, which
studiously avoided any mention of C++ until the end of his
talk, when he was asked about standardization. I was
surprised to learn that the C++ community at large wanted a
few more years before beginning but when ANSI accepted
HP&#39;s request for a standard, the process was forced to
start: it was a matter of participating or having
standardization proceed without one&#39;s input. Andy managed
to highlight very effectively the balance of strengths in
Python, one of the most important being its support for
extension via libraries. In many ways that makes Python a
good analogue for C++ in the interpreted world
<p>There were several kind mentions of the Boost.Python
library from people who found it indispensable. I was
particularly happy that Karl MacMillan, Michael Droettboom,
and Ichiro Fujinaga from Johns Hopkins is using it to do OCR
on a vast library of music notation, since in a previous life
I was an author of music notation software. These guys are
also drawing on Ullrich Koethe&#39;s VIGRA library for image
manipulation (Ullrich has been a major contributor to
Boost.Python). They also have a system for writing the
Boost.Python wrapper code in C++ comments, which allows them
to keep all of the code in one place. I&#39;ve asked them to
send me some information on that.
<p>The development of Swig has been gaining momentum again
(the basic description at
www.boost.org/libs/python/doc/comparisons.html still
applies). The talk given about it by David Beazly was very
well-attended, and they appear to have quite a few users.
Swig&#39;s strengths (coverage of many langauages) and
weaknesses (incomplete C++ language support) haven&#39;t
changed, although the C++ support seems to have improved
considerably - they now claim to have a complete model of the
C++ type system. It seems to be mostly geared at wrapping
what Walter Landry calls &quot;C-Tran&quot;: C++ code which
traffics in built-in types with little use of abstraction.
I&#39;m not knocking that, either: I&#39;m sure a lot of that
code exists, so it&#39;s a valuable service. One feature Swig
has which I&#39;d like to steal is the ability to unwrap a
single Python argument into multiple C++ arguments, for
example, by converting a Python string into a pointer and
length. When his talk was over, David approached me about a
possible joint workshop on language binding, which sounds
like a fun idea to me.
<p>I spent some considerable time talking with Steven Knight,
the leader of the Scons build tool effort. We had a lot to
share with one another, and I gained a much better
appreciation for many of the Scons design decisions. Scons
seems to be concentrating on being the ultimate build system
substrate, and Steve seemed to think that we were on the
right track with our high-level design. We both hope that the
Boost.Build V2 high-level architecture can eventually be
ported to run on top of Scons.
<p>They also have a highly-refined and successful development
procedure which I&#39;d like to emulate for Boost.Build V2.
Among many other things they do, their source-control system
automatically ensures that when you check in a new test, it
is automatically run on the currently checked-in state of the
code, and is expected to fail -- a relatively obvious good
idea which I&#39;ve never heard before.
<p>Guido Van Rossum&#39;s &quot;State of the Python
Union&quot; address was full of questions for the community
about what should be done next, but the one idea Guido seemed
to stress was that core language stability and continuing
library development would be a good idea (sound familiar?) I
mentioned the Boost model as a counterpoint to the idea of
something like CPAN (the massive Perl library archives), and
it seemed to generate some significant interest. I&#39;ve
offered to work with anyone from the Python community who
wants to set up something like Boost.
<p>There was some discussion of &quot;string
interpolation&quot; (variable substitution in strings), and
Guido mentioned that he had some thoughts about the
strengths/weaknesses of Python&#39;s formatting interface. It
might be useful for those working on formatting for boost to
contact him and find out what he has to say.
<p>Ka-Ping Yee demoed a Mailman discussion thread weaver.
This tool weaves the various messages in a discussion thread
into a single document so you can follow the entire
conversation. Since we&#39;re looking very seriously at
moving Boost to Mailman, this could be a really useful thing
for us to have. If we do this, we&#39;ll move the yahoogroups
discussions into the mailman archive so old discussions can
be easily accessed in the same fashion.
<p>And, just because it&#39;s cool, though perhaps not
relevant: http://homepages.ulb.ac.be/~arigo/psyco/ is a
promising effort to accelerate the execution of Python code
to speeds approaching those of compiled languages. It
reminded me a lot of Todd Veldhuizen&#39;s research into
moving parts of C++ template compilation to runtime, only
coming from the opposite end of things.
<h2><a name="progress">Boost.Python v2 Progress</a></h2>
Here&#39;s what actually got accomplished.
<h3><a name="documentation">Documentation</a></h3>
<p>My first priority upon returning from Python10 was to get
some documentation in place. After wasting an unfortunate
amount of time looking at automatic documentation tools which
don&#39;t quite work, I settled down to use Bill Kempf&#39;s
HTML templates designed to be a boost standard. While they
are working well, it is highly labor-intensive.
<p>I decided to begin with the high-level reference material,
as opposed to tutorial, narrative, or nitty-gritty details of
the framework. It seemed more important to have a precise
description of the way the commonly-used components work than
to have examples in HTML (since we already have some test
modules), and since the low-level details are much
less-frequently needed by users it made sense for me to
simply respond to support requests for the time being.
<p>After completing approximately 60% of the high-level docs
(currently checked in to libs/python/doc/v2), I found myself
ready to start documenting the mechanisms for creating
to-/from-python converters. This caused a dilemma: I had
realized during the previous week that a much simpler,
more-efficient, and easier-to-use implementation was
possible, but I hadn&#39;t planned on implementing it right
away, since what was already in place worked adequately. I
had also received my first query on the C++-sig about how to
write such a converter
<p>Given the labor-intensive nature of documentation writing,
I decided it would be a bad idea to document the conversion
mechanism if I was just going to rewrite it. Often the best
impetus for simplifying a design is the realization that
understandably documenting its current state would be too
difficult, and this was no exception.
<h3><a name="conversion">Overhaul of
<code>to_python</code>/<code>from_python</code> conversion
mechanism</a></h3>
<p>There were two basic realizations involved here:
<ol>
<li><code>to_python</code> conversion could be a one-step
process, once an appropriate conversion function is found.
This allows elimination of the separate indirect
convertibility check
<li>There are basically two categories of from_python
conversions: those which lvalues stored within or held by
the Python object (essentially extractions), like what
happens when an instance of a C++ class exposed with class_
is used as the target of a wrapped member function), and
those in which a new rvalue gets created, as when a Python
Float is converted to a C++
<code>complex&lt;double&gt;</code> or a Python tuple is
converted to a C++ <code>std::vector&lt;&gt;</code>. From
the client side, there are two corresponding categories of
conversion: those which demand an lvalue conversion and
those which can accept an lvalue or an rvalue conversion.
</ol>
The latter realization allowed the following collapse, which
considerably simplified things:
<blockquote>
<table border="1" summary="Conversion protocol">
<tr>
<th>Target Type
<th>Eligible Converters
<tr>
<td><code>T</code>
<td rowspan="5"><code>T</code> rvalue or lvalue
<tr>
<td><code>T const</code>
<tr>
<td><code>T volatile</code>
<tr>
<td><code>T const volatile</code>
<tr>
<td><code>T const&amp;</code>
<tr>
<td><code>T const*</code>
<td rowspan="9"><code>T</code> lvalue
<tr>
<td><code>T volatile*</code>
<tr>
<td><code>T const volatile*</code>
<tr>
<td><code>T&amp;</code>
<tr>
<td><code>T volatile&amp;</code>
<tr>
<td><code>T const volatile&amp;</code>
<tr>
<td><code>T* const&amp;</code>
<tr>
<td><code>T const* const&amp;</code>
<tr>
<td><code>T volatile*const&amp;</code>
<tr>
<td><code>T const volatile*const&amp;</code>
</table>
</blockquote>
This job included the following additional enhancements:
<ul>
<li>Elimination of virtual functions, which cause object
code bloat
<li>Registration of a single converter function for all
lvalue conversions, two for all rvalue conversions
<li>Killed lots of unneeded code
<li>Increased opacity of registry interface
<li>Eliminated all need for decorated runtime type
identifiers
<li>Updated test modules to reflect new interface
<li>Eliminated the need for users to worry about converter
lifetime issues Additional Builtin Conversion Enhancements
<li>Support for complex&lt;float&gt;,
complex&lt;double&gt;, and complex&lt;long double&gt;
conversions
<li>Support for bool conversions
<li>NULL pointers representable by None in Python
<li>Support for conversion of Python classic classes to
numeric types
</ul>
<h3><a name="miscellaneous">Miscellaneous</a></h3>
These don&#39;t fit easily under a large heading:
<ul>
<li>Support CallPolicies for class member functions
<li>from_python_data.hpp: revamped type alignment
metaprogram so that it&#39;s fast enough for KCC
<li>classfwd.hpp header forward-declares class_&lt;T&gt;
<li>indirect_traits.hpp:
<li>added is_pointer_to_reference
<li>fixed bugs
<li>Reduced recompilation dependencies
<li>msvc_typeinfo works around broken MS/Intel typeid()
implementation
<li>Many fixes and improvements to the type_traits library
in order to work around compiler bugs and suppress warnings
<li>Eliminated the need for explicit acquisition of
converter registrations
<li>Expanded constructor support to 6 arguments
<li>Implemented generalized pointer lifetime support
<li>Updated code generation for returning.hpp
<li>Tracked down and fixed cycle GC bugs
<li>Added comprehensive unit tests for destroy_reference,
pointer_type_id, select_from_python, complex&lt;T&gt;,
bool, and classic class instance conversions
</ul>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
4 April, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
<p class="c3">&copy; Copyright <a href=
"../../../../people/dave_abrahams.htm">Dave Abrahams</a>
2002. All Rights Reserved.

View File

@@ -1,217 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python -
&lt;boost/python/has_back_reference.hpp&gt;</title>
<style type="text/css">
p.c3 {font-style: italic}
h2.c2 {text-align: center}
h1.c1 {text-align: center}
</style>
<table border="0" cellpadding="7" cellspacing="0" width=
"100%" summary="header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86"
width="277" alt="C++ Boost" src=
"../../../../c++boost.gif" border="0"></a></h3>
<td valign="top">
<h1 class="c1">Boost.Python</h1>
<h2 class="c2">Header
&lt;boost/python/has_back_reference.hpp&gt;</h2>
</table>
<hr>
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a>
<dt><a href="#classes">Classes</a>
<dd>
<dl class="page-index">
<dt><a href="#has_back_reference-spec">Class template
<code>has_back_reference</code></a>
<dd>
<dl class="page-index">
<dt><a href=
"#has_back_reference-spec-synopsis">Class template
<code>has_back_reference</code> synopsis</a>
</dl>
<dt><a href="#examples">Example(s)</a>
</dl>
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<p><code>&lt;boost/python/has_back_reference.hpp&gt;</code>
defines the traits class template
<code>has_back_reference&lt;&gt;</code>, which can be
specialized by the user to indicate that a wrapped class
instance holds a <code>PyObject*</code> corresponding to a
Python object.
<h2><a name="classes"></a>Classes</h2>
<h3><a name="has_back_reference-spec"></a>Class template
<code>has_back_reference</code></h3>
<p>A unary metafunction whose <code>value</code> is true iff
its argument is a <code>pointer_wrapper&lt;&gt;</code>.
<h4><a name="has_back_reference-spec-synopsis"></a>Class
template <code>has_back_reference</code> synopsis</h4>
<pre>
namespace boost { namespace python
{
template&lt;class WrappedClass&gt; class has_back_reference
{
static <i>unspecified</i> value = false;
};
}}
</pre>
<p>A &quot;<a href=
"../../../../more/generic_programming.html#traits">traits
class</a>&quot; which is inspected by Boost.Python to
determine how wrapped classes can be constructed.
<dl class="traits-semantics">
<dt><code>value</code> is an integral constant convertible
to bool of unspecified type.
<dt>Specializations may substitute a value convertible to
<code>true</code> for <code>value</code> iff for each invocation of
<code>class_&lt;WrappedClass&gt;::def_init(args&lt;</code><i>type-sequence...</i><code>&gt;())</code>,
there exists a corresponding constructor
<code>WrappedClass::WrappedClass(PyObject*,&nbsp;</code><i>type-sequence...</i><code>)</code>. If
such a specialization exists, the <code>WrappedClass</code>
constructors will be called with a &quot;back reference&quot; pointer
to the corresponding Python object whenever they are invoked from
Python.
</dl>
<h2><a name="examples"></a>Example</h2>
<h3>C++ module definition</h3>
<pre>
#include &lt;boost/python/class.hpp&gt;
#include &lt;boost/python/module.hpp&gt;
#include &lt;boost/python/has_back_reference.hpp&gt;
#include &lt;boost/shared_ptr.hpp&gt;
using namespace boost::python;
struct X
{
X(PyObject* self) : m_self(self), m_x(0) {}
X(PyObject* self, int x) : m_self(self), m_x(x) {}
PyObject* self() { return m_self; }
int get() { return m_x; }
void set(int x) { m_x = x; }
PyObject* m_self;
int x;
};
// specialize has_back_reference for X
namespace boost { namespace python
{
template &lt;&gt;
struct has_back_reference&lt;X&gt;
{
enum { value = true; }
}
}}
struct Y
{
Y() : m_x(0) {}
Y(int x) : m_x(x) {}
int get() { return m_x; }
void set(int x) { m_x = x; }
int x;
};
boost::shared_ptr&lt;Y&gt; Y_self(boost::shared_ptr&lt;Y&gt; self) const { return self; }
BOOST_PYTHON_MODULE_INIT(back_references)
{
module(&quot;back_references&quot;)
.add(
class_&lt;X&gt;(&quot;X&quot;)
.def_init()
.def_init(args&lt;int&gt;())
.def(&quot;self&quot;, &amp;X::self)
.def(&quot;get&quot;, &amp;X::get)
.def(&quot;set&quot;, &amp;X::set)
)
.add(
class_&lt;Y, shared_ptr&lt;Y&gt; &gt;(&quot;Y&quot;)
.def_init()
.def_init(args&lt;int&gt;())
.def(&quot;get&quot;, &amp;Y::get)
.def(&quot;set&quot;, &amp;Y::set)
.def(&quot;self&quot;, Y_self)
)
;
}
</pre>
The following Python session illustrates that <code>x.self()</code>
returns the same Python object on which it is invoked, while
<code>y.self()</code> must create a new Python object which refers to
the same Y instance.
<h3>Python code</h3>
<pre>
&gt;&gt;&gt; from back_references import *
&gt;&gt;&gt; x = X(1)
&gt;&gt;&gt; x2 = x.self()
&gt;&gt;&gt; x2 is x
<b>1</b>
&gt;&gt;&gt; (x.get(), x2.get())
(1, 1)
&gt;&gt;&gt; x.set(10)
&gt;&gt;&gt; (x.get(), x2.get())
(10, 10)
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; y = Y(2)
&gt;&gt;&gt; y2 = y.self()
&gt;&gt;&gt; y2 is y
<b>0</b>
&gt;&gt;&gt; (y.get(), y2.get())
(2, 2)
&gt;&gt;&gt; y.set(20)
&gt;&gt;&gt; (y.get(), y2.get())
(20, 20)
</pre>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
07 May, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
<p class="c3">&copy; Copyright <a href=
"../../../../people/dave_abrahams.htm">Dave Abrahams</a>
2002. All Rights Reserved.

View File

@@ -1,149 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - &lt;boost/python/implicit.hpp&gt;</title>
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt=
"C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">Header &lt;boost/python/implicit.hpp&gt;</h2>
</table>
<hr>
<h2>Contents</h2>
<dl function="page-index">
<dt><a href="#introduction">Introduction</a>
<dt><a href="#functions">Functions</a>
<dd>
<dl function="page-index">
<dt><a href="#implicitly_convertible-spec">Function Template <code>implicitly_convertible</code></a>
</dl>
<dt><a href="#examples">Example</a>
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<code>implicitly_convertible</code> allows Boost.Python to
implicitly take advantage of a C++ implicit or explicit conversion
when matching Python objects to C++ argument types.
<h2><a name="functions"></a>Functions</h2>
<h3><a name="implicitly_convertible-spec"></a>Function template <code>implicitly_convertible</code></h3>
<pre>
template &lt;class Source, class Target&gt;
void implicitly_convertible();
</pre>
<table border="1" summary="implicitly_convertible template parameters">
<caption>
<b><code>implicitly_convertible</code> template parameters</b><br>
</caption>
<tr>
<th>Parameter
<th>Description
<tr>
<td><code>Source</code>
<td>The source type of the implicit conversion
<tr>
<td><code>Target</code>
<td>The target type of the implicit conversion
<tr>
</table>
<dl class="function-semantics">
<dt><b>Requires:</b> The expression <code>Target(s)</code>,
where <code>s</code> is of type <code>Source</code>, is valid.
<dt><b>Effects:</b> registers an rvalue <code>from_python</code>
converter to <code>Target</code> which can succeed for any
<code>PyObject*&nbsp;p</code> iff there exists any registered
converter which can produce <code>Source</code> rvalues
<dt><b>Rationale:</b> C++ users expect to be able to take
advantage of the same sort of interoperability in Python as they
do in C++.
</dl>
<h2><a name="examples"></a>Example</h2>
<h3>C++ module definition</h3>
<pre>
#include &lt;boost/python/class.hpp&gt;
#include &lt;boost/python/implicit.hpp&gt;
#include &lt;boost/python/module.hpp&gt;
using namespace boost::python;
struct X
{
X(int x) : v(x) {}
operator int() { return v; }
int v;
};
int x_value(X const&amp; x)
{
return x.v;
}
X make_x(int n) { return X(n); }
BOOST_PYTHON_MODULE_INIT(implicit_ext)
{
module(&quot;implicit_ext&quot;)
.def(&quot;x_value&quot;, x_value)
.def(&quot;make_x&quot;, make_x)
.add(
class_&lt;X&gt;(&quot;X&quot;)
.def_init(args&lt;int&gt;())
)
;
implicitly_convertible&lt;X,int&gt;();
implicitly_convertible&lt;int,X&gt;();
}
</pre>
<h3>Python code</h3>
<pre>
&gt;&gt;&gt; from implicit_ext import *
&gt;&gt;&gt; x_value(X(42))
42
&gt;&gt;&gt; x_value(42)
42
&gt;&gt;&gt; x = make_x(X(42))
&gt;&gt;&gt; x_value(x)
42
</pre>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
08 May, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave
Abrahams</a> 2002. All Rights Reserved.</i>

View File

@@ -51,7 +51,7 @@
<h2><a name="functions"></a>Functions</h2>
<pre>
<a name="make_function-spec">template &lt;class F&gt;</a>
objects::function* make_function(F f)
objects::function* make_function(F f)&lt;/a&gt;
template &lt;class F, class Policies&gt;
objects::function* make_function(F f, Policies const&amp; policies)
@@ -80,7 +80,7 @@ objects::function* make_function(F f, Policies const&amp; policies)
objects::function* make_constructor();</a>
</pre>
<dl class="function-semantics">
<dl class="make_constructor-semantics">
<dt><b>Requires:</b> <code>T</code> is a class type. <code>ArgList</code>
is an <a href="../../../mpl/doc/Sequences.html">MPL sequence</a> of C++
argument types (<i>A1, A2,... AN</i>) such that if

View File

@@ -104,7 +104,7 @@ Foo* make_foo(int x) { return new Foo(x); }
using namespace boost::python;
BOOST_PYTHON_MODULE_INIT(my_module)
{
module("my_module")
module m("my_module")
.def("make_foo", make_foo)
.add(
class_&lt;Foo&gt;()

View File

@@ -1,261 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../boost.css">
<title>Boost.Python - &lt;boost/python/ptr.hpp&gt;</title>
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt=
"C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
<td valign="top">
<h1 align="center">Boost.Python</h1>
<h2 align="center">Header &lt;boost/python/ptr.hpp&gt;</h2>
</table>
<hr>
<h2>Contents</h2>
<dl class="page-index">
<dt><a href="#introduction">Introduction</a>
<dt><a href="#functions">Functions</a>
<dd>
<dl class="page-index">
<dt><a href="#ptr-spec">ptr</a>
</dl>
<dt><a href="#classes">Classes</a>
<dd>
<dl class="page-index">
<dt><a href="#pointer_wrapper-spec">Class template <code>pointer_wrapper</code></a>
<dd>
<dl class="page-index">
<dt><a href="#pointer_wrapper-spec-synopsis">Class template <code>pointer_wrapper</code> synopsis</a>
<dt><a href="#pointer_wrapper-spec-types">Class
<code>pointer_wrapper</code> types</a>
<dt><a href="#pointer_wrapper-spec-ctors">Class
<code>pointer_wrapper</code> constructors and destructor</a>
<dt><a href="#pointer_wrapper-spec-observers">Class
<code>pointer_wrapper</code> observer functions</a>
</dl>
</dl>
<dt><a href="#metafunctions">Metafunctions</a>
<dd>
<dl class="page-index">
<dt><a href="#is_pointer_wrapper-spec">Class template <code>is_pointer_wrapper</code></a>
<dd>
<dl class="page-index">
<dt><a href="#is_pointer_wrapper-spec-synopsis">Class template <code>is_pointer_wrapper</code> synopsis</a>
</dl>
<dt><a href="#unwrap_pointer-spec">Class template <code>unwrap_pointer</code></a>
<dd>
<dl class="page-index">
<dt><a href="#unwrap_pointer-spec-synopsis">Class template <code>unwrap_pointer</code> synopsis</a>
</dl>
</dl>
<dt><a href="#examples">Example(s)</a>
</dl>
<hr>
<h2><a name="introduction"></a>Introduction</h2>
<p><code>&lt;boost/python/ptr.hpp&gt;</code> defines the
<code>ptr()</code> function template, which allows users to
specify how to convert C++ pointer values to python in the context
of implementing overridable virtual functions, invoking Python
callable objects, or explicitly converting C++ objects to
Python. Normally, when passing pointers to Python callbacks, the
pointee is copied to ensure that the Python object
never holds a dangling reference. To specify that the new Python
object should merely contain a copy of a pointer <code>p</code>,
the user can pass <code><a href="#ptr-spec">ptr</a>(p)</code> instead of passing
<code>p</code> directly. This interface is meant to mirror the use
of <a href="../../../bind/ref.html"><code>boost::ref()</code></a>,
which can be similarly used to prevent copying of referents.
<p><code>ptr(p)</code> returns an instance of <code><a
href="#pointer_wrapper">pointer_wrapper&lt;&gt;</a></code>, which
can be detected using the <code><a
href="#pointer_wrapper">is_pointer_wrapper&lt;&gt;</a></code>
metafunction; <code><a
href="#pointer_wrapper">unwrap_pointer&lt;&gt;</a></code> is a
metafunction which extracts the original pointer type from a
<code>pointer_wrapper&lt;&gt;</code>. These classes can be thought
of as implementation details.
<h2><a name="functions"></a>Functions</h2>
<pre>
<a name="ptr-spec">template &lt;class T&gt;</a>
pointer_wrapper&lt;T&gt; ptr(T x);
</pre>
<dl class="ptr-semantics">
<dt><b>Requires:</b> <code>T</code> is a pointer type.
<dt><b>Returns:</b> <code><a href="#pointer_wrapper-spec">pointer_wrapper</a>&lt;T&gt;(x)</code>
<dt><b>Throws:</b> nothing.
</dl>
<h2><a name="classes"></a>Classes</h2>
<h3><a name="pointer_wrapper-spec"></a>Class template <code>pointer_wrapper</code></h3>
<p>A &quot;type envelope&quot; which is returned by <a
href="#ptr-spec">ptr()</a>, used to indicate reference semantics
for pointers passed to Python callbacks.
<h4><a name="pointer_wrapper-spec-synopsis"></a>Class
<code>pointer_wrapper</code> synopsis</h4>
<pre>
namespace boost { namespace python
{
template&lt;class Ptr&gt; class pointer_wrapper
{
public:
typedef Ptr type;
explicit pointer_wrapper(Ptr x);
operator Ptr() const;
Ptr get() const;
};
}}
</pre>
<h4><a name="pointer_wrapper-spec-types"></a>Class template <code>pointer_wrapper</code> types</h4>
<pre>
typedef Ptr type;
</pre>
The type of the pointer being wrapped.
<h4><a name="pointer_wrapper-spec-ctors"></a>Class template <code>pointer_wrapper</code> constructors and
destructor</h4>
<pre>
explicit pointer_wrapper(Ptr x);
</pre>
<dl class="function-semantics">
<dt><b>Requires:</b> <code>Ptr</code> is a pointer type.
<dt><b>Effects:</b> Stores <code>x</code> in a the <code>pointer_wrapper&lt;&gt;</code>.
<dt><b>Throws:</b> nothing.
</dl>
<h4><a name="pointer_wrapper-spec-observers"></a>Class template <code>pointer_wrapper</code> observer
functions</h4>
<pre>
operator Ptr() const;
Ptr get() const;
</pre>
<dl class="function-semantics">
<dt><b>Returns:</b> a copy of the stored pointer.
<dt><b>Rationale:</b> <code>pointer_wrapper</code> is intended
to be a stand-in for the actual pointer type, but sometimes it's
better to have an explicit way to retrieve the pointer.
</dl>
<h3><a name="is_pointer_wrapper-spec"></a>Class template <code>is_pointer_wrapper</code></h3>
<p>A unary metafunction whose <code>value</code> is true iff its
argument is a <code>pointer_wrapper&lt;&gt;</code>.
<h4><a name="is_pointer_wrapper-spec-synopsis"></a>Class template <code>is_pointer_wrapper</code> synopsis</h4>
<pre>
namespace boost { namespace python
{
template&lt;class T&gt; class is_pointer_wrapper
{
static <i>unspecified</i> value = ...;
};
}}
</pre>
<dl class="metafunction-semantics">
<dt><b>Returns:</b> <code>true</code> iff <code>T</code> is a
specialization of
<code>pointer_wrapper&lt;&gt;</code>.
<dt><code>value</code> is an integral constant convertible to bool of
unspecified type
</dl>
<h3><a name="unwrap_pointer-spec"></a>Class template <code>unwrap_pointer</code></h3>
A unary metafunction which extracts the wrapped pointer type from a
specialization of <code>pointer_wrapper&lt;&gt;</code>.
<h4><a name="unwrap_pointer-spec-synopsis"></a>Class template <code>unwrap_pointer</code> synopsis</h4>
<pre>
namespace boost { namespace python
{
template&lt;class T&gt; class unwrap_pointer
{
typedef <i>unspecified</i> type;
};
}}
</pre>
<dl class="metafunction-semantics">
<dt><b>Returns:</b> <code>T::type</code> if <code>T</code> is a
specialization of
<code>pointer_wrapper&lt;&gt;</code>, <code>T</code> otherwise
</dl>
<h2><a name="examples"></a>Example(s)</h2>
This example illustrates the use of <code>ptr()</code> to prevent an
object from being copied:
<pre>
#include &lt;boost/python/call.hpp&gt;
#include &lt;boost/python/ptr.hpp&gt;
class expensive_to_copy
{
...
};
void pass_as_arg(expensive_to_copy* x, PyObject* f)
{
// call the Python function f, passing a Python object built around
// which refers to *x by-pointer.
//
// *** Note: ensuring that *x outlives the argument to f() is ***
// *** up to the user! Failure to do so could result in a crash! ***
boost::python::call&lt;void&gt;(f, ptr(x));
}
...
</pre>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
07 May, 2002
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave
Abrahams</a> 2002. All Rights Reserved.</i>

View File

@@ -24,11 +24,9 @@
<dl class="Reference">
<dt><a href="#high_level">High Level Components</a>
<dt><a href="#models_of_call_policies">Models of CallPolicies</a>
<dt><a href="#framework">Framework Elements</a>
<dt><a href="#return_handler_generators">Models of ReturnHandlerGenerator</a>
<dt><a href="#type_conversion">To/From Python Type Conversion</a>
<dt><a href="#utilities">Utilities</a>
<dt><a href="#by_name">Index By Name</a>
</dl>
@@ -43,31 +41,6 @@
<h3>General Purpose</h3>
<dl class="index">
<dt><a href="call.html">call.hpp</a>
<dd>
<dl class="index">
<dt><a href="call.html#functions">Functions</a>
<dd>
<dl class="index">
<dt><a href=
"call.html#call-spec">call</a>
</dl>
</dl>
<dt><a href="call_method.html">call_method.hpp</a>
<dd>
<dl class="index">
<dt><a href="call_method.html#functions">Functions</a>
<dd>
<dl class="index">
<dt><a href=
"call_method.html#call_method-spec">call_method</a>
</dl>
</dl>
<dt><a href="class.html">class.hpp/class_fwd.hpp</a>
<dd>
@@ -84,22 +57,6 @@
</dl>
</dl>
<dt><a href="data_members.html">data_members.hpp</a>
<dd>
<dl class="index">
<dt><a href="data_members.html#functions">Functions</a>
<dd>
<dl class="index">
<dt><a href=
"data_members.html#make_getter-spec">make_getter</a>
<dt><a href=
"data_members.html#make_setter-spec">make_setter</a>
</dl>
</dl>
<dt><a href="errors.html">errors.hpp</a>
<dd>
@@ -183,8 +140,89 @@
</dl>
</dl>
</dl>
<a name="type_conversion"></a>
<h3>To/From Python Type Conversion</h3>
<dl class="index">
<dt><a href="from_python.html">from_python.hpp</a>
<dd>
<dl class="index">
<dt><a href="from_python.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"from_python.html#from_python-spec">from_python</a>
</dl>
</dl>
<dt><a href="to_python_converter.html">to_python_converter.hpp</a>
<dd>
<dl class="index">
<dt><a href="to_python_converter.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"to_python_converter.html#to_python_converter-spec">to_python_converter</a>
</dl>
</dl>
<dt><a href="to_python_indirect.html">to_python_indirect.hpp</a>
<dd>
<dl class="index">
<dt><a href="to_python_indirect.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"to_python_indirect.html#to_python_indirect-spec">to_python_indirect</a>
</dl>
</dl>
<dt><a href="to_python_value.html">to_python_value.hpp</a>
<dd>
<dl class="index">
<dt><a href="to_python_value.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"to_python_value.html#to_python_value-spec">to_python_value</a>
</dl>
</dl>
<dt><a href="type_from_python.html">type_from_python.hpp</a>
<dd>
<dl class="index">
<dt><a href="type_from_python.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"type_from_python.html#type_from_python-spec">type_from_python</a>
</dl>
</dl>
<dt><a href="value_from_python.html">value_from_python.hpp</a>
<dd>
<dl class="index">
<dt><a href="value_from_python.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"value_from_python.html#value_from_python-spec">value_from_python</a>
</dl>
</dl>
</dl>
<a name="models_of_call_policies"></a>
<h3>Models of CallPolicies</h3>
@@ -331,140 +369,6 @@
</dl>
</dl>
</dl>
<a name="type_conversion"></a>
<h3>To/From Python Type Conversion</h3>
<dl class="index">
<dt><a href="from_python.html">from_python.hpp</a>
<dd>
<dl class="index">
<dt><a href="from_python.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"from_python.html#from_python-spec">from_python</a>
</dl>
</dl>
<dt><a href="has_back_reference.html">has_back_reference.hpp</a>
<dd>
<dl class="index">
<dt><a href="has_back_reference.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href="has_back_reference.html#has_back_reference-spec">has_back_reference</a>
</dl>
</dl>
<dt><a href="implicit.html">implicit.hpp</a>
<dd>
<dl class="index">
<dt><a href="implicit.html#functions">Functions</a>
<dd>
<dl class="index">
<dt><a href=
"implicit.html#implicitly_convertible-spec">implicitly_convertible</a>
</dl>
</dl>
<dt><a href="ptr.html">ptr.hpp</a>
<dd>
<dl class="index">
<dt><a href="ptr.html#functions">Functions</a>
<dd>
<dl class="index">
<dt><a href="ptr.html#ptr-spec">ptr</a>
</dl>
<dt><a href="ptr.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href="ptr.html#pointer_wrapper-spec">pointer_wrapper</a>
</dl>
<dt><a href="ptr.html#metafunctions">MetaFunctions</a>
<dd>
<dl class="index">
<dt><a href="ptr.html#is_pointer_wrapper-spec">is_pointer_wrapper</a>
<dt><a href="ptr.html#unwrap_pointer-spec">unwrap_pointer</a>
</dl>
</dl>
<dt><a href="to_python_converter.html">to_python_converter.hpp</a>
<dd>
<dl class="index">
<dt><a href="to_python_converter.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"to_python_converter.html#to_python_converter-spec">to_python_converter</a>
</dl>
</dl>
<dt><a href="to_python_indirect.html">to_python_indirect.hpp</a>
<dd>
<dl class="index">
<dt><a href="to_python_indirect.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"to_python_indirect.html#to_python_indirect-spec">to_python_indirect</a>
</dl>
</dl>
<dt><a href="to_python_value.html">to_python_value.hpp</a>
<dd>
<dl class="index">
<dt><a href="to_python_value.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"to_python_value.html#to_python_value-spec">to_python_value</a>
</dl>
</dl>
<dt><a href="type_from_python.html">type_from_python.hpp</a>
<dd>
<dl class="index">
<dt><a href="type_from_python.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"type_from_python.html#type_from_python-spec">type_from_python</a>
</dl>
</dl>
<dt><a href="value_from_python.html">value_from_python.hpp</a>
<dd>
<dl class="index">
<dt><a href="value_from_python.html#classes">Classes</a>
<dd>
<dl class="index">
<dt><a href=
"value_from_python.html#value_from_python-spec">value_from_python</a>
</dl>
</dl>
</dl>
</dl>
<hr>

View File

@@ -130,7 +130,7 @@ Singleton&amp; get_it()
using namespace boost::python;
BOOST_PYTHON_MODULE_INIT(singleton)
{
module("singleton")
module m("singleton")
.def("get_it", get_it)
.add(
class_&lt;Singleton&gt;()

View File

@@ -118,7 +118,7 @@ struct Foo {
using namespace boost::python;
BOOST_PYTHON_MODULE_INIT(my_module)
{
module("my_module")
module m("my_module")
.add(
class_&lt;Bar&gt;()
)

Binary file not shown.

View File

@@ -1,39 +0,0 @@
# Specify our location in the boost project hierarchy
subproject libs/python/example ;
# Declares the following targets:
#
# 1. an extension module called "getting_started1", which is
# built from "getting_started1.cpp". Built by default
#
# 2. A test target called my-test.test which runs
# test_getting_started1.py with the extension module above. Built
# when out-of date, but only if invoked by name or if the global
# "test" target is invoked.
#
# 3. A test target called my-test.run wihch runs the above test
# unconditionally. Built only when invoked by name.
#
# To see verbose test output, add "-sPYTHON_TEST_ARGS=-v" to the bjam
# command-line before the first target.
#
# Include definitions needed for Python modules
SEARCH on python.jam = $(BOOST_BUILD_PATH) ;
include python.jam ;
# Declare a Python extension called getting_started1
extension getting_started1
: # sources
getting_started1.cpp
# dependencies
<dll>../build/boost_python
;
# Declare a test for the extension module
boost-python-runtest my-test
: # Python test driver
test_getting_started1.py
# extension modules to use
<pyd>getting_started1 ;

View File

@@ -19,3 +19,6 @@ Examples for the cross-module support are provided by:
ivect.cpp
See also: libs/python/doc/cross_module.html
The files example1.cpp and rwgk1.cpp are obsolete. They are only
included because the Visual Studio project in the build directory still
refers to them.

View File

@@ -77,7 +77,7 @@ BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
if (tup.size() != 3) {
PyErr_SetString(PyExc_ValueError,
"expecting exactly 3 values in tuple.");
python::throw_error_already_set();
throw python::error_already_set();
}
MillerIndex result;
for (int i = 0; i < 3; i++)

43
example/example1.cpp Normal file
View File

@@ -0,0 +1,43 @@
#include <string.h>
namespace hello {
class world
{
public:
world(int) {}
~world() {}
const char* get() const { return "hi, world"; }
};
size_t length(const world& x) { return strlen(x.get()); }
}
#include <boost/python/class_builder.hpp>
// Python requires an exported function called init<module-name> in every
// extension module. This is where we build the module contents.
BOOST_PYTHON_MODULE_INIT(hello)
{
// create an object representing this extension module
boost::python::module_builder hello("hello");
// Create the Python type object for our extension class
boost::python::class_builder<hello::world> world_class(hello, "world");
// Add the __init__ function
world_class.def(boost::python::constructor<int>());
// Add a regular member function
world_class.def(&hello::world::get, "get");
// Add a regular function to the module
hello.def(hello::length, "length");
}
// Win32 DLL boilerplate
#if defined(_WIN32)
#include <windows.h>
extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)
{
return 1;
}
#endif // _WIN32

View File

@@ -63,7 +63,7 @@ namespace { // Avoid cluttering the global namespace.
if (state.size() != 1) {
PyErr_SetString(PyExc_ValueError,
"Unexpected argument in call to __setstate__.");
python::throw_error_already_set();
throw python::error_already_set();
}
int number = from_python(state[0].get(), python::type<int>());
if (number != 42)

View File

@@ -99,7 +99,7 @@ namespace {
{
if(args.size() != 1 || keywords.size() != 0) {
PyErr_SetString(PyExc_TypeError, "wrong number of arguments");
boost::python::throw_error_already_set();
throw boost::python::error_already_set();
}
const world& w = from_python(args[0].get(), type<const world&>());
ref mydict = getattr(args[0], "__dict__");
@@ -115,7 +115,7 @@ namespace {
{
if(args.size() != 2 || keywords.size() != 0) {
PyErr_SetString(PyExc_TypeError, "wrong number of arguments");
boost::python::throw_error_already_set();
throw boost::python::error_already_set();
}
world& w = from_python(args[0].get(), type<world&>());
ref mydict = getattr(args[0], "__dict__");
@@ -123,7 +123,7 @@ namespace {
if (state.size() != 2) {
PyErr_SetString(PyExc_ValueError,
"Unexpected argument in call to __setstate__.");
python::throw_error_already_set();
throw python::error_already_set();
}
// restore the object's __dict__
dictionary odict = from_python(mydict.get(), type<dictionary>());

Binary file not shown.

View File

@@ -35,7 +35,7 @@ namespace vects {
{ \
if (lhs.size() != rhs.size()) { \
PyErr_SetString(PyExc_ValueError, "vectors have different sizes"); \
boost::python::throw_error_already_set(); \
throw boost::python::error_already_set(); \
} \
std::vector<bool> result(lhs.size()); \
for (std::size_t i=0; i<lhs.size(); i++) { \

View File

@@ -12,7 +12,7 @@ namespace vects { \
operator##oper (const vect_type1& lhs, const vect_type2& rhs) { \
if (lhs.size() != rhs.size()) { \
PyErr_SetString(PyExc_ValueError, "vectors have different sizes"); \
boost::python::throw_error_already_set(); \
throw boost::python::error_already_set(); \
} \
result_type result(lhs.size()); \
for (std::size_t i=0; i<lhs.size(); i++) { \

24
example/rwgk1.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <string>
namespace { // Avoid cluttering the global namespace.
// A couple of simple C++ functions that we want to expose to Python.
std::string greet() { return "hello, world"; }
int square(int number) { return number * number; }
}
#include <boost/python/class_builder.hpp>
namespace python = boost::python;
// Python requires an exported function called init<module-name> in every
// extension module. This is where we build the module contents.
BOOST_PYTHON_MODULE_INIT(rwgk1)
{
// Create an object representing this extension module.
python::module_builder this_module("rwgk1");
// Add regular functions to the module.
this_module.def(greet, "greet");
this_module.def(square, "square");
}

View File

@@ -32,7 +32,7 @@ namespace { // Avoid cluttering the global namespace.
void raise_vector_IndexError() {
PyErr_SetString(PyExc_IndexError, "vector index out of range");
python::throw_error_already_set();
throw python::error_already_set();
}
double getitem(const std::vector<double>& vd, std::size_t key) {
@@ -90,8 +90,8 @@ BOOST_PYTHON_MODULE_INIT(simple_vector)
python::class_builder<std::vector<double>, vector_double_wrapper>
vector_double(this_module, "vector_double");
vector_double.def(python::constructor<int>());
vector_double.def(python::constructor<>());
vector_double.def(python::constructor<int>());
vector_double.def(python::constructor<python::tuple>());
vector_double.def(&std::vector<double>::size, "__len__");
vector_double.def(getitem, "__getitem__");

View File

@@ -39,7 +39,7 @@ namespace example {
void raise_vector_IndexError() {
PyErr_SetString(PyExc_IndexError, "vector index out of range");
boost::python::throw_error_already_set();
throw boost::python::error_already_set();
}
template <typename T>

View File

@@ -1,73 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef ARGS_DWA2002323_HPP
# define ARGS_DWA2002323_HPP
# include <boost/config.hpp>
# include <boost/mpl/type_list.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/enum_params.hpp>
# include <boost/preprocessor/enum_params_with_a_default.hpp>
# include <boost/preprocessor/comma_if.hpp>
# if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 245
namespace boost { namespace python {
// A type list for specifying arguments
template < BOOST_MPL_LIST_DEFAULT_PARAMETERS(typename A, boost::mpl::null_argument) >
struct args : boost::mpl::type_list< BOOST_MPL_LIST_PARAMETERS(A) >::type
{};
}} // namespace boost::python
# else // slow template instantiators need this other version with
// explicit specializations of mpl::size<> and
// mpl::at<>. Eventually, however, inheritance from mpl::list
// *should* be eliminated and the two versions unified, just in
// order to get true arity independence
namespace boost { namespace python {
template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PYTHON_MAX_ARITY, class A, boost::mpl::null_argument) >
struct args
{};
}} // namespace boost::python
namespace boost { namespace mpl {
template <class T> struct size;
template <long N, class Seq> struct at;
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/args.hpp>
# endif
# define BOOST_PYTHON_ARGS_SIZE(index,ignored) \
template <BOOST_PP_ENUM_PARAMS(index, class A)> \
struct size<boost::python::args<BOOST_PP_ENUM_PARAMS(index, A)> > \
{ \
BOOST_STATIC_CONSTANT(long, value = index); \
}; \
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_ARGS_SIZE, nil)
# define BOOST_PYTHON_ARGS_AT(index,ignored) \
template < \
BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(BOOST_PYTHON_ARITY_FINISH), class A)> \
struct at<index, boost::python::args< \
BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(BOOST_PYTHON_ARITY_FINISH), A)> > \
{ \
typedef BOOST_PP_CAT(A,index) type; \
}; \
BOOST_PP_REPEAT_FROM_TO_2ND(
BOOST_PP_DEC(BOOST_PYTHON_ARITY_START), BOOST_PP_DEC(BOOST_PYTHON_ARITY_FINISH)
, BOOST_PYTHON_ARGS_AT, data)
}}
# endif
#endif // ARGS_DWA2002323_HPP

View File

@@ -1,58 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef BASES_DWA2002321_HPP
# define BASES_DWA2002321_HPP
# include <boost/type_traits/object_traits.hpp>
# include <boost/mpl/type_list.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/mpl/identity/identity.hpp>
namespace boost { namespace python {
// A type list for specifying bases
template < BOOST_MPL_LIST_DEFAULT_PARAMETERS(typename B, ::boost::mpl::null_argument) >
struct bases : ::boost::mpl::type_list< BOOST_MPL_LIST_PARAMETERS(B) >::type
{};
namespace detail
{
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T> struct specifies_bases
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
template < BOOST_MPL_LIST_PARAMETERS(class B) >
struct specifies_bases< bases< BOOST_MPL_LIST_PARAMETERS(B) > >
{
BOOST_STATIC_CONSTANT(bool, value = true);
};
# else
template < BOOST_MPL_LIST_PARAMETERS(class B) >
static char is_bases_helper(bases< BOOST_MPL_LIST_PARAMETERS(B) > const&);
static char (& is_bases_helper(...) )[256];
template <class T> struct specifies_bases
{
private:
static typename add_reference<T>::type make();
BOOST_STATIC_CONSTANT(bool, non_ref = !is_reference<T>::value);
public:
BOOST_STATIC_CONSTANT(bool, value = non_ref & (sizeof(is_bases_helper(make())) == 1));
};
# endif
template <class T, class Prev = bases<> >
struct select_bases
: mpl::select_type<
specifies_bases<T>::value
, T
, Prev
>
{
};
}
}} // namespace boost::python
#endif // BASES_DWA2002321_HPP

View File

@@ -1,49 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef CALL_DWA2002411_HPP
# define CALL_DWA2002411_HPP
# include <boost/python/converter/callback.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/comma_if.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/preprocessor/enum_params.hpp>
# include <boost/preprocessor/repeat.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/type.hpp>
namespace boost { namespace python {
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/call.hpp>
# endif
# define BOOST_PYTHON_CALL_FUNCTION(nargs,ignored) \
template < \
class R \
BOOST_PP_COMMA_IF(nargs) BOOST_PP_ENUM_PARAMS(nargs, class A) \
> \
typename converter::callback_from_python<R>::result_type \
call(PyObject* callable \
BOOST_PP_COMMA_IF(nargs) BOOST_PYTHON_ENUM_PARAMS2(nargs, (A,const& a)) \
, boost::type<R>* = 0 \
) \
{ \
converter::callback_from_python<R> converter; \
return converter( \
PyEval_CallFunction( \
callable \
, const_cast<char*>(BOOST_PYTHON_ARG_STRING(nargs)) \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM(nargs,BOOST_PYTHON_CALLBACK_TO_PYTHON_GET,nil) \
)); \
}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CALL_FUNCTION,data)
}} // namespace boost::python
#endif // CALL_DWA2002411_HPP

View File

@@ -1,50 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef CALL_METHOD_DWA2002411_HPP
# define CALL_METHOD_DWA2002411_HPP
# include <boost/python/converter/callback.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/comma_if.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/preprocessor/enum_params.hpp>
# include <boost/preprocessor/repeat.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/type.hpp>
namespace boost { namespace python {
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/call_method.hpp>
# endif
# define BOOST_PYTHON_CALL_METHOD_FUNCTION(nargs,ignored) \
template < \
class R \
BOOST_PP_COMMA_IF(nargs) BOOST_PP_ENUM_PARAMS(nargs, class A) \
> \
typename converter::callback_from_python<R>::result_type \
call_method(PyObject* self, char const* name \
BOOST_PP_COMMA_IF(nargs) BOOST_PYTHON_ENUM_PARAMS2(nargs, (A,const& a)) \
, boost::type<R>* = 0 \
) \
{ \
converter::callback_from_python<R> converter; \
return converter( \
PyEval_CallMethod( \
self \
, const_cast<char*>(name) \
, const_cast<char*>(BOOST_PYTHON_ARG_STRING(nargs)) \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM(nargs,BOOST_PYTHON_CALLBACK_TO_PYTHON_GET,nil) \
)); \
}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CALL_METHOD_FUNCTION,data)
}} // namespace boost::python
#endif // CALL_METHOD_DWA2002411_HPP

View File

@@ -7,51 +7,55 @@
# define CLASS_DWA200216_HPP
# include <boost/python/class_fwd.hpp>
# include <boost/python/bases.hpp>
# include <boost/python/args.hpp>
# include <boost/python/reference.hpp>
# include <boost/python/object/class.hpp>
# include <boost/python/object/value_holder_fwd.hpp>
# include <boost/python/converter/type_id.hpp>
# include <boost/python/detail/wrap_function.hpp>
# include <boost/python/detail/member_function_cast.hpp>
# include <boost/mpl/type_list.hpp>
# include <boost/python/object/class_converters.hpp>
# include <boost/type_traits/ice.hpp>
# include <boost/type_traits/same_traits.hpp>
# include <boost/mpl/size.hpp>
# include <boost/mpl/for_each.hpp>
# include <boost/mpl/bool_t.hpp>
# include <boost/python/object/select_holder.hpp>
# include <boost/python/object/class_wrapper.hpp>
# include <boost/python/data_members.hpp>
# include <boost/utility.hpp>
# include <boost/python/detail/type_list.hpp>
namespace // put some convenience classes into the unnamed namespace for the user
{
// A type list for specifying bases
template < BOOST_MPL_LIST_DEFAULT_PARAMETERS(typename B, ::boost::mpl::null_argument) >
struct bases : ::boost::mpl::type_list< BOOST_MPL_LIST_PARAMETERS(B) >::type
{};
// A type list for specifying arguments
template < BOOST_MPL_LIST_DEFAULT_PARAMETERS(typename A, ::boost::mpl::null_argument) >
struct args : ::boost::mpl::type_list< BOOST_MPL_LIST_PARAMETERS(A) >::type
{};
}
namespace boost { namespace python {
namespace detail
{
struct write_type_id;
template <class T, class Prev = detail::not_specified>
struct select_held_type;
template <class T1, class T2, class T3>
struct has_noncopyable;
// Register a to_python converter for a class T, depending on the
// type of the first (tag) argument. The 2nd argument is a pointer
// to the type of holder that must be created. The 3rd argument is a
// reference to the Python type object to be created.
template <class T, class Holder>
static inline void register_copy_constructor(mpl::bool_t<true> const&, Holder*, ref const& obj, T* = 0)
// This is an mpl BinaryMetaFunction object with a runtime behavior,
// which is to write the id of the type which is passed as its 2nd
// compile-time argument into the iterator pointed to by its runtime
// argument
struct write_type_id
{
objects::class_wrapper<T,Holder> x(obj);
}
// The first argument is Ignored because mpl::for_each is still
// currently an accumulate (reduce) implementation.
template <class Ignored, class T> struct apply
{
// also an artifact of accumulate-based for_each
typedef void type;
// Tag dispatched to have no effect.
template <class T, class Holder>
static inline void register_copy_constructor(mpl::bool_t<false> const&, Holder*, ref const&, T* = 0)
{
}
// Here's the runtime behavior
static void execute(converter::undecorated_type_id_t** p)
{
*(*p)++ = converter::undecorated_type_id<T>();
}
};
};
}
//
@@ -60,24 +64,27 @@ namespace detail
// This is the primary mechanism through which users will expose
// C++ classes to Python. The three template arguments are:
//
// T - The class being exposed to Python
//
// Bases - An MPL sequence of base classes
//
// HolderGenerator -
// An optional type generator for the "holder" which
// maintains the C++ object inside the Python instance. The
// default just holds the object "by-value", but other
// holders can be substituted which will hold the C++ object
// by smart pointer, for example.
//
template <
class T // class being wrapped
, class X1 // = detail::not_specified
, class X2 // = detail::not_specified
, class X3 // = detail::not_specified
, class Bases
, class HolderGenerator
>
class class_ : public objects::class_base
class class_ : private objects::class_base
{
typedef class_<T,X1,X2,X3> self;
BOOST_STATIC_CONSTANT(bool, is_copyable = (!detail::has_noncopyable<X1,X2,X3>::value));
typedef typename detail::select_held_type<
X1, typename detail::select_held_type<
X2, typename detail::select_held_type<
X3
>::type>::type>::type held_type;
typedef class_<T,Bases,HolderGenerator> self;
public:
// Automatically derive the class name - only works on some
// compilers because type_info::name is sometimes mangled (gcc)
class_();
@@ -123,25 +130,7 @@ class class_ : public objects::class_base
template <class Args>
self& def_init(Args const&)
{
def("__init__",
make_constructor<Args>(
// Using runtime type selection works around a CWPro7 bug.
objects::select_holder<T,held_type>((held_type*)0).get()
)
);
return *this;
}
template <class Args, class CallPolicy>
self& def_init(Args const&, CallPolicy policy)
{
def("__init__",
make_constructor<Args>(
policy
// Using runtime type selection works around a CWPro7 bug.
, objects::select_holder<T,held_type>((held_type*)0).get()
)
);
def("__init__", make_constructor<T,Args,HolderGenerator>());
return *this;
}
@@ -152,38 +141,12 @@ class class_ : public objects::class_base
return *this;
}
//
// Data member access
//
template <class D>
self& def_readonly(char const* name, D T::*pm)
{
ref fget(make_getter(pm));
this->add_property(name, fget);
return *this;
}
template <class D>
self& def_readwrite(char const* name, D T::*pm)
{
ref fget(make_getter(pm));
ref fset(make_setter(pm));
this->add_property(name, fget, fset);
return *this;
}
// return the underlying object
// ref object() const;
ref object() const;
private: // types
typedef objects::class_id class_id;
typedef typename detail::select_bases<X1
, typename detail::select_bases<X2
, typename boost::python::detail::select_bases<X3>::type
>::type
>::type bases;
// A helper class which will contain an array of id objects to be
// passed to the base class constructor
struct id_vector
@@ -196,91 +159,48 @@ class class_ : public objects::class_base
// Write the rest of the elements into succeeding positions.
class_id* p = ids + 1;
mpl::for_each<bases, void, detail::write_type_id>::execute(&p);
mpl::for_each<Bases, void, detail::write_type_id>::execute(&p);
}
BOOST_STATIC_CONSTANT(
std::size_t, size = mpl::size<bases>::value + 1);
std::size_t, size = mpl::size<Bases>::value + 1);
class_id ids[size];
};
friend struct id_vector;
private: // helper functions
void initialize_converters();
};
//
// implementations
//
template <class T, class X1, class X2, class X3>
inline class_<T,X1,X2,X3>::class_()
template <class T, class Bases, class HolderGenerator>
inline class_<T, Bases, HolderGenerator>::class_()
: class_base(typeid(T).name(), id_vector::size, id_vector().ids)
{
// register converters
objects::register_class_from_python<T,bases>();
detail::register_copy_constructor<T>(
mpl::bool_t<is_copyable>()
, objects::select_holder<T,held_type>((held_type*)0).get()
, this->object());
// Bring the class converters into existence. This static object
// will survive until the shared library this module lives in is
// unloaded (that doesn't happen until Python terminates).
static objects::class_converters<T,Bases> converters(object());
}
template <class T, class X1, class X2, class X3>
inline class_<T,X1,X2,X3>::class_(char const* name)
template <class T, class Bases, class HolderGenerator>
inline class_<T, Bases, HolderGenerator>::class_(char const* name)
: class_base(name, id_vector::size, id_vector().ids)
{
// register converters
objects::register_class_from_python<T,bases>();
detail::register_copy_constructor<T>(
mpl::bool_t<is_copyable>()
, objects::select_holder<T,held_type>((held_type*)0).get()
, this->object());
// Bring the class converters into existence. This static object
// will survive until the shared library this module lives in is
// unloaded (that doesn't happen until Python terminates).
static objects::class_converters<T,Bases> converters(object());
}
namespace detail
template <class T, class Bases, class HolderGenerator>
inline ref class_<T, Bases, HolderGenerator>::object() const
{
// This is an mpl BinaryMetaFunction object with a runtime behavior,
// which is to write the id of the type which is passed as its 2nd
// compile-time argument into the iterator pointed to by its runtime
// argument
struct write_type_id
{
// The first argument is Ignored because mpl::for_each is still
// currently an accumulate (reduce) implementation.
template <class Ignored, class T> struct apply
{
// also an artifact of accumulate-based for_each
typedef void type;
// Here's the runtime behavior
static void execute(converter::undecorated_type_id_t** p)
{
*(*p)++ = converter::undecorated_type_id<T>();
}
};
};
template <class T1, class T2, class T3>
struct has_noncopyable
: type_traits::ice_or<
is_same<T1,noncopyable>::value
, is_same<T2,noncopyable>::value
, is_same<T3,noncopyable>::value>
{};
template <class T, class Prev>
struct select_held_type
: mpl::select_type<
type_traits::ice_or<
specifies_bases<T>::value
, is_same<T,noncopyable>::value
>::value
, Prev
, T
>
{
};
typedef objects::class_base base;
return this->base::object();
}
}} // namespace boost::python

View File

@@ -5,9 +5,7 @@
// to its suitability for any purpose.
#ifndef CLASS_FWD_DWA200222_HPP
# define CLASS_FWD_DWA200222_HPP
# include <boost/python/detail/not_specified.hpp>
# include <boost/python/args.hpp>
# include <boost/python/bases.hpp>
# include <boost/python/object/value_holder_fwd.hpp>
namespace boost { namespace python {
@@ -18,9 +16,8 @@ namespace detail
template <
class T // class being wrapped
, class X1 = detail::not_specified
, class X2 = detail::not_specified
, class X3 = detail::not_specified
, class Bases = detail::empty_list
, class HolderGenerator = objects::value_holder_generator<>
>
class class_;

View File

@@ -145,7 +145,8 @@ namespace detail {
// A type which acts a lot like a built-in Python class. T is the obj type,
// so class_t<instance> is a very simple "class-alike".
template <class T>
class class_t : public boost::python::detail::class_base
class BOOST_PYTHON_DECL_TEMPLATE class_t
: public boost::python::detail::class_base
{
public:
class_t(meta_class<T>* meta_class_obj, string name, tuple bases, const dictionary& name_space);
@@ -226,7 +227,7 @@ class class_t : public boost::python::detail::class_base
// The type of a class_t<T> object.
template <class T>
class meta_class
class BOOST_PYTHON_DECL_TEMPLATE meta_class
: public boost::python::detail::reprable<
boost::python::detail::callable<
boost::python::detail::getattrable<
@@ -349,21 +350,19 @@ int class_t<T>::instance_mapping_ass_subscript(PyObject* obj, PyObject* key, PyO
return 0;
}
bool BOOST_PYTHON_DECL adjust_slice_indices(PyObject* obj, int& start, int& finish);
void BOOST_PYTHON_DECL adjust_slice_indices(PyObject* obj, int& start, int& finish);
template <class T>
PyObject* class_t<T>::instance_sequence_slice(PyObject* obj, int start, int finish) const
{
if (!adjust_slice_indices(obj, start, finish))
return 0;
adjust_slice_indices(obj, start, finish);
return downcast<T>(obj)->get_slice(start, finish);
}
template <class T>
int class_t<T>::instance_sequence_ass_slice(PyObject* obj, int start, int finish, PyObject* value) const
{
if (!adjust_slice_indices(obj, start, finish))
return -1;
adjust_slice_indices(obj, start, finish);
downcast<T>(obj)->set_slice(start, finish, value);
return 0;
}

View File

@@ -160,7 +160,7 @@ unsigned char from_python(PyObject*, boost::python::type<const unsigned char&>);
BOOST_PYTHON_DECL float from_python(PyObject*, boost::python::type<float>);
BOOST_PYTHON_DECL double from_python(PyObject*, boost::python::type<double>);
# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
# ifndef BOOST_MSVC6_OR_EARLIER
PyObject* to_python(float);
PyObject* to_python(double);
# else
@@ -260,7 +260,7 @@ PyObject* from_python(PyObject*, boost::python::type<PyObject*>);
// #endif
// }} // namespace boost::python
#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
#if !defined(BOOST_MSVC6_OR_EARLIER)
template <class T>
boost::shared_ptr<T> from_python(PyObject*p, boost::python::type<boost::shared_ptr<T> >)
{
@@ -286,7 +286,7 @@ PyObject* to_python(boost::shared_ptr<T> p)
// inline implementations
//
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
#ifndef BOOST_MSVC6_OR_EARLIER
inline PyObject* to_python(double d)
{
return PyFloat_FromDouble(d);
@@ -296,7 +296,7 @@ inline PyObject* to_python(float f)
{
return PyFloat_FromDouble(f);
}
#endif
#endif // BOOST_MSVC6_OR_EARLIER
inline PyObject* to_python(long l)
{

View File

@@ -17,7 +17,6 @@
# include <boost/python/to_python_indirect.hpp>
# include <boost/python/detail/none.hpp>
# include <boost/python/ptr.hpp>
# include <boost/python/errors.hpp>
namespace boost { namespace python { namespace converter {
@@ -133,33 +132,6 @@ template <class T>
struct callback_from_python
: detail::select_callback_from_python<T>::type
{
typedef T result_type;
};
struct void_result
{
private:
void_result() {}
void operator=(void_result const&);
// I would prefer to make this completely untouchable, but few
// compilers support template friends
# if 0
void_result(void_result const&);
# endif
friend struct callback_from_python<void>;
};
// Specialization as a convenience for call and call_method
template <>
struct callback_from_python<void>
{
typedef void_result result_type;
result_type operator()(PyObject* x) const
{
Py_DECREF(expect_non_null(x));
return result_type();
}
};
template <class T>
@@ -172,14 +144,6 @@ struct callback_to_python
callback_to_python(T const& x);
};
// Convenience macros for call<> and call_method<> code generation
# define BOOST_PYTHON_CALLBACK_TO_PYTHON_GET(index,ignored) \
converter::callback_to_python<BOOST_PP_CAT(A,index)>( \
BOOST_PP_CAT(a,index)).get()
# define BOOST_PYTHON_ARG_STRING(nargs) \
"(" BOOST_PP_REPEAT(nargs,BOOST_PYTHON_PROJECT_2ND,"O") ")"
//
// Implementations
//

View File

@@ -21,9 +21,6 @@ BOOST_PYTHON_DECL void* find(
BOOST_PYTHON_DECL rvalue_stage1_data find(
PyObject* source, rvalue_from_python_registration const*);
BOOST_PYTHON_DECL rvalue_from_python_registration const* find_chain(
PyObject* source, rvalue_from_python_registration const*);
}}} // namespace boost::python::converter
#endif // FIND_FROM_PYTHON_DWA2002223_HPP

View File

@@ -9,6 +9,7 @@
# include <boost/python/detail/char_array.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/type_traits/same_traits.hpp>
# include <boost/type_traits/alignment_traits.hpp>
# include <boost/type_traits/transform_traits.hpp>
# include <boost/static_assert.hpp>
# include <boost/python/converter/from_python_stage1_data.hpp>
@@ -23,10 +24,18 @@ namespace boost { namespace python { namespace converter {
namespace detail
{
template <class T> struct referent_alignment;
template <class T> struct referent_size;
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct referent_alignment<T&>
{
BOOST_STATIC_CONSTANT(
std::size_t, value = alignment_of<T>::value);
};
template <class T>
struct referent_size<T&>
{
@@ -36,6 +45,26 @@ namespace detail
# else
template <class U>
struct alignment_chars
{
BOOST_STATIC_CONSTANT(
std::size_T, n = alignment_of<U>::value);
char elements[n + 1];
};
template <class T> struct referent_alignment
{
template <class U>
static alignment_chars<U> helper(U&);
static T t;
BOOST_STATIC_CONSTANT(
std::size_t, value = sizeof(helper(t).elements) - 1);
};
template <class T> struct referent_size
{
static T f();
@@ -53,12 +82,24 @@ namespace detail
char, short, int, long, float, double, long double \
, void*, function_ptr, member_ptr, member_function_ptr))
# define BOOST_PYTHON_CHOOSE_LOWER_ALIGNMENT(R,P,I,T) \
typename mpl::select_type< \
alignment_of<T>::value <= target, T, char>::type BOOST_PP_CAT(t,I);
# define BOOST_PYTHON_CHOOSE_LOWER_SIZE(R,P,I,T) \
typename mpl::select_type< \
sizeof(T) <= target, T, char>::type BOOST_PP_CAT(t,I);
# define BOOST_PYTHON_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I);
template <std::size_t target>
union lower_alignment
{
BOOST_PP_LIST_FOR_EACH_I(
BOOST_PYTHON_CHOOSE_LOWER_ALIGNMENT
, ignored, BOOST_PYTHON_ALIGNMENT_TYPES)
};
template <std::size_t target>
union lower_size
{
@@ -67,6 +108,13 @@ namespace detail
, ignored, BOOST_PYTHON_ALIGNMENT_TYPES)
};
union max_align
{
BOOST_PP_LIST_FOR_EACH_I(
BOOST_PYTHON_CHOOSE_T
, ignored, BOOST_PYTHON_ALIGNMENT_TYPES)
};
template <class Align, std::size_t size>
union aligned_storage
{
@@ -77,7 +125,37 @@ namespace detail
template <class Reference>
struct referent_storage
{
typedef lower_size<referent_size<Reference>::value> align_t;
typedef typename remove_cv<typename remove_reference<Reference>::type>::type referent;
BOOST_STATIC_CONSTANT(std::size_t, target = referent_alignment<Reference>::value);
typedef lower_alignment<target> t1;
BOOST_STATIC_CONSTANT(bool, t1_aligned =
(alignment_of<t1>::value >= target)
& (alignment_of<t1>::value % target == 0));
typedef lower_size<referent_size<Reference>::value> t2;
BOOST_STATIC_CONSTANT(bool, t2_aligned =
(alignment_of<t2>::value >= target)
& (alignment_of<t2>::value % target == 0));
typedef typename mpl::select_type<
t1_aligned
, t1
, typename mpl::select_type<
t2_aligned
, t2
, max_align
>::type
>::type align_t;
BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t>::value);
BOOST_STATIC_ASSERT(found >= target);
BOOST_STATIC_ASSERT(found % target == 0);
typedef aligned_storage<align_t,referent_size<Reference>::value> type;
};
}

View File

@@ -1,55 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef IMPLICIT_DWA2002326_HPP
# define IMPLICIT_DWA2002326_HPP
# include <boost/python/converter/from_python_data.hpp>
# include <boost/python/converter/from_python_stage1_data.hpp>
# include <boost/python/converter/registrations.hpp>
namespace boost { namespace python { namespace converter {
template <class Source, class Target>
struct implicit
{
static void* convertible(PyObject* obj)
{
// Find a converter registration which can produce a Source
// instance from obj
return const_cast<rvalue_from_python_registration*>(
find_chain(obj, rvalue_from_python_chain<Source>::value));
}
static void construct(PyObject* obj, rvalue_stage1_data* data)
{
// This is the registration we got from the convertible step
rvalue_from_python_registration const* registration
= static_cast<rvalue_from_python_registration*>(data->convertible);
// Call the convertible function again
rvalue_data<Source> intermediate_data(registration->convertible(obj));
// Use the result to construct the source type if the first
// converter was an rvalue converter.
if (registration->construct != 0)
registration->construct(obj, &intermediate_data.stage1);
void* storage = ((rvalue_base_data<Target>*)data)->storage.bytes;
# if !defined(BOOST_MSVC) || _MSC_FULL_VER != 13012108 // vc7.01 alpha workaround
new (storage) Target(*static_cast<Source*>(intermediate_data.stage1.convertible));
# else
Target x(*static_cast<Source*>(intermediate_data.stage1.convertible));
new (storage) Target(x);
# endif
// record successful construction
data->convertible = storage;
}
};
}}} // namespace boost::python::converter
#endif // IMPLICIT_DWA2002326_HPP

View File

@@ -37,14 +37,6 @@ namespace registry
, undecorated_type_id_t
);
// Insert an rvalue from_python converter at the tail of the
// chain. Used for implicit conversions
BOOST_PYTHON_DECL void push_back(
void* (*convertible)(PyObject*)
, constructor_function
, undecorated_type_id_t
);
BOOST_PYTHON_DECL PyTypeObject*& class_object(undecorated_type_id_t key);
}

View File

@@ -18,12 +18,8 @@
# include <boost/python/class_builder.hpp>
namespace boost { namespace python {
struct BOOST_PYTHON_DECL import_error: error_already_set {};
struct BOOST_PYTHON_DECL export_error : error_already_set {};
void BOOST_PYTHON_DECL throw_import_error();
void BOOST_PYTHON_DECL throw_export_error();
struct BOOST_PYTHON_DECL import_error: error_already_set {};
struct BOOST_PYTHON_DECL export_error : error_already_set {};
namespace detail
{
@@ -174,8 +170,10 @@ struct export_converter_object_noncopyable : export_converter_object_base<T>
virtual PyObject* to_python(const T& x) {
PyErr_SetString(PyExc_RuntimeError,
"to_python(const T&) converter not exported");
throw_import_error();
throw import_error();
#if defined(__MWERKS__) && __MWERKS__ <= 0x2406
return 0;
#endif
}
virtual T* from_python_Ts(PyObject* p, boost::python::type<T*> t) {

View File

@@ -1,111 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef DATA_MEMBERS_DWA2002328_HPP
# define DATA_MEMBERS_DWA2002328_HPP
# include <boost/python/detail/config.hpp>
# include <boost/python/detail/wrap_python.hpp>
# include <boost/python/object/function.hpp>
# include <boost/type_traits/transform_traits.hpp>
# include <boost/type_traits/cv_traits.hpp>
# include <boost/python/return_value_policy.hpp>
# include <boost/python/copy_non_const_reference.hpp>
namespace boost { namespace python {
namespace detail
{
template <class Data, class Class, class Policies>
struct member
{
static PyObject* get(Data Class::*pm, PyObject* args_, PyObject*, Policies const& policies)
{
from_python<Class*> c0(PyTuple_GET_ITEM(args_, 0));
if (!c0.convertible()) return 0;
// find the result converter
typedef typename Policies::result_converter result_converter;
typedef typename boost::add_reference<Data>::type source;
typename mpl::apply1<result_converter,source>::type cr;
if (!cr.convertible()) return 0;
if (!policies.precall(args_)) return 0;
PyObject* result = cr( (c0(PyTuple_GET_ITEM(args_, 0)))->*pm );
return policies.postcall(args_, result);
}
static PyObject* set(Data Class::*pm, PyObject* args_, PyObject*, Policies const& policies)
{
// check that each of the arguments is convertible
from_python<Class*> c0(PyTuple_GET_ITEM(args_, 0));
if (!c0.convertible()) return 0;
typedef typename add_const<Data>::type target1;
typedef typename add_reference<target1>::type target;
from_python<target> c1(PyTuple_GET_ITEM(args_, 1));
if (!c1.convertible()) return 0;
if (!policies.precall(args_)) return 0;
(c0(PyTuple_GET_ITEM(args_, 0)))->*pm = c1(PyTuple_GET_ITEM(args_, 1));
return policies.postcall(args_, detail::none());
}
};
}
template <class C, class D>
objects::function* make_getter(D C::*pm)
{
typedef return_value_policy<copy_non_const_reference> default_policy;
return new objects::function(
objects::py_function(
::boost::bind(
&detail::member<D,C,default_policy>::get, pm, _1, _2
, default_policy()))
, 1);
}
template <class C, class D, class Policies>
objects::function* make_getter(D C::*pm, Policies const& policies)
{
return new objects::function(
objects::py_function(
::boost::bind(
&detail::member<D,C,Policies>::get, pm, _1, _2
, policies))
, 1);
}
template <class C, class D>
objects::function* make_setter(D C::*pm)
{
return new objects::function(
objects::py_function(
::boost::bind(
&detail::member<D,C,default_call_policies>::set, pm, _1, _2
, default_call_policies()))
, 2);
}
template <class C, class D, class Policies>
objects::function* make_setter(D C::*pm, Policies const& policies)
{
return new objects::function(
objects::py_function(
::boost::bind(
&detail::member<D,C,Policies>::set, pm, _1, _2
, policies))
, 2);
}
}} // namespace boost::python
#endif // DATA_MEMBERS_DWA2002328_HPP

View File

@@ -11,11 +11,7 @@
#ifndef ARG_TUPLE_SIZE_DWA20011201_HPP
# define ARG_TUPLE_SIZE_DWA20011201_HPP
# include <boost/config.hpp>
# include <boost/python/detail/char_array.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/mpl/aux_/preprocessor.hpp>
# include <boost/preprocessor/comma_if.hpp>
namespace boost { namespace python { namespace detail {
@@ -24,29 +20,203 @@ namespace boost { namespace python { namespace detail {
// (member) function of the given type.
template <class F> struct arg_tuple_size;
// Include the pre-expanded version of the code
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/arg_tuple_size.hpp>
# endif
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
// Specializations for function pointers
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \
template <class R BOOST_PP_COMMA_IF(args) BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
struct arg_tuple_size<BOOST_PYTHON_FN(*,0,args)> \
{ \
BOOST_STATIC_CONSTANT(std::size_t, value = args); \
template <class R>
struct arg_tuple_size<R (*)()>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 0);
};
// Specializations for member function pointers
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \
template <class R, BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
struct arg_tuple_size<BOOST_PYTHON_FN(A0::*,1,args) cv()> \
{ \
BOOST_STATIC_CONSTANT(std::size_t, value = args); \
template <class R, class A1>
struct arg_tuple_size<R (*)(A1)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 1);
};
template <class R, class A1, class A2>
struct arg_tuple_size<R (*)(A1, A2)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 2);
};
template <class R, class A1, class A2, class A3>
struct arg_tuple_size<R (*)(A1, A2, A3)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 3);
};
template <class R, class A1, class A2, class A3, class A4>
struct arg_tuple_size<R (*)(A1, A2, A3, A4)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 4);
};
template <class R, class A1, class A2, class A3, class A4, class A5>
struct arg_tuple_size<R (*)(A1, A2, A3, A4, A5)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 5);
};
template <class R, class A1, class A2, class A3, class A4, class A5, class A6>
struct arg_tuple_size<R (*)(A1, A2, A3, A4, A5, A6)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 6);
};
template <class R, class A0>
struct arg_tuple_size<R (A0::*)()>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 1);
};
template <class R, class A0, class A1>
struct arg_tuple_size<R (A0::*)(A1)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 2);
};
template <class R, class A0, class A1, class A2>
struct arg_tuple_size<R (A0::*)(A1, A2)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 3);
};
template <class R, class A0, class A1, class A2, class A3>
struct arg_tuple_size<R (A0::*)(A1, A2, A3)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 4);
};
template <class R, class A0, class A1, class A2, class A3, class A4>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 5);
};
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4, A5)>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 6);
};
// Metrowerks thinks this creates ambiguities
# if !defined(__MWERKS__) || __MWERKS__ > 0x2406
template <class R, class A0>
struct arg_tuple_size<R (A0::*)() const>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 1);
};
template <class R, class A0, class A1>
struct arg_tuple_size<R (A0::*)(A1) const>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 2);
};
template <class R, class A0, class A1, class A2>
struct arg_tuple_size<R (A0::*)(A1, A2) const>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 3);
};
template <class R, class A0, class A1, class A2, class A3>
struct arg_tuple_size<R (A0::*)(A1, A2, A3) const>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 4);
};
template <class R, class A0, class A1, class A2, class A3, class A4>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4) const>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 5);
};
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4, A5) const>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 6);
};
template <class R, class A0>
struct arg_tuple_size<R (A0::*)() volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 1);
};
template <class R, class A0, class A1>
struct arg_tuple_size<R (A0::*)(A1) volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 2);
};
template <class R, class A0, class A1, class A2>
struct arg_tuple_size<R (A0::*)(A1, A2) volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 3);
};
template <class R, class A0, class A1, class A2, class A3>
struct arg_tuple_size<R (A0::*)(A1, A2, A3) volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 4);
};
template <class R, class A0, class A1, class A2, class A3, class A4>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4) volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 5);
};
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4, A5) volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 6);
};
template <class R, class A0>
struct arg_tuple_size<R (A0::*)() const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 1);
};
template <class R, class A0, class A1>
struct arg_tuple_size<R (A0::*)(A1) const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 2);
};
template <class R, class A0, class A1, class A2>
struct arg_tuple_size<R (A0::*)(A1, A2) const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 3);
};
template <class R, class A0, class A1, class A2, class A3>
struct arg_tuple_size<R (A0::*)(A1, A2, A3) const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 4);
};
template <class R, class A0, class A1, class A2, class A3, class A4>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4) const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 5);
};
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
struct arg_tuple_size<R (A0::*)(A1, A2, A3, A4, A5) const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t, value = 6);
};
# endif // __MWERKS__
# else
// We will use the "sizeof() trick" to work around the lack of
@@ -60,22 +230,103 @@ struct arg_tuple_size<BOOST_PYTHON_FN(A0::*,1,args) cv()> \
// their return value is used to discriminate between various free
// and member function pointers at compile-time.
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \
template <class R BOOST_PP_COMMA_IF(args) BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
char_array<args> arg_tuple_size_helper(BOOST_PYTHON_FN(*,0,args));
template <class R>
char_array<0> arg_tuple_size_helper(R (*)());
template <class R, class A1>
char_array<1> arg_tuple_size_helper(R (*)(A1));
template <class R, class A1, class A2>
char_array<2> arg_tuple_size_helper(R (*)(A1, A2));
template <class R, class A1, class A2, class A3>
char_array<3> arg_tuple_size_helper(R (*)(A1, A2, A3));
template <class R, class A1, class A2, class A3, class A4>
char_array<4> arg_tuple_size_helper(R (*)(A1, A2, A3, A4));
template <class R, class A1, class A2, class A3, class A4, class A5>
char_array<5> arg_tuple_size_helper(R (*)(A1, A2, A3, A4, A5));
template <class R, class A1, class A2, class A3, class A4, class A5, class A6>
char_array<6> arg_tuple_size_helper(R (*)(A1, A2, A3, A4, A5, A6));
template <class R, class A0>
char_array<1> arg_tuple_size_helper(R (A0::*)());
template <class R, class A0, class A1>
char_array<2> arg_tuple_size_helper(R (A0::*)(A1));
template <class R, class A0, class A1, class A2>
char_array<3> arg_tuple_size_helper(R (A0::*)(A1, A2));
template <class R, class A0, class A1, class A2, class A3>
char_array<4> arg_tuple_size_helper(R (A0::*)(A1, A2, A3));
template <class R, class A0, class A1, class A2, class A3, class A4>
char_array<5> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4));
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
char_array<6> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4, A5));
template <class R, class A0>
char_array<1> arg_tuple_size_helper(R (A0::*)() const);
template <class R, class A0, class A1>
char_array<2> arg_tuple_size_helper(R (A0::*)(A1) const);
template <class R, class A0, class A1, class A2>
char_array<3> arg_tuple_size_helper(R (A0::*)(A1, A2) const);
template <class R, class A0, class A1, class A2, class A3>
char_array<4> arg_tuple_size_helper(R (A0::*)(A1, A2, A3) const);
template <class R, class A0, class A1, class A2, class A3, class A4>
char_array<5> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4) const);
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
char_array<6> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4, A5) const);
template <class R, class A0>
char_array<1> arg_tuple_size_helper(R (A0::*)() volatile);
template <class R, class A0, class A1>
char_array<2> arg_tuple_size_helper(R (A0::*)(A1) volatile);
template <class R, class A0, class A1, class A2>
char_array<3> arg_tuple_size_helper(R (A0::*)(A1, A2) volatile);
template <class R, class A0, class A1, class A2, class A3>
char_array<4> arg_tuple_size_helper(R (A0::*)(A1, A2, A3) volatile);
template <class R, class A0, class A1, class A2, class A3, class A4>
char_array<5> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4) volatile);
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
char_array<6> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4, A5) volatile);
template <class R, class A0>
char_array<1> arg_tuple_size_helper(R (A0::*)() const volatile);
template <class R, class A0, class A1>
char_array<2> arg_tuple_size_helper(R (A0::*)(A1) const volatile);
template <class R, class A0, class A1, class A2>
char_array<3> arg_tuple_size_helper(R (A0::*)(A1, A2) const volatile);
template <class R, class A0, class A1, class A2, class A3>
char_array<4> arg_tuple_size_helper(R (A0::*)(A1, A2, A3) const volatile);
template <class R, class A0, class A1, class A2, class A3, class A4>
char_array<5> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4) const volatile);
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
char_array<6> arg_tuple_size_helper(R (A0::*)(A1, A2, A3, A4, A5) const volatile);
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \
template <class R, BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
char_array<args> arg_tuple_size_helper(BOOST_PYTHON_FN(A0::*,1,args)cv());
# endif
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_ARG_TUPLE_SIZE_PF, nil)
// Generate a series for each cv-qualification
BOOST_PYTHON_REPEAT_MF_CV_2ND(BOOST_PYTHON_ARG_TUPLE_SIZE_PMF)
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(__BORLANDC__)
template <class F>
struct arg_tuple_size
{

View File

@@ -11,9 +11,6 @@
# include <boost/mpl/select_type.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/type_traits/same_traits.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/mpl/aux_/preprocessor.hpp>
# include <boost/preprocessor/comma_if.hpp>
namespace boost { namespace python
{
@@ -26,41 +23,192 @@ struct caller
{
typedef PyObject* result_type;
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/caller.hpp>
# endif
template <class P, class R>
PyObject* operator()(R (*f)(), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
# define BOOST_PYTHON_CALLER_PF(args_, ignored) \
template < \
class P \
, class R \
BOOST_PP_COMMA_IF(args_) BOOST_MPL_TEMPLATE_PARAMETERS(0, args_, class A) \
> \
PyObject* operator()( \
BOOST_PYTHON_FN(*f,0,args_) \
, PyObject* args, PyObject* keywords \
, P const& policies \
) const \
{ \
return returning<R>::call(f, args, keywords,&policies); \
}
template <class P, class R, class A0>
PyObject* operator()(R (*f)(A0), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CALLER_PF, nil)
template <class P, class R, class A0, class A1>
PyObject* operator()(R (*f)(A0, A1), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2>
PyObject* operator()(R (*f)(A0, A1, A2), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3>
PyObject* operator()(R (*f)(A0, A1, A2, A3), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4>
PyObject* operator()(R (*f)(A0, A1, A2, A3, A4), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4, class A5>
PyObject* operator()(R (*f)(A0, A1, A2, A3, A4, A5), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
// Member functions
# define BOOST_PYTHON_CALLER_PMF(args_, cv) \
template <class P, class R, BOOST_MPL_TEMPLATE_PARAMETERS(0, args_, class A)> \
PyObject* operator()( \
BOOST_PYTHON_FN(A0::*f,1,args_)cv() \
, PyObject* args, PyObject* keywords \
, P const& policies \
) const \
{ \
return returning<R>::call(f, args, keywords,&policies); \
}
template <class P, class R, class A0>
PyObject* operator()(R (A0::*f)(), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
BOOST_PYTHON_REPEAT_MF_ALL_CV_2ND(BOOST_PYTHON_CALLER_PMF)
template <class P, class R, class A0, class A1>
PyObject* operator()(R (A0::*f)(A1), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2>
PyObject* operator()(R (A0::*f)(A1, A2), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3>
PyObject* operator()(R (A0::*f)(A1, A2, A3), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4, class A5>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4, A5), PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0>
PyObject* operator()(R (A0::*f)() const, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1>
PyObject* operator()(R (A0::*f)(A1) const, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2>
PyObject* operator()(R (A0::*f)(A1, A2) const, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3>
PyObject* operator()(R (A0::*f)(A1, A2, A3) const, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4) const, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4, class A5>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4, A5) const, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0>
PyObject* operator()(R (A0::*f)() volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1>
PyObject* operator()(R (A0::*f)(A1) volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2>
PyObject* operator()(R (A0::*f)(A1, A2) volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3>
PyObject* operator()(R (A0::*f)(A1, A2, A3) volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4) volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4, class A5>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4, A5) volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0>
PyObject* operator()(R (A0::*f)() const volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1>
PyObject* operator()(R (A0::*f)(A1) const volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2>
PyObject* operator()(R (A0::*f)(A1, A2) const volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3>
PyObject* operator()(R (A0::*f)(A1, A2, A3) const volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4) const volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
template <class P, class R, class A0, class A1, class A2, class A3, class A4, class A5>
PyObject* operator()(R (A0::*f)(A1, A2, A3, A4, A5) const volatile, PyObject* args, PyObject* keywords, P const& policies) const
{
return returning<R>::call(f, args, keywords, policies);
}
};
}}} // namespace boost::python::detail

View File

@@ -79,16 +79,32 @@
// backwards compatibility:
#ifdef BOOST_PYTHON_STATIC_LIB
# define BOOST_PYTHON_STATIC_LINK
# elif !defined(BOOST_PYTHON_DYNAMIC_LIB)
# define BOOST_PYTHON_DYNAMIC_LIB
#endif
#if defined(__MWERKS__) \
#if defined(__MWERKS__) \
|| (defined(__DECCXX_VER) && __DECCXX_VER <= 60590002) \
|| (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730)
# define BOOST_PYTHON_NO_TEMPLATE_EXPORT
#endif
#if defined(__GNUC__)
# define BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD extern
# define BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD extern
#endif
// Handle default cases
#ifndef BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD
# ifdef _WIN32
# define BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD extern
# else
# define BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD
# endif
#endif
#ifndef BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD
# define BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD
#endif
#if defined(BOOST_PYTHON_DYNAMIC_LIB) && defined(_WIN32)
# if defined(BOOST_PYTHON_SOURCE)
# define BOOST_PYTHON_DECL __declspec(dllexport)
@@ -96,26 +112,54 @@
# else
# define BOOST_PYTHON_DECL __declspec(dllimport)
# endif
// MinGW, at least, has some problems exporting template instantiations
# if defined(__GNUC__) && __GNUC__ < 3 && !defined(__CYGWIN__)
# define BOOST_PYTHON_NO_TEMPLATE_EXPORT
# endif
#endif
#ifndef BOOST_PYTHON_DECL
# define BOOST_PYTHON_DECL
#endif
#ifndef BOOST_PYTHON_EXPORT
# define BOOST_PYTHON_EXPORT extern
#endif
#ifndef BOOST_PYTHON_DECL_TEMPLATE
# ifndef BOOST_PYTHON_NO_TEMPLATE_EXPORT
# define BOOST_PYTHON_DECL_TEMPLATE BOOST_PYTHON_DECL
# else
# define BOOST_PYTHON_DECL_TEMPLATE
# endif
#endif
#if !defined(BOOST_PYTHON_NO_TEMPLATE_EXPORT)
# define BOOST_PYTHON_EXPORT_CLASS_TEMPLATE(instantiation) BOOST_PYTHON_EXPORT template class BOOST_PYTHON_DECL instantiation
#if defined(BOOST_PYTHON_SOURCE)
# define BOOST_PYTHON_EXPORT BOOST_PYTHON_EXPORT_TEMPLATE_KEYWORD
#else
# define BOOST_PYTHON_EXPORT_CLASS_TEMPLATE(instantiation) struct ThIsTyPeNeVeRuSeD
# define BOOST_PYTHON_EXPORT BOOST_PYTHON_IMPORT_TEMPLATE_KEYWORD
#endif
# ifndef BOOST_PYTHON_EXPORT_TEMPLATE
# define BOOST_PYTHON_EXPORT_TEMPLATE BOOST_PYTHON_EXPORT template
# endif
# define BOOST_PYTHON_EXPORT_TEMPLATE_CLASS BOOST_PYTHON_EXPORT template class BOOST_PYTHON_DECL
// Borland C++ Fix/error check:
#if defined(__BORLANDC__)
# if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)
// problems with std::basic_string and dll RTL:
# if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE)
# ifdef BOOST_PYTHON_BUILD_DLL
# error _RWSTD_COMPILE_INSTANTIATE must not be defined when building regex++ as a DLL
# else
# pragma warn defining _RWSTD_COMPILE_INSTANTIATE when linking to the DLL version of the RTL may produce memory corruption problems in std::basic_string, as a result of separate versions of basic_string's static data in the RTL and you're exe/dll: be warned!!
# endif
# endif
# ifndef _RTLDLL
// this is harmless for a static link:
# define _RWSTD_COMPILE_INSTANTIATE
# endif
# endif
//
// VCL support:
// if we're building a console app then there can't be any VCL (can there?)
# if !defined(__CONSOLE__) && !defined(_NO_VCL)
# define BOOST_PYTHON_USE_VCL
# endif
#endif
#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730

View File

@@ -70,8 +70,10 @@ namespace detail
} // namespace detail
BOOST_PYTHON_EXPORT_CLASS_TEMPLATE(class_t<detail::extension_instance>);
BOOST_PYTHON_EXPORT_CLASS_TEMPLATE(meta_class<detail::extension_instance>);
# ifndef BOOST_PYTHON_NO_TEMPLATE_EXPORT
BOOST_PYTHON_EXPORT_TEMPLATE_CLASS class_t<detail::extension_instance>;
BOOST_PYTHON_EXPORT_TEMPLATE_CLASS meta_class<detail::extension_instance>;
# endif
namespace detail {
@@ -255,8 +257,10 @@ class python_extension_class_converters
return static_cast<T*>(target);
}
boost::python::detail::report_missing_instance_data(self, boost::python::detail::class_registry<T>::class_object(), typeid(T));
boost::python::throw_argument_error();
throw boost::python::argument_error();
#if defined(__MWERKS__) && __MWERKS__ <= 0x2406
return 0;
#endif
}
// Convert to T*
@@ -284,9 +288,10 @@ class python_extension_class_converters
return held->ptr();
}
boost::python::detail::report_missing_ptr_data(self, boost::python::detail::class_registry<T>::class_object(), typeid(T));
boost::python::throw_argument_error();
return *(PtrType*)obj;
throw boost::python::argument_error();
#if defined(__MWERKS__) && __MWERKS__ <= 0x2406
return *(PtrType*)0;
#endif
}
// Extract from obj a reference to the PtrType object which is holding a

View File

@@ -1,117 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef IF_ELSE_DWA2002322_HPP
# define IF_ELSE_DWA2002322_HPP
# include <boost/config.hpp>
namespace boost { namespace python { namespace detail {
template <class T> struct elif_selected;
template <class T>
struct if_selected
{
template <bool b>
struct elif : elif_selected<T>
{
};
template <class U>
struct else_
{
typedef T type;
};
};
# if defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
namespace msvc70_aux {
template< bool > struct inherit_from
{
template< typename T > struct result
{
typedef T type;
};
};
template<> struct inherit_from<true>
{
template< typename T > struct result
{
struct type {};
};
};
template< typename T >
struct never_true
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
} // namespace msvc70_aux
#endif // # if defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
template <class T>
struct elif_selected
{
# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__MWERKS__) && __MWERKS__ <= 0x2407)
template <class U> class then;
# elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
template <class U>
struct then : msvc70_aux::inherit_from< msvc70_aux::never_true<U>::value >
::template result< if_selected<T> >::type
{
};
# else
template <class U>
struct then : if_selected<T>
{
};
# endif
};
# if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__MWERKS__) && __MWERKS__ <= 0x2407)
template <class T>
template <class U>
class elif_selected<T>::then : public if_selected<T>
{
};
# endif
template <bool b> struct if_
{
template <class T>
struct then : if_selected<T>
{
};
};
struct if_unselected
{
template <bool b> struct elif : if_<b>
{
};
template <class U>
struct else_
{
typedef U type;
};
};
template <>
struct if_<false>
{
template <class T>
struct then : if_unselected
{
};
};
}}} // namespace boost::python::detail
#endif // IF_ELSE_DWA2002322_HPP

View File

@@ -7,7 +7,6 @@
# define INDIRECT_TRAITS_DWA2002131_HPP
# include <boost/type_traits/cv_traits.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/type_traits/function_traits.hpp>
# include <boost/mpl/select_type.hpp>
namespace boost { namespace python { namespace detail {
@@ -25,76 +24,6 @@ struct is_reference_to_const<T const&>
BOOST_STATIC_CONSTANT(bool, value = true);
};
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13012108 // vc7.01 alpha workaround
template<class T>
struct is_reference_to_const<T const volatile&>
{
static const bool value = true;
};
# endif
# if 0 // Corresponding code doesn't work on MSVC yet
template <class T>
struct is_reference_to_function
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
template <class T>
struct is_reference_to_function<T&>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_reference_to_function<T const&>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_reference_to_function<T volatile&>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_reference_to_function<T const volatile&>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
# endif
template <class T>
struct is_pointer_to_function
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
template <class T>
struct is_pointer_to_function<T*>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_pointer_to_function<T const*>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_pointer_to_function<T volatile*>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_pointer_to_function<T const volatile*>
{
BOOST_STATIC_CONSTANT(bool, value = is_function<T>::value);
};
template <class T>
struct is_reference_to_non_const
{
@@ -120,15 +49,6 @@ struct is_reference_to_volatile<T volatile&>
BOOST_STATIC_CONSTANT(bool, value = true);
};
# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13012108 // vc7.01 alpha workaround
template <class T>
struct is_reference_to_volatile<T const volatile&>
{
static const bool value = true;
};
# endif
template <class T>
struct is_reference_to_pointer
{
@@ -194,25 +114,6 @@ struct is_pointer_help
>::type type;
};
# if 0 // doesn't seem to work yet
template <class T>
struct is_reference_to_function
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof(::boost::detail::is_function_tester(t)) == sizeof(::boost::type_traits::yes_type));
# endif
template <class T>
struct is_pointer_to_function
{
static T t;
BOOST_STATIC_CONSTANT(
bool, value
= sizeof(::boost::detail::is_function_tester(t)) == sizeof(::boost::type_traits::yes_type));
};
template <typename V>
typename is_const_help<V>::type reference_to_const_helper(V&);
outer_no_type

View File

@@ -299,7 +299,7 @@ struct init0 : init
virtual instance_holder_base* create_holder(extension_instance* self, PyObject* args, PyObject* /*keywords*/) const
{
if (!PyArg_ParseTuple(args, const_cast<char*>("")))
throw_argument_error();
throw argument_error();
return new T(self
);
}
@@ -314,7 +314,7 @@ struct init1 : init
{
PyObject* a1;
if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &a1))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>()))
);
@@ -331,7 +331,7 @@ struct init2 : init
PyObject* a1;
PyObject* a2;
if (!PyArg_ParseTuple(args, const_cast<char*>("OO"), &a1, &a2))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>()))
@@ -350,7 +350,7 @@ struct init3 : init
PyObject* a2;
PyObject* a3;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOO"), &a1, &a2, &a3))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -371,7 +371,7 @@ struct init4 : init
PyObject* a3;
PyObject* a4;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOO"), &a1, &a2, &a3, &a4))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -394,7 +394,7 @@ struct init5 : init
PyObject* a4;
PyObject* a5;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOO"), &a1, &a2, &a3, &a4, &a5))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -419,7 +419,7 @@ struct init6 : init
PyObject* a5;
PyObject* a6;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -446,7 +446,7 @@ struct init7 : init
PyObject* a6;
PyObject* a7;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -475,7 +475,7 @@ struct init8 : init
PyObject* a7;
PyObject* a8;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -506,7 +506,7 @@ struct init9 : init
PyObject* a8;
PyObject* a9;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),
@@ -539,7 +539,7 @@ struct init10 : init
PyObject* a9;
PyObject* a10;
if (!PyArg_ParseTuple(args, const_cast<char*>("OOOOOOOOOO"), &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10))
throw_argument_error();
throw argument_error();
return new T(self,
boost::python::detail::reference_parameter<A1>(from_python(a1, type<A1>())),
boost::python::detail::reference_parameter<A2>(from_python(a2, type<A2>())),

View File

@@ -7,10 +7,6 @@
# define MEMBER_FUNCTION_CAST_DWA2002311_HPP
# include <boost/mpl/select_type.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/mpl/aux_/preprocessor.hpp>
# include <boost/preprocessor/comma_if.hpp>
# include <boost/preprocessor/dec.hpp>
namespace boost { namespace python { namespace detail {
@@ -53,26 +49,174 @@ struct member_function_cast_impl
{
return non_member_function_cast_impl();
}
# endif
// Member functions
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/member_function_cast.hpp>
# endif
# endif
template <class S, class R>
static cast_helper<S,R(T::*)()> stage1(R (S::*)())
{
return cast_helper<S,R(T::*)()>();
}
# define BOOST_PYTHON_MEMBER_FUNCTION_CAST_STAGE1(args, cv) \
template < \
class S \
, class R \
BOOST_PP_COMMA_IF(BOOST_PP_DEC(args)) BOOST_MPL_TEMPLATE_PARAMETERS(1, args, class A) \
> \
static cast_helper<S,BOOST_PYTHON_FN(T::*,1,args)cv()> \
stage1(BOOST_PYTHON_FN(S::*,1,args)cv()) \
{ \
return cast_helper<S,BOOST_PYTHON_FN(T::*,1,args)cv()>(); \
}
template <class S, class R, class A0>
static cast_helper<S,R(T::*)(A0)> stage1(R (S::*)(A0))
{
return cast_helper<S,R(T::*)(A0)>();
}
BOOST_PYTHON_REPEAT_MF_ALL_CV_2ND(BOOST_PYTHON_MEMBER_FUNCTION_CAST_STAGE1)
template <class S, class R, class A0, class A1>
static cast_helper<S,R(T::*)(A0,A1) > stage1(R (S::*)(A0,A1))
{
return cast_helper<R(S::*)(A0,A1),R(T::*)(A0,A1) >();
}
template <class S, class R, class A0, class A1,class A2>
static cast_helper<S,R(T::*)(A0,A1,A2) > stage1(R (S::*)(A0,A1,A2))
{
return cast_helper<R(S::*)(A0,A1,A2),R(T::*)(A0,A1,A2) >();
}
template <class S, class R, class A0, class A1, class A2, class A3>
static cast_helper<S,R(T::*)(A0,A1,A2,A3)> stage1(R (S::*)(A0,A1,A2,A3))
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3)>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)> stage1(R (S::*)(A0,A1,A2,A3,A4))
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4, class A5>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)> stage1(R (S::*)(A0,A1,A2,A3,A4,A5))
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)>();
}
template <class S, class R>
static cast_helper<S,R(T::*)()const> stage1(R (S::*)()const)
{
return cast_helper<S,R(T::*)()const>();
}
template <class S, class R, class A0>
static cast_helper<S,R(T::*)(A0)const> stage1(R (S::*)(A0)const)
{
return cast_helper<S,R(T::*)(A0)const>();
}
template <class S, class R, class A0, class A1>
static cast_helper<S,R(T::*)(A0,A1)const> stage1(R (S::*)(A0,A1)const)
{
return cast_helper<S,R(T::*)(A0,A1)const>();
}
template <class S, class R, class A0, class A1,class A2>
static cast_helper<S,R(T::*)(A0,A1,A2)const> stage1(R (S::*)(A0,A1,A2)const)
{
return cast_helper<S,R(T::*)(A0,A1,A2)const>();
}
template <class S, class R, class A0, class A1, class A2, class A3>
static cast_helper<S,R(T::*)(A0,A1,A2,A3)const> stage1(R (S::*)(A0,A1,A2,A3)const)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3)const>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)const> stage1(R (S::*)(A0,A1,A2,A3,A4)const)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)const>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4, class A5>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)const> stage1(R (S::*)(A0,A1,A2,A3,A4,A5)const)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)const>();
}
template <class S, class R>
static cast_helper<S,R(T::*)()volatile> stage1(R (S::*)()volatile)
{
return cast_helper<S,R(T::*)()volatile>();
}
template <class S, class R, class A0>
static cast_helper<S,R(T::*)(A0)volatile> stage1(R (S::*)(A0)volatile)
{
return cast_helper<S,R(T::*)(A0)volatile>();
}
template <class S, class R, class A0, class A1>
static cast_helper<S,R(T::*)(A0,A1)volatile> stage1(R (S::*)(A0,A1)volatile)
{
return cast_helper<S,R(T::*)(A0,A1)volatile>();
}
template <class S, class R, class A0, class A1,class A2>
static cast_helper<S,R(T::*)(A0,A1,A2)volatile> stage1(R (S::*)(A0,A1,A2)volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2)volatile>();
}
template <class S, class R, class A0, class A1, class A2, class A3>
static cast_helper<S,R(T::*)(A0,A1,A2,A3)volatile> stage1(R (S::*)(A0,A1,A2,A3)volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3)volatile>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)volatile> stage1(R (S::*)(A0,A1,A2,A3,A4)volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)volatile>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4, class A5>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)volatile> stage1(R (S::*)(A0,A1,A2,A3,A4,A5)volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)volatile>();
}
template <class S, class R>
static cast_helper<S,R(T::*)()const volatile> stage1(R (S::*)()const volatile)
{
return cast_helper<S,R(T::*)()const volatile>();
}
template <class S, class R, class A0>
static cast_helper<S,R(T::*)(A0)const volatile> stage1(R (S::*)(A0)const volatile)
{
return cast_helper<S,R(T::*)(A0)const volatile>();
}
template <class S, class R, class A0, class A1>
static cast_helper<S,R(T::*)(A0,A1)const volatile> stage1(R (S::*)(A0,A1)const volatile)
{
return cast_helper<S,R(T::*)(A0,A1)const volatile>();
}
template <class S, class R, class A0, class A1,class A2>
static cast_helper<S,R(T::*)(A0,A1,A2)const volatile> stage1(R (S::*)(A0,A1,A2)const volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2)const volatile>();
}
template <class S, class R, class A0, class A1, class A2, class A3>
static cast_helper<S,R(T::*)(A0,A1,A2,A3)const volatile> stage1(R (S::*)(A0,A1,A2,A3)const volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3)const volatile>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)const volatile> stage1(R (S::*)(A0,A1,A2,A3,A4)const volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4)const volatile>();
}
template <class S, class R, class A0, class A1, class A2, class A3, class A4, class A5>
static cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)const volatile> stage1(R (S::*)(A0,A1,A2,A3,A4,A5)const volatile)
{
return cast_helper<S,R(T::*)(A0,A1,A2,A3,A4,A5)const volatile>();
}
};

View File

@@ -8,8 +8,7 @@
#include <boost/type.hpp>
#include <typeinfo>
#include <boost/type_traits/array_traits.hpp>
#include <boost/type_traits/reference_traits.hpp>
//
// Fix for MSVC's broken typeid() implementation which doesn't strip
// decoration. This fix doesn't handle cv-qualified array types. It
@@ -63,35 +62,35 @@ inline typeinfo typeid_nonref(boost::type<T>* = 0)
}
template <class T>
inline typeinfo typeid_ref(T&(*)())
inline typeinfo typeid_ref(boost::type<T>*, ...)
{
return typeid_nonref<T>();
}
template <class U, class T>
inline typeinfo typeid_ref(boost::type<U>*, T& (*)())
{
return typeid_nonref<T>();
}
template <class T>
inline typeinfo array_ref_typeid(bool_t<true>, bool_t<false>, boost::type<T>* = 0)
inline typeinfo typeid_array(bool_t<false>, boost::type<T>* = 0)
{
return typeid_ref((T&(*)())0);
typedef T (*x)();
return typeid_ref((boost::type<T>*)0, x(0));
}
template <class T>
inline typeinfo array_ref_typeid(bool_t<false>, bool_t<true>, boost::type<T>* = 0)
inline typeinfo typeid_array(bool_t<true>, boost::type<T>* = 0)
{
return typeid_ref((T(*)())0);
}
template <class T>
inline typeinfo array_ref_typeid(bool_t<false>, bool_t<false>, boost::type<T>* = 0)
{
return typeid_ref((T&(*)())0);
return typeid_nonref<T>();
}
template <class T>
inline typeinfo msvc_typeid(boost::type<T>* = 0)
{
typedef bool_t<is_array<T>::value> array_tag;
typedef bool_t<is_reference<T>::value> ref_tag;
return array_ref_typeid(array_tag(), ref_tag(), (boost::type<T>*)0);
typedef bool_t<is_array<T>::value> tag;
return typeid_array(tag(), (boost::type<T>*)0);
}
}}} // namespace boost::python::detail

View File

@@ -1,15 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef NOT_SPECIFIED_DWA2002321_HPP
# define NOT_SPECIFIED_DWA2002321_HPP
namespace boost { namespace python { namespace detail {
struct not_specified {};
}}} // namespace boost::python::detail
#endif // NOT_SPECIFIED_DWA2002321_HPP

View File

@@ -1,36 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef POINTEE_DWA2002323_HPP
# define POINTEE_DWA2002323_HPP
# include <boost/type_traits/object_traits.hpp>
namespace boost { namespace python { namespace detail {
template <bool is_ptr = true>
struct pointee_impl
{
template <class T> struct apply : remove_pointer<T> {};
};
template <>
struct pointee_impl<false>
{
template <class T> struct apply
{
typedef typename T::element_type type;
};
};
template <class T>
struct pointee
: pointee_impl<is_pointer<T>::value>::template apply<T>
{
};
}}} // namespace boost::python::detail
#endif // POINTEE_DWA2002323_HPP

View File

@@ -1,110 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef PREPROCESSOR_DWA200247_HPP
# define PREPROCESSOR_DWA200247_HPP
# include <boost/config.hpp>
# include <boost/preprocessor/tuple/to_list.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/list/for_each.hpp>
# include <boost/preprocessor/repeat_from_to_2nd.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/empty.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/preprocessor/expr_if.hpp>
namespace boost { namespace python { namespace detail {
# define BOOST_PYTHON_CONST() const
# define BOOST_PYTHON_VOLATILE() volatile
# define BOOST_PYTHON_CONST_VOLATILE() const volatile
# define BOOST_PYTHON_ALL_CV \
BOOST_PP_TUPLE_TO_LIST(4, (BOOST_PP_EMPTY \
, BOOST_PYTHON_CONST \
, BOOST_PYTHON_VOLATILE \
, BOOST_PYTHON_CONST_VOLATILE))
# if !defined(__MWERKS__) || __MWERKS__ > 0x2407
# define BOOST_PYTHON_MEMBER_FUNCTION_CV BOOST_PYTHON_ALL_CV
# else
# define BOOST_PYTHON_MEMBER_FUNCTION_CV BOOST_PP_TUPLE_TO_LIST(1, (BOOST_PP_EMPTY))
# endif
#ifndef BOOST_PYTHON_DEBUGGABLE_ARITY
# define BOOST_PYTHON_DEBUGGABLE_ARITY 15
#endif
#ifndef BOOST_PYTHON_MAX_ARITY
# if !defined(__EDG_VERSION__) || __EDG_VERSION__ > 245
// Generate at least two more arguments just to test the syntax
# define BOOST_PYTHON_MAX_ARITY 17
# else
// Current EDG compilers have a really slow preprocessor which makes
// it important not to generate new functions with it unless
// absolutely neccessary
# define BOOST_PYTHON_MAX_ARITY BOOST_PYTHON_DEBUGGABLE_ARITY
# endif
#endif
#ifdef BOOST_PYTHON_GENERATE_CODE
# undef BOOST_STATIC_CONSTANT
# define BOOST_PYTHON_ARITY_START 0
# define BOOST_PYTHON_ARITY_FINISH BOOST_PP_INC(BOOST_PYTHON_DEBUGGABLE_ARITY)
# define BOOST_PYTHON_MF_ARITY_START 1
# define BOOST_PYTHON_MF_ARITY_FINISH BOOST_PP_INC(BOOST_PP_INC(BOOST_PYTHON_DEBUGGABLE_ARITY))
#else
# define BOOST_PYTHON_ARITY_START BOOST_PP_INC(BOOST_PYTHON_DEBUGGABLE_ARITY)
# define BOOST_PYTHON_ARITY_FINISH BOOST_PP_INC(BOOST_PYTHON_MAX_ARITY)
# define BOOST_PYTHON_MF_ARITY_START BOOST_PP_INC(BOOST_PP_INC(BOOST_PYTHON_DEBUGGABLE_ARITY))
# define BOOST_PYTHON_MF_ARITY_FINISH BOOST_PP_INC(BOOST_PP_INC(BOOST_PYTHON_MAX_ARITY))
#endif
#if BOOST_PYTHON_MAX_ARITY > BOOST_PYTHON_DEBUGGABLE_ARITY
# define BOOST_PYTHON_FN(inner,start,count) \
R(inner)(BOOST_MPL_TEMPLATE_PARAMETERS(start,count,A))
# define BOOST_PYTHON_REPEAT_ARITY_2ND(function,data) \
BOOST_PP_REPEAT_FROM_TO_2ND( \
BOOST_PYTHON_ARITY_START, BOOST_PYTHON_ARITY_FINISH \
, function, data)
# define BOOST_PYTHON_REPEAT_MF_ARITY_2ND(function,data) \
BOOST_PP_REPEAT_FROM_TO_2ND( \
BOOST_PYTHON_MF_ARITY_START, BOOST_PYTHON_MF_ARITY_FINISH \
, function, data)
# define BOOST_PYTHON_REPEAT_PMF_CV(index, function, cv) \
BOOST_PYTHON_REPEAT_MF_ARITY_2ND(function,cv)
# define BOOST_PYTHON_REPEAT_MF_CV_2ND(function) \
BOOST_PP_LIST_FOR_EACH(BOOST_PYTHON_REPEAT_PMF_CV,function,BOOST_PYTHON_MEMBER_FUNCTION_CV)
# define BOOST_PYTHON_REPEAT_MF_ALL_CV_2ND(function) \
BOOST_PP_LIST_FOR_EACH(BOOST_PYTHON_REPEAT_PMF_CV,function,BOOST_PYTHON_ALL_CV)
#define BOOST_PYTHON_NUMBER_PAIR(Index, Pair) \
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,Pair),Index) \
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,Pair),Index)
#define BOOST_PYTHON_ENUM_PARAMS2(N, Pair) BOOST_PP_ENUM(N, BOOST_PYTHON_NUMBER_PAIR, Pair)
# define BOOST_PYTHON_PROJECT_1ST(a1,a2) a1
# define BOOST_PYTHON_PROJECT_2ND(a1,a2) a2
#else
# define BOOST_PYTHON_REPEAT_ARITY_2ND(function,data)
# define BOOST_PYTHON_REPEAT_MF_ARITY_2ND(function,data)
# define BOOST_PYTHON_REPEAT_MF_ALL_CV_2ND(function)
# define BOOST_PYTHON_REPEAT_MF_CV_2ND(function)
# define BOOST_PYTHON_REPEAT_PMF_CV(index, function, cv)
#endif
}}} // namespace boost::python::detail
#endif // PREPROCESSOR_DWA200247_HPP

View File

@@ -0,0 +1,183 @@
#error obsolete
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE regex_libary_include.hpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
* Note this is an internal header file included
* by regex.hpp, do not include on its own.
*/
#ifndef BOOST_REGEX_LIBRARY_INCLUDE_HPP
#define BOOST_REGEX_LIBRARY_INCLUDE_HPP
#ifndef BOOST_REGEX_NO_LIB
#if defined(BOOST_MSVC) && !defined(BOOST_REGEX_BUILD_DLL)
#ifdef __SGI_STL_PORT
#ifdef _DLL
// All these are multithreaded:
#if defined(_DEBUG) && defined(__STL_DEBUG)
#pragma comment(lib, "vc6-stlport-re300ddl.lib")
#elif defined(_DEBUG)
#pragma comment(lib, "vc6-stlport-re300dl.lib")
#elif defined(BOOST_REGEX_STATIC_LINK)
// static regex lib, dll runtime
#pragma comment(lib, "vc6-stlport-re300ls.lib")
#else // DEBUG
#pragma comment(lib, "vc6-stlport-re300l.lib")
#endif // _DEBUG
#else // _DLL
#ifdef _MT
#if defined(_DEBUG) && defined(__STL_DEBUG)
#pragma comment(lib, "vc6-stlport-re300ddm.lib")
#elif defined(_DEBUG)
#pragma comment(lib, "vc6-stlport-re300dm.lib")
#else //_DEBUG
#pragma comment(lib, "vc6-stlport-re300m.lib")
#endif //_DEBUG
#else //_MT
// STLPort does not support single threaded builds:
#error STLPort does not support single threaded builds
#endif //_MT
#endif //_DLL
#elif _MSC_VER < 1300
#ifdef _DLL
// All these are multithreaded:
#ifdef _DEBUG
#pragma comment(lib, "vc6-re300dl.lib")
#elif defined(BOOST_REGEX_STATIC_LINK)
// static regex lib, dll runtime
#pragma comment(lib, "vc6-re300ls.lib")
#else // DEBUG
#pragma comment(lib, "vc6-re300l.lib")
#endif // _DEBUG
#else // _DLL
#ifdef _MT
#ifdef _DEBUG
#pragma comment(lib, "vc6-re300dm.lib")
#else //_DEBUG
#pragma comment(lib, "vc6-re300m.lib")
#endif //_DEBUG
#else //_MT
#ifdef _DEBUG
#pragma comment(lib, "vc6-re300d.lib")
#else //_DEBUG
#pragma comment(lib, "vc6-re300.lib")
#endif //_DEBUG
#endif //_MT
#endif //_DLL
#else
#ifdef _DLL
// All these are multithreaded:
#ifdef _DEBUG
#pragma comment(lib, "vc7-re300dl.lib")
#elif defined(BOOST_REGEX_STATIC_LINK)
// static regex lib, dll runtime
#pragma comment(lib, "vc7-re300ls.lib")
#else // DEBUG
#pragma comment(lib, "vc7-re300l.lib")
#endif // _DEBUG
#else // _DLL
#ifdef _MT
#ifdef _DEBUG
#pragma comment(lib, "vc7-re300dm.lib")
#else //_DEBUG
#pragma comment(lib, "vc7-re300m.lib")
#endif //_DEBUG
#else //_MT
#ifdef _DEBUG
#pragma comment(lib, "vc7-re300d.lib")
#else //_DEBUG
#pragma comment(lib, "vc7-re300.lib")
#endif //_DEBUG
#endif //_MT
#endif //_DLL
#endif // __SGI_STL_PORT
#endif //BOOST_MSVC
#if defined(__BORLANDC__) && !defined(BOOST_REGEX_BUILD_DLL)
#if __BORLANDC__ < 0x550
#ifdef BOOST_REGEX_USE_VCL
#ifdef _RTLDLL
#pragma comment(lib, "bcb4re300lv.lib")
#else
#pragma comment(lib, "bcb4re300v.lib")
#endif
#else // VCL
#ifdef _RTLDLL
#ifdef __MT__
#pragma comment(lib, "bcb4re300lm.lib")
#else // __MT__
#pragma comment(lib, "bcb4re300l.lib")
#endif // __MT__
#else //_RTLDLL
#ifdef __MT__
#pragma comment(lib, "bcb4re300m.lib")
#else // __MT__
#pragma comment(lib, "bcb4re300.lib")
#endif // __MT__
#endif // _RTLDLL
#endif // VCL
#else // C++ Builder 5:
#ifdef BOOST_REGEX_USE_VCL
#ifdef _RTLDLL
#pragma comment(lib, "bcb5re300lv.lib")
#else
#pragma comment(lib, "bcb5re300v.lib")
#endif
#else // VCL
#ifdef _RTLDLL
#ifdef __MT__
#pragma comment(lib, "bcb5re300lm.lib")
#else // __MT__
#pragma comment(lib, "bcb5re300l.lib")
#endif // __MT__
#else //_RTLDLL
#ifdef __MT__
#pragma comment(lib, "bcb5re300m.lib")
#else // __MT__
#pragma comment(lib, "bcb5re300.lib")
#endif // __MT__
#endif // _RTLDLL
#endif // VCL
#endif
#endif //__BORLANDC__
#endif //BOOST_REGEX_NO_LIB
#endif // BOOST_REGEX_LIBRARY_INCLUDE_HPP

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,217 @@
// (C) Copyright David Abrahams 2002. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
// This work was funded in part by Lawrence Berkeley and Lawrence
// Livermore National Labs
//
// This file generated for 5-argument member functions and 6-argument free
// functions by gen_signature.py
#ifndef SIGNATURE_DWA2002128_HPP
# define SIGNATURE_DWA2002128_HPP
# include <boost/mpl/type_list.hpp>
namespace boost { namespace python { namespace detail {
template <class R>
mpl::type_list<R>
signature(R (*)())
{
return mpl::type_list<R>();
}
template <class R, class A0>
mpl::type_list<R,A0>
signature(R (*)(A0))
{
return mpl::type_list<R,A0>();
}
template <class R, class A0, class A1>
mpl::type_list<R,A0,A1>
signature(R (*)(A0, A1))
{
return mpl::type_list<R,A0,A1>();
}
template <class R, class A0, class A1, class A2>
mpl::type_list<R,A0,A1,A2>
signature(R (*)(A0, A1, A2))
{
return mpl::type_list<R,A0,A1,A2>();
}
template <class R, class A0, class A1, class A2, class A3>
mpl::type_list<R,A0,A1,A2,A3>
signature(R (*)(A0, A1, A2, A3))
{
return mpl::type_list<R,A0,A1,A2,A3>();
}
template <class R, class A0, class A1, class A2, class A3, class A4>
mpl::type_list<R,A0,A1,A2,A3,A4>
signature(R (*)(A0, A1, A2, A3, A4))
{
return mpl::type_list<R,A0,A1,A2,A3,A4>();
}
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
mpl::type_list<R,A0,A1,A2,A3,A4,A5>
signature(R (*)(A0, A1, A2, A3, A4, A5))
{
return mpl::type_list<R,A0,A1,A2,A3,A4,A5>();
}
template <class R, class A0>
mpl::type_list<R,A0&> signature(R (A0::*)())
{
return mpl::type_list<R,A0&>();
}
template <class R, class A0, class A1>
mpl::type_list<R,A0&,A1> signature(R (A0::*)(A1))
{
return mpl::type_list<R,A0&,A1>();
}
template <class R, class A0, class A1, class A2>
mpl::type_list<R,A0&,A1,A2> signature(R (A0::*)(A1, A2))
{
return mpl::type_list<R,A0&,A1,A2>();
}
template <class R, class A0, class A1, class A2, class A3>
mpl::type_list<R,A0&,A1,A2,A3> signature(R (A0::*)(A1, A2, A3))
{
return mpl::type_list<R,A0&,A1,A2,A3>();
}
template <class R, class A0, class A1, class A2, class A3, class A4>
mpl::type_list<R,A0&,A1,A2,A3,A4> signature(R (A0::*)(A1, A2, A3, A4))
{
return mpl::type_list<R,A0&,A1,A2,A3,A4>();
}
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
mpl::type_list<R,A0&,A1,A2,A3,A4,A5> signature(R (A0::*)(A1, A2, A3, A4, A5))
{
return mpl::type_list<R,A0&,A1,A2,A3,A4,A5>();
}
template <class R, class A0>
mpl::type_list<R,A0 const&> signature(R (A0::*)() const)
{
return mpl::type_list<R,A0 const&>();
}
template <class R, class A0, class A1>
mpl::type_list<R,A0 const&,A1> signature(R (A0::*)(A1) const)
{
return mpl::type_list<R,A0 const&,A1>();
}
template <class R, class A0, class A1, class A2>
mpl::type_list<R,A0 const&,A1,A2> signature(R (A0::*)(A1, A2) const)
{
return mpl::type_list<R,A0 const&,A1,A2>();
}
template <class R, class A0, class A1, class A2, class A3>
mpl::type_list<R,A0 const&,A1,A2,A3> signature(R (A0::*)(A1, A2, A3) const)
{
return mpl::type_list<R,A0 const&,A1,A2,A3>();
}
template <class R, class A0, class A1, class A2, class A3, class A4>
mpl::type_list<R,A0 const&,A1,A2,A3,A4> signature(R (A0::*)(A1, A2, A3, A4) const)
{
return mpl::type_list<R,A0 const&,A1,A2,A3,A4>();
}
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
mpl::type_list<R,A0 const&,A1,A2,A3,A4,A5> signature(R (A0::*)(A1, A2, A3, A4, A5) const)
{
return mpl::type_list<R,A0 const&,A1,A2,A3,A4,A5>();
}
template <class R, class A0>
mpl::type_list<R,A0 volatile&> signature(R (A0::*)() volatile)
{
return mpl::type_list<R,A0 volatile&>();
}
template <class R, class A0, class A1>
mpl::type_list<R,A0 volatile&,A1> signature(R (A0::*)(A1) volatile)
{
return mpl::type_list<R,A0 volatile&,A1>();
}
template <class R, class A0, class A1, class A2>
mpl::type_list<R,A0 volatile&,A1,A2> signature(R (A0::*)(A1, A2) volatile)
{
return mpl::type_list<R,A0 volatile&,A1,A2>();
}
template <class R, class A0, class A1, class A2, class A3>
mpl::type_list<R,A0 volatile&,A1,A2,A3> signature(R (A0::*)(A1, A2, A3) volatile)
{
return mpl::type_list<R,A0 volatile&,A1,A2,A3>();
}
template <class R, class A0, class A1, class A2, class A3, class A4>
mpl::type_list<R,A0 volatile&,A1,A2,A3,A4> signature(R (A0::*)(A1, A2, A3, A4) volatile)
{
return mpl::type_list<R,A0 volatile&,A1,A2,A3,A4>();
}
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
mpl::type_list<R,A0 volatile&,A1,A2,A3,A4,A5> signature(R (A0::*)(A1, A2, A3, A4, A5) volatile)
{
return mpl::type_list<R,A0 volatile&,A1,A2,A3,A4,A5>();
}
template <class R, class A0>
mpl::type_list<R,A0 const volatile&> signature(R (A0::*)() const volatile)
{
return mpl::type_list<R,A0 const volatile&>();
}
template <class R, class A0, class A1>
mpl::type_list<R,A0 const volatile&,A1> signature(R (A0::*)(A1) const volatile)
{
return mpl::type_list<R,A0 const volatile&,A1>();
}
template <class R, class A0, class A1, class A2>
mpl::type_list<R,A0 const volatile&,A1,A2> signature(R (A0::*)(A1, A2) const volatile)
{
return mpl::type_list<R,A0 const volatile&,A1,A2>();
}
template <class R, class A0, class A1, class A2, class A3>
mpl::type_list<R,A0 const volatile&,A1,A2,A3> signature(R (A0::*)(A1, A2, A3) const volatile)
{
return mpl::type_list<R,A0 const volatile&,A1,A2,A3>();
}
template <class R, class A0, class A1, class A2, class A3, class A4>
mpl::type_list<R,A0 const volatile&,A1,A2,A3,A4> signature(R (A0::*)(A1, A2, A3, A4) const volatile)
{
return mpl::type_list<R,A0 const volatile&,A1,A2,A3,A4>();
}
template <class R, class A0, class A1, class A2, class A3, class A4, class A5>
mpl::type_list<R,A0 const volatile&,A1,A2,A3,A4,A5> signature(R (A0::*)(A1, A2, A3, A4, A5) const volatile)
{
return mpl::type_list<R,A0 const volatile&,A1,A2,A3,A4,A5>();
}
}}} // namespace boost::python::detail
#endif // SIGNATURE_DWA2002128_HPP

View File

@@ -9,8 +9,6 @@
# include <boost/python/make_function.hpp>
# include <boost/type_traits/ice.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/type_traits/transform_traits.hpp>
# include <boost/python/detail/indirect_traits.hpp>
# include <boost/mpl/select_type.hpp>
namespace boost { namespace python { namespace detail {
@@ -23,16 +21,39 @@ namespace boost { namespace python { namespace detail {
// function pointer or function type, should produce a callable Python
// object.
template <class F>
inline PyObject* wrap_function_aux(F f, PyObject*) { return f; }
template <bool needs_wrapping>
struct wrap_function_select
{
template <class F>
static objects::function* execute(F f)
{
return make_function(f);
}
};
template <class F>
inline PyObject* wrap_function_aux(F f, ...) { return make_function(f); }
template<>
struct wrap_function_select<false>
{
template <class F>
static F execute(F f)
{
return f;
}
};
template <class F>
PyObject* wrap_function(F f)
{
return wrap_function_aux(f, f);
return wrap_function_select<
# if 1
type_traits::ice_not<
is_pointer<F>::value
# else
type_traits::ice_or<
is_function<F>::value
, is_member_function_pointer<F>::value
# endif
>::value >::execute(f);
}
}}} // namespace boost::python::detail

View File

@@ -36,25 +36,20 @@
//
#if defined(_WIN32) || defined(__CYGWIN__)
# if defined(__GNUC__) && defined(__CYGWIN__)
# define SIZEOF_LONG 4
# if PY_MAJOR_VERSION < 2 || PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 2
typedef int pid_t;
# define WORD_BIT 32
# define hypot _hypot
# include <stdio.h>
# if PY_MAJOR_VERSION < 2
# define HAVE_CLOCK
# define HAVE_STRFTIME
# define HAVE_STRERROR
# endif
# define NT_THREADS
# if __GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ < 3
# define WITH_THREAD
# endif
# ifndef NETSCAPE_PI
# define USE_SOCKET
# endif

View File

@@ -15,8 +15,8 @@
namespace boost { namespace python {
struct BOOST_PYTHON_DECL error_already_set {};
struct BOOST_PYTHON_DECL argument_error : error_already_set {};
struct error_already_set {};
struct argument_error : error_already_set {};
// Handles exceptions caught just before returning to Python code.
// Returns true iff an exception was caught.
@@ -35,17 +35,14 @@ inline void handle_exception()
handle_exception(detail::rethrow);
}
BOOST_PYTHON_DECL PyObject* expect_non_null_impl(PyObject* x);
BOOST_PYTHON_DECL PyObject* expect_non_null(PyObject* x);
template <class T>
inline T* expect_non_null(T* x)
T* expect_non_null(T* x)
{
return (T*)expect_non_null_impl((PyObject*)x);
return (T*)expect_non_null((PyObject*)x);
}
BOOST_PYTHON_DECL void throw_argument_error();
BOOST_PYTHON_DECL void throw_error_already_set();
}} // namespace boost::python
#endif // ERRORS_DWA052500_H_

View File

@@ -1,22 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef HAS_BACK_REFERENCE_DWA2002323_HPP
# define HAS_BACK_REFERENCE_DWA2002323_HPP
namespace boost { namespace python {
// traits class which users can specialize to indicate that a class
// contains a back-reference to its owning PyObject*
template <class T>
struct has_back_reference
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
}} // namespace boost::python
#endif // HAS_BACK_REFERENCE_DWA2002323_HPP

View File

@@ -1,28 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef IMPLICIT_DWA2002325_HPP
# define IMPLICIT_DWA2002325_HPP
# include <boost/type.hpp>
# include <boost/python/converter/implicit.hpp>
# include <boost/python/converter/registry.hpp>
# include <boost/python/converter/type_id.hpp>
namespace boost { namespace python {
template <class Source, class Target>
void implicitly_convertible(boost::type<Source>* = 0, boost::type<Target>* = 0)
{
typedef converter::implicit<Source,Target> functions;
converter::registry::push_back(
&functions::convertible
, &functions::construct
, converter::undecorated_type_id<Target>());
}
}} // namespace boost::python
#endif // IMPLICIT_DWA2002325_HPP

View File

@@ -35,8 +35,8 @@ objects::function* make_function(F f, Policies const& policies)
, detail::arg_tuple_size<F>::value);
}
template <class ArgList, class Holder>
objects::function* make_constructor(Holder* = 0, ArgList* = 0)
template <class T, class ArgList, class Generator>
objects::function* make_constructor(T* = 0, ArgList* = 0, Generator* = 0)
{
enum { nargs = mpl::size<ArgList>::value };
@@ -44,25 +44,11 @@ objects::function* make_constructor(Holder* = 0, ArgList* = 0)
objects::py_function(
::boost::bind<PyObject*>(detail::caller(),
objects::make_holder<nargs>
::template apply<Holder,ArgList>::execute
::template apply<T,Generator,ArgList>::execute
, _1, _2, default_call_policies()))
, nargs + 1);
}
template <class ArgList, class Holder, class Policies>
objects::function* make_constructor(Policies const& policies, Holder* = 0, ArgList* = 0)
{
enum { nargs = mpl::size<ArgList>::value };
return new objects::function(
objects::py_function(
::boost::bind<PyObject*>(detail::caller(),
objects::make_holder<nargs>
::template apply<Holder,ArgList>::execute
, _1, _2, policies))
, nargs + 1);
}
}} // namespace boost::python
#endif // MAKE_FUNCTION_DWA20011221_HPP

View File

@@ -37,8 +37,6 @@ struct BOOST_PYTHON_DECL class_base : private noncopyable
// Retrieve the underlying object
ref object() const { return m_object; }
void add_property(char const* name, ref const& fget);
void add_property(char const* name, ref const& fget, ref const& fset);
private:
ref m_object;
};
@@ -59,8 +57,6 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable
private:
instance_holder* m_next;
};
// This macro is needed for implementation of derived holders
# define BOOST_PYTHON_UNFORWARD(N,ignored) (typename unforward<A##N>::type)(a##N)
// Each extension instance will be one of these
struct instance

View File

@@ -11,10 +11,27 @@
# include <boost/python/reference.hpp>
# include <boost/python/converter/registry.hpp>
# include <boost/python/object/find_instance.hpp>
# include <boost/python/object/inheritance.hpp>
namespace boost { namespace python { namespace objects {
// Instantiating this class brings into existence all converters
// associated with a class Bases is expected to be an mpl sequence of
// base types.
template <class Derived, class Bases>
struct class_converters
{
public: // member functions
// Constructor takes the python class object associated with T
class_converters(ref const& python_class);
private: // data members
class_wrapper<Derived> m_wrapper;
};
//
// Implementation details
//
//////////////////////////////////////////////////////////////////////
//
// register_base_of<T> -
@@ -69,17 +86,11 @@ struct register_base_of
};
};
// Brings into existence all converters associated with a class Bases
// is expected to be an mpl sequence of base types.
template <class Derived, class Bases>
inline void register_class_from_python(Derived* = 0, Bases* = 0)
class_converters<Derived,Bases>::class_converters(ref const& type_object)
: m_wrapper(type_object)
{
// cause the static registration to be instantiated. Can't just
// cast it to void on all compilers; some will skip its
// initialization.
void const* ignored = &instance_finder<Derived>::registration;
(void)ignored;
(void)instance_finder<Derived>::registration;
// register all up/downcasts here
register_dynamic_id<Derived>();

View File

@@ -6,14 +6,15 @@
#ifndef CLASS_WRAPPER_DWA20011221_HPP
# define CLASS_WRAPPER_DWA20011221_HPP
# include <boost/python/object/value_holder.hpp>
# include <boost/python/reference.hpp>
# include <boost/python/to_python_converter.hpp>
namespace boost { namespace python { namespace objects {
template <class T, class Holder>
template <class T>
struct class_wrapper
: to_python_converter<T,class_wrapper<T,Holder> >
: to_python_converter<T, class_wrapper<T> >
{
class_wrapper(ref const& type_)
: m_class_object_keeper(type_)
@@ -38,7 +39,7 @@ struct class_wrapper
// Build a value_holder to contain the object using the copy
// constructor
Holder* p = new Holder(raw_result, cref(x));
value_holder<T>* p = new value_holder<T>(raw_result, cref(x));
// Install it in the instance
p->install(raw_result);
@@ -52,8 +53,8 @@ struct class_wrapper
static PyTypeObject* m_class_object;
};
template <class T, class Holder>
PyTypeObject* class_wrapper<T,Holder>::m_class_object;
template <class T>
PyTypeObject* class_wrapper<T>::m_class_object;
}}} // namespace boost::python::objects

View File

@@ -6,9 +6,6 @@
#ifndef FIND_INSTANCE_DWA2002312_HPP
# define FIND_INSTANCE_DWA2002312_HPP
# include <boost/python/converter/type_id.hpp>
# include <boost/python/converter/registry.hpp>
namespace boost { namespace python { namespace objects {
// Given an undecorated type_id, find the instance data which

View File

@@ -10,99 +10,28 @@
# include <boost/type_traits/object_traits.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/type_traits/transform_traits.hpp>
# include <boost/ref.hpp>
namespace boost { namespace python { namespace objects {
template <class T>
struct reference_to_value
{
typedef typename add_reference<typename add_const<T>::type>::type reference;
reference_to_value(reference x) : m_value(x) {}
operator reference() const { return m_value; }
private:
reference m_value;
};
// A little metaprogram which selects the type to pass through an
// intermediate forwarding function when the destination argument type
// is T.
template <class T>
struct forward
: mpl::select_type<
is_scalar<T>::value
{
BOOST_STATIC_CONSTANT(
bool, by_value = (is_scalar<T>::value | is_reference<T>::value)
);
typedef typename mpl::select_type<
by_value
, T
, reference_to_value<T> >
{
, reference_wrapper<
typename add_const<T>::type
>
>::type type;
};
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<typename T>
class unforward
{
public:
typedef typename unwrap_reference<T>::type& type;
};
template<typename T>
class unforward<reference_to_value<T> >
{
public:
typedef T type;
};
# else // no partial specialization
namespace detail
{
typedef char (&yes_reference_to_value_t)[1];
typedef char (&no_reference_to_value_t)[2];
no_reference_to_value_t is_reference_to_value_test(...);
template<typename T>
yes_reference_to_value_t is_reference_to_value_test(type< reference_to_value<T> >);
template<bool wrapped>
struct unforwarder
{
template <class T>
struct apply
{
typedef typename unwrap_reference<T>::type& type;
};
};
template<>
struct unforwarder<true>
{
template <class T>
struct apply
{
typedef typename T::reference type;
};
};
template<typename T>
class is_reference_to_value
{
public:
BOOST_STATIC_CONSTANT(
bool, value = (
sizeof(is_reference_to_value_test(type<T>()))
== sizeof(yes_reference_to_value_t)));
};
}
template <typename T>
class unforward
: public detail::unforwarder<
detail::is_reference_to_value<T>::value
>::template apply<T>
{};
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
}}} // namespace boost::python::objects
#endif // FORWARD_DWA20011215_HPP

View File

@@ -40,6 +40,8 @@ struct BOOST_PYTHON_DECL function : PyObject
function* m_overloads;
};
extern BOOST_PYTHON_DECL PyTypeObject function_type;
//
// implementations
//

View File

@@ -10,48 +10,166 @@
# include <boost/python/object/forward.hpp>
# include <boost/python/object/class.hpp>
# include <boost/python/detail/wrap_python.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/repeat.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/mpl/apply.hpp>
namespace boost { namespace python { namespace objects {
template <int nargs> struct make_holder;
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/make_holder.hpp>
# endif
# define BOOST_PYTHON_FORWARD_ARG(index, ignored) \
typedef typename mpl::at<index,ArgList>::type BOOST_PP_CAT(t,index); \
typedef typename forward<BOOST_PP_CAT(t,index)>::type BOOST_PP_CAT(f,index);
# define BOOST_PYTHON_DO_FORWARD_ARG(index, ignored) \
BOOST_PP_CAT(f,index)(BOOST_PP_CAT(a, index))
# define BOOST_PYTHON_MAKE_HOLDER(nargs,ignored) \
template <> \
struct make_holder<nargs> \
{ \
template <class Holder, class ArgList> \
struct apply \
{ \
BOOST_PP_REPEAT(nargs, BOOST_PYTHON_FORWARD_ARG, nil) \
\
static void execute( \
PyObject* p \
BOOST_PP_COMMA_IF(nargs) BOOST_PYTHON_ENUM_PARAMS2(nargs, (t,a)) ) \
{ \
(new Holder( \
p \
BOOST_PP_COMMA_IF(nargs) BOOST_PP_ENUM( \
nargs,BOOST_PYTHON_DO_FORWARD_ARG,nil)))->install(p); \
} \
}; \
template <>
struct make_holder<0>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
static void execute(
PyObject* p)
{
(new holder(p))->install(p);
}
};
};
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_MAKE_HOLDER,nil)
template <>
struct make_holder<1>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
static void execute(
PyObject* p
, t0 a0)
{
(new holder(p, f0(a0)))->install(p);
}
};
};
template <>
struct make_holder<2>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
static void execute(
PyObject* p, t0 a0, t1 a1)
{
(new holder(p, f0(a0), f1(a1)))->install(p);
}
};
};
template <>
struct make_holder<3>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
static void execute(
PyObject* p, t0 a0, t1 a1, t2 a2)
{
(new holder(p, f0(a0), f1(a1), f2(a2)))->install(p);
}
};
};
template <>
struct make_holder<4>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
static void execute(
PyObject* p, t0 a0, t1 a1, t2 a2, t3 a3)
{
(new holder(p, f0(a0), f1(a1), f2(a2), f3(a3)))->install(p);
}
};
};
template <>
struct make_holder<5>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
static void execute(
PyObject* p, t0 a0, t1 a1, t2 a2, t3 a3, t4 a4)
{
(new holder(p, f0(a0), f1(a1), f2(a2), f3(a3), f4(a4)))->install(p);
}
};
};
template <>
struct make_holder<6>
{
template <class T, class Generator, class ArgList>
struct apply
{
typedef typename mpl::apply1<Generator,T>::type holder;
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
static void execute(
PyObject* p, t0 a0, t1 a1, t2 a2, t3 a3, t4 a4, t5 a5)
{
(new holder(p, f0(a0), f1(a1), f2(a2), f3(a3), f4(a4), f5(a5)))->install(p);
}
};
};
}}} // namespace boost::python::objects

View File

@@ -10,13 +10,10 @@
# include <boost/python/converter/type_id.hpp>
# include <boost/python/object/inheritance.hpp>
# include <boost/python/object/find_instance.hpp>
# include <boost/python/object/forward.hpp>
# include <boost/ref.hpp>
# include <boost/type.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/mpl/apply.hpp>
# include <boost/python/detail/pointee.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/enum_params.hpp>
namespace boost { namespace python { namespace objects {
@@ -24,27 +21,125 @@ template <class Pointer, class Value>
struct pointer_holder : instance_holder
{
pointer_holder(Pointer);
// Forward construction to the held object
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/pointer_holder.hpp>
# endif
pointer_holder(PyObject*)
: m_p(new Value) {}
# define BOOST_PYTHON_CONSTRUCT_POINTER_HOLDER(nargs, ignored) \
BOOST_PP_EXPR_IF(nargs, template <) \
BOOST_PP_ENUM_PARAMS(nargs, class A) \
BOOST_PP_EXPR_IF(nargs, >) \
pointer_holder(PyObject* \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PYTHON_ENUM_PARAMS2(nargs, (A,a))) \
: m_p(new Value( \
BOOST_PP_ENUM(nargs, BOOST_PYTHON_UNFORWARD, nil) \
)) \
template <class A1>
pointer_holder(PyObject*, A1 a1)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
))
{}
template <class A1, class A2>
pointer_holder(PyObject*, A1 a1, A2 a2)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
))
{}
template <class A1, class A2, class A3>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
))
{}
template <class A1, class A2, class A3, class A4>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
))
{}
template <class A1, class A2, class A3, class A4, class A5>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
)) {}
template <class A1, class A2, class A3, class A4, class A5, class A6>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
)) {}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
))
{}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
))
{}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
))
{}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
pointer_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)
: m_p(new Value(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
, (typename unwrap_reference<A10>::type&)(a10)
))
{}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CONSTRUCT_POINTER_HOLDER,nil)
private: // required holder implementation
void* holds(converter::undecorated_type_id_t);
@@ -52,36 +147,161 @@ struct pointer_holder : instance_holder
Pointer m_p;
};
template <class Pointer, class Value>
template <class Pointer, class Value, class BackReferenceType>
struct pointer_holder_back_reference : instance_holder
{
private:
typedef typename python::detail::pointee<Pointer>::type held_type;
public:
pointer_holder_back_reference(Pointer);
// Forward construction to the held object
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/ptr_holder_back_reference.hpp>
# endif
# define BOOST_PYTHON_CONSTRUCT_POINTER_HOLDER_BACK_REFERENCE(nargs, ignored) \
BOOST_PP_EXPR_IF(nargs, template <) \
BOOST_PP_ENUM_PARAMS(nargs, class A) \
BOOST_PP_EXPR_IF(nargs, >) \
pointer_holder_back_reference(PyObject* p \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PYTHON_ENUM_PARAMS2(nargs, (A,a))) \
: m_p(new held_type( \
p BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM(nargs, BOOST_PYTHON_UNFORWARD, nil) \
)) \
{ \
void const* x = &instance_finder<held_type>::registration; (void)x; \
pointer_holder_back_reference(PyObject* p)
: m_p(new BackReferenceType(p)) {
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1>
pointer_holder_back_reference(PyObject* p, A1 a1)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
)) {
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
)) {
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
pointer_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)
: m_p(new BackReferenceType(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
, (typename unwrap_reference<A10>::type&)(a10)
))
{
(void)instance_finder<BackReferenceType>::registration;
}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CONSTRUCT_POINTER_HOLDER_BACK_REFERENCE,nil)
private: // required holder implementation
void* holds(converter::undecorated_type_id_t);
@@ -90,18 +310,81 @@ struct pointer_holder_back_reference : instance_holder
Pointer m_p;
};
}}} // namespace boost::python::objects
// back to namespace boost for this forward declaration
namespace boost
{
template <class T> class shared_ptr;
}
namespace boost { namespace python { namespace objects {
struct shared_ptr_generator
{
template <class T>
struct apply
{
typedef boost::shared_ptr<T> type;
};
};
struct no_back_reference;
// Workaround lack of partial specialization
namespace detail
{
template <class BackReferenceType, class PointerGenerator>
struct pointer_holder_back_reference_generator
{
template <class Held>
struct apply
{
typedef typename mpl::apply1<
PointerGenerator,BackReferenceType
>::type pointer;
typedef pointer_holder_back_reference<pointer,Held,BackReferenceType> type;
};
};
template <class PointerGenerator>
struct plain_pointer_holder_generator
{
template <class Held>
struct apply
{
typedef typename mpl::apply1<
PointerGenerator,Held
>::type pointer;
typedef pointer_holder<pointer, Held> type;
};
};
}
// A generator metafunction which can be passed to make_holder
// PointerGenerator should be another generator metafunction which
// makes the appropriate (smart) pointer type to hold the argument to
// pointer_holder_generator.
template <class PointerGenerator, class BackReferenceType = no_back_reference>
struct pointer_holder_generator
: mpl::select_type<
is_same<BackReferenceType,no_back_reference>::value
, detail::plain_pointer_holder_generator<
PointerGenerator>
, detail::pointer_holder_back_reference_generator<
BackReferenceType,PointerGenerator>
>::type
{
};
template <class Pointer, class Value>
pointer_holder<Pointer,Value>::pointer_holder(Pointer p)
: m_p(p)
{
}
template <class Pointer, class Value>
pointer_holder_back_reference<Pointer,Value>::pointer_holder_back_reference(Pointer p)
: m_p(p)
{
}
template <class Pointer, class Value>
void* pointer_holder<Pointer, Value>::holds(converter::undecorated_type_id_t dst_t)
{
@@ -113,20 +396,6 @@ void* pointer_holder<Pointer, Value>::holds(converter::undecorated_type_id_t dst
: find_dynamic_type(&*this->m_p, src_t, dst_t);
}
template <class Pointer, class Value>
void* pointer_holder_back_reference<Pointer, Value>::holds(converter::undecorated_type_id_t dst_t)
{
if (dst_t == converter::undecorated_type_id<Pointer>())
return &this->m_p;
if (dst_t == converter::undecorated_type_id<held_type>())
return &*this->m_p;
converter::type_id_t src_t = converter::undecorated_type_id<Value>();
Value* p = &*this->m_p;
return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t);
}
}}} // namespace boost::python::objects
#endif // POINTER_HOLDER_DWA20011215_HPP

View File

@@ -1,73 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef SELECT_HOLDER_DWA2002322_HPP
# define SELECT_HOLDER_DWA2002322_HPP
# include <boost/python/has_back_reference.hpp>
# include <boost/python/detail/not_specified.hpp>
# include <boost/python/detail/pointee.hpp>
# include <boost/python/object/value_holder.hpp>
# include <boost/python/object/pointer_holder.hpp>
# include <boost/type.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/type_traits/same_traits.hpp>
namespace boost { namespace python { namespace objects {
namespace detail
{
template <class T, class Held>
struct select_value_holder
{
BOOST_STATIC_CONSTANT(bool, selector = (!is_same<T,Held>::value) | has_back_reference<T>::value);
typedef typename mpl::select_type<
selector
, value_holder_back_reference<T,Held>
, value_holder<T>
>::type holder;
static holder* get() { return 0; }
};
template <class T,class Ptr>
struct select_pointer_holder
{
typedef typename python::detail::pointee<Ptr>::type pointee;
BOOST_STATIC_CONSTANT(bool, selector = (!is_same<T,pointee>::value) | has_back_reference<T>::value);
typedef typename mpl::select_type<
selector
, pointer_holder_back_reference<Ptr,T>
, pointer_holder<Ptr,T>
>::type holder;
static holder* get() { return 0; }
};
}
template <class T, class NotSpecified>
inline detail::select_value_holder<T,T> select_holder(python::detail::not_specified*, T* = 0, NotSpecified* = 0)
{
return detail::select_value_holder<T,T>();
}
template <class T, class Held>
inline detail::select_value_holder<T, Held> select_holder(T*, Held* = 0)
{
return detail::select_value_holder<T, Held>();
}
template <class T, class Ptr>
detail::select_pointer_holder<T,Ptr> select_holder(void*, Ptr* = 0, T* = 0)
{
return detail::select_pointer_holder<T,Ptr>();
}
}}} // namespace boost::python::objects
#endif // SELECT_HOLDER_DWA2002322_HPP

View File

@@ -11,9 +11,7 @@
# include <boost/python/converter/type_id.hpp>
# include <boost/python/object/inheritance.hpp>
# include <boost/python/object/find_instance.hpp>
# include <boost/python/object/forward.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/enum_params.hpp>
# include <boost/ref.hpp>
namespace boost { namespace python { namespace objects {
@@ -21,23 +19,121 @@ template <class Held>
struct value_holder : instance_holder
{
// Forward construction to the held object
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/value_holder.hpp>
# endif
# define BOOST_PYTHON_CONSTRUCT_VALUE_HOLDER(nargs, ignored) \
BOOST_PP_EXPR_IF(nargs, template <) \
BOOST_PP_ENUM_PARAMS(nargs, class A) \
BOOST_PP_EXPR_IF(nargs, >) \
value_holder(PyObject* \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PYTHON_ENUM_PARAMS2(nargs, (A,a))) \
: m_held( \
BOOST_PP_ENUM(nargs, BOOST_PYTHON_UNFORWARD, nil) \
) \
value_holder(PyObject*)
: m_held() {}
template <class A1>
value_holder(PyObject*, A1 a1)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
)
{}
template <class A1, class A2>
value_holder(PyObject*, A1 a1, A2 a2)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
)
{}
template <class A1, class A2, class A3>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
)
{}
template <class A1, class A2, class A3, class A4>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
)
{}
template <class A1, class A2, class A3, class A4, class A5>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
) {}
template <class A1, class A2, class A3, class A4, class A5, class A6>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
) {}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
)
{}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
)
{}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
)
{}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
value_holder(PyObject*, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)
: m_held(
(typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
, (typename unwrap_reference<A10>::type&)(a10)
)
{}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CONSTRUCT_VALUE_HOLDER,nil)
private: // required holder implementation
void* holds(converter::undecorated_type_id_t);
@@ -46,31 +142,158 @@ struct value_holder : instance_holder
Held m_held;
};
template <class Held, class BackReferenceType>
template <class Held,class BackReferenceType>
struct value_holder_back_reference : instance_holder
{
// Forward construction to the held object
# ifndef BOOST_PYTHON_GENERATE_CODE
# include <boost/python/preprocessed/value_holder_back_reference.hpp>
# endif
# define BOOST_PYTHON_CONSTRUCT_VALUE_HOLDER_BACK_REFERENCE(nargs, ignored) \
BOOST_PP_EXPR_IF(nargs, template <) \
BOOST_PP_ENUM_PARAMS(nargs, class A) \
BOOST_PP_EXPR_IF(nargs, >) \
value_holder_back_reference(PyObject* p \
BOOST_PP_COMMA_IF(nargs) \
BOOST_PYTHON_ENUM_PARAMS2(nargs, (A,a))) \
: m_held( \
p BOOST_PP_COMMA_IF(nargs) \
BOOST_PP_ENUM(nargs, BOOST_PYTHON_UNFORWARD, nil) \
) \
{ \
void const* x = &instance_finder<BackReferenceType>::registration; (void)x; \
value_holder_back_reference(PyObject* p)
: m_held() {
(void)instance_finder<BackReferenceType>::registration;
}
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CONSTRUCT_VALUE_HOLDER_BACK_REFERENCE,nil)
template <class A1>
value_holder_back_reference(PyObject* p, A1 a1)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
) {
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
) {
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
value_holder_back_reference(PyObject* p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)
: m_held(p
, (typename unwrap_reference<A1>::type&)(a1)
, (typename unwrap_reference<A2>::type&)(a2)
, (typename unwrap_reference<A3>::type&)(a3)
, (typename unwrap_reference<A4>::type&)(a4)
, (typename unwrap_reference<A5>::type&)(a5)
, (typename unwrap_reference<A6>::type&)(a6)
, (typename unwrap_reference<A7>::type&)(a7)
, (typename unwrap_reference<A8>::type&)(a8)
, (typename unwrap_reference<A9>::type&)(a9)
, (typename unwrap_reference<A10>::type&)(a10)
)
{
(void)instance_finder<BackReferenceType>::registration;
}
private: // required holder implementation
void* holds(converter::undecorated_type_id_t);
@@ -78,6 +301,27 @@ struct value_holder_back_reference : instance_holder
BackReferenceType m_held;
};
// A generator metafunction which can be passed to make_holder
template <>
struct value_holder_generator<no_back_reference>
{
template <class Held>
struct apply
{
typedef value_holder<Held> type;
};
};
template <class BackReferenceType>
struct value_holder_generator
{
template <class Held>
struct apply
{
typedef value_holder_back_reference<Held,BackReferenceType> type;
};
};
template <class Held>
void* value_holder<Held>::holds(converter::undecorated_type_id_t dst_t)
{

View File

@@ -344,7 +344,7 @@ namespace detail
if (args.size() == 3 && args[2]->ob_type != Py_None->ob_type)
{
PyErr_SetString(PyExc_TypeError, "expected 2 arguments, got 3");
throw_argument_error();
throw argument_error();
}
return BOOST_PYTHON_CONVERSION::to_python(
@@ -367,7 +367,7 @@ namespace detail
if (args.size() == 3 && args[2]->ob_type != Py_None->ob_type)
{
PyErr_SetString(PyExc_TypeError, "bad operand type(s) for pow()");
throw_argument_error();
throw argument_error();
}
return BOOST_PYTHON_CONVERSION::to_python(

View File

@@ -1,583 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef ARG_TUPLE_SIZE_DWA2002410_HPP
# define ARG_TUPLE_SIZE_DWA2002410_HPP
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template<class R>
struct arg_tuple_size<R(*)()>
{
BOOST_STATIC_CONSTANT(std::size_t,value=0);
};
template<class R,class A0>
struct arg_tuple_size<R(*)(A0)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=1);
};
template<class R,class A0,class A1>
struct arg_tuple_size<R(*)(A0,A1)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=2);
};
template<class R,class A0,class A1,class A2>
struct arg_tuple_size<R(*)(A0,A1,A2)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=3);
};
template<class R,class A0,class A1,class A2,class A3>
struct arg_tuple_size<R(*)(A0,A1,A2,A3)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=4);
};
template<class R,class A0,class A1,class A2,class A3,class A4>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=5);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=6);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=7);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=8);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=9);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=10);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=11);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=12);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=13);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=14);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct arg_tuple_size<R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=15);
};
template<class R,class A0>
struct arg_tuple_size<R(A0::*)()>
{
BOOST_STATIC_CONSTANT(std::size_t,value=1);
};
template<class R,class A0,class A1>
struct arg_tuple_size<R(A0::*)(A1)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=2);
};
template<class R,class A0,class A1,class A2>
struct arg_tuple_size<R(A0::*)(A1,A2)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=3);
};
template<class R,class A0,class A1,class A2,class A3>
struct arg_tuple_size<R(A0::*)(A1,A2,A3)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=4);
};
template<class R,class A0,class A1,class A2,class A3,class A4>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=5);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=6);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=7);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=8);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=9);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=10);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=11);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=12);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=13);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=14);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=15);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)>
{
BOOST_STATIC_CONSTANT(std::size_t,value=16);
};
// Metrowerks thinks this creates ambiguities
# if !defined(__MWERKS__) || __MWERKS__ > 0x2407
template<class R,class A0>
struct arg_tuple_size<R(A0::*)()const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=1);
};
template<class R,class A0,class A1>
struct arg_tuple_size<R(A0::*)(A1)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=2);
};
template<class R,class A0,class A1,class A2>
struct arg_tuple_size<R(A0::*)(A1,A2)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=3);
};
template<class R,class A0,class A1,class A2,class A3>
struct arg_tuple_size<R(A0::*)(A1,A2,A3)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=4);
};
template<class R,class A0,class A1,class A2,class A3,class A4>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=5);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=6);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=7);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=8);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=9);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=10);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=11);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=12);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=13);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=14);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=15);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const>
{
BOOST_STATIC_CONSTANT(std::size_t,value=16);
};
template<class R,class A0>
struct arg_tuple_size<R(A0::*)()volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=1);
};
template<class R,class A0,class A1>
struct arg_tuple_size<R(A0::*)(A1)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=2);
};
template<class R,class A0,class A1,class A2>
struct arg_tuple_size<R(A0::*)(A1,A2)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=3);
};
template<class R,class A0,class A1,class A2,class A3>
struct arg_tuple_size<R(A0::*)(A1,A2,A3)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=4);
};
template<class R,class A0,class A1,class A2,class A3,class A4>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=5);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=6);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=7);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=8);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=9);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=10);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=11);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=12);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=13);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=14);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=15);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=16);
};
template<class R,class A0>
struct arg_tuple_size<R(A0::*)()const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=1);
};
template<class R,class A0,class A1>
struct arg_tuple_size<R(A0::*)(A1)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=2);
};
template<class R,class A0,class A1,class A2>
struct arg_tuple_size<R(A0::*)(A1,A2)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=3);
};
template<class R,class A0,class A1,class A2,class A3>
struct arg_tuple_size<R(A0::*)(A1,A2,A3)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=4);
};
template<class R,class A0,class A1,class A2,class A3,class A4>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=5);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=6);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=7);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=8);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=9);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=10);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=11);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=12);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=13);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=14);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=15);
};
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
struct arg_tuple_size<R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const volatile>
{
BOOST_STATIC_CONSTANT(std::size_t,value=16);
};
# endif
# else
template<class R>char_array<0>
arg_tuple_size_helper(R(*)());
template<class R,class A0>char_array<1>
arg_tuple_size_helper(R(*)(A0));
template<class R,class A0,class A1>char_array<2>
arg_tuple_size_helper(R(*)(A0,A1));
template<class R,class A0,class A1,class A2>char_array<3>
arg_tuple_size_helper(R(*)(A0,A1,A2));
template<class R,class A0,class A1,class A2,class A3>char_array<4>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3));
template<class R,class A0,class A1,class A2,class A3,class A4>char_array<5>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>char_array<6>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>char_array<7>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>char_array<8>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>char_array<9>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>char_array<10>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>char_array<11>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>char_array<12>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>char_array<13>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>char_array<14>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>char_array<15>
arg_tuple_size_helper(R(*)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14));
template<class R,class A0>char_array<1>
arg_tuple_size_helper(R(A0::*)());
template<class R,class A0,class A1>char_array<2>
arg_tuple_size_helper(R(A0::*)(A1));
template<class R,class A0,class A1,class A2>char_array<3>
arg_tuple_size_helper(R(A0::*)(A1,A2));
template<class R,class A0,class A1,class A2,class A3>char_array<4>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3));
template<class R,class A0,class A1,class A2,class A3,class A4>char_array<5>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>char_array<6>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>char_array<7>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>char_array<8>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>char_array<9>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>char_array<10>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>char_array<11>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>char_array<12>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>char_array<13>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>char_array<14>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>char_array<15>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14));
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>char_array<16>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15));
template<class R,class A0>char_array<1>
arg_tuple_size_helper(R(A0::*)()const);
template<class R,class A0,class A1>char_array<2>
arg_tuple_size_helper(R(A0::*)(A1)const);
template<class R,class A0,class A1,class A2>char_array<3>
arg_tuple_size_helper(R(A0::*)(A1,A2)const);
template<class R,class A0,class A1,class A2,class A3>char_array<4>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3)const);
template<class R,class A0,class A1,class A2,class A3,class A4>char_array<5>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>char_array<6>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>char_array<7>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>char_array<8>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>char_array<9>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>char_array<10>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>char_array<11>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>char_array<12>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>char_array<13>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>char_array<14>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>char_array<15>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>char_array<16>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const);
template<class R,class A0>char_array<1>
arg_tuple_size_helper(R(A0::*)()volatile);
template<class R,class A0,class A1>char_array<2>
arg_tuple_size_helper(R(A0::*)(A1)volatile);
template<class R,class A0,class A1,class A2>char_array<3>
arg_tuple_size_helper(R(A0::*)(A1,A2)volatile);
template<class R,class A0,class A1,class A2,class A3>char_array<4>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4>char_array<5>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>char_array<6>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>char_array<7>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>char_array<8>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>char_array<9>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>char_array<10>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>char_array<11>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>char_array<12>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>char_array<13>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>char_array<14>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>char_array<15>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>char_array<16>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)volatile);
template<class R,class A0>char_array<1>
arg_tuple_size_helper(R(A0::*)()const volatile);
template<class R,class A0,class A1>char_array<2>
arg_tuple_size_helper(R(A0::*)(A1)const volatile);
template<class R,class A0,class A1,class A2>char_array<3>
arg_tuple_size_helper(R(A0::*)(A1,A2)const volatile);
template<class R,class A0,class A1,class A2,class A3>char_array<4>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4>char_array<5>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>char_array<6>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>char_array<7>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>char_array<8>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>char_array<9>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>char_array<10>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>char_array<11>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>char_array<12>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>char_array<13>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>char_array<14>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>char_array<15>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const volatile);
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>char_array<16>
arg_tuple_size_helper(R(A0::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const volatile);
# endif
#endif // ARG_TUPLE_SIZE_DWA2002410_HPP

View File

@@ -1,169 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef ARGS_DWA2002417_HPP
# define ARGS_DWA2002417_HPP
template<>
struct size<boost::python::args<> >
{
BOOST_STATIC_CONSTANT(long,value=0);
};
template<class A0>
struct size<boost::python::args<A0> >
{
BOOST_STATIC_CONSTANT(long,value=1);
};
template<class A0,class A1>
struct size<boost::python::args<A0,A1> >
{
BOOST_STATIC_CONSTANT(long,value=2);
};
template<class A0,class A1,class A2>
struct size<boost::python::args<A0,A1,A2> >
{
BOOST_STATIC_CONSTANT(long,value=3);
};
template<class A0,class A1,class A2,class A3>
struct size<boost::python::args<A0,A1,A2,A3> >
{
BOOST_STATIC_CONSTANT(long,value=4);
};
template<class A0,class A1,class A2,class A3,class A4>
struct size<boost::python::args<A0,A1,A2,A3,A4> >
{
BOOST_STATIC_CONSTANT(long,value=5);
};
template<class A0,class A1,class A2,class A3,class A4,class A5>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5> >
{
BOOST_STATIC_CONSTANT(long,value=6);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6> >
{
BOOST_STATIC_CONSTANT(long,value=7);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7> >
{
BOOST_STATIC_CONSTANT(long,value=8);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8> >
{
BOOST_STATIC_CONSTANT(long,value=9);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9> >
{
BOOST_STATIC_CONSTANT(long,value=10);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> >
{
BOOST_STATIC_CONSTANT(long,value=11);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11> >
{
BOOST_STATIC_CONSTANT(long,value=12);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12> >
{
BOOST_STATIC_CONSTANT(long,value=13);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13> >
{
BOOST_STATIC_CONSTANT(long,value=14);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct size<boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
BOOST_STATIC_CONSTANT(long,value=15);
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<0,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A0 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<1,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A1 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<2,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A2 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<3,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A3 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<4,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A4 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<5,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A5 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<6,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A6 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<7,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A7 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<8,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A8 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<9,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A9 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<10,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A10 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<11,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A11 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<12,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A12 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<13,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A13 type;
};
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
struct at<14,boost::python::args<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14> >
{
typedef A14 type;
};
#endif // ARGS_DWA2002417_HPP

View File

@@ -1,278 +0,0 @@
//Copyright David Abrahams 2002.Permission to copy,use,
//modify,sell and distribute this software is granted provided this
//copyright notice appears in all copies.This software is provided
//"as is" without express or implied warranty,and with no claim as
//to its suitability for any purpose.
#ifndef CALL_PP_DWA2002411_HPP
# define CALL_PP_DWA2002411_HPP
// emacs commands used to pre-clean preprocessor output:
// (replace-regexp ", *converter" "\n, converter")
// (replace-string "PyEval_CallFunction(" "\nPyEval_CallFunction(\n")
template<class R>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" ")")));
}
template<class R,class A0>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" ")")
,converter::callback_to_python<A0>(a0).get()));
}
template<class R,class A0,class A1>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()));
}
template<class R,class A0,class A1,class A2>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()));
}
template<class R,class A0,class A1,class A2,class A3>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,A12 const&a12,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()
,converter::callback_to_python<A12>(a12).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,A12 const&a12,A13 const&a13,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()
,converter::callback_to_python<A12>(a12).get()
,converter::callback_to_python<A13>(a13).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
typename converter::callback_from_python<R>::result_type
call(PyObject*callable,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,A12 const&a12,A13 const&a13,A14 const&a14,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallFunction(
callable,const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()
,converter::callback_to_python<A12>(a12).get()
,converter::callback_to_python<A13>(a13).get()
,converter::callback_to_python<A14>(a14).get()));
}
#endif // CALL_PP_DWA2002411_HPP

View File

@@ -1,277 +0,0 @@
//Copyright David Abrahams 2002.Permission to copy,use,
//modify,sell and distribute this software is granted provided this
//copyright notice appears in all copies.This software is provided
//"as is" without express or implied warranty,and with no claim as
//to its suitability for any purpose.
#ifndef CALL_METHOD_PP_DWA2002411_HPP
# define CALL_METHOD_PP_DWA2002411_HPP
// emacs commands used to pre-clean preprocessor output:
// (replace-regexp ", *converter" "\n, converter")
// (replace-string "PyEval_CallMethod(" "\nPyEval_CallMethod(\n")
template<class R>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" ")")));
}
template<class R,class A0>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" ")")
,converter::callback_to_python<A0>(a0).get()));
}
template<class R,class A0,class A1>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()));
}
template<class R,class A0,class A1,class A2>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()));
}
template<class R,class A0,class A1,class A2,class A3>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,A12 const&a12,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()
,converter::callback_to_python<A12>(a12).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,A12 const&a12,A13 const&a13,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()
,converter::callback_to_python<A12>(a12).get()
,converter::callback_to_python<A13>(a13).get()));
}
template<class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
typename converter::callback_from_python<R>::result_type
call_method(PyObject*self,char const*name,A0 const&a0,A1 const&a1,A2 const&a2,A3 const&a3,A4 const&a4,A5 const&a5,A6 const&a6,A7 const&a7,A8 const&a8,A9 const&a9,A10 const&a10,A11 const&a11,A12 const&a12,A13 const&a13,A14 const&a14,boost::type<R>* =0)
{
converter::callback_from_python<R>converter;
return converter(
PyEval_CallMethod(
self,const_cast<char*>(name),const_cast<char*>("(" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" "O" ")")
,converter::callback_to_python<A0>(a0).get()
,converter::callback_to_python<A1>(a1).get()
,converter::callback_to_python<A2>(a2).get()
,converter::callback_to_python<A3>(a3).get()
,converter::callback_to_python<A4>(a4).get()
,converter::callback_to_python<A5>(a5).get()
,converter::callback_to_python<A6>(a6).get()
,converter::callback_to_python<A7>(a7).get()
,converter::callback_to_python<A8>(a8).get()
,converter::callback_to_python<A9>(a9).get()
,converter::callback_to_python<A10>(a10).get()
,converter::callback_to_python<A11>(a11).get()
,converter::callback_to_python<A12>(a12).get()
,converter::callback_to_python<A13>(a13).get()
,converter::callback_to_python<A14>(a14).get()));
}
#endif// CALL_METHOD_PP_DWA2002411_HPP

View File

@@ -1,413 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef CALLER_DWA2002410_HPP
# define CALLER_DWA2002410_HPP
template<class P,class R>
PyObject*operator()(R(*f)(),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0>
PyObject*operator()(R(*f)(A0),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1>
PyObject*operator()(R(*f)(A0,A1),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2>
PyObject*operator()(R(*f)(A0,A1,A2),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3>
PyObject*operator()(R(*f)(A0,A1,A2,A3),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
PyObject*operator()(R(*f)(A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0>
PyObject*operator()(R(A0::*f)(),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1>
PyObject*operator()(R(A0::*f)(A1),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2>
PyObject*operator()(R(A0::*f)(A1,A2),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3>
PyObject*operator()(R(A0::*f)(A1,A2,A3),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15),PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0>
PyObject*operator()(R(A0::*f)()const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1>
PyObject*operator()(R(A0::*f)(A1)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2>
PyObject*operator()(R(A0::*f)(A1,A2)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3>
PyObject*operator()(R(A0::*f)(A1,A2,A3)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0>
PyObject*operator()(R(A0::*f)()volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1>
PyObject*operator()(R(A0::*f)(A1)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2>
PyObject*operator()(R(A0::*f)(A1,A2)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3>
PyObject*operator()(R(A0::*f)(A1,A2,A3)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0>
PyObject*operator()(R(A0::*f)()const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1>
PyObject*operator()(R(A0::*f)(A1)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2>
PyObject*operator()(R(A0::*f)(A1,A2)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3>
PyObject*operator()(R(A0::*f)(A1,A2,A3)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
template<class P,class R,class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
PyObject*operator()(R(A0::*f)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const volatile,PyObject*args,PyObject*keywords,P const&policies)const
{
return returning<R>::call(f,args,keywords,&policies);
}
#endif // CALLER_DWA2002410_HPP

View File

@@ -1,507 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef MAKE_HOLDER_DWA2002416_HPP
# define MAKE_HOLDER_DWA2002416_HPP
template<>
struct make_holder<0>
{
template<class Holder,class ArgList>
struct apply
{
static void
execute(PyObject*p)
{
(new
Holder(p))->install(p);
}
};
};
template<>
struct make_holder<1>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
static void
execute(PyObject*p,t0 a0)
{
(new
Holder(p,f0(a0)))->install(p);
}
};
};
template<>
struct make_holder<2>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
static void
execute(PyObject*p,t0 a0,t1 a1)
{
(new
Holder(p,f0(a0),f1(a1)))->install(p);
}
};
};
template<>
struct make_holder<3>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2)))->install(p);
}
};
};
template<>
struct make_holder<4>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3)))->install(p);
}
};
};
template<>
struct make_holder<5>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4)))->install(p);
}
};
};
template<>
struct make_holder<6>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5)))->install(p);
}
};
};
template<>
struct make_holder<7>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6)))->install(p);
}
};
};
template<>
struct make_holder<8>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7)))->install(p);
}
};
};
template<>
struct make_holder<9>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8)))->install(p);
}
};
};
template<>
struct make_holder<10>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
typedef typename mpl::at<9,ArgList>::type t9;
typedef typename forward<t9>::type f9;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8),f9(a9)))->install(p);
}
};
};
template<>
struct make_holder<11>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
typedef typename mpl::at<9,ArgList>::type t9;
typedef typename forward<t9>::type f9;
typedef typename mpl::at<10,ArgList>::type t10;
typedef typename forward<t10>::type f10;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8),f9(a9),f10(a10)))->install(p);
}
};
};
template<>
struct make_holder<12>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
typedef typename mpl::at<9,ArgList>::type t9;
typedef typename forward<t9>::type f9;
typedef typename mpl::at<10,ArgList>::type t10;
typedef typename forward<t10>::type f10;
typedef typename mpl::at<11,ArgList>::type t11;
typedef typename forward<t11>::type f11;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8),f9(a9),f10(a10),f11(a11)))->install(p);
}
};
};
template<>
struct make_holder<13>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
typedef typename mpl::at<9,ArgList>::type t9;
typedef typename forward<t9>::type f9;
typedef typename mpl::at<10,ArgList>::type t10;
typedef typename forward<t10>::type f10;
typedef typename mpl::at<11,ArgList>::type t11;
typedef typename forward<t11>::type f11;
typedef typename mpl::at<12,ArgList>::type t12;
typedef typename forward<t12>::type f12;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8),f9(a9),f10(a10),f11(a11),f12(a12)))->install(p);
}
};
};
template<>
struct make_holder<14>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
typedef typename mpl::at<9,ArgList>::type t9;
typedef typename forward<t9>::type f9;
typedef typename mpl::at<10,ArgList>::type t10;
typedef typename forward<t10>::type f10;
typedef typename mpl::at<11,ArgList>::type t11;
typedef typename forward<t11>::type f11;
typedef typename mpl::at<12,ArgList>::type t12;
typedef typename forward<t12>::type f12;
typedef typename mpl::at<13,ArgList>::type t13;
typedef typename forward<t13>::type f13;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12,t13 a13)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8),f9(a9),f10(a10),f11(a11),f12(a12),f13(a13)))->install(p);
}
};
};
template<>
struct make_holder<15>
{
template<class Holder,class ArgList>
struct apply
{
typedef typename mpl::at<0,ArgList>::type t0;
typedef typename forward<t0>::type f0;
typedef typename mpl::at<1,ArgList>::type t1;
typedef typename forward<t1>::type f1;
typedef typename mpl::at<2,ArgList>::type t2;
typedef typename forward<t2>::type f2;
typedef typename mpl::at<3,ArgList>::type t3;
typedef typename forward<t3>::type f3;
typedef typename mpl::at<4,ArgList>::type t4;
typedef typename forward<t4>::type f4;
typedef typename mpl::at<5,ArgList>::type t5;
typedef typename forward<t5>::type f5;
typedef typename mpl::at<6,ArgList>::type t6;
typedef typename forward<t6>::type f6;
typedef typename mpl::at<7,ArgList>::type t7;
typedef typename forward<t7>::type f7;
typedef typename mpl::at<8,ArgList>::type t8;
typedef typename forward<t8>::type f8;
typedef typename mpl::at<9,ArgList>::type t9;
typedef typename forward<t9>::type f9;
typedef typename mpl::at<10,ArgList>::type t10;
typedef typename forward<t10>::type f10;
typedef typename mpl::at<11,ArgList>::type t11;
typedef typename forward<t11>::type f11;
typedef typename mpl::at<12,ArgList>::type t12;
typedef typename forward<t12>::type f12;
typedef typename mpl::at<13,ArgList>::type t13;
typedef typename forward<t13>::type f13;
typedef typename mpl::at<14,ArgList>::type t14;
typedef typename forward<t14>::type f14;
static void
execute(PyObject*p,t0 a0,t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12,t13 a13,t14 a14)
{
(new
Holder(p,f0(a0),f1(a1),f2(a2),f3(a3),f4(a4),f5(a5),f6(a6),f7(a7),f8(a8),f9(a9),f10(a10),f11(a11),f12(a12),f13(a13),f14(a14)))->install(p);
}
};
};
#endif // MAKE_HOLDER_DWA2002416_HPP

View File

@@ -1,396 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef MEMBER_FUNCTION_CAST_DWA2002410_HPP
# define MEMBER_FUNCTION_CAST_DWA2002410_HPP
// emacs commands used to pre-clean preprocessor output
// (replace-regexp "> *stage1(" ">\nstage1(")
template<class S,class R>
static cast_helper<S,R(T::*)()>
stage1(R(S::*)())
{
return cast_helper<S,R(T::*)()>();
}
template<class S,class R,class A1>
static cast_helper<S,R(T::*)(A1)>
stage1(R(S::*)(A1))
{
return cast_helper<S,R(T::*)(A1)>();
}
template<class S,class R,class A1,class A2>
static cast_helper<S,R(T::*)(A1,A2)>
stage1(R(S::*)(A1,A2))
{
return cast_helper<S,R(T::*)(A1,A2)>();
}
template<class S,class R,class A1,class A2,class A3>
static cast_helper<S,R(T::*)(A1,A2,A3)>
stage1(R(S::*)(A1,A2,A3))
{
return cast_helper<S,R(T::*)(A1,A2,A3)>();
}
template<class S,class R,class A1,class A2,class A3,class A4>
static cast_helper<S,R(T::*)(A1,A2,A3,A4)>
stage1(R(S::*)(A1,A2,A3,A4))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)>
stage1(R(S::*)(A1,A2,A3,A4,A5))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15))
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)>();
}
template<class S,class R>
static cast_helper<S,R(T::*)()const>
stage1(R(S::*)()const)
{
return cast_helper<S,R(T::*)()const>();
}
template<class S,class R,class A1>
static cast_helper<S,R(T::*)(A1)const>
stage1(R(S::*)(A1)const)
{
return cast_helper<S,R(T::*)(A1)const>();
}
template<class S,class R,class A1,class A2>
static cast_helper<S,R(T::*)(A1,A2)const>
stage1(R(S::*)(A1,A2)const)
{
return cast_helper<S,R(T::*)(A1,A2)const>();
}
template<class S,class R,class A1,class A2,class A3>
static cast_helper<S,R(T::*)(A1,A2,A3)const>
stage1(R(S::*)(A1,A2,A3)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4>
static cast_helper<S,R(T::*)(A1,A2,A3,A4)const>
stage1(R(S::*)(A1,A2,A3,A4)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)const>
stage1(R(S::*)(A1,A2,A3,A4,A5)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const>();
}
template<class S,class R>
static cast_helper<S,R(T::*)()volatile>
stage1(R(S::*)()volatile)
{
return cast_helper<S,R(T::*)()volatile>();
}
template<class S,class R,class A1>
static cast_helper<S,R(T::*)(A1)volatile>
stage1(R(S::*)(A1)volatile)
{
return cast_helper<S,R(T::*)(A1)volatile>();
}
template<class S,class R,class A1,class A2>
static cast_helper<S,R(T::*)(A1,A2)volatile>
stage1(R(S::*)(A1,A2)volatile)
{
return cast_helper<S,R(T::*)(A1,A2)volatile>();
}
template<class S,class R,class A1,class A2,class A3>
static cast_helper<S,R(T::*)(A1,A2,A3)volatile>
stage1(R(S::*)(A1,A2,A3)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4>
static cast_helper<S,R(T::*)(A1,A2,A3,A4)volatile>
stage1(R(S::*)(A1,A2,A3,A4)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)volatile>();
}
template<class S,class R>
static cast_helper<S,R(T::*)()const volatile>
stage1(R(S::*)()const volatile)
{
return cast_helper<S,R(T::*)()const volatile>();
}
template<class S,class R,class A1>
static cast_helper<S,R(T::*)(A1)const volatile>
stage1(R(S::*)(A1)const volatile)
{
return cast_helper<S,R(T::*)(A1)const volatile>();
}
template<class S,class R,class A1,class A2>
static cast_helper<S,R(T::*)(A1,A2)const volatile>
stage1(R(S::*)(A1,A2)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2)const volatile>();
}
template<class S,class R,class A1,class A2,class A3>
static cast_helper<S,R(T::*)(A1,A2,A3)const volatile>
stage1(R(S::*)(A1,A2,A3)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4>
static cast_helper<S,R(T::*)(A1,A2,A3,A4)const volatile>
stage1(R(S::*)(A1,A2,A3,A4)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14)const volatile>();
}
template<class S,class R,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14,class A15>
static cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const volatile>
stage1(R(S::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const volatile)
{
return cast_helper<S,R(T::*)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15)const volatile>();
}
#endif // MEMBER_FUNCTION_CAST_DWA2002410_HPP

View File

@@ -1,230 +0,0 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef POINTER_HOLDER_DWA2002411_HPP
# define POINTER_HOLDER_DWA2002411_HPP
// emacs commands used to pre-clean preprocessor output:
// (replace-regexp ": *m_p *(" "\n: m_p(")
// (replace-regexp "Value(" "Value(\n")
// (replace-regexp ", *(" "\n, (")
pointer_holder(PyObject*)
:m_p(new Value(
))
{
}
template<class A0>
pointer_holder(PyObject*,A0 a0)
:m_p(new Value(
(typename unforward<A0>::type)(a0)))
{
}
template<class A0,class A1>
pointer_holder(PyObject*,A0 a0,A1 a1)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)))
{
}
template<class A0,class A1,class A2>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)))
{
}
template<class A0,class A1,class A2,class A3>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)))
{
}
template<class A0,class A1,class A2,class A3,class A4>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11,A12 a12)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)
,(typename unforward<A12>::type)(a12)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11,A12 a12,A13 a13)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)
,(typename unforward<A12>::type)(a12)
,(typename unforward<A13>::type)(a13)))
{
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
pointer_holder(PyObject*,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11,A12 a12,A13 a13,A14 a14)
:m_p(new Value(
(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)
,(typename unforward<A12>::type)(a12)
,(typename unforward<A13>::type)(a13)
,(typename unforward<A14>::type)(a14)))
{
}
#endif // POINTER_HOLDER_DWA2002411_HPP

View File

@@ -1,261 +0,0 @@
//Copyright David Abrahams 2002.Permission to copy,use,
//modify,sell and distribute this software is granted provided this
//copyright notice appears in all copies.This software is provided
//"as is" without express or implied warranty,and with no claim as
//to its suitability for any purpose.
#ifndef POINTER_HOLDER_BACK_REFERENCE_DWA2002411_HPP
#define POINTER_HOLDER_BACK_REFERENCE_DWA2002411_HPP
// emacs commands used to pre-clean preprocessor output:
// (replace-regexp ": *m_p *(" "\n: m_p(")
// (replace-regexp "held_type(" "held_type(\n")
// (replace-regexp ", *(" "\n, (")
pointer_holder_back_reference(PyObject*p)
:m_p(new held_type(
p))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0>
pointer_holder_back_reference(PyObject*p,A0 a0)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11,A12 a12)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)
,(typename unforward<A12>::type)(a12)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11,A12 a12,A13 a13)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)
,(typename unforward<A12>::type)(a12)
,(typename unforward<A13>::type)(a13)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
template<class A0,class A1,class A2,class A3,class A4,class A5,class A6,class A7,class A8,class A9,class A10,class A11,class A12,class A13,class A14>
pointer_holder_back_reference(PyObject*p,A0 a0,A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9,A10 a10,A11 a11,A12 a12,A13 a13,A14 a14)
:m_p(new held_type(
p
,(typename unforward<A0>::type)(a0)
,(typename unforward<A1>::type)(a1)
,(typename unforward<A2>::type)(a2)
,(typename unforward<A3>::type)(a3)
,(typename unforward<A4>::type)(a4)
,(typename unforward<A5>::type)(a5)
,(typename unforward<A6>::type)(a6)
,(typename unforward<A7>::type)(a7)
,(typename unforward<A8>::type)(a8)
,(typename unforward<A9>::type)(a9)
,(typename unforward<A10>::type)(a10)
,(typename unforward<A11>::type)(a11)
,(typename unforward<A12>::type)(a12)
,(typename unforward<A13>::type)(a13)
,(typename unforward<A14>::type)(a14)))
{
void const*x=&instance_finder<held_type>::registration;
(void)x;
}
#endif//POINTER_HOLDER_BACK_REFERENCE_DWA2002411_HPP

Some files were not shown because too many files have changed in this diff Show More