|
|
Boost.PythonConfigurationŤփ |
Boost.Python uses several configuration macros in <boost/config.hpp>, as well as configuration macros meant to be supplied by the application. These macros are documented here.
Boost.PythonʹӃK<boost/config.hpp> 儼踶Ťփꪣ썊 ͬʱ빻ᓐӦӃ̡駔ą䖃ꪡ㍊ 䋴抇բꪵċ僷΄嵡㼯p>
These are the macros that may be defined by an application using Boost.Python. Note that if you extend a strict interpretation of the C++ standard to cover dynamic libraries, using different values of these macros when compiling different libraries (including extension modules and the Boost.Python library itself) is a violation of the ODR. However, we know of no C++ implementations on which this particular violation is detectable or causes any problems.
բʇԓɊ鈴Boost.Python儓擃樒嵄ꪡ㍊ עҢ㬈繻豽⊍C++᪗죬ʹ֮ༀ趯̬썊 ćo넜Ӄ⻍쵄ꪖ屠ҫ⻍쵄썊 㨰쀨)չģ喙ͼb>Boost.Python㩣썊 籔⾍ʇ捍a href="definitions.html#ODR">ODR載巴ᣍ Ȼ渣쎒CuӐԚȎꎃ++ʵϖ쬲բ֖̘ʢ載啥㬻⒲䋔쳉Ȏꎎʌ⡣
| Macro
ꪍ |
Default
Ĭȏֵ |
Meaning
ꬒ半 |
|---|---|---|
BOOST_PYTHON_MAX_ARITY |
15 | The maximum arity of any function, member function,
or constructor to be wrapped, invocation of a Boost.Python
function wich is specified as taking arguments
x1, x2,...Xn. This includes, in
particular, callback mechanisms such as object::operator()(...)
or call_method<R>(...
).
佷◰儈Β뺯ʽᢳɔắʽ벹錟ꯊ䳼a href= "definitions.html#arity">Ԫʽ㬍 촼b>Boost.Pythonꯊʜ儲Ί퍊 x1, x2,...Xnᣍ
̘ᰰ쀨똵綹ֆ㬀툧object::operator()(...)
벼code>call_method<R>(...
)ᣠ
|
BOOST_PYTHON_MAX_BASES |
10 | The maximum number of template arguments to the
bases<...>
class template, which is used to specify the bases of a wrapped C++
class..
bases<...>
ģॵėģॲΊʽ㬍
脹ģ॓A䖸÷ỷ◰儃++ 儻造ᣍ
|
BOOST_PYTHON_STATIC_MODULE |
not defined
δ樒半 |
If defined, prevents your module initialization
function from being treated as an exported symbol on platforms which
support that distinction in-code
ȧ黆패֧㖓oꂫǸ疵쳶綹ţ썊 樒勼Է鄣侀劼믺ỵᗷһ趵쳶綹š㍊ |
These macros are defined by Boost.Python and are implementation details of interest only to implementors and those porting to new platforms.
բꪓɼb>Boost.Python樒嵄㬊NJ取ɏ粲轚㬍 ֻӐĊ取՟㬒Լćֲ҆퐂ƽ̨儈˶Դ˸ˈ䡣
| Macro
ꪍ |
Default
Ĭȏֵ |
Meaning
ꬒ半 |
|---|---|---|
BOOST_PYTHON_TYPE_ID_NAME |
not defined
δ樒半 |
If defined, this indicates that the type_info
comparison across shared library boundaries does not work on this
platform. In other words, if shared-lib-1 passes
typeid(T) to a function in shared-lib-2 which compares
it to typeid(T), that comparison may return
false. If this macro is #defined, Boost.Python uses and
compares typeid(T).name() instead of using and comparing
the std::type_info objects directly.
ȧ黓蒥㬍 ˵÷膽패ɏɒԿ甽鲏儱߽籈폴ype_infoᣍ 뻾仰˵ǣ숧黹⏭ϲ鲏2儺䫵ݍ typeid(T)㬲⓫儼code>typeid(T)ሽϣ썊 뿉Ĝʇfalseᣍ
ȧ黣define胺꣬Boost.Python롊鈴typeid(T).name()
Ƚϣ춸⻊ǖὓʹӃꍱȽϼcode>std::type_info攏㡣
|
BOOST_PYTHON_NO_PY_SIGNATURES |
not defined
δ樒半 |
If defined for a module no pythonic signatures are generated
for the docstrings of the module functions, and no python type is associated with any
of the converters registered by the module. This also reduces the binary size of the
module by about 14% (gcc compiled). If defined for the boost_python runtime library, the default for the docstring_options.enable_py_signatures() is set to false.
ȧ黃㿩Ӑ樒壬Բ胄㿩ꯊ΄歲ַ봮뻡⺉ꐹthon儇郻ʽ㬍 胄㿩ע⡵ĈκΗ껻Ʒ漲뻡閣ꐹthon Ѝᣍ բҲ롼吡澽薆ģ冀Ĵ㐡㬔챴%㨧cc᠒룩br> ȧ黢oost_pythonԋʱ蒥㬍 docstring_options.enable_py_signatures()
億숏ֵ롉莪falseᣍ
|
BOOST_PYTHON_SUPPORTS_PY_SIGNATURES |
defined if BOOST_PYTHON_NO_PY_SIGNATURES is undefined
ȧ黼code>BOOST_PYTHON_NO_PY_SIGNATURESδ樒唲樒布ꪍ |
This macro is defined to enable a smooth transition from older Boost.Python versions
which do not support pythonic signatures. For example usage see
here.
Boost.Python汾⻖糖Pythonǩu㬶蒥胺꣬ԴӾɰ汾ƽΈ齶ɡ㍊ ʹӃ儀헓컼a href="pytype_function.html#examples">բ/ᣍ |
BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE |
not defined
δ樒半 |
If defined the python type of __init__ method "self" parameters
is properly generated, otherwise object is used. It is undefined
by default because it increases the binary size of the module by about 14% (gcc compiled).
ȧ黓蒥㬾ͻᕽȷɺ㉐ython __init__罷資ᰳelfᱲΊ Ѝ㬷ᔲ㬾͊鈴objectᣄ숏ʇδ樒壬ҲΪ˼Զ쓁˄㿩攜ֆ䳐ᣬԼ14%㨧cc᠒룩ᣍ
|
Revised 7 January, 2003
© Copyright Dave Abrahams 2002.
筒룺켯a>
ҫ΄輐£결08.6.15